@vuu-ui/vuu-table-extras 0.8.5 → 0.8.6
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/LICENSE +201 -0
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +3 -3
- package/esm/index.js +1 -1
- package/esm/index.js.map +3 -3
- package/package.json +13 -12
- package/types/datagrid-configuration-ui/column-picker/ColumnListItem.d.ts +1 -1
- package/types/table-settings/column-picker/ColumnListItem.d.ts +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2015 UBS
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Qt=Object.create;var Ge=Object.defineProperty;var Lt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var Mt=(e,n)=>{for(var t in n)Ge(e,t,{get:n[t],enumerable:!0})},An=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of It(n))!$t.call(e,i)&&i!==t&&Ge(e,i,{get:()=>n[i],enumerable:!(o=Lt(n,i))||o.enumerable});return e};var Y=(e,n,t)=>(t=e!=null?Qt(Bt(e)):{},An(n||!e||!e.__esModule?Ge(t,"default",{value:e,enumerable:!0}):t,e)),Ut=e=>An(Ge({},"__esModule",{value:!0}),e);var Nn=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var u=(e,n,t)=>(Nn(e,n,"read from private field"),t?t.call(e):n.get(e)),L=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},j=(e,n,t,o)=>(Nn(e,n,"write to private field"),o?o.call(e,t):n.set(e,t),t);var zo={};Mt(zo,{ColumnExpressionInput:()=>En,ColumnNamedTerms:()=>Ze,ColumnSettingsPanel:()=>Yo,DataSourceStats:()=>Mo,DatagridSettingsPanel:()=>$o,columnExpressionLanguageSupport:()=>rn,isCompleteExpression:()=>dn,isCompleteRelationalExpression:()=>gn,lastNamedChild:()=>Je,useColumnExpressionEditor:()=>yn,useColumnExpressionSuggestionProvider:()=>On,walkTree:()=>mn});module.exports=Ut(zo);var A=require("@vuu-ui/vuu-utils"),Fn=Y(require("classnames"),1);var te=require("@vuu-ui/vuu-utils"),We=require("react"),Gt=[void 0,void 0,void 0,void 0];function kn(e,n,t){var x;let o=(0,We.useRef)(),[i,r,s,p]=o.current||Gt,{type:l}=t,c=(0,te.isTypeDescriptor)(l)?(x=l.formatting)==null?void 0:x.decimals:void 0,g=e===i&&(0,te.isValidNumber)(n)&&(0,te.isValidNumber)(r)&&t===s?(0,te.getMovingValueDirection)(n,p,r,c):"";return(0,We.useEffect)(()=>{o.current=[e,n,t,g]}),g}var Xe=require("react/jsx-runtime"),Wt=String.fromCharCode(11014),Ht=String.fromCharCode(11015),{KEY:Xt}=A.metadataKeys,He="vuuBackgroundCell",we={ArrowOnly:"arrow",BackgroundOnly:"bg-only",ArrowBackground:"arrow-bg"},Vt=e=>(0,A.isTypeDescriptor)(e)&&e.renderer&&"flashStyle"in e.renderer?e.renderer.flashStyle:we.BackgroundOnly,Yt=({column:e,row:n})=>{let{key:t,type:o,valueFormatter:i}=e,r=n[t],s=Vt(o),p=kn(n[Xt],r,e),l=s===we.ArrowOnly||s===we.ArrowBackground?p===A.UP1||p===A.UP2?Wt:p===A.DOWN1||p===A.DOWN2?Ht:null:null,c=p?" "+p:"",g=(0,Fn.default)(He,c,{[`${He}-arrowOnly`]:s===we.ArrowOnly,[`${He}-arrowBackground`]:s===we.ArrowBackground});return(0,Xe.jsxs)("div",{className:g,tabIndex:-1,children:[(0,Xe.jsx)("div",{className:`${He}-flasher`,children:l}),i(n[e.key])]})};(0,A.registerComponent)("background",Yt,"cell-renderer",{serverDataType:["long","int","double"]});var ue=require("@vuu-ui/vuu-utils"),Qn=Y(require("classnames"),1);var oe=require("react/jsx-runtime"),Re="vuuProgressCell",zt=({column:e,columnMap:n,row:t})=>{let{type:o}=e,i=t[e.key],r=!1,s=0;if((0,ue.isTypeDescriptor)(o)&&(0,ue.isColumnTypeRenderer)(o.renderer)){let{associatedField:l}=o.renderer,c=t[n[l]];if(typeof i=="number"&&typeof c=="number")s=Math.min(Math.round(i/c*100),100),r=isFinite(s);else{let g=parseFloat(i);if(Number.isFinite(g)){let x=parseFloat(c);Number.isFinite(x)&&(s=Math.min(Math.round(g/x*100),100),r=isFinite(s))}}}let p=(0,Qn.default)(Re,{});return(0,oe.jsxs)("div",{className:p,tabIndex:-1,children:[r?(0,oe.jsxs)("span",{className:`${Re}-track`,children:[(0,oe.jsx)("span",{className:`${Re}-bg`}),(0,oe.jsx)("span",{className:`${Re}-bar`,style:{"--progress-bar-pct":`-${100-s}%`}})]}):null,(0,oe.jsx)("span",{className:`${Re}-text`,children:`${s} %`})]})};(0,ue.registerComponent)("vuu.progress",zt,"cell-renderer",{serverDataType:["long","int","double"]});var S=require("@vuu-ui/vuu-codemirror"),bn=require("@vuu-ui/vuu-utils"),ee=require("react");var I=require("@vuu-ui/vuu-codemirror");var Ln=require("@lezer/lr"),Ve=Ln.LRParser.deserialize({version:14,states:"&fOVQPOOO!SQPO'#C^OVQPO'#CcQ!pQPOOO#OQPO'#CkO#TQPO'#CrOOQO'#Cy'#CyO#YQPO,58}OVQPO,59QOVQPO,59QOVQPO,59VOVQPO'#CtOOQO,59^,59^OOQO1G.i1G.iOOQO1G.l1G.lO#kQPO1G.lO$fQPO'#CmO%WQQO1G.qOOQO'#C{'#C{O%cQPO,59`OOQO'#Cn'#CnO%wQPO,59XOVQPO,59ZOVQPO,59[OVQPO7+$]OVQPO'#CuO&`QPO1G.zOOQO1G.z1G.zO&hQQO'#C^O&rQQO1G.sO'ZQQO1G.uOOQO1G.v1G.vO'fQPO<<GwO'wQPO,59aOOQO-E6s-E6sOOQO7+$f7+$fOVQPOAN=cO(]QQO1G.lO(tQPOG22}OOQOLD(iLD(iO%wQPO,59QO%wQPO,59Q",stateData:")[~OlOS~ORUOSUOTUOUUOWQO`SOnPO~OWgXZQX[QX]QX^QXeQX~OjQXXQXpQXqQXrQXsQXtQXuQX~PnOZWO[WO]XO^XO~OWYO~OWZO~OX]OZWO[WO]XO^XO~OZWO[WO]Yi^YijYiXYipYiqYirYisYitYiuYieYi~OZWO[WO]XO^XOpdOqdOrdOsdOtdOudO~OehOvfOwgO~OXkOZWO[WO]XO^XOeiO~ORUOSUOTUOUUOWQO`SOnlO~OXsOeiO~OvQXwQX~PnOZxO[xO]yO^yOeaivaiwai~OwgOecivci~OZWO[WO]XO^XOetO~OZWO[WO]XO^XOXiaeia~OZxO[xO]Yi^YieYivYiwYi~OXwOZWO[WO]XO^XO~O`UTn~",goto:"#spPPqPPPPqPPqPPPPqP!R!W!R!RPq!Z!k!nPPP!tP#jmUOQWXYZefghitxyVbYfgRe`mTOQWXYZefghitxyR[TQjcRrjQROQVQS^WxQ_XU`YfgQcZQmeQphQqiQuyRvtQaYQnfRog",nodeNames:"\u26A0 ColumnDefinitionExpression Column Number String True False ParenthesizedExpression OpenBrace CloseBrace ArithmeticExpression Divide Times Plus Minus ConditionalExpression If RelationalExpression RelationalOperator AndCondition OrCondition Comma CallExpression Function ArgList",maxTerm:39,skippedNodes:[0],repeatNodeCount:1,tokenData:".^~RnXY#PYZ#P]^#Ppq#Pqr#brs#mxy$eyz$jz{$o{|$t|}$y}!O%O!O!P%T!P!Q%c!Q![%h!^!_%s!_!`&Q!`!a&V!c!}&d#R#S&d#T#U&u#U#Y&d#Y#Z(Y#Z#]&d#]#^*j#^#c&d#c#d+f#d#h&d#h#i,b#i#o&d~#USl~XY#PYZ#P]^#Ppq#P~#eP!_!`#h~#mOu~~#pWOX#mZ]#m^r#mrs$Ys#O#m#P;'S#m;'S;=`$_<%lO#m~$_OS~~$bP;=`<%l#m~$jOW~~$oOX~~$tO[~~$yO]~~%OOe~~%TO^~~%WP!Q![%Z~%`PR~!Q![%Z~%hOZ~~%mQR~!O!P%Z!Q![%h~%xPr~!_!`%{~&QOt~~&VOp~~&[Pq~!_!`&_~&dOs~P&iSnP!Q![&d!c!}&d#R#S&d#T#o&dR&zUnP!Q![&d!c!}&d#R#S&d#T#b&d#b#c'^#c#o&dR'cUnP!Q![&d!c!}&d#R#S&d#T#W&d#W#X'u#X#o&dR'|SvQnP!Q![&d!c!}&d#R#S&d#T#o&d~(_TnP!Q![&d!c!}&d#R#S&d#T#U(n#U#o&d~(sUnP!Q![&d!c!}&d#R#S&d#T#`&d#`#a)V#a#o&d~)[UnP!Q![&d!c!}&d#R#S&d#T#g&d#g#h)n#h#o&d~)sUnP!Q![&d!c!}&d#R#S&d#T#X&d#X#Y*V#Y#o&d~*^SU~nP!Q![&d!c!}&d#R#S&d#T#o&d~*oUnP!Q![&d!c!}&d#R#S&d#T#Y&d#Y#Z+R#Z#o&d~+YS`~nP!Q![&d!c!}&d#R#S&d#T#o&dR+kUnP!Q![&d!c!}&d#R#S&d#T#f&d#f#g+}#g#o&dR,USwQnP!Q![&d!c!}&d#R#S&d#T#o&d~,gUnP!Q![&d!c!}&d#R#S&d#T#f&d#f#g,y#g#o&d~-OUnP!Q![&d!c!}&d#R#S&d#T#i&d#i#j-b#j#o&d~-gUnP!Q![&d!c!}&d#R#S&d#T#X&d#X#Y-y#Y#o&d~.QST~nP!Q![&d!c!}&d#R#S&d#T#o&d",tokenizers:[0,1],topRules:{ColumnDefinitionExpression:[0,1]},tokenPrec:375});var Zt=I.LRLanguage.define({name:"VuuColumnExpression",parser:Ve.configure({props:[(0,I.styleTags)({Function:I.tags.variableName,String:I.tags.string,Or:I.tags.emphasis,Operator:I.tags.operator})]})}),rn=()=>new I.LanguageSupport(Zt);var sn=class{constructor(n){switch(this.value=n,typeof n){case"boolean":this.type="booleanLiteralExpression";break;case"number":this.type="numericLiteralExpression";break;default:this.type="stringLiteralExpression"}}toJSON(){return{type:this.type,value:this.value}}},an=class{constructor(n){this.type="colExpression";this.column=n}toJSON(){return{type:this.type,column:this.column}}},Ne,se,ln=class{constructor(n="unknown"){L(this,Ne,[{type:"unknown"},{type:"unknown"}]);L(this,se,void 0);this.type="arithmeticExpression";j(this,se,n)}get op(){return u(this,se)}set op(n){j(this,se,n)}get expressions(){return u(this,Ne)}toJSON(){return{type:this.type,op:u(this,se),expressions:u(this,Ne)}}};Ne=new WeakMap,se=new WeakMap;var fe,pn=class{constructor(n){L(this,fe,[]);this.type="callExpression";this.functionName=n}get expressions(){return u(this,fe)}get arguments(){return u(this,fe)}toJSON(){return{type:this.type,functionName:this.functionName,arguments:u(this,fe).map(n=>{var t;return(t=n.toJSON)==null?void 0:t.call(n)})}}};fe=new WeakMap;var ke,Ce,de=class{constructor(){L(this,ke,[{type:"unknown"},{type:"unknown"}]);L(this,Ce,"unknown");this.type="relationalExpression"}get op(){return u(this,Ce)}set op(n){j(this,Ce,n)}get expressions(){return u(this,ke)}toJSON(){return{type:this.type,op:u(this,Ce),expressions:u(this,ke)}}};ke=new WeakMap,Ce=new WeakMap;var Fe,xe,ge=class{constructor(n){L(this,Fe,[{type:"unknown"},{type:"unknown"}]);L(this,xe,void 0);this.type="booleanCondition";j(this,xe,n)}get op(){return u(this,xe)}get expressions(){return u(this,Fe)}toJSON(){return{type:this.type,op:u(this,xe),expressions:u(this,Fe).map(n=>{var t;return(t=n.toJSON)==null?void 0:t.call(n)})}}};Fe=new WeakMap,xe=new WeakMap;var M,Ae=class{constructor(n){L(this,M,void 0);this.type="conditionalExpression";j(this,M,[n?new ge(n):new de,{type:"unknown"},{type:"unknown"}])}get expressions(){return u(this,M)}get condition(){return u(this,M)[0]}get truthyExpression(){return u(this,M)[1]}set truthyExpression(n){u(this,M)[1]=n}get falsyExpression(){return u(this,M)[2]}set falsyExpression(n){u(this,M)[2]=n}toJSON(){var n,t,o,i,r;return{type:this.type,condition:(t=(n=this.condition).toJSON)==null?void 0:t.call(n),truthyExpression:this.truthyExpression,falsyExpression:(r=(i=(o=this.falsyExpression)==null?void 0:o.toJSON)==null?void 0:i.call(o))!=null?r:this.falsyExpression}}};M=new WeakMap;var re=e=>e.type==="unknown",Ye=e=>e.type==="arithmeticExpression",Jt=e=>e.type==="callExpression",me=e=>e.type==="conditionalExpression",qt=e=>e.type==="relationalExpression"||e.type==="booleanCondition";var _t=e=>e.type==="booleanCondition",un=e=>(e==null?void 0:e.type)==="relationalExpression";var N=e=>{if(re(e))return e;if(un(e)){let[n,t]=e.expressions;if(D(n))return N(n);if(e.op==="unknown")return e;if(D(t))return N(t)}else if(qt(e)){let{expressions:n=[]}=e;for(let t of n)if(D(t))return N(t)}else if(me(e)){let{condition:n,truthyExpression:t,falsyExpression:o}=e;if(D(n))return N(n);if(D(t))return N(t);if(D(o))return N(o)}else if(Ye(e)){let{expressions:n=[]}=e;for(let t of n)if(D(t))return N(t)}},ze=(e,n,t)=>{let{expressions:o=[]}=e;if(o.includes(n)){let i=o.indexOf(n);return o.splice(i,1,t),!0}else for(let i of o)if(ze(i,n,t))return!0;return!1},D=e=>re(e)?!0:me(e)?D(e.condition)||D(e.truthyExpression)||D(e.falsyExpression):un(e)||_t(e)?e.op===void 0||e.expressions.some(n=>D(n)):!1,In=(e,n)=>{let t=N(e);t?t.expressions?t.expressions.push(n):console.warn("don't know how to treat targetExpression"):console.error("no target expression found")},C,ie,cn=class{constructor(){L(this,C,void 0);L(this,ie,[])}setCondition(n){if(u(this,C)===void 0)this.addExpression(new Ae(n));else if(me(u(this,C))){if(D(u(this,C).condition)){let t=n?new ge(n):new de;this.addExpression(t)}else if(re(u(this,C).truthyExpression))u(this,C).truthyExpression=new Ae(n);else if(D(u(this,C).truthyExpression)){let t=n?new ge(n):new de;this.addExpression(t)}else if(re(u(this,C).falsyExpression))u(this,C).falsyExpression=new Ae(n);else if(D(u(this,C).falsyExpression)){let t=n?new ge(n):new de;this.addExpression(t)}}else console.error("setCondition called unexpectedly")}addExpression(n){if(u(this,ie).length>0){let t=u(this,ie).at(-1);t==null||t.arguments.push(n)}else if(u(this,C)===void 0)j(this,C,n);else if(Ye(u(this,C))){let t=N(u(this,C));t&&re(t)&&ze(u(this,C),t,n)}else if(me(u(this,C))&&D(u(this,C))){let t=N(u(this,C));t&&re(t)?ze(u(this,C),t,n):t&&In(t,n)}}setFunction(n){let t=new pn(n);this.addExpression(t),u(this,ie).push(t)}setColumn(n){this.addExpression(new an(n))}setArithmeticOp(n){let t=n,o=u(this,C);Ye(o)&&(o.op=t)}setRelationalOperator(n){let t=n;if(u(this,C)&&me(u(this,C))){let o=N(u(this,C));un(o)?o.op=t:console.error(`no target expression found (op = ${n})`)}}setValue(n){let t=new sn(n);if(u(this,C)===void 0)j(this,C,t);else if(Ye(u(this,C)))this.addExpression(t);else if(Jt(u(this,C)))u(this,C).arguments.push(t);else if(me(u(this,C)))if(D(u(this,C))){let o=N(u(this,C));o&&re(o)?ze(u(this,C),o,t):o&&In(o,t)}else console.log("what do we do with value, in a complete expression")}closeBrace(){u(this,ie).pop()}get expression(){return u(this,C)}toJSON(){var n;return(n=u(this,C))==null?void 0:n.toJSON()}};C=new WeakMap,ie=new WeakMap;var mn=(e,n)=>{let t=new cn,o=e.cursor();do{let{name:i,from:r,to:s}=o;switch(i){case"AndCondition":t.setCondition("and");break;case"OrCondition":t.setCondition("or");break;case"RelationalExpression":t.setCondition();break;case"ArithmeticExpression":t.addExpression(new ln);break;case"Column":{let p=n.substring(r,s);t.setColumn(p)}break;case"Function":{let p=n.substring(r,s);t.setFunction(p)}break;case"Times":case"Divide":case"Plus":case"Minus":{let p=n.substring(r,s);t.setArithmeticOp(p)}break;case"RelationalOperator":{let p=n.substring(r,s);t.setRelationalOperator(p)}break;case"False":case"True":{let p=n.substring(r,s);t.setValue(p==="true")}break;case"String":t.setValue(n.substring(r+1,s-1));break;case"Number":t.setValue(parseFloat(n.substring(r,s)));break;case"CloseBrace":t.closeBrace();break;default:}}while(o.next());return t.toJSON()};var Kt=Ve.configure({strict:!0}),Bn=["Number","String"],Ze=[...Bn,"AndCondition","ArithmeticExpression","BooleanOperator","RelationalOperatorOperator","CallExpression","CloseBrace","Column","Comma","ConditionalExpression","Divide","Equal","If","Minus","OpenBrace","OrCondition","ParenthesizedExpression","Plus","RelationalExpression","RelationalOperator","Times"],dn=e=>{try{return Kt.parse(e),!0}catch{return!1}},Je=e=>{let{lastChild:n}=e;for(;n&&!Ze.includes(n.name);)n=n.prevSibling,console.log(n==null?void 0:n.name);return n},gn=e=>{if((e==null?void 0:e.name)==="RelationalExpression"){let{firstChild:n}=e,t=Je(e);if((n==null?void 0:n.name)==="Column"&&typeof(t==null?void 0:t.name)=="string"&&Bn.includes(t.name))return!0}return!1};var ae=require("@vuu-ui/vuu-codemirror"),jt=ae.HighlightStyle.define([{tag:ae.tags.variableName,color:"var(--vuuFilterEditor-variableColor)"},{tag:ae.tags.comment,color:"green",fontStyle:"italic"}]),$n=(0,ae.syntaxHighlighting)(jt);var Mn=require("@vuu-ui/vuu-codemirror"),Un=Mn.EditorView.theme({"&":{border:"solid 1px var(--salt-container-primary-borderColor)",color:"var(--vuuFilterEditor-color)",backgroundColor:"var(--vuuFilterEditor-background)"},".cm-content":{caretColor:"var(--vuuFilterEditor-cursorColor)"},"&.cm-focused .cm-cursor":{borderLeftColor:"var(--vuuFilterEditor-cursorColor)"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"var(--vuuFilterEditor-selectionBackground)"},".cm-selectionBackground, ::selection":{backgroundColor:"var(--vuuFilterEditor-selectionBackground)"},".cm-scroller":{fontFamily:"var(--vuuFilterEditor-fontFamily)"},".cm-tooltip":{background:"var(--vuuFilterEditor-tooltipBackground)",border:"var(--vuuFilterEditor-tooltipBorder)",boxShadow:"var(--vuuFilterEditor-tooltipElevation)","&.cm-tooltip-autocomplete > ul":{fontFamily:"var(--vuuFilterEditor-fontFamily)",fontSize:"var(--vuuFilterEditor-fontSize)",maxHeight:"240px"},"&.cm-tooltip-autocomplete > ul > li":{height:"var(--vuuFilterEditor-suggestion-height)",padding:"0 3px",lineHeight:"var(--vuuFilterEditor-suggestion-height)"},"&.cm-tooltip-autocomplete li[aria-selected]":{background:"var(--vuuFilterEditor-suggestion-selectedBackground)",color:"var(--vuuFilterEditor-suggestion-selectedColor)"},"&.cm-tooltip-autocomplete li .cm-completionDetail":{color:"var(--vuuFilterEditor-suggestion-detailColor)"}}},{dark:!1});var T=require("@vuu-ui/vuu-codemirror"),xn=require("react");var eo=(e,n)=>n?e.map(t=>{var o;return{...t,apply:typeof t.apply=="function"?t.apply:`${n}${(o=t.apply)!=null?o:t.label}`}}):e,no=e=>e===void 0?!1:["Times","Divide","Plus","Minus"].includes(e.name),he=(e,n)=>{var i;let{lastChild:t}=e,{pos:o}=n;for(;t;)if(t.from<o&&Ze.includes(t.name)){if(t.name==="ParenthesizedExpression"){let s=(i=t.firstChild)==null?void 0:i.nextSibling;s&&(t=s)}return t}else t=t.prevSibling},Gn=(e,n)=>{var t;if(e.name==="ArgList"){let o=e.prevSibling;if(o)return(0,T.getValue)(o,n)}else if(e.name==="OpenBrace"){let o=(t=e.parent)==null?void 0:t.prevSibling;if((o==null?void 0:o.name)==="Function")return(0,T.getValue)(o,n)}},Wn=(e,n)=>{if(e.name==="RelationalExpression"){let t=Je(e);if((t==null?void 0:t.name)==="RelationalOperator")return(0,T.getValue)(t,n)}else{let t=e.prevSibling;if((t==null?void 0:t.name)==="RelationalOperator")return(0,T.getValue)(t,n)}},hn=(e,n)=>{var t;if(e.name==="RelationalExpression"){if(((t=e.firstChild)==null?void 0:t.name)==="Column")return(0,T.getValue)(e.firstChild,n)}else{let o=e.prevSibling;if((o==null?void 0:o.name)==="Column")return(0,T.getValue)(o,n);if((o==null?void 0:o.name)==="RelationalOperator")return hn(o,n)}},fn=async(e,n,t,o={})=>{let i=await n.getSuggestions(t,o),{startsWith:r=""}=o;return{from:e.pos-r.length,options:i}},Cn=(e,n,t,o,i)=>{let r=he(e,n);switch(console.log(`conditional expression last child ${r==null?void 0:r.name}`),r==null?void 0:r.name){case"If":return fn(n,t,"expression",{prefix:"( "});case"OpenBrace":return fn(n,t,"expression");case"Condition":return fn(n,t,"expression",{prefix:", "});case"CloseBrace":if(o){let s=[{apply:()=>{i==null||i()},label:"Save Expression",boost:10}];return{from:n.pos,options:s}}}},to=(e,n)=>{let t=[{apply:()=>{n==null||n()},label:"Save Expression",boost:10}];return{from:e.pos,options:t}},Hn=(e,n)=>{let t=(0,xn.useCallback)(async(o,i,r={})=>{let s=await e.getSuggestions(i,r),{startsWith:p=""}=r;return{from:o.pos-p.length,options:s}},[e]);return(0,xn.useCallback)(async o=>{var x,h;let{state:i,pos:r}=o,s=(x=o.matchBefore(/\w*/))!=null?x:{from:0,to:0,text:void 0},l=(0,T.syntaxTree)(i).resolveInner(r,-1),c=i.doc.toString(),g=dn(c);switch(console.log({nodeBeforeName:l.name}),l.name){case"If":return console.log("conditional expression If"),t(o,"expression",{prefix:"( "});case"Condition":{let a=he(l,o);if((a==null?void 0:a.name)==="Column"){let d=(0,T.getPreviousNode)(a);if((d==null?void 0:d.name)!=="RelationalOperator")return t(o,"condition-operator",{columnName:(0,T.getValue)(a,i)});console.log(`Condition last child Column, prev child ${d==null?void 0:d.name}`)}else if((a==null?void 0:a.name)==="RelationalOperator")return t(o,"expression");console.log(`condition last child ${a==null?void 0:a.name}`)}break;case"ConditionalExpression":return Cn(l,o,e);case"RelationalExpression":{if(gn(l))return{from:o.pos,options:T.booleanJoinSuggestions.concat({label:", <truthy expression>, <falsy expression>",apply:", "})};{let a=Wn(l,i),d=hn(l,i);if(a)return t(o,"expression");{let f=await e.getSuggestions("condition-operator",{columnName:d});return{from:o.pos,options:f}}}}break;case"RelationalOperator":return t(o,"expression");case"String":{let a=Wn(l,i),d=hn(l,i),{from:f,to:m}=l;if(m-f===2&&o.pos===f+1){if(d&&a)return t(o,"columnValue",{columnName:d,operator:a,startsWith:s.text})}else if(m-f>2&&o.pos===m)return t(o,"expression",{prefix:", "});console.log(`we have a string, column is ${d} ${f} ${m}`)}break;case"ArithmeticExpression":{let a=he(l,o);if((a==null?void 0:a.name)==="Column")return t(o,"expression");if(no(a)){let d=a.name;return t(o,"column",{operator:d})}}break;case"OpenBrace":{let a=Gn(l,i);return t(o,"expression",{functionName:a})}break;case"ArgList":{let a=Gn(l,i),d=he(l,o),f=(d==null?void 0:d.name)==="OpenBrace"?void 0:",",m=await e.getSuggestions("expression",{functionName:a});return m=f?eo(m,", "):m,(d==null?void 0:d.name)!=="OpenBrace"&&(d==null?void 0:d.name)!=="Comma"&&(m=[{apply:") ",boost:10,label:"Done - no more arguments"}].concat(m)),{from:o.pos,options:m}}case"Equal":if(c.trim()==="=")return t(o,"expression");break;case"ParenthesizedExpression":case"ColumnDefinitionExpression":if(o.pos===0)return t(o,"expression");{let a=he(l,o);if((a==null?void 0:a.name)==="Column"){if(g){let d=[{apply:()=>{n.current()},label:"Save Expression",boost:10}],f=(0,T.getValue)(a,i),m=await e.getSuggestions("operator",{columnName:f});return{from:o.pos,options:d.concat(m)}}}else if((a==null?void 0:a.name)==="CallExpression"){if(g){let d=[{apply:()=>{n.current()},label:"Save Expression",boost:10}];return{from:o.pos,options:d}}}else if((a==null?void 0:a.name)==="ArithmeticExpression"){if(g){let d=[{apply:()=>{n.current()},label:"Save Expression",boost:10}],f=he(a,o);if((f==null?void 0:f.name)==="Column"){let m=(0,T.getValue)(f,i),P=await e.getSuggestions("operator",{columnName:m});d=d.concat(P)}return{from:o.pos,options:d}}}else if((a==null?void 0:a.name)==="ConditionalExpression")return Cn(a,o,e,g,n.current);break}case"Column":if(await e.isPartialMatch("expression",void 0,s.text))return t(o,"expression",{startsWith:s.text});break;case"Comma":{let a=(0,T.getNamedParentNode)(l);if((a==null?void 0:a.name)==="ConditionalExpression")return t(o,"expression")}break;case"CloseBrace":{let a=(0,T.getNamedParentNode)(l);if((a==null?void 0:a.name)==="ConditionalExpression")return Cn(a,o,e,g,n.current);if((a==null?void 0:a.name)==="ArgList"&&g)return to(o,n.current);console.log(`does closebrace denote an ARgList or a parenthetised expression ? ${a}`)}break;default:((h=l==null?void 0:l.prevSibling)==null?void 0:h.name)==="FilterClause"&&console.log("looks like we ight be a or|and operator")}},[t,n,e])};var Qe=e=>{if(e.current==null)throw Error("EditorView not defined");return e.current},oo=()=>"vuuSuggestion",ro=()=>console.log("noooop"),so=e=>"expressionType"in e,io=e=>{if(so(e)){let n=(0,bn.createEl)("div","expression-type-container"),t=(0,bn.createEl)("span","expression-type",e.expressionType);return n.appendChild(t),n}else return null},yn=({onChange:e,onSubmitExpression:n,suggestionProvider:t})=>{let o=(0,ee.useRef)(null),i=(0,ee.useRef)(ro),r=(0,ee.useRef)(),s=Hn(t,i),[p,l]=(0,ee.useMemo)(()=>{let c=()=>{let f=Qe(r),m=f.state.doc.toString(),P=(0,S.ensureSyntaxTree)(f.state,f.state.doc.length,5e3);if(P){let R=mn(P,m);return[m,R]}else return["",void 0]},g=()=>{Qe(r).setState(d())},x=()=>{let[f,m]=c();n==null||n(f,m),g()},h=f=>S.keymap.of([{key:f,run(){return x(),!0}}]),a=f=>S.keymap.of([{key:f,run(){return(0,S.startCompletion)(Qe(r)),!0}}]),d=()=>S.EditorState.create({doc:"",extensions:[S.minimalSetup,(0,S.autocompletion)({addToOptions:[{render:io,position:70}],override:[s],optionClass:oo}),rn(),S.keymap.of(S.defaultKeymap),h("Ctrl-Enter"),a("ArrowDown"),S.EditorView.updateListener.of(f=>{let m=Qe(r);if(f.docChanged){(0,S.startCompletion)(m);let P=m.state.doc.toString();e==null||e(P,void 0)}}),Un,$n]});return i.current=()=>{x(),setTimeout(()=>{Qe(r).focus()},100)},[d,g]},[s,e,n]);return(0,ee.useEffect)(()=>{if(!o.current)throw Error("editor not in dom");return r.current=new S.EditorView({state:p(),parent:o.current}),()=>{var c;(c=r.current)==null||c.destroy()}},[s,p]),{editorRef:o,clearInput:l}};var Xn=require("react/jsx-runtime"),ao="vuuColumnExpressionInput",En=({onChange:e,onSubmitExpression:n,suggestionProvider:t})=>{let{editorRef:o}=yn({onChange:e,onSubmitExpression:n,suggestionProvider:t});return(0,Xn.jsx)("div",{className:`${ao}`,ref:o})};var G=require("@vuu-ui/vuu-codemirror"),qe=require("@vuu-ui/vuu-data-react"),Ee=require("@vuu-ui/vuu-utils"),ye=require("react");var be=[{accepts:"string",description:"Returns multiple string values as a single joined string. Arguments may be string literal values, string columns or other string expressions. Non string arguments may also be included, these will be converted to strings.",example:{expression:'concatenate("example", "-test")',result:'"example-test"'},name:"concatenate",params:{description:"( string, string, [ string* ] )"},type:"string"},{accepts:["string","string"],description:"Tests a string value to determine whether it contains a given substring. Accepts two arguments: source text and target substring. Returns true if <source text> contains one or more occurrences of <target subscring>",example:{expression:'contains("Royal Bank of Scotland", "bank")',result:"true"},name:"contains",params:{description:"( string )"},type:"boolean"},{accepts:["string","number"],description:"Returns the leftmost <number> characters from <string>. First argument may be a string literal, string column or other string expression.",example:{expression:'left("USD Benchmark Report", 3)',result:'"USD"'},name:"left",params:{count:2,description:"( string, number )"},type:"string"},{accepts:"string",description:"Returns the number of characters in <string>. Argument may be a string literal, string column or other string expression.",example:{expression:'len("example")',result:"7"},name:"len",params:{description:"(string)"},type:"number"},{accepts:"string",description:"Convert a string value to lowercase. Argument may be a string column or other string expression.",example:{expression:'lower("examPLE")',result:'"example"'},name:"lower",params:{description:"( string )"},type:"string"},{accepts:"string",description:"Convert a string value to uppercase. Argument may be a string column or other string expression.",example:{expression:'upper("example")',result:'"EXAMPLE"'},name:"upper",params:{description:"( string )"},type:"string"},{accepts:["string","number"],description:"Returns the rightmost <number> characters from <string>. First argument may be a string literal, string column or other string expression.",example:{expression:"blah",result:"blah"},name:"right",params:{description:"( string )"},type:"string"},{accepts:["string","string","string"],description:"Replace characters within a string. Accepts three arguments: source text, text to replace and replacement text. Returns a copy of <source text> with any occurrences of <text to replace> replaced by <replacement text>",example:{expression:"blah",result:"blah"},name:"replace",params:{description:"( string )"},type:"string"},{accepts:"number",description:"Converts a number to a string.",example:{expression:"blah",result:"blah"},name:"text",params:{description:"( string )"},type:"string"},{accepts:"string",description:"Tests a string value to determine whether it starts with a given substring. Accepts two arguments: source text and target substring. Returns true if <source text> starts with <target subscring>.",example:{expression:"blah",result:"blah"},name:"starts",params:{description:"( string )"},type:"boolean"},{accepts:"string",description:"Tests a string value to determine whether it ends with a given substring. Accepts two arguments: source text and target substring. Returns true if <source text> ends with <target subscring>.",example:{expression:"blah",result:"blah"},name:"ends",params:{description:"( string )"},type:"boolean"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"min",params:{description:"( string )"},type:"number"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"max",params:{description:"( string )"},type:"number"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"sum",params:{description:"( string )"},type:"number"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"round",params:{description:"( string )"},type:"number"},{accepts:"any",description:"blah",example:{expression:"blah",result:"blah"},name:"or",params:{description:"( string )"},type:"boolean"},{accepts:"any",description:"blah",example:{expression:"blah",result:"blah"},name:"and",params:{description:"( string )"},type:"boolean"},{accepts:"any",description:"Return one of two possible result values, depending on the evaluation of a filter expression. If <filterExpression> resolves to true, result is <expression1>, otherwise <expression2>. ",example:{expression:"blah",result:"blah"},name:"if",params:{description:"( filterExpression, expression1, expression 2)"},type:"variable"}];var U=require("@vuu-ui/vuu-utils"),Vn=({name:e,description:n,example:t,params:o,type:i})=>{let r=(0,U.createEl)("div","vuuFunctionDoc"),s=(0,U.createEl)("div","function-heading"),p=(0,U.createEl)("span","function-name",e),l=(0,U.createEl)("span","param-list",o.description),c=(0,U.createEl)("span","function-type",i);s.appendChild(p),s.appendChild(l),s.appendChild(c);let g=(0,U.createEl)("p",void 0,n);if(r.appendChild(s),r.appendChild(g),t){let x=(0,U.createEl)("div","example-container","Example:"),h=(0,U.createEl)("div","example-expression",t.expression),a=(0,U.createEl)("div","example-result",t.result);x.appendChild(h),x.appendChild(a),r.appendChild(x)}return r};var lo=[],le=e=>e.map(n=>{var t;return{...n,apply:((t=n.apply)!=null?t:n.label)+" "}}),po=(e,{functionName:n,operator:t})=>{if(t)return e.filter(Ee.isNumericColumn);if(n){let o=be.find(i=>i.name===n);if(o)switch(o.accepts){case"string":return e.filter(Ee.isTextColumn);case"number":return e.filter(Ee.isNumericColumn);default:return e}}return e},Yn=(e,n)=>po(e,n).map(o=>{var r;let i=(r=o.label)!=null?r:o.name;return{apply:n.prefix?`${n.prefix}${i}`:i,label:i,boost:5,type:"column",expressionType:o.serverDataType}}),co=[{apply:"* ",boost:2,label:"*",type:"operator"},{apply:"/ ",boost:2,label:"/",type:"operator"},{apply:"+ ",boost:2,label:"+",type:"operator"},{apply:"- ",boost:2,label:"-",type:"operator"}],uo=e=>e===void 0||(0,Ee.isNumericColumn)(e)?co:lo,mo=e=>{switch(e.serverDataType){case"string":case"char":return le(G.stringOperators);case"int":case"long":case"double":return le(G.numericOperators)}},vn=e=>({apply:`${e.name}( `,boost:2,expressionType:e.type,info:()=>Vn(e),label:e.name,type:"function"}),go=e=>{if(e){if(typeof e.accepts=="string")return e.accepts;if(Array.isArray(e.accepts))return e.accepts.every(n=>n==="string")?"string":"any"}return"any"},fo=be.map(vn),Co=({functionName:e})=>{if(e){let n=be.find(o=>o.name===e),t=go(n);if(n)switch(t){case"string":return be.filter(o=>o.type==="string"||o.type==="variable").map(vn);case"number":return be.filter(o=>o.type==="number"||o.type==="variable").map(vn);default:}}return fo},xo={},On=({columns:e,table:n})=>{let t=(0,ye.useCallback)(p=>p?e.find(l=>l.name===p):void 0,[e]),o=(0,ye.useRef)(),i=(0,qe.useTypeaheadSuggestions)(),r=(0,ye.useCallback)(async(p,l=xo)=>{let{columnName:c,functionName:g,operator:x,prefix:h}=l;switch(p){case"expression":{let a=await le(Yn(e,{functionName:g,prefix:h})).concat(Co(l));return o.current=a}case"column":{let a=await Yn(e,l);return o.current=le(a)}case"operator":{let a=await uo(t(c));return o.current=le(a)}case"relational-operator":{let a=await(0,G.getRelationalOperators)(t(c));return o.current=le(a)}case"condition-operator":{let a=t(c);if(a){let d=await mo(a);if(d)return o.current=le(d)}}break;case"columnValue":if(c&&x){let a=(0,qe.getTypeaheadParams)(n,c),d=await i(a);return o.current=(0,G.toSuggestions)(d,{suffix:""}),o.current.forEach(f=>{f.apply=(m,P,R)=>{let X=new G.AnnotationType,De=R+P.label.length+1;m.dispatch({changes:{from:R,insert:P.label},selection:{anchor:De,head:De},annotations:X.of(P)})}}),o.current}break}return[]},[e,t,i,n]),s=(0,ye.useCallback)(async(p,l,c)=>{let{current:g}=o,x=!1,h=g||await r(p,{columnName:l});if(c&&h)for(let a of h){if(a.label===c)return!1;a.label.startsWith(c)&&(x=!0)}return x},[r]);return{getSuggestions:r,isPartialMatch:s}};var Te=require("@salt-ds/core"),xt=Y(require("classnames"),1),q=require("react");var Pn=require("@heswell/salt-lab"),B=require("@salt-ds/core"),W=require("react");var zn=require("@heswell/salt-lab"),Zn=Y(require("classnames"),1);var Oe=require("react/jsx-runtime"),ve="vuuColumnListItem",Jn=({className:e,item:n,label:t,style:o,...i})=>{let r=(0,Zn.default)(ve,e,{[`${ve}-calculated`]:n==null?void 0:n.expression,[`${ve}-hidden`]:n==null?void 0:n.hidden});return(0,Oe.jsxs)(zn.ListItem,{className:r,...i,children:[(0,Oe.jsx)("span",{className:`${ve}-iconType`}),(0,Oe.jsx)("label",{className:`${ve}-label`,children:t}),(0,Oe.jsx)("span",{className:`${ve}-iconHidden`})]})};var E=require("react/jsx-runtime"),Pe="vuuColumnPicker",ho=(e,n)=>e.filter(t=>n.find(o=>o.name===t.name)==null),qn=({availableColumns:e,id:n,dispatchColumnAction:t,onAddCalculatedColumnClick:o,onSelectionChange:i,chosenColumns:r,selectedColumn:s})=>{let[p,l]=(0,W.useState)([]),c=(0,B.useIdMemo)(n),g=ho(e,r),x=(0,W.useCallback)(()=>{p.length>0&&(l([]),t({type:"addColumn",columns:p}))},[t,p]),h=(0,W.useCallback)(()=>s&&t({type:"removeColumn",column:s}),[s,t]),a=(0,W.useCallback)(()=>s&&t({type:"moveColumn",column:s,moveBy:-1}),[t,s]),d=(0,W.useCallback)(()=>s&&t({type:"moveColumn",column:s,moveBy:1}),[t,s]),f=(0,W.useCallback)((R,X)=>l(X),[]),m=(0,W.useCallback)((R,X)=>i==null?void 0:i(X),[i]),P=(0,W.useCallback)((R,X)=>{t({type:"moveColumn",moveFrom:R,moveTo:X})},[t]);return(0,E.jsxs)("div",{className:Pe,id:c,children:[(0,E.jsxs)("div",{className:`${Pe}-listColumn`,children:[(0,E.jsx)("label",{htmlFor:`available-${c}`,children:(0,E.jsx)(B.Text,{as:"h4",children:"Available Columns"})}),(0,E.jsx)("div",{className:`${Pe}-listContainer`,style:{flex:1,overflow:"hidden"},children:(0,E.jsx)(Pn.List,{borderless:!0,checkable:!1,height:"100%",id:`available-${c}`,itemHeight:24,itemToString:R=>R.name,onSelectionChange:f,selected:p,selectionStrategy:"extended",source:g})}),(0,E.jsx)("div",{style:{display:"flex",alignItems:"center",flex:"0 0 32px",marginTop:"var(--salt-size-basis-unit)"},children:(0,E.jsxs)(B.Button,{onClick:x,disabled:p.length===0,children:["Show",(0,E.jsx)("span",{"data-icon":"arrow-thin-right",style:{marginLeft:8}})]})})]}),(0,E.jsxs)("div",{className:`${Pe}-listColumn`,children:[(0,E.jsx)("label",{htmlFor:`selected-${c}`,children:(0,E.jsx)(B.Text,{as:"h4",children:"Included Columns"})}),(0,E.jsx)("div",{className:`${Pe}-listContainer`,style:{flex:1,overflow:"hidden"},children:(0,E.jsx)(Pn.List,{ListItem:Jn,allowDragDrop:!0,borderless:!0,height:"100%",id:`selected-${c}`,itemHeight:24,itemToString:R=>R.name,onMoveListItem:P,onSelectionChange:m,selected:s,style:{flex:1},source:r})}),(0,E.jsxs)("div",{style:{alignItems:"center",flex:"0 0 32px",display:"flex",gap:6,marginTop:"var(--salt-size-basis-unit)"},children:[(0,E.jsxs)(B.Button,{onClick:h,disabled:s===null,children:[(0,E.jsx)("span",{"data-icon":"arrow-thin-left",style:{marginRight:8}}),"Hide"]}),(0,E.jsx)(B.Button,{"aria-label":"Move column up",onClick:a,disabled:s===null||(r==null?void 0:r.indexOf(s))===0,style:{width:28},children:(0,E.jsx)("span",{"data-icon":"arrow-thin-up"})}),(0,E.jsx)(B.Button,{"aria-label":"Move column down",onClick:d,disabled:s===null||r.indexOf(s)===r.length-1,style:{width:28},children:(0,E.jsx)("span",{"data-icon":"arrow-thin-down"})}),(0,E.jsx)(B.Button,{"aria-label":"Add calculated column",className:`${Pe}-addCalculatedColumn`,onClick:o,variant:"primary",children:(0,E.jsx)("span",{"data-icon":"add"})})]})]})]})};var lt=require("@vuu-ui/vuu-layout"),v=require("@heswell/salt-lab"),Ie=require("@salt-ds/core"),pt=Y(require("classnames"),1),Z=require("react");var nt=require("@vuu-ui/vuu-utils"),tt=require("@heswell/salt-lab"),ot=require("@salt-ds/core"),Tn=Y(require("classnames"),1),rt=require("react");var pe=require("@heswell/salt-lab"),_n=require("@salt-ds/core"),Le=require("react");var k=require("react/jsx-runtime"),bo={alignOnDecimals:!1,decimals:4,zeroPad:!1},yo=(e,n)=>{let t=typeof e=="object"&&e.formatting?e.formatting:{};return["alignOnDecimals","decimals","zeroPad"].reduce((i,r)=>t[r]!==void 0?{...i,[r]:t[r]}:(n==null?void 0:n[r])!==void 0?{...i,[r]:n[r]}:i,bo)},Kn=({column:e,dispatchColumnAction:n})=>{let{decimals:t,alignOnDecimals:o,zeroPad:i}=yo(e==null?void 0:e.type),r=(0,Le.useCallback)(c=>n({type:"updateColumnTypeFormatting",column:e,...c}),[e,n]),s=(0,Le.useCallback)(c=>r({decimals:parseInt(c.toString(),10)}),[r]),p=(0,Le.useCallback)((c,g)=>r({alignOnDecimals:g}),[r]),l=(0,Le.useCallback)((c,g)=>r({zeroPad:g}),[r]);switch(e.serverDataType){case"double":return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(pe.FormField,{label:"No of Decimals",labelPlacement:"top",children:(0,k.jsx)(pe.StepperInput,{value:t,onChange:s})}),(0,k.jsx)(pe.Switch,{checked:o,label:"Align on decimals",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:p}),(0,k.jsx)(pe.Switch,{checked:i,label:"Zero pad",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:l})]});case"long":case"int":return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(_n.Text,{children:"Work in progress"})});default:return null}};var _e=require("react/jsx-runtime"),jn=({column:e,dispatchColumnAction:n})=>(console.log({column:e,dispatchColumnAction:n}),(0,_e.jsx)(_e.Fragment,{children:"what"}));var z=require("react/jsx-runtime"),Sn="vuuColumnTypePanel",Eo=["Default Renderer (int, long)"],vo=["Default Renderer (double)"],et=["Default Renderer (string)"],Oo=e=>{let t=(0,nt.getRegisteredCellRenderers)(e.serverDataType).map(o=>o.name);switch(console.log({customRendererNames:t}),e.serverDataType){case"char":case"string":return et;case"int":case"long":return Eo;case"double":return vo.concat(t);default:return et}},st=({className:e,column:n,dispatchColumnAction:t,...o})=>{let i=(0,rt.useMemo)(()=>{switch(n.serverDataType){case"double":case"int":case"long":return(0,z.jsx)(Kn,{column:n,dispatchColumnAction:t});default:return(0,z.jsx)(jn,{column:n,dispatchColumnAction:t})}},[n,t]),{serverDataType:r="string"}=n,s=Oo(n);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(tt.Dropdown,{className:(0,Tn.default)(`${Sn}-renderer`),fullWidth:!0,selected:s[0],source:s}),(0,z.jsx)(ot.Panel,{...o,className:(0,Tn.default)(Sn,e,`${Sn}-${r}`),children:i})]})};var b=require("react/jsx-runtime"),it="vuuColumnSettingsPanel",Po={className:"salt-density-high"},at=()=>null,ct=({column:e,dispatchColumnAction:n,style:t,...o})=>{var h,a,d,f;let[i,r]=(0,Z.useState)(0),s=(0,Z.useCallback)(m=>n({type:"updateColumnProp",column:e,...m}),[e,n]),p=(0,Z.useCallback)(m=>s({align:m.target.value}),[s]),l=(0,Z.useCallback)(m=>s({pin:m.target.value}),[s]),c=(0,Z.useCallback)((m,P)=>s({hidden:P}),[s]),g=(0,Z.useCallback)((m,P)=>s({label:P}),[s]),x=(0,Z.useCallback)(m=>s({width:parseInt(m.toString(),10)}),[s]);return(0,b.jsxs)("div",{className:it,...o,style:{...t},children:[(0,b.jsx)(Ie.Text,{as:"h4",children:"Column Settings"}),(0,b.jsxs)(lt.Stack,{active:i,showTabs:!0,className:(0,pt.default)(`${it}-columnTabs`),onTabSelectionChanged:r,TabstripProps:Po,children:[(0,b.jsxs)(Ie.Panel,{title:"Column",children:[(0,b.jsx)(v.FormField,{label:"Hidden",labelPlacement:"left",children:(0,b.jsx)(v.Checkbox,{checked:e.hidden===!0,onChange:c})}),(0,b.jsx)(v.FormField,{label:"Label",labelPlacement:"left",children:(0,b.jsx)(v.Input,{value:(h=e.label)!=null?h:e.name,onChange:g})}),(0,b.jsx)(v.FormField,{label:"Width",labelPlacement:"left",children:(0,b.jsx)(v.StepperInput,{value:(a=e.width)!=null?a:100,onChange:x})}),(0,b.jsx)(v.FormField,{label:"Align",labelPlacement:"left",ActivationIndicatorComponent:at,children:(0,b.jsxs)(v.RadioButtonGroup,{"aria-label":"Column Align",value:(d=e.align)!=null?d:"left",legend:"Align",onChange:p,children:[(0,b.jsx)(v.RadioButton,{label:"Left",value:"left"}),(0,b.jsx)(v.RadioButton,{label:"Right",value:"right"})]})}),(0,b.jsx)(v.FormField,{label:"Pin Column",labelPlacement:"left",ActivationIndicatorComponent:at,children:(0,b.jsxs)(v.RadioButtonGroup,{"aria-label":"Pin Column",value:(f=e.pin)!=null?f:"",legend:"Pin Column",onChange:l,children:[(0,b.jsx)(v.RadioButton,{label:"Do not pin",value:""}),(0,b.jsx)(v.RadioButton,{label:"Left",value:"left"}),(0,b.jsx)(v.RadioButton,{label:"Right",value:"right"})]})})]}),(0,b.jsx)(st,{column:e,dispatchColumnAction:n,title:"Data Cell"}),(0,b.jsxs)(Ie.Panel,{title:"Vuu",variant:"secondary",children:[(0,b.jsx)(v.FormField,{label:"Name",labelPlacement:"top",readOnly:!0,variant:"secondary",children:(0,b.jsx)(v.Input,{value:e.name})}),(0,b.jsx)(v.FormField,{label:"Vuu type",labelPlacement:"top",readOnly:!0,variant:"secondary",children:(0,b.jsx)(v.Input,{value:e.serverDataType})})]})]})]})};var $=require("@heswell/salt-lab"),je=require("@salt-ds/core"),Ke=require("react");var F=require("react/jsx-runtime"),So="vuuGridSettingsPanel",To=()=>null,ut=({config:e,dispatchColumnAction:n,style:t,...o})=>{var p;let i=(0,Ke.useCallback)(l=>n({type:"updateGridSettings",...l}),[n]),r=(0,Ke.useCallback)(l=>i({columnFormatHeader:l.target.value}),[i]),s=(0,Ke.useCallback)(l=>i({columnDefaultWidth:parseInt(l.toString(),10)}),[i]);return(0,F.jsxs)("div",{className:So,...o,style:{...t},children:[(0,F.jsx)(je.Text,{as:"h4",children:"Grid Settings"}),(0,F.jsxs)(je.Panel,{children:[(0,F.jsx)($.FormField,{label:"Format column labels",labelPlacement:"left",ActivationIndicatorComponent:To,children:(0,F.jsxs)($.RadioButtonGroup,{"aria-label":"Format column labels",value:e.columnFormatHeader,legend:"Format column labels",onChange:r,children:[(0,F.jsx)($.RadioButton,{label:"No Formatting",value:void 0}),(0,F.jsx)($.RadioButton,{label:"Capitalize",value:"capitalize"}),(0,F.jsx)($.RadioButton,{label:"Uppercase",value:"uppercase"})]})}),(0,F.jsx)($.FormField,{label:"Default Column Width",labelPlacement:"left",children:(0,F.jsx)($.StepperInput,{value:(p=e.columnDefaultWidth)!=null?p:100,onChange:s})})]})]})};var mt=require("react"),dt=require("@heswell/salt-lab"),gt=require("@vuu-ui/vuu-utils"),Do=(e,n)=>{switch(console.log(`gridSettingsReducer ${n.type}`),n.type){case"addColumn":return wo(e,n);case"addCalculatedColumn":return Ro(e,n);case"moveColumn":return No(e,n);case"removeColumn":return Ao(e,n);case"updateColumn":return e;case"updateColumnProp":return ko(e,n);case"updateGridSettings":return Fo(e,n);case"updateColumnTypeFormatting":return Qo(e,n);default:return e}},ft=e=>{let[n,t]=(0,mt.useReducer)(Do,e);return{gridSettings:n,dispatchColumnAction:t}};function wo(e,{column:n,columns:t,index:o=-1}){let{columns:i}=e;if(o===-1){if(Array.isArray(t))return{...e,columns:i.concat(t)};if(n)return{...e,columns:i.concat(n)}}return e}function Ro(e,{columnName:n,columnType:t,expression:o}){let{columns:i}=e,r={name:n,expression:o,serverDataType:t};return{...e,columns:i.concat(r)}}function Ao(e,{column:n}){let{columns:t}=e;return{...e,columns:t.filter(o=>o.name!==n.name)}}function No(e,{column:n,moveBy:t,moveFrom:o,moveTo:i}){let{columns:r}=e;if(n&&typeof t=="number"){let s=r.indexOf(n),p=r.slice(),[l]=p.splice(s,1);return p.splice(s+t,0,l),{...e,columns:p}}else return typeof o=="number"&&typeof i=="number"?{...e,columns:(0,dt.moveItem)(r,o,i)}:e}function ko(e,{align:n,column:t,hidden:o,label:i,width:r}){let{columns:s}=e;return(n==="left"||n==="right")&&(s=Be(s,{...t,align:n})),typeof o=="boolean"&&(s=Be(s,{...t,hidden:o})),typeof i=="string"&&(s=Be(s,{...t,label:i})),typeof r=="number"&&(s=Be(s,{...t,width:r})),{...e,columns:s}}function Fo(e,{columnFormatHeader:n}){return{...e,columnFormatHeader:n!=null?n:e.columnFormatHeader}}function Qo(e,{alignOnDecimals:n,column:t,decimals:o,zeroPad:i}){let{columns:r}=e;if(r.find(p=>p.name===t.name)){let{serverDataType:p="string",type:l=(0,gt.fromServerDataType)(p)}=t,c=typeof l=="string"?{name:l}:{...l};return typeof n=="boolean"&&(c.formatting={...c.formatting,alignOnDecimals:n}),typeof o=="number"&&(c.formatting={...c.formatting,decimals:o}),typeof i=="boolean"&&(c.formatting={...c.formatting,zeroPad:i}),{...e,columns:Be(r,{...t,type:c})}}else return e}function Be(e,n){return e.map(t=>t.name===n.name?n:t)}var ht=require("@vuu-ui/vuu-layout");var en=require("@heswell/salt-lab"),Se=require("@salt-ds/core"),H=require("react");var J=require("react/jsx-runtime"),Ct=({columns:e,dispatchColumnAction:n,table:t})=>{let[o,i]=(0,H.useState)(""),[,r]=(0,H.useState)(),s=(0,H.useRef)(""),p=On({columns:e,table:t}),l=(0,H.useCallback)(h=>{let{value:a}=h.target;i(a)},[]),c=(0,H.useCallback)(h=>{s.current=h},[]),g=(0,H.useCallback)((h,a)=>{console.log({source:h}),r(a)},[]),x=(0,H.useCallback)(()=>{s.current&&(console.log(`save expression ${JSON.stringify(s.current,null,2)}`),n({type:"addCalculatedColumn",columnName:o,expression:s.current,columnType:"string"}))},[o,n]);return(0,J.jsxs)(Se.Panel,{className:"vuuCalculatedColumnPanel",title:"Define Computed Column",children:[(0,J.jsx)(Se.Text,{styleAs:"h4",children:"Define Computed Column"}),(0,J.jsx)(en.FormField,{label:"Column Name",labelPlacement:"left",children:(0,J.jsx)(en.Input,{value:o,onChange:l})}),(0,J.jsx)(En,{onChange:c,onSubmitExpression:g,suggestionProvider:p}),(0,J.jsx)("div",{style:{marginTop:12},children:(0,J.jsx)(Se.Button,{onClick:x,children:"Add Column"})})]})};var w=require("react/jsx-runtime"),nn="vuuDatagridSettingsPanel",Lo=()=>{},Io=["table-settings","column-chooser","column-settings","define-column"],Bo=(e,n)=>Io[n],$o=({availableColumns:e,className:n,gridConfig:t,onCancel:o,onConfigChange:i,...r})=>{var De;console.log("DatagridSettingsPanel render");let[s,p]=(0,q.useState)(0),{gridSettings:l,dispatchColumnAction:c}=ft(t),[g,x]=(0,q.useState)(null),h=(0,q.useCallback)(V=>{x(V?V.name:null)},[]),a=(0,q.useCallback)((V,Ft=!1)=>{console.log("1) DataGridSettingsPanel fire onConfigChange"),i==null||i(l,Ft)},[l,i]),d=(0,q.useCallback)(V=>{p(V)},[]),f=(0,q.useCallback)(V=>a(V,!0),[a]),m=g===null?null:(De=l.columns.find(V=>V.name===g))!=null?De:null,P={activeTabIndex:s,allowRenameTab:!1,orientation:"vertical"},R=(0,q.useCallback)(()=>p(3),[]),X=s===2?"right":void 0;return(0,w.jsxs)("div",{...r,className:(0,xt.default)(nn,n),children:[(0,w.jsxs)(ht.Stack,{TabstripProps:P,className:`${nn}-stack`,getTabIcon:Bo,getTabLabel:Lo,active:s===2?1:s,onTabSelectionChanged:d,showTabs:!0,children:[(0,w.jsx)(ut,{config:l,dispatchColumnAction:c}),(0,w.jsxs)("div",{className:`${nn}-columnPanels`,"data-align":X,children:[(0,w.jsx)(qn,{availableColumns:e,chosenColumns:l.columns,dispatchColumnAction:c,onSelectionChange:h,onAddCalculatedColumnClick:R,selectedColumn:m}),m===null?(0,w.jsx)(Te.Panel,{className:"vuuColumnSettingsPanel",children:"Select a column"}):(0,w.jsx)(ct,{column:m,dispatchColumnAction:c,style:{background:"white",flex:"1 0 150px"}})]}),(0,w.jsx)("div",{title:"Column Settings",children:"Column Settings"}),(0,w.jsx)(Ct,{columns:l.columns,dispatchColumnAction:c,table:{module:"SIMUL",table:"instruments"}})]}),(0,w.jsxs)("div",{className:`${nn}-buttonBar`,children:[(0,w.jsx)(Te.Button,{onClick:o,children:"Cancel"}),(0,w.jsx)(Te.Button,{onClick:a,children:"Apply"}),(0,w.jsx)(Te.Button,{onClick:f,children:"Save"})]})]})};var $e=require("react"),bt=Y(require("classnames"),1);var ne=require("react/jsx-runtime"),tn="vuuDatasourceStats",Dn=new Intl.NumberFormat,Mo=({className:e,dataSource:n})=>{let[t,o]=(0,$e.useState)(n.range),[i,r]=(0,$e.useState)(n.size);(0,$e.useEffect)(()=>{r(n.size),n.on("resize",r),n.on("range",o)},[n]);let s=(0,bt.default)(tn,e),p=Dn.format(t.from),l=Dn.format(t.to-1),c=Dn.format(i);return(0,ne.jsxs)("div",{className:s,children:[(0,ne.jsx)("span",{children:"Showing rows"}),(0,ne.jsx)("span",{className:`${tn}-range`,children:p}),(0,ne.jsx)("span",{className:`${tn}-range`,children:l}),(0,ne.jsx)("span",{children:"of"}),(0,ne.jsx)("span",{className:`${tn}-size`,children:c})]})};var Nt=require("@vuu-ui/vuu-layout"),O=require("@heswell/salt-lab"),Ue=require("@salt-ds/core"),kt=Y(require("classnames"),1),K=require("react");var Pt=require("@vuu-ui/vuu-utils"),St=require("@heswell/salt-lab"),Tt=require("@salt-ds/core"),Rn=Y(require("classnames"),1),Dt=require("react");var ce=require("@heswell/salt-lab"),yt=require("@salt-ds/core"),Me=require("react");var Q=require("react/jsx-runtime"),Uo={alignOnDecimals:!1,decimals:4,zeroPad:!1},Go=(e,n)=>{let t=typeof e=="object"&&e.formatting?e.formatting:{};return["alignOnDecimals","decimals","zeroPad"].reduce((i,r)=>t[r]!==void 0?{...i,[r]:t[r]}:(n==null?void 0:n[r])!==void 0?{...i,[r]:n[r]}:i,Uo)},Et=({column:e,dispatchColumnAction:n})=>{let{decimals:t,alignOnDecimals:o,zeroPad:i}=Go(e==null?void 0:e.type),r=(0,Me.useCallback)(c=>n({type:"updateColumnTypeFormatting",column:e,...c}),[e,n]),s=(0,Me.useCallback)(c=>r({decimals:parseInt(c.toString(),10)}),[r]),p=(0,Me.useCallback)((c,g)=>r({alignOnDecimals:g}),[r]),l=(0,Me.useCallback)((c,g)=>r({zeroPad:g}),[r]);switch(e.serverDataType){case"double":return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ce.FormField,{label:"No of Decimals",labelPlacement:"top",children:(0,Q.jsx)(ce.StepperInput,{value:t,onChange:s})}),(0,Q.jsx)(ce.Switch,{checked:o,label:"Align on decimals",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:p}),(0,Q.jsx)(ce.Switch,{checked:i,label:"Zero pad",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:l})]});case"long":case"int":return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(yt.Text,{children:"Work in progress"})});default:return null}};var on=require("react/jsx-runtime"),vt=({column:e,dispatchColumnAction:n})=>(console.log(e,n),(0,on.jsx)(on.Fragment,{children:"what"}));var _=require("react/jsx-runtime"),wn="vuuColumnTypePanel",Wo=["Default Renderer (int, long)"],Ho=["Default Renderer (double)"],Ot=["Default Renderer (string)"],Xo=e=>{let t=(0,Pt.getRegisteredCellRenderers)(e.serverDataType).map(o=>o.name);switch(console.log({customRendererNames:t}),e.serverDataType){case"char":case"string":return Ot;case"int":case"long":return Wo;case"double":return Ho.concat(t);default:return Ot}},wt=({className:e,column:n,dispatchColumnAction:t,...o})=>{let i=(0,Dt.useMemo)(()=>{switch(n.serverDataType){case"double":case"int":case"long":return(0,_.jsx)(Et,{column:n,dispatchColumnAction:t});default:return(0,_.jsx)(vt,{column:n,dispatchColumnAction:t})}},[n,t]),{serverDataType:r="string"}=n,s=Xo(n);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(St.Dropdown,{className:(0,Rn.default)(`${wn}-renderer`),fullWidth:!0,selected:s[0],source:s}),(0,_.jsx)(Tt.Panel,{...o,className:(0,Rn.default)(wn,e,`${wn}-${r}`),children:i})]})};var y=require("react/jsx-runtime"),Rt="vuuColumnSettingsPanel",Vo={className:"salt-density-high"},At=()=>null,Yo=({column:e,dispatchColumnAction:n,style:t,...o})=>{var h,a,d,f;let[i,r]=(0,K.useState)(0),s=(0,K.useCallback)(m=>n({type:"updateColumnProp",column:e,...m}),[e,n]),p=(0,K.useCallback)(m=>s({align:m.target.value}),[s]),l=(0,K.useCallback)(m=>s({pin:m.target.value}),[s]),c=(0,K.useCallback)((m,P)=>s({hidden:P}),[s]),g=(0,K.useCallback)((m,P)=>s({label:P}),[s]),x=(0,K.useCallback)(m=>s({width:parseInt(m.toString(),10)}),[s]);return(0,y.jsxs)("div",{className:Rt,...o,style:{...t},children:[(0,y.jsx)(Ue.Text,{as:"h4",children:"Column Settings"}),(0,y.jsxs)(Nt.Stack,{active:i,showTabs:!0,className:(0,kt.default)(`${Rt}-columnTabs`),onTabSelectionChanged:r,TabstripProps:Vo,children:[(0,y.jsxs)(Ue.Panel,{title:"Column",children:[(0,y.jsx)(O.FormField,{label:"Hidden",labelPlacement:"left",children:(0,y.jsx)(O.Checkbox,{checked:e.hidden===!0,onChange:c})}),(0,y.jsx)(O.FormField,{label:"Label",labelPlacement:"left",children:(0,y.jsx)(O.Input,{value:(h=e.label)!=null?h:e.name,onChange:g})}),(0,y.jsx)(O.FormField,{label:"Width",labelPlacement:"left",children:(0,y.jsx)(O.StepperInput,{value:(a=e.width)!=null?a:100,onChange:x})}),(0,y.jsx)(O.FormField,{label:"Align",labelPlacement:"left",ActivationIndicatorComponent:At,children:(0,y.jsxs)(O.RadioButtonGroup,{"aria-label":"Column Align",value:(d=e.align)!=null?d:"left",legend:"Align",onChange:p,children:[(0,y.jsx)(O.RadioButton,{label:"Left",value:"left"}),(0,y.jsx)(O.RadioButton,{label:"Right",value:"right"})]})}),(0,y.jsx)(O.FormField,{label:"Pin Column",labelPlacement:"left",ActivationIndicatorComponent:At,children:(0,y.jsxs)(O.RadioButtonGroup,{"aria-label":"Pin Column",value:(f=e.pin)!=null?f:"",legend:"Pin Column",onChange:l,children:[(0,y.jsx)(O.RadioButton,{label:"Do not pin",value:""}),(0,y.jsx)(O.RadioButton,{label:"Left",value:"left"}),(0,y.jsx)(O.RadioButton,{label:"Right",value:"right"})]})})]}),(0,y.jsx)(wt,{column:e,dispatchColumnAction:n,title:"Data Cell"}),(0,y.jsxs)(Ue.Panel,{title:"Vuu",variant:"secondary",children:[(0,y.jsx)(O.FormField,{label:"Name",labelPlacement:"top",readOnly:!0,variant:"secondary",children:(0,y.jsx)(O.Input,{value:e.name})}),(0,y.jsx)(O.FormField,{label:"Vuu type",labelPlacement:"top",readOnly:!0,variant:"secondary",children:(0,y.jsx)(O.Input,{value:e.serverDataType})})]})]})]})};
|
|
1
|
+
"use strict";var Nt=Object.create;var Ue=Object.defineProperty;var kt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Qt=Object.prototype.hasOwnProperty;var It=(e,n)=>{for(var t in n)Ue(e,t,{get:n[t],enumerable:!0})},wn=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of At(n))!Qt.call(e,i)&&i!==t&&Ue(e,i,{get:()=>n[i],enumerable:!(o=kt(n,i))||o.enumerable});return e};var Y=(e,n,t)=>(t=e!=null?Nt(Lt(e)):{},wn(n||!e||!e.__esModule?Ue(t,"default",{value:e,enumerable:!0}):t,e)),Bt=e=>wn(Ue({},"__esModule",{value:!0}),e);var Fn=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var c=(e,n,t)=>(Fn(e,n,"read from private field"),t?t.call(e):n.get(e)),I=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},j=(e,n,t,o)=>(Fn(e,n,"write to private field"),o?o.call(e,t):n.set(e,t),t);var Wo={};It(Wo,{ColumnExpressionInput:()=>bn,ColumnNamedTerms:()=>ze,ColumnSettingsPanel:()=>Go,DataSourceStats:()=>Qo,DatagridSettingsPanel:()=>Lo,columnExpressionLanguageSupport:()=>tn,isCompleteExpression:()=>cn,isCompleteRelationalExpression:()=>mn,lastNamedChild:()=>Ze,useColumnExpressionEditor:()=>hn,useColumnExpressionSuggestionProvider:()=>En,walkTree:()=>un});module.exports=Bt(Wo);var R=require("@vuu-ui/vuu-utils"),Nn=Y(require("classnames"),1);var te=require("@vuu-ui/vuu-utils"),He=require("react"),Mt=[void 0,void 0,void 0,void 0];function Rn(e,n,t){var E;let o=(0,He.useRef)(),[i,r,s,p]=o.current||Mt,{type:l}=t,u=(0,te.isTypeDescriptor)(l)?(E=l.formatting)==null?void 0:E.decimals:void 0,g=e===i&&(0,te.isValidNumber)(n)&&(0,te.isValidNumber)(r)&&t===s?(0,te.getMovingValueDirection)(n,p,r,u):"";return(0,He.useEffect)(()=>{o.current=[e,n,t,g]}),g}var We=require("react/jsx-runtime"),$t=String.fromCharCode(11014),Ut=String.fromCharCode(11015),{KEY:Ht}=R.metadataKeys,Ge="vuuBackgroundCell",De={ArrowOnly:"arrow",BackgroundOnly:"bg-only",ArrowBackground:"arrow-bg"},Gt=e=>(0,R.isTypeDescriptor)(e)&&e.renderer&&"flashStyle"in e.renderer?e.renderer.flashStyle:De.BackgroundOnly,Wt=({column:e,row:n})=>{let{key:t,type:o,valueFormatter:i}=e,r=n[t],s=Gt(o),p=Rn(n[Ht],r,e),l=s===De.ArrowOnly||s===De.ArrowBackground?p===R.UP1||p===R.UP2?$t:p===R.DOWN1||p===R.DOWN2?Ut:null:null,u=p?" "+p:"",g=(0,Nn.default)(Ge,u,{[`${Ge}-arrowOnly`]:s===De.ArrowOnly,[`${Ge}-arrowBackground`]:s===De.ArrowBackground});return(0,We.jsxs)("div",{className:g,tabIndex:-1,children:[(0,We.jsx)("div",{className:`${Ge}-flasher`,children:l}),i(n[e.key])]})};(0,R.registerComponent)("background",Wt,"cell-renderer",{serverDataType:["long","int","double"]});var pe=require("@vuu-ui/vuu-utils"),kn=Y(require("classnames"),1);var oe=require("react/jsx-runtime"),we="vuuProgressCell",Xt=({column:e,columnMap:n,row:t})=>{let{type:o}=e,i=t[e.key],r=!1,s=0;if((0,pe.isTypeDescriptor)(o)&&(0,pe.isColumnTypeRenderer)(o.renderer)){let{associatedField:l}=o.renderer,u=t[n[l]];if(typeof i=="number"&&typeof u=="number")s=Math.min(Math.round(i/u*100),100),r=isFinite(s);else{let g=parseFloat(i);if(Number.isFinite(g)){let E=parseFloat(u);Number.isFinite(E)&&(s=Math.min(Math.round(g/E*100),100),r=isFinite(s))}}}let p=(0,kn.default)(we,{});return(0,oe.jsxs)("div",{className:p,tabIndex:-1,children:[r?(0,oe.jsxs)("span",{className:`${we}-track`,children:[(0,oe.jsx)("span",{className:`${we}-bg`}),(0,oe.jsx)("span",{className:`${we}-bar`,style:{"--progress-bar-pct":`-${100-s}%`}})]}):null,(0,oe.jsx)("span",{className:`${we}-text`,children:`${s} %`})]})};(0,pe.registerComponent)("vuu.progress",Xt,"cell-renderer",{serverDataType:["long","int","double"]});var P=require("@vuu-ui/vuu-codemirror"),xn=require("@vuu-ui/vuu-utils"),ee=require("react");var B=require("@vuu-ui/vuu-codemirror");var An=require("@lezer/lr"),Xe=An.LRParser.deserialize({version:14,states:"&fOVQPOOO!SQPO'#C^OVQPO'#CcQ!pQPOOO#OQPO'#CkO#TQPO'#CrOOQO'#Cy'#CyO#YQPO,58}OVQPO,59QOVQPO,59QOVQPO,59VOVQPO'#CtOOQO,59^,59^OOQO1G.i1G.iOOQO1G.l1G.lO#kQPO1G.lO$fQPO'#CmO%WQQO1G.qOOQO'#C{'#C{O%cQPO,59`OOQO'#Cn'#CnO%wQPO,59XOVQPO,59ZOVQPO,59[OVQPO7+$]OVQPO'#CuO&`QPO1G.zOOQO1G.z1G.zO&hQQO'#C^O&rQQO1G.sO'ZQQO1G.uOOQO1G.v1G.vO'fQPO<<GwO'wQPO,59aOOQO-E6s-E6sOOQO7+$f7+$fOVQPOAN=cO(]QQO1G.lO(tQPOG22}OOQOLD(iLD(iO%wQPO,59QO%wQPO,59Q",stateData:")[~OlOS~ORUOSUOTUOUUOWQO`SOnPO~OWgXZQX[QX]QX^QXeQX~OjQXXQXpQXqQXrQXsQXtQXuQX~PnOZWO[WO]XO^XO~OWYO~OWZO~OX]OZWO[WO]XO^XO~OZWO[WO]Yi^YijYiXYipYiqYirYisYitYiuYieYi~OZWO[WO]XO^XOpdOqdOrdOsdOtdOudO~OehOvfOwgO~OXkOZWO[WO]XO^XOeiO~ORUOSUOTUOUUOWQO`SOnlO~OXsOeiO~OvQXwQX~PnOZxO[xO]yO^yOeaivaiwai~OwgOecivci~OZWO[WO]XO^XOetO~OZWO[WO]XO^XOXiaeia~OZxO[xO]Yi^YieYivYiwYi~OXwOZWO[WO]XO^XO~O`UTn~",goto:"#spPPqPPPPqPPqPPPPqP!R!W!R!RPq!Z!k!nPPP!tP#jmUOQWXYZefghitxyVbYfgRe`mTOQWXYZefghitxyR[TQjcRrjQROQVQS^WxQ_XU`YfgQcZQmeQphQqiQuyRvtQaYQnfRog",nodeNames:"\u26A0 ColumnDefinitionExpression Column Number String True False ParenthesizedExpression OpenBrace CloseBrace ArithmeticExpression Divide Times Plus Minus ConditionalExpression If RelationalExpression RelationalOperator AndCondition OrCondition Comma CallExpression Function ArgList",maxTerm:39,skippedNodes:[0],repeatNodeCount:1,tokenData:".^~RnXY#PYZ#P]^#Ppq#Pqr#brs#mxy$eyz$jz{$o{|$t|}$y}!O%O!O!P%T!P!Q%c!Q![%h!^!_%s!_!`&Q!`!a&V!c!}&d#R#S&d#T#U&u#U#Y&d#Y#Z(Y#Z#]&d#]#^*j#^#c&d#c#d+f#d#h&d#h#i,b#i#o&d~#USl~XY#PYZ#P]^#Ppq#P~#eP!_!`#h~#mOu~~#pWOX#mZ]#m^r#mrs$Ys#O#m#P;'S#m;'S;=`$_<%lO#m~$_OS~~$bP;=`<%l#m~$jOW~~$oOX~~$tO[~~$yO]~~%OOe~~%TO^~~%WP!Q![%Z~%`PR~!Q![%Z~%hOZ~~%mQR~!O!P%Z!Q![%h~%xPr~!_!`%{~&QOt~~&VOp~~&[Pq~!_!`&_~&dOs~P&iSnP!Q![&d!c!}&d#R#S&d#T#o&dR&zUnP!Q![&d!c!}&d#R#S&d#T#b&d#b#c'^#c#o&dR'cUnP!Q![&d!c!}&d#R#S&d#T#W&d#W#X'u#X#o&dR'|SvQnP!Q![&d!c!}&d#R#S&d#T#o&d~(_TnP!Q![&d!c!}&d#R#S&d#T#U(n#U#o&d~(sUnP!Q![&d!c!}&d#R#S&d#T#`&d#`#a)V#a#o&d~)[UnP!Q![&d!c!}&d#R#S&d#T#g&d#g#h)n#h#o&d~)sUnP!Q![&d!c!}&d#R#S&d#T#X&d#X#Y*V#Y#o&d~*^SU~nP!Q![&d!c!}&d#R#S&d#T#o&d~*oUnP!Q![&d!c!}&d#R#S&d#T#Y&d#Y#Z+R#Z#o&d~+YS`~nP!Q![&d!c!}&d#R#S&d#T#o&dR+kUnP!Q![&d!c!}&d#R#S&d#T#f&d#f#g+}#g#o&dR,USwQnP!Q![&d!c!}&d#R#S&d#T#o&d~,gUnP!Q![&d!c!}&d#R#S&d#T#f&d#f#g,y#g#o&d~-OUnP!Q![&d!c!}&d#R#S&d#T#i&d#i#j-b#j#o&d~-gUnP!Q![&d!c!}&d#R#S&d#T#X&d#X#Y-y#Y#o&d~.QST~nP!Q![&d!c!}&d#R#S&d#T#o&d",tokenizers:[0,1],topRules:{ColumnDefinitionExpression:[0,1]},tokenPrec:375});var Vt=B.LRLanguage.define({name:"VuuColumnExpression",parser:Xe.configure({props:[(0,B.styleTags)({Function:B.tags.variableName,String:B.tags.string,Or:B.tags.emphasis,Operator:B.tags.operator})]})}),tn=()=>new B.LanguageSupport(Vt);var on=class{constructor(n){switch(this.value=n,typeof n){case"boolean":this.type="booleanLiteralExpression";break;case"number":this.type="numericLiteralExpression";break;default:this.type="stringLiteralExpression"}}toJSON(){return{type:this.type,value:this.value}}},rn=class{constructor(n){this.type="colExpression";this.column=n}toJSON(){return{type:this.type,column:this.column}}},Re,se,sn=class{constructor(n="unknown"){I(this,Re,[{type:"unknown"},{type:"unknown"}]);I(this,se,void 0);this.type="arithmeticExpression";j(this,se,n)}get op(){return c(this,se)}set op(n){j(this,se,n)}get expressions(){return c(this,Re)}toJSON(){return{type:this.type,op:c(this,se),expressions:c(this,Re)}}};Re=new WeakMap,se=new WeakMap;var de,an=class{constructor(n){I(this,de,[]);this.type="callExpression";this.functionName=n}get expressions(){return c(this,de)}get arguments(){return c(this,de)}toJSON(){return{type:this.type,functionName:this.functionName,arguments:c(this,de).map(n=>{var t;return(t=n.toJSON)==null?void 0:t.call(n)})}}};de=new WeakMap;var Ne,ge,ce=class{constructor(){I(this,Ne,[{type:"unknown"},{type:"unknown"}]);I(this,ge,"unknown");this.type="relationalExpression"}get op(){return c(this,ge)}set op(n){j(this,ge,n)}get expressions(){return c(this,Ne)}toJSON(){return{type:this.type,op:c(this,ge),expressions:c(this,Ne)}}};Ne=new WeakMap,ge=new WeakMap;var ke,fe,me=class{constructor(n){I(this,ke,[{type:"unknown"},{type:"unknown"}]);I(this,fe,void 0);this.type="booleanCondition";j(this,fe,n)}get op(){return c(this,fe)}get expressions(){return c(this,ke)}toJSON(){return{type:this.type,op:c(this,fe),expressions:c(this,ke).map(n=>{var t;return(t=n.toJSON)==null?void 0:t.call(n)})}}};ke=new WeakMap,fe=new WeakMap;var U,Fe=class{constructor(n){I(this,U,void 0);this.type="conditionalExpression";j(this,U,[n?new me(n):new ce,{type:"unknown"},{type:"unknown"}])}get expressions(){return c(this,U)}get condition(){return c(this,U)[0]}get truthyExpression(){return c(this,U)[1]}set truthyExpression(n){c(this,U)[1]=n}get falsyExpression(){return c(this,U)[2]}set falsyExpression(n){c(this,U)[2]=n}toJSON(){var n,t,o,i,r;return{type:this.type,condition:(t=(n=this.condition).toJSON)==null?void 0:t.call(n),truthyExpression:this.truthyExpression,falsyExpression:(r=(i=(o=this.falsyExpression)==null?void 0:o.toJSON)==null?void 0:i.call(o))!=null?r:this.falsyExpression}}};U=new WeakMap;var re=e=>e.type==="unknown",Ve=e=>e.type==="arithmeticExpression",Yt=e=>e.type==="callExpression",ue=e=>e.type==="conditionalExpression",zt=e=>e.type==="relationalExpression"||e.type==="booleanCondition";var Zt=e=>e.type==="booleanCondition",pn=e=>(e==null?void 0:e.type)==="relationalExpression";var L=e=>{if(re(e))return e;if(pn(e)){let[n,t]=e.expressions;if(D(n))return L(n);if(e.op==="unknown")return e;if(D(t))return L(t)}else if(zt(e)){let{expressions:n=[]}=e;for(let t of n)if(D(t))return L(t)}else if(ue(e)){let{condition:n,truthyExpression:t,falsyExpression:o}=e;if(D(n))return L(n);if(D(t))return L(t);if(D(o))return L(o)}else if(Ve(e)){let{expressions:n=[]}=e;for(let t of n)if(D(t))return L(t)}},Ye=(e,n,t)=>{let{expressions:o=[]}=e;if(o.includes(n)){let i=o.indexOf(n);return o.splice(i,1,t),!0}else for(let i of o)if(Ye(i,n,t))return!0;return!1},D=e=>re(e)?!0:ue(e)?D(e.condition)||D(e.truthyExpression)||D(e.falsyExpression):pn(e)||Zt(e)?e.op===void 0||e.expressions.some(n=>D(n)):!1,Ln=(e,n)=>{let t=L(e);t?t.expressions?t.expressions.push(n):console.warn("don't know how to treat targetExpression"):console.error("no target expression found")},C,ie,ln=class{constructor(){I(this,C,void 0);I(this,ie,[])}setCondition(n){if(c(this,C)===void 0)this.addExpression(new Fe(n));else if(ue(c(this,C))){if(D(c(this,C).condition)){let t=n?new me(n):new ce;this.addExpression(t)}else if(re(c(this,C).truthyExpression))c(this,C).truthyExpression=new Fe(n);else if(D(c(this,C).truthyExpression)){let t=n?new me(n):new ce;this.addExpression(t)}else if(re(c(this,C).falsyExpression))c(this,C).falsyExpression=new Fe(n);else if(D(c(this,C).falsyExpression)){let t=n?new me(n):new ce;this.addExpression(t)}}else console.error("setCondition called unexpectedly")}addExpression(n){if(c(this,ie).length>0){let t=c(this,ie).at(-1);t==null||t.arguments.push(n)}else if(c(this,C)===void 0)j(this,C,n);else if(Ve(c(this,C))){let t=L(c(this,C));t&&re(t)&&Ye(c(this,C),t,n)}else if(ue(c(this,C))&&D(c(this,C))){let t=L(c(this,C));t&&re(t)?Ye(c(this,C),t,n):t&&Ln(t,n)}}setFunction(n){let t=new an(n);this.addExpression(t),c(this,ie).push(t)}setColumn(n){this.addExpression(new rn(n))}setArithmeticOp(n){let t=n,o=c(this,C);Ve(o)&&(o.op=t)}setRelationalOperator(n){let t=n;if(c(this,C)&&ue(c(this,C))){let o=L(c(this,C));pn(o)?o.op=t:console.error(`no target expression found (op = ${n})`)}}setValue(n){let t=new on(n);if(c(this,C)===void 0)j(this,C,t);else if(Ve(c(this,C)))this.addExpression(t);else if(Yt(c(this,C)))c(this,C).arguments.push(t);else if(ue(c(this,C)))if(D(c(this,C))){let o=L(c(this,C));o&&re(o)?Ye(c(this,C),o,t):o&&Ln(o,t)}else console.log("what do we do with value, in a complete expression")}closeBrace(){c(this,ie).pop()}get expression(){return c(this,C)}toJSON(){var n;return(n=c(this,C))==null?void 0:n.toJSON()}};C=new WeakMap,ie=new WeakMap;var un=(e,n)=>{let t=new ln,o=e.cursor();do{let{name:i,from:r,to:s}=o;switch(i){case"AndCondition":t.setCondition("and");break;case"OrCondition":t.setCondition("or");break;case"RelationalExpression":t.setCondition();break;case"ArithmeticExpression":t.addExpression(new sn);break;case"Column":{let p=n.substring(r,s);t.setColumn(p)}break;case"Function":{let p=n.substring(r,s);t.setFunction(p)}break;case"Times":case"Divide":case"Plus":case"Minus":{let p=n.substring(r,s);t.setArithmeticOp(p)}break;case"RelationalOperator":{let p=n.substring(r,s);t.setRelationalOperator(p)}break;case"False":case"True":{let p=n.substring(r,s);t.setValue(p==="true")}break;case"String":t.setValue(n.substring(r+1,s-1));break;case"Number":t.setValue(parseFloat(n.substring(r,s)));break;case"CloseBrace":t.closeBrace();break;default:}}while(o.next());return t.toJSON()};var Jt=Xe.configure({strict:!0}),Qn=["Number","String"],ze=[...Qn,"AndCondition","ArithmeticExpression","BooleanOperator","RelationalOperatorOperator","CallExpression","CloseBrace","Column","Comma","ConditionalExpression","Divide","Equal","If","Minus","OpenBrace","OrCondition","ParenthesizedExpression","Plus","RelationalExpression","RelationalOperator","Times"],cn=e=>{try{return Jt.parse(e),!0}catch{return!1}},Ze=e=>{let{lastChild:n}=e;for(;n&&!ze.includes(n.name);)n=n.prevSibling,console.log(n==null?void 0:n.name);return n},mn=e=>{if((e==null?void 0:e.name)==="RelationalExpression"){let{firstChild:n}=e,t=Ze(e);if((n==null?void 0:n.name)==="Column"&&typeof(t==null?void 0:t.name)=="string"&&Qn.includes(t.name))return!0}return!1};var ae=require("@vuu-ui/vuu-codemirror"),qt=ae.HighlightStyle.define([{tag:ae.tags.variableName,color:"var(--vuuFilterEditor-variableColor)"},{tag:ae.tags.comment,color:"green",fontStyle:"italic"}]),In=(0,ae.syntaxHighlighting)(qt);var Bn=require("@vuu-ui/vuu-codemirror"),Mn=Bn.EditorView.theme({"&":{border:"solid 1px var(--salt-container-primary-borderColor)",color:"var(--vuuFilterEditor-color)",backgroundColor:"var(--vuuFilterEditor-background)"},".cm-content":{caretColor:"var(--vuuFilterEditor-cursorColor)"},"&.cm-focused .cm-cursor":{borderLeftColor:"var(--vuuFilterEditor-cursorColor)"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"var(--vuuFilterEditor-selectionBackground)"},".cm-selectionBackground, ::selection":{backgroundColor:"var(--vuuFilterEditor-selectionBackground)"},".cm-scroller":{fontFamily:"var(--vuuFilterEditor-fontFamily)"},".cm-tooltip":{background:"var(--vuuFilterEditor-tooltipBackground)",border:"var(--vuuFilterEditor-tooltipBorder)",boxShadow:"var(--vuuFilterEditor-tooltipElevation)","&.cm-tooltip-autocomplete > ul":{fontFamily:"var(--vuuFilterEditor-fontFamily)",fontSize:"var(--vuuFilterEditor-fontSize)",maxHeight:"240px"},"&.cm-tooltip-autocomplete > ul > li":{height:"var(--vuuFilterEditor-suggestion-height)",padding:"0 3px",lineHeight:"var(--vuuFilterEditor-suggestion-height)"},"&.cm-tooltip-autocomplete li[aria-selected]":{background:"var(--vuuFilterEditor-suggestion-selectedBackground)",color:"var(--vuuFilterEditor-suggestion-selectedColor)"},"&.cm-tooltip-autocomplete li .cm-completionDetail":{color:"var(--vuuFilterEditor-suggestion-detailColor)"}}},{dark:!1});var S=require("@vuu-ui/vuu-codemirror"),fn=require("react");var _t=(e,n)=>n?e.map(t=>{var o;return{...t,apply:typeof t.apply=="function"?t.apply:`${n}${(o=t.apply)!=null?o:t.label}`}}):e,Kt=e=>e===void 0?!1:["Times","Divide","Plus","Minus"].includes(e.name),Ce=(e,n)=>{var i;let{lastChild:t}=e,{pos:o}=n;for(;t;)if(t.from<o&&ze.includes(t.name)){if(t.name==="ParenthesizedExpression"){let s=(i=t.firstChild)==null?void 0:i.nextSibling;s&&(t=s)}return t}else t=t.prevSibling},$n=(e,n)=>{var t;if(e.name==="ArgList"){let o=e.prevSibling;if(o)return(0,S.getValue)(o,n)}else if(e.name==="OpenBrace"){let o=(t=e.parent)==null?void 0:t.prevSibling;if((o==null?void 0:o.name)==="Function")return(0,S.getValue)(o,n)}},Un=(e,n)=>{if(e.name==="RelationalExpression"){let t=Ze(e);if((t==null?void 0:t.name)==="RelationalOperator")return(0,S.getValue)(t,n)}else{let t=e.prevSibling;if((t==null?void 0:t.name)==="RelationalOperator")return(0,S.getValue)(t,n)}},Cn=(e,n)=>{var t;if(e.name==="RelationalExpression"){if(((t=e.firstChild)==null?void 0:t.name)==="Column")return(0,S.getValue)(e.firstChild,n)}else{let o=e.prevSibling;if((o==null?void 0:o.name)==="Column")return(0,S.getValue)(o,n);if((o==null?void 0:o.name)==="RelationalOperator")return Cn(o,n)}},dn=async(e,n,t,o={})=>{let i=await n.getSuggestions(t,o),{startsWith:r=""}=o;return{from:e.pos-r.length,options:i}},gn=(e,n,t,o,i)=>{let r=Ce(e,n);switch(console.log(`conditional expression last child ${r==null?void 0:r.name}`),r==null?void 0:r.name){case"If":return dn(n,t,"expression",{prefix:"( "});case"OpenBrace":return dn(n,t,"expression");case"Condition":return dn(n,t,"expression",{prefix:", "});case"CloseBrace":if(o){let s=[{apply:()=>{i==null||i()},label:"Save Expression",boost:10}];return{from:n.pos,options:s}}}},jt=(e,n)=>{let t=[{apply:()=>{n==null||n()},label:"Save Expression",boost:10}];return{from:e.pos,options:t}},Hn=(e,n)=>{let t=(0,fn.useCallback)(async(o,i,r={})=>{let s=await e.getSuggestions(i,r),{startsWith:p=""}=r;return{from:o.pos-p.length,options:s}},[e]);return(0,fn.useCallback)(async o=>{var E,v;let{state:i,pos:r}=o,s=(E=o.matchBefore(/\w*/))!=null?E:{from:0,to:0,text:void 0},l=(0,S.syntaxTree)(i).resolveInner(r,-1),u=i.doc.toString(),g=cn(u);switch(console.log({nodeBeforeName:l.name}),l.name){case"If":return console.log("conditional expression If"),t(o,"expression",{prefix:"( "});case"Condition":{let a=Ce(l,o);if((a==null?void 0:a.name)==="Column"){let d=(0,S.getPreviousNode)(a);if((d==null?void 0:d.name)!=="RelationalOperator")return t(o,"condition-operator",{columnName:(0,S.getValue)(a,i)});console.log(`Condition last child Column, prev child ${d==null?void 0:d.name}`)}else if((a==null?void 0:a.name)==="RelationalOperator")return t(o,"expression");console.log(`condition last child ${a==null?void 0:a.name}`)}break;case"ConditionalExpression":return gn(l,o,e);case"RelationalExpression":{if(mn(l))return{from:o.pos,options:S.booleanJoinSuggestions.concat({label:", <truthy expression>, <falsy expression>",apply:", "})};{let a=Un(l,i),d=Cn(l,i);if(a)return t(o,"expression");{let f=await e.getSuggestions("condition-operator",{columnName:d});return{from:o.pos,options:f}}}}break;case"RelationalOperator":return t(o,"expression");case"String":{let a=Un(l,i),d=Cn(l,i),{from:f,to:m}=l;if(m-f===2&&o.pos===f+1){if(d&&a)return t(o,"columnValue",{columnName:d,operator:a,startsWith:s.text})}else if(m-f>2&&o.pos===m)return t(o,"expression",{prefix:", "});console.log(`we have a string, column is ${d} ${f} ${m}`)}break;case"ArithmeticExpression":{let a=Ce(l,o);if((a==null?void 0:a.name)==="Column")return t(o,"expression");if(Kt(a)){let d=a.name;return t(o,"column",{operator:d})}}break;case"OpenBrace":{let a=$n(l,i);return t(o,"expression",{functionName:a})}break;case"ArgList":{let a=$n(l,i),d=Ce(l,o),f=(d==null?void 0:d.name)==="OpenBrace"?void 0:",",m=await e.getSuggestions("expression",{functionName:a});return m=f?_t(m,", "):m,(d==null?void 0:d.name)!=="OpenBrace"&&(d==null?void 0:d.name)!=="Comma"&&(m=[{apply:") ",boost:10,label:"Done - no more arguments"}].concat(m)),{from:o.pos,options:m}}case"Equal":if(u.trim()==="=")return t(o,"expression");break;case"ParenthesizedExpression":case"ColumnDefinitionExpression":if(o.pos===0)return t(o,"expression");{let a=Ce(l,o);if((a==null?void 0:a.name)==="Column"){if(g){let d=[{apply:()=>{n.current()},label:"Save Expression",boost:10}],f=(0,S.getValue)(a,i),m=await e.getSuggestions("operator",{columnName:f});return{from:o.pos,options:d.concat(m)}}}else if((a==null?void 0:a.name)==="CallExpression"){if(g){let d=[{apply:()=>{n.current()},label:"Save Expression",boost:10}];return{from:o.pos,options:d}}}else if((a==null?void 0:a.name)==="ArithmeticExpression"){if(g){let d=[{apply:()=>{n.current()},label:"Save Expression",boost:10}],f=Ce(a,o);if((f==null?void 0:f.name)==="Column"){let m=(0,S.getValue)(f,i),T=await e.getSuggestions("operator",{columnName:m});d=d.concat(T)}return{from:o.pos,options:d}}}else if((a==null?void 0:a.name)==="ConditionalExpression")return gn(a,o,e,g,n.current);break}case"Column":if(await e.isPartialMatch("expression",void 0,s.text))return t(o,"expression",{startsWith:s.text});break;case"Comma":{let a=(0,S.getNamedParentNode)(l);if((a==null?void 0:a.name)==="ConditionalExpression")return t(o,"expression")}break;case"CloseBrace":{let a=(0,S.getNamedParentNode)(l);if((a==null?void 0:a.name)==="ConditionalExpression")return gn(a,o,e,g,n.current);if((a==null?void 0:a.name)==="ArgList"&&g)return jt(o,n.current);console.log(`does closebrace denote an ARgList or a parenthetised expression ? ${a}`)}break;default:((v=l==null?void 0:l.prevSibling)==null?void 0:v.name)==="FilterClause"&&console.log("looks like we ight be a or|and operator")}},[t,n,e])};var Ae=e=>{if(e.current==null)throw Error("EditorView not defined");return e.current},eo=()=>"vuuSuggestion",no=()=>console.log("noooop"),to=e=>"expressionType"in e,oo=e=>{if(to(e)){let n=(0,xn.createEl)("div","expression-type-container"),t=(0,xn.createEl)("span","expression-type",e.expressionType);return n.appendChild(t),n}else return null},hn=({onChange:e,onSubmitExpression:n,suggestionProvider:t})=>{let o=(0,ee.useRef)(null),i=(0,ee.useRef)(no),r=(0,ee.useRef)(),s=Hn(t,i),[p,l]=(0,ee.useMemo)(()=>{let u=()=>{let f=Ae(r),m=f.state.doc.toString(),T=(0,P.ensureSyntaxTree)(f.state,f.state.doc.length,5e3);if(T){let $=un(T,m);return[m,$]}else return["",void 0]},g=()=>{Ae(r).setState(d())},E=()=>{let[f,m]=u();n==null||n(f,m),g()},v=f=>P.keymap.of([{key:f,run(){return E(),!0}}]),a=f=>P.keymap.of([{key:f,run(){return(0,P.startCompletion)(Ae(r)),!0}}]),d=()=>P.EditorState.create({doc:"",extensions:[P.minimalSetup,(0,P.autocompletion)({addToOptions:[{render:oo,position:70}],override:[s],optionClass:eo}),tn(),P.keymap.of(P.defaultKeymap),v("Ctrl-Enter"),a("ArrowDown"),P.EditorView.updateListener.of(f=>{let m=Ae(r);if(f.docChanged){(0,P.startCompletion)(m);let T=m.state.doc.toString();e==null||e(T,void 0)}}),Mn,In]});return i.current=()=>{E(),setTimeout(()=>{Ae(r).focus()},100)},[d,g]},[s,e,n]);return(0,ee.useEffect)(()=>{if(!o.current)throw Error("editor not in dom");return r.current=new P.EditorView({state:p(),parent:o.current}),()=>{var u;(u=r.current)==null||u.destroy()}},[s,p]),{editorRef:o,clearInput:l}};var Gn=require("react/jsx-runtime"),ro="vuuColumnExpressionInput",bn=({onChange:e,onSubmitExpression:n,suggestionProvider:t})=>{let{editorRef:o}=hn({onChange:e,onSubmitExpression:n,suggestionProvider:t});return(0,Gn.jsx)("div",{className:`${ro}`,ref:o})};var G=require("@vuu-ui/vuu-codemirror"),Je=require("@vuu-ui/vuu-data-react"),be=require("@vuu-ui/vuu-utils"),he=require("react");var xe=[{accepts:"string",description:"Returns multiple string values as a single joined string. Arguments may be string literal values, string columns or other string expressions. Non string arguments may also be included, these will be converted to strings.",example:{expression:'concatenate("example", "-test")',result:'"example-test"'},name:"concatenate",params:{description:"( string, string, [ string* ] )"},type:"string"},{accepts:["string","string"],description:"Tests a string value to determine whether it contains a given substring. Accepts two arguments: source text and target substring. Returns true if <source text> contains one or more occurrences of <target subscring>",example:{expression:'contains("Royal Bank of Scotland", "bank")',result:"true"},name:"contains",params:{description:"( string )"},type:"boolean"},{accepts:["string","number"],description:"Returns the leftmost <number> characters from <string>. First argument may be a string literal, string column or other string expression.",example:{expression:'left("USD Benchmark Report", 3)',result:'"USD"'},name:"left",params:{count:2,description:"( string, number )"},type:"string"},{accepts:"string",description:"Returns the number of characters in <string>. Argument may be a string literal, string column or other string expression.",example:{expression:'len("example")',result:"7"},name:"len",params:{description:"(string)"},type:"number"},{accepts:"string",description:"Convert a string value to lowercase. Argument may be a string column or other string expression.",example:{expression:'lower("examPLE")',result:'"example"'},name:"lower",params:{description:"( string )"},type:"string"},{accepts:"string",description:"Convert a string value to uppercase. Argument may be a string column or other string expression.",example:{expression:'upper("example")',result:'"EXAMPLE"'},name:"upper",params:{description:"( string )"},type:"string"},{accepts:["string","number"],description:"Returns the rightmost <number> characters from <string>. First argument may be a string literal, string column or other string expression.",example:{expression:"blah",result:"blah"},name:"right",params:{description:"( string )"},type:"string"},{accepts:["string","string","string"],description:"Replace characters within a string. Accepts three arguments: source text, text to replace and replacement text. Returns a copy of <source text> with any occurrences of <text to replace> replaced by <replacement text>",example:{expression:"blah",result:"blah"},name:"replace",params:{description:"( string )"},type:"string"},{accepts:"number",description:"Converts a number to a string.",example:{expression:"blah",result:"blah"},name:"text",params:{description:"( string )"},type:"string"},{accepts:"string",description:"Tests a string value to determine whether it starts with a given substring. Accepts two arguments: source text and target substring. Returns true if <source text> starts with <target subscring>.",example:{expression:"blah",result:"blah"},name:"starts",params:{description:"( string )"},type:"boolean"},{accepts:"string",description:"Tests a string value to determine whether it ends with a given substring. Accepts two arguments: source text and target substring. Returns true if <source text> ends with <target subscring>.",example:{expression:"blah",result:"blah"},name:"ends",params:{description:"( string )"},type:"boolean"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"min",params:{description:"( string )"},type:"number"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"max",params:{description:"( string )"},type:"number"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"sum",params:{description:"( string )"},type:"number"},{accepts:"number",description:"blah",example:{expression:"blah",result:"blah"},name:"round",params:{description:"( string )"},type:"number"},{accepts:"any",description:"blah",example:{expression:"blah",result:"blah"},name:"or",params:{description:"( string )"},type:"boolean"},{accepts:"any",description:"blah",example:{expression:"blah",result:"blah"},name:"and",params:{description:"( string )"},type:"boolean"},{accepts:"any",description:"Return one of two possible result values, depending on the evaluation of a filter expression. If <filterExpression> resolves to true, result is <expression1>, otherwise <expression2>. ",example:{expression:"blah",result:"blah"},name:"if",params:{description:"( filterExpression, expression1, expression 2)"},type:"variable"}];var H=require("@vuu-ui/vuu-utils"),Wn=({name:e,description:n,example:t,params:o,type:i})=>{let r=(0,H.createEl)("div","vuuFunctionDoc"),s=(0,H.createEl)("div","function-heading"),p=(0,H.createEl)("span","function-name",e),l=(0,H.createEl)("span","param-list",o.description),u=(0,H.createEl)("span","function-type",i);s.appendChild(p),s.appendChild(l),s.appendChild(u);let g=(0,H.createEl)("p",void 0,n);if(r.appendChild(s),r.appendChild(g),t){let E=(0,H.createEl)("div","example-container","Example:"),v=(0,H.createEl)("div","example-expression",t.expression),a=(0,H.createEl)("div","example-result",t.result);E.appendChild(v),E.appendChild(a),r.appendChild(E)}return r};var so=[],le=e=>e.map(n=>{var t;return{...n,apply:((t=n.apply)!=null?t:n.label)+" "}}),io=(e,{functionName:n,operator:t})=>{if(t)return e.filter(be.isNumericColumn);if(n){let o=xe.find(i=>i.name===n);if(o)switch(o.accepts){case"string":return e.filter(be.isTextColumn);case"number":return e.filter(be.isNumericColumn);default:return e}}return e},Xn=(e,n)=>io(e,n).map(o=>{var r;let i=(r=o.label)!=null?r:o.name;return{apply:n.prefix?`${n.prefix}${i}`:i,label:i,boost:5,type:"column",expressionType:o.serverDataType}}),ao=[{apply:"* ",boost:2,label:"*",type:"operator"},{apply:"/ ",boost:2,label:"/",type:"operator"},{apply:"+ ",boost:2,label:"+",type:"operator"},{apply:"- ",boost:2,label:"-",type:"operator"}],lo=e=>e===void 0||(0,be.isNumericColumn)(e)?ao:so,po=e=>{switch(e.serverDataType){case"string":case"char":return le(G.stringOperators);case"int":case"long":case"double":return le(G.numericOperators)}},yn=e=>({apply:`${e.name}( `,boost:2,expressionType:e.type,info:()=>Wn(e),label:e.name,type:"function"}),uo=e=>{if(e){if(typeof e.accepts=="string")return e.accepts;if(Array.isArray(e.accepts))return e.accepts.every(n=>n==="string")?"string":"any"}return"any"},co=xe.map(yn),mo=({functionName:e})=>{if(e){let n=xe.find(o=>o.name===e),t=uo(n);if(n)switch(t){case"string":return xe.filter(o=>o.type==="string"||o.type==="variable").map(yn);case"number":return xe.filter(o=>o.type==="number"||o.type==="variable").map(yn);default:}}return co},go={},En=({columns:e,table:n})=>{let t=(0,he.useCallback)(p=>p?e.find(l=>l.name===p):void 0,[e]),o=(0,he.useRef)(),i=(0,Je.useTypeaheadSuggestions)(),r=(0,he.useCallback)(async(p,l=go)=>{let{columnName:u,functionName:g,operator:E,prefix:v}=l;switch(p){case"expression":{let a=await le(Xn(e,{functionName:g,prefix:v})).concat(mo(l));return o.current=a}case"column":{let a=await Xn(e,l);return o.current=le(a)}case"operator":{let a=await lo(t(u));return o.current=le(a)}case"relational-operator":{let a=await(0,G.getRelationalOperators)(t(u));return o.current=le(a)}case"condition-operator":{let a=t(u);if(a){let d=await po(a);if(d)return o.current=le(d)}}break;case"columnValue":if(u&&E){let a=(0,Je.getTypeaheadParams)(n,u),d=await i(a);return o.current=(0,G.toSuggestions)(d,{suffix:""}),o.current.forEach(f=>{f.apply=(m,T,$)=>{let nn=new G.AnnotationType,Te=$+T.label.length+1;m.dispatch({changes:{from:$,insert:T.label},selection:{anchor:Te,head:Te},annotations:nn.of(T)})}}),o.current}break}return[]},[e,t,i,n]),s=(0,he.useCallback)(async(p,l,u)=>{let{current:g}=o,E=!1,v=g||await r(p,{columnName:l});if(u&&v)for(let a of v){if(a.label===u)return!1;a.label.startsWith(u)&&(E=!0)}return E},[r]);return{getSuggestions:r,isPartialMatch:s}};var Pe=require("@salt-ds/core"),ft=Y(require("classnames"),1),q=require("react");var vn=require("@salt-ds/lab"),M=require("@salt-ds/core"),z=require("react");var Vn=require("@salt-ds/lab"),Yn=Y(require("classnames"),1);var Ee=require("react/jsx-runtime"),ye="vuuColumnListItem",zn=({className:e,item:n,label:t,style:o,...i})=>{let r=(0,Yn.default)(ye,e,{[`${ye}-calculated`]:n==null?void 0:n.expression,[`${ye}-hidden`]:n==null?void 0:n.hidden});return(0,Ee.jsxs)(Vn.ListItem,{className:r,...i,children:[(0,Ee.jsx)("span",{className:`${ye}-iconType`}),(0,Ee.jsx)("label",{className:`${ye}-label`,children:t}),(0,Ee.jsx)("span",{className:`${ye}-iconHidden`})]})};var O=require("react/jsx-runtime"),ve="vuuColumnPicker",fo=(e,n)=>e.filter(t=>n.find(o=>o.name===t.name)==null),Zn=({availableColumns:e,id:n,dispatchColumnAction:t,onAddCalculatedColumnClick:o,onSelectionChange:i,chosenColumns:r,selectedColumn:s})=>{let[p,l]=(0,z.useState)([]),u=(0,M.useIdMemo)(n),g=fo(e,r),E=(0,z.useCallback)(()=>{p.length>0&&(l([]),t({type:"addColumn",columns:p}))},[t,p]),v=(0,z.useCallback)(()=>s&&t({type:"removeColumn",column:s}),[s,t]),a=(0,z.useCallback)(()=>s&&t({type:"moveColumn",column:s,moveBy:-1}),[t,s]),d=(0,z.useCallback)(()=>s&&t({type:"moveColumn",column:s,moveBy:1}),[t,s]),f=(0,z.useCallback)((T,$)=>l($),[]),m=(0,z.useCallback)((T,$)=>i==null?void 0:i($),[i]);return(0,O.jsxs)("div",{className:ve,id:u,children:[(0,O.jsxs)("div",{className:`${ve}-listColumn`,children:[(0,O.jsx)("label",{htmlFor:`available-${u}`,children:(0,O.jsx)(M.Text,{as:"h4",children:"Available Columns"})}),(0,O.jsx)("div",{className:`${ve}-listContainer`,style:{flex:1,overflow:"hidden"},children:(0,O.jsx)(vn.List,{borderless:!0,checkable:!1,height:"100%",id:`available-${u}`,itemHeight:24,itemToString:T=>T.name,onSelectionChange:f,selected:p,selectionStrategy:"extended",source:g})}),(0,O.jsx)("div",{style:{display:"flex",alignItems:"center",flex:"0 0 32px",marginTop:"var(--salt-size-basis-unit)"},children:(0,O.jsxs)(M.Button,{onClick:E,disabled:p.length===0,children:["Show",(0,O.jsx)("span",{"data-icon":"arrow-thin-right",style:{marginLeft:8}})]})})]}),(0,O.jsxs)("div",{className:`${ve}-listColumn`,children:[(0,O.jsx)("label",{htmlFor:`selected-${u}`,children:(0,O.jsx)(M.Text,{as:"h4",children:"Included Columns"})}),(0,O.jsx)("div",{className:`${ve}-listContainer`,style:{flex:1,overflow:"hidden"},children:(0,O.jsx)(vn.List,{ListItem:zn,borderless:!0,height:"100%",id:`selected-${u}`,itemHeight:24,itemToString:T=>T.name,onSelectionChange:m,selected:s,style:{flex:1},source:r})}),(0,O.jsxs)("div",{style:{alignItems:"center",flex:"0 0 32px",display:"flex",gap:6,marginTop:"var(--salt-size-basis-unit)"},children:[(0,O.jsxs)(M.Button,{onClick:v,disabled:s===null,children:[(0,O.jsx)("span",{"data-icon":"arrow-thin-left",style:{marginRight:8}}),"Hide"]}),(0,O.jsx)(M.Button,{"aria-label":"Move column up",onClick:a,disabled:s===null||(r==null?void 0:r.indexOf(s))===0,style:{width:28},children:(0,O.jsx)("span",{"data-icon":"arrow-thin-up"})}),(0,O.jsx)(M.Button,{"aria-label":"Move column down",onClick:d,disabled:s===null||r.indexOf(s)===r.length-1,style:{width:28},children:(0,O.jsx)("span",{"data-icon":"arrow-thin-down"})}),(0,O.jsx)(M.Button,{"aria-label":"Add calculated column",className:`${ve}-addCalculatedColumn`,onClick:o,variant:"primary",children:(0,O.jsx)("span",{"data-icon":"add"})})]})]})]})};var rt=require("@vuu-ui/vuu-layout"),st=require("@salt-ds/lab"),x=require("@salt-ds/core"),it=Y(require("classnames"),1),J=require("react");var Kn=require("@vuu-ui/vuu-utils"),jn=require("@salt-ds/lab"),et=require("@salt-ds/core"),Pn=Y(require("classnames"),1),nt=require("react");var Qe=require("@salt-ds/lab"),Oe=require("@salt-ds/core"),Le=require("react");var k=require("react/jsx-runtime"),Co={alignOnDecimals:!1,decimals:4,zeroPad:!1},xo=(e,n)=>{let t=typeof e=="object"&&e.formatting?e.formatting:{};return["alignOnDecimals","decimals","zeroPad"].reduce((i,r)=>t[r]!==void 0?{...i,[r]:t[r]}:(n==null?void 0:n[r])!==void 0?{...i,[r]:n[r]}:i,Co)},Jn=({column:e,dispatchColumnAction:n})=>{let{decimals:t,alignOnDecimals:o,zeroPad:i}=xo(e==null?void 0:e.type),r=(0,Le.useCallback)(u=>n({type:"updateColumnTypeFormatting",column:e,...u}),[e,n]),s=(0,Le.useCallback)(u=>r({decimals:parseInt(u.toString(),10)}),[r]),p=(0,Le.useCallback)((u,g)=>r({alignOnDecimals:g}),[r]),l=(0,Le.useCallback)((u,g)=>r({zeroPad:g}),[r]);switch(e.serverDataType){case"double":return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(Oe.FormField,{labelPlacement:"top",children:[(0,k.jsx)(Oe.FormFieldLabel,{children:"No of Decimals"}),(0,k.jsx)(Qe.StepperInput,{value:t,onChange:s})]}),(0,k.jsx)(Qe.Switch,{checked:o,label:"Align on decimals",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:p}),(0,k.jsx)(Qe.Switch,{checked:i,label:"Zero pad",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:l})]});case"long":case"int":return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(Oe.Text,{children:"Work in progress"})});default:return null}};var qe=require("react/jsx-runtime"),qn=({column:e,dispatchColumnAction:n})=>(console.log({column:e,dispatchColumnAction:n}),(0,qe.jsx)(qe.Fragment,{children:"what"}));var Z=require("react/jsx-runtime"),On="vuuColumnTypePanel",ho=["Default Renderer (int, long)"],bo=["Default Renderer (double)"],_n=["Default Renderer (string)"],yo=e=>{let t=(0,Kn.getRegisteredCellRenderers)(e.serverDataType).map(o=>o.name);switch(console.log({customRendererNames:t}),e.serverDataType){case"char":case"string":return _n;case"int":case"long":return ho;case"double":return bo.concat(t);default:return _n}},tt=({className:e,column:n,dispatchColumnAction:t,...o})=>{let i=(0,nt.useMemo)(()=>{switch(n.serverDataType){case"double":case"int":case"long":return(0,Z.jsx)(Jn,{column:n,dispatchColumnAction:t});default:return(0,Z.jsx)(qn,{column:n,dispatchColumnAction:t})}},[n,t]),{serverDataType:r="string"}=n,s=yo(n);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(jn.Dropdown,{className:(0,Pn.default)(`${On}-renderer`),fullWidth:!0,selected:s[0],source:s}),(0,Z.jsx)(et.Panel,{...o,className:(0,Pn.default)(On,e,`${On}-${r}`),children:i})]})};var b=require("react/jsx-runtime"),ot="vuuColumnSettingsPanel",Eo={className:"salt-density-high"},at=({column:e,dispatchColumnAction:n,style:t,...o})=>{var v,a,d,f;let[i,r]=(0,J.useState)(0),s=(0,J.useCallback)(m=>n({type:"updateColumnProp",column:e,...m}),[e,n]),p=(0,J.useCallback)(m=>s({align:m.target.value}),[s]),l=(0,J.useCallback)(m=>s({pin:m.target.value}),[s]),u=(0,J.useCallback)(m=>s({hidden:m.target.checked}),[s]),g=(0,J.useCallback)(m=>s({label:m.target.value}),[s]),E=(0,J.useCallback)(m=>s({width:parseInt(m.toString(),10)}),[s]);return(0,b.jsxs)("div",{className:ot,...o,style:{...t},children:[(0,b.jsx)(x.Text,{as:"h4",children:"Column Settings"}),(0,b.jsxs)(rt.Stack,{active:i,className:(0,it.default)(`${ot}-columnTabs`),onTabSelectionChanged:r,TabstripProps:Eo,children:[(0,b.jsxs)(x.Panel,{title:"Column",children:[(0,b.jsxs)(x.FormField,{labelPlacement:"left",children:[(0,b.jsx)(x.FormFieldLabel,{children:"Hidden"}),(0,b.jsx)(x.Checkbox,{checked:e.hidden===!0,onChange:u})]}),(0,b.jsxs)(x.FormField,{labelPlacement:"left",children:[(0,b.jsx)(x.FormFieldLabel,{children:"Label"}),(0,b.jsx)(x.Input,{value:(v=e.label)!=null?v:e.name,onChange:g})]}),(0,b.jsxs)(x.FormField,{labelPlacement:"left",children:[(0,b.jsx)(x.FormFieldLabel,{children:"Width"}),(0,b.jsx)(st.StepperInput,{value:(a=e.width)!=null?a:100,onChange:E})]}),(0,b.jsxs)(x.FormField,{labelPlacement:"left",children:[(0,b.jsx)(x.FormFieldLabel,{children:"ALign"}),(0,b.jsxs)(x.RadioButtonGroup,{"aria-label":"Column Align",value:(d=e.align)!=null?d:"left",onChange:p,children:[(0,b.jsx)(x.RadioButton,{label:"Left",value:"left"}),(0,b.jsx)(x.RadioButton,{label:"Right",value:"right"})]})]}),(0,b.jsxs)(x.FormField,{labelPlacement:"left",children:[(0,b.jsx)(x.FormFieldLabel,{children:"Pin Column"}),(0,b.jsxs)(x.RadioButtonGroup,{"aria-label":"Pin Column",value:(f=e.pin)!=null?f:"",onChange:l,children:[(0,b.jsx)(x.RadioButton,{label:"Do not pin",value:""}),(0,b.jsx)(x.RadioButton,{label:"Left",value:"left"}),(0,b.jsx)(x.RadioButton,{label:"Right",value:"right"})]})]})]}),(0,b.jsx)(tt,{column:e,dispatchColumnAction:n,title:"Data Cell"}),(0,b.jsxs)(x.Panel,{title:"Vuu",variant:"secondary",children:[(0,b.jsxs)(x.FormField,{labelPlacement:"top",readOnly:!0,children:[(0,b.jsx)(x.FormFieldLabel,{children:"Name"}),(0,b.jsx)(x.Input,{value:e.name})]}),(0,b.jsxs)(x.FormField,{labelPlacement:"top",readOnly:!0,children:[(0,b.jsx)(x.FormFieldLabel,{children:"Vuu Type"}),(0,b.jsx)(x.Input,{value:e.serverDataType})]})]})]})]})};var w=require("@salt-ds/core"),lt=require("@salt-ds/lab"),_e=require("react");var N=require("react/jsx-runtime"),vo="vuuGridSettingsPanel",pt=({config:e,dispatchColumnAction:n,style:t,...o})=>{var p;let i=(0,_e.useCallback)(l=>n({type:"updateGridSettings",...l}),[n]),r=(0,_e.useCallback)(l=>i({columnFormatHeader:l.target.value}),[i]),s=(0,_e.useCallback)(l=>i({columnDefaultWidth:parseInt(l.toString(),10)}),[i]);return(0,N.jsxs)("div",{className:vo,...o,style:{...t},children:[(0,N.jsx)(w.Text,{as:"h4",children:"Grid Settings"}),(0,N.jsxs)(w.Panel,{children:[(0,N.jsxs)(w.FormField,{labelPlacement:"left",children:[(0,N.jsx)(w.FormFieldLabel,{children:"Format column labels"}),(0,N.jsxs)(w.RadioButtonGroup,{"aria-label":"Format column labels",value:e.columnFormatHeader,onChange:r,children:[(0,N.jsx)(w.RadioButton,{label:"No Formatting",value:void 0}),(0,N.jsx)(w.RadioButton,{label:"Capitalize",value:"capitalize"}),(0,N.jsx)(w.RadioButton,{label:"Uppercase",value:"uppercase"})]})]}),(0,N.jsxs)(w.FormField,{labelPlacement:"left",children:[(0,N.jsx)(w.FormFieldLabel,{children:"Default Column Width"}),(0,N.jsx)(lt.StepperInput,{value:(p=e.columnDefaultWidth)!=null?p:100,onChange:s})]})]})]})};var ut=require("react"),ct=require("@vuu-ui/vuu-ui-controls"),mt=require("@vuu-ui/vuu-utils"),Oo=(e,n)=>{switch(console.log(`gridSettingsReducer ${n.type}`),n.type){case"addColumn":return Po(e,n);case"addCalculatedColumn":return So(e,n);case"moveColumn":return Do(e,n);case"removeColumn":return To(e,n);case"updateColumn":return e;case"updateColumnProp":return wo(e,n);case"updateGridSettings":return Fo(e,n);case"updateColumnTypeFormatting":return Ro(e,n);default:return e}},dt=e=>{let[n,t]=(0,ut.useReducer)(Oo,e);return{gridSettings:n,dispatchColumnAction:t}};function Po(e,{column:n,columns:t,index:o=-1}){let{columns:i}=e;if(o===-1){if(Array.isArray(t))return{...e,columns:i.concat(t)};if(n)return{...e,columns:i.concat(n)}}return e}function So(e,{columnName:n,columnType:t,expression:o}){let{columns:i}=e,r={name:n,expression:o,serverDataType:t};return{...e,columns:i.concat(r)}}function To(e,{column:n}){let{columns:t}=e;return{...e,columns:t.filter(o=>o.name!==n.name)}}function Do(e,{column:n,moveBy:t,moveFrom:o,moveTo:i}){let{columns:r}=e;if(n&&typeof t=="number"){let s=r.indexOf(n),p=r.slice(),[l]=p.splice(s,1);return p.splice(s+t,0,l),{...e,columns:p}}else return typeof o=="number"&&typeof i=="number"?{...e,columns:(0,ct.moveItem)(r,o,i)}:e}function wo(e,{align:n,column:t,hidden:o,label:i,width:r}){let{columns:s}=e;return(n==="left"||n==="right")&&(s=Ie(s,{...t,align:n})),typeof o=="boolean"&&(s=Ie(s,{...t,hidden:o})),typeof i=="string"&&(s=Ie(s,{...t,label:i})),typeof r=="number"&&(s=Ie(s,{...t,width:r})),{...e,columns:s}}function Fo(e,{columnFormatHeader:n}){return{...e,columnFormatHeader:n!=null?n:e.columnFormatHeader}}function Ro(e,{alignOnDecimals:n,column:t,decimals:o,zeroPad:i}){let{columns:r}=e;if(r.find(p=>p.name===t.name)){let{serverDataType:p="string",type:l=(0,mt.fromServerDataType)(p)}=t,u=typeof l=="string"?{name:l}:{...l};return typeof n=="boolean"&&(u.formatting={...u.formatting,alignOnDecimals:n}),typeof o=="number"&&(u.formatting={...u.formatting,decimals:o}),typeof i=="boolean"&&(u.formatting={...u.formatting,zeroPad:i}),{...e,columns:Ie(r,{...t,type:u})}}else return e}function Ie(e,n){return e.map(t=>t.name===n.name?n:t)}var Ct=require("@vuu-ui/vuu-layout");var Q=require("@salt-ds/core"),X=require("react");var W=require("react/jsx-runtime"),gt=({columns:e,dispatchColumnAction:n,table:t})=>{let[o,i]=(0,X.useState)(""),[,r]=(0,X.useState)(),s=(0,X.useRef)(""),p=En({columns:e,table:t}),l=(0,X.useCallback)(v=>{let{value:a}=v.target;i(a)},[]),u=(0,X.useCallback)(v=>{s.current=v},[]),g=(0,X.useCallback)((v,a)=>{console.log({source:v}),r(a)},[]),E=(0,X.useCallback)(()=>{s.current&&(console.log(`save expression ${JSON.stringify(s.current,null,2)}`),n({type:"addCalculatedColumn",columnName:o,expression:s.current,columnType:"string"}))},[o,n]);return(0,W.jsxs)(Q.Panel,{className:"vuuCalculatedColumnPanel",title:"Define Computed Column",children:[(0,W.jsx)(Q.Text,{styleAs:"h4",children:"Define Computed Column"}),(0,W.jsxs)(Q.FormField,{labelPlacement:"left",children:[(0,W.jsx)(Q.FormFieldLabel,{children:"Column Name"}),(0,W.jsx)(Q.Input,{value:o,onChange:l})]}),(0,W.jsx)(bn,{onChange:u,onSubmitExpression:g,suggestionProvider:p}),(0,W.jsx)("div",{style:{marginTop:12},children:(0,W.jsx)(Q.Button,{onClick:E,children:"Add Column"})})]})};var F=require("react/jsx-runtime"),Ke="vuuDatagridSettingsPanel",No=()=>{},ko=["table-settings","column-chooser","column-settings","define-column"],Ao=(e,n)=>ko[n],Lo=({availableColumns:e,className:n,gridConfig:t,onCancel:o,onConfigChange:i,...r})=>{var Te;console.log("DatagridSettingsPanel render");let[s,p]=(0,q.useState)(0),{gridSettings:l,dispatchColumnAction:u}=dt(t),[g,E]=(0,q.useState)(null),v=(0,q.useCallback)(V=>{E(V?V.name:null)},[]),a=(0,q.useCallback)((V,Rt=!1)=>{console.log("1) DataGridSettingsPanel fire onConfigChange"),i==null||i(l,Rt)},[l,i]),d=(0,q.useCallback)(V=>{p(V)},[]),f=(0,q.useCallback)(V=>a(V,!0),[a]),m=g===null?null:(Te=l.columns.find(V=>V.name===g))!=null?Te:null,T={activeTabIndex:s,allowRenameTab:!1,orientation:"vertical"},$=(0,q.useCallback)(()=>p(3),[]),nn=s===2?"right":void 0;return(0,F.jsxs)("div",{...r,className:(0,ft.default)(Ke,n),children:[(0,F.jsxs)(Ct.Stack,{TabstripProps:T,className:`${Ke}-stack`,getTabIcon:Ao,getTabLabel:No,active:s===2?1:s,onTabSelectionChanged:d,children:[(0,F.jsx)(pt,{config:l,dispatchColumnAction:u}),(0,F.jsxs)("div",{className:`${Ke}-columnPanels`,"data-align":nn,children:[(0,F.jsx)(Zn,{availableColumns:e,chosenColumns:l.columns,dispatchColumnAction:u,onSelectionChange:v,onAddCalculatedColumnClick:$,selectedColumn:m}),m===null?(0,F.jsx)(Pe.Panel,{className:"vuuColumnSettingsPanel",children:"Select a column"}):(0,F.jsx)(at,{column:m,dispatchColumnAction:u,style:{background:"white",flex:"1 0 150px"}})]}),(0,F.jsx)("div",{title:"Column Settings",children:"Column Settings"}),(0,F.jsx)(gt,{columns:l.columns,dispatchColumnAction:u,table:{module:"SIMUL",table:"instruments"}})]}),(0,F.jsxs)("div",{className:`${Ke}-buttonBar`,children:[(0,F.jsx)(Pe.Button,{onClick:o,children:"Cancel"}),(0,F.jsx)(Pe.Button,{onClick:a,children:"Apply"}),(0,F.jsx)(Pe.Button,{onClick:f,children:"Save"})]})]})};var Be=require("react"),xt=Y(require("classnames"),1);var ne=require("react/jsx-runtime"),je="vuuDatasourceStats",Sn=new Intl.NumberFormat,Qo=({className:e,dataSource:n})=>{let[t,o]=(0,Be.useState)(n.range),[i,r]=(0,Be.useState)(n.size);(0,Be.useEffect)(()=>{r(n.size),n.on("resize",r),n.on("range",o)},[n]);let s=(0,xt.default)(je,e),p=Sn.format(t.from),l=Sn.format(t.to-1),u=Sn.format(i);return(0,ne.jsxs)("div",{className:s,children:[(0,ne.jsx)("span",{children:"Showing rows"}),(0,ne.jsx)("span",{className:`${je}-range`,children:p}),(0,ne.jsx)("span",{className:`${je}-range`,children:l}),(0,ne.jsx)("span",{children:"of"}),(0,ne.jsx)("span",{className:`${je}-size`,children:u})]})};var Dt=require("@vuu-ui/vuu-layout"),wt=require("@salt-ds/lab"),h=require("@salt-ds/core"),Ft=Y(require("classnames"),1),K=require("react");var Et=require("@vuu-ui/vuu-utils"),vt=require("@salt-ds/lab"),Ot=require("@salt-ds/core"),Dn=Y(require("classnames"),1),Pt=require("react");var $e=require("@salt-ds/lab"),Se=require("@salt-ds/core"),Me=require("react");var A=require("react/jsx-runtime"),Io={alignOnDecimals:!1,decimals:4,zeroPad:!1},Bo=(e,n)=>{let t=typeof e=="object"&&e.formatting?e.formatting:{};return["alignOnDecimals","decimals","zeroPad"].reduce((i,r)=>t[r]!==void 0?{...i,[r]:t[r]}:(n==null?void 0:n[r])!==void 0?{...i,[r]:n[r]}:i,Io)},ht=({column:e,dispatchColumnAction:n})=>{let{decimals:t,alignOnDecimals:o,zeroPad:i}=Bo(e==null?void 0:e.type),r=(0,Me.useCallback)(u=>n({type:"updateColumnTypeFormatting",column:e,...u}),[e,n]),s=(0,Me.useCallback)(u=>r({decimals:parseInt(u.toString(),10)}),[r]),p=(0,Me.useCallback)((u,g)=>r({alignOnDecimals:g}),[r]),l=(0,Me.useCallback)((u,g)=>r({zeroPad:g}),[r]);switch(e.serverDataType){case"double":return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(Se.FormField,{labelPlacement:"top",children:[(0,A.jsx)(Se.FormFieldLabel,{children:"No of Decimals"}),(0,A.jsx)($e.StepperInput,{value:t,onChange:s})]}),(0,A.jsx)($e.Switch,{checked:o,label:"Align on decimals",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:p}),(0,A.jsx)($e.Switch,{checked:i,label:"Zero pad",LabelProps:{className:"vuuColumnPanelSwitch"},onChange:l})]});case"long":case"int":return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(Se.Text,{children:"Work in progress"})});default:return null}};var en=require("react/jsx-runtime"),bt=({column:e,dispatchColumnAction:n})=>(console.log(e,n),(0,en.jsx)(en.Fragment,{children:"what"}));var _=require("react/jsx-runtime"),Tn="vuuColumnTypePanel",Mo=["Default Renderer (int, long)"],$o=["Default Renderer (double)"],yt=["Default Renderer (string)"],Uo=e=>{let t=(0,Et.getRegisteredCellRenderers)(e.serverDataType).map(o=>o.name);switch(console.log({customRendererNames:t}),e.serverDataType){case"char":case"string":return yt;case"int":case"long":return Mo;case"double":return $o.concat(t);default:return yt}},St=({className:e,column:n,dispatchColumnAction:t,...o})=>{let i=(0,Pt.useMemo)(()=>{switch(n.serverDataType){case"double":case"int":case"long":return(0,_.jsx)(ht,{column:n,dispatchColumnAction:t});default:return(0,_.jsx)(bt,{column:n,dispatchColumnAction:t})}},[n,t]),{serverDataType:r="string"}=n,s=Uo(n);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(vt.Dropdown,{className:(0,Dn.default)(`${Tn}-renderer`),fullWidth:!0,selected:s[0],source:s}),(0,_.jsx)(Ot.Panel,{...o,className:(0,Dn.default)(Tn,e,`${Tn}-${r}`),children:i})]})};var y=require("react/jsx-runtime"),Tt="vuuColumnSettingsPanel",Ho={className:"salt-density-high"},Go=({column:e,dispatchColumnAction:n,style:t,...o})=>{var v,a,d,f;let[i,r]=(0,K.useState)(0),s=(0,K.useCallback)(m=>n({type:"updateColumnProp",column:e,...m}),[e,n]),p=(0,K.useCallback)(m=>s({align:m.target.value}),[s]),l=(0,K.useCallback)(m=>s({pin:m.target.value}),[s]),u=(0,K.useCallback)(m=>s({hidden:m.target.checked}),[s]),g=(0,K.useCallback)(m=>s({label:m.target.value}),[s]),E=(0,K.useCallback)(m=>s({width:parseInt(m.toString(),10)}),[s]);return(0,y.jsxs)("div",{className:Tt,...o,style:{...t},children:[(0,y.jsx)(h.Text,{as:"h4",children:"Column Settings"}),(0,y.jsxs)(Dt.Stack,{active:i,className:(0,Ft.default)(`${Tt}-columnTabs`),onTabSelectionChanged:r,TabstripProps:Ho,children:[(0,y.jsxs)(h.Panel,{title:"Column",children:[(0,y.jsxs)(h.FormField,{labelPlacement:"left",children:[(0,y.jsx)(h.FormFieldLabel,{children:"Hidden"}),(0,y.jsx)(h.Checkbox,{checked:e.hidden===!0,onChange:u})]}),(0,y.jsxs)(h.FormField,{labelPlacement:"left",children:[(0,y.jsx)(h.FormFieldLabel,{children:"Label"}),(0,y.jsx)(h.Input,{value:(v=e.label)!=null?v:e.name,onChange:g})]}),(0,y.jsxs)(h.FormField,{labelPlacement:"left",children:[(0,y.jsx)(h.FormFieldLabel,{children:"Width"}),(0,y.jsx)(wt.StepperInput,{value:(a=e.width)!=null?a:100,onChange:E})]}),(0,y.jsxs)(h.FormField,{labelPlacement:"left",children:[(0,y.jsx)(h.FormFieldLabel,{children:"Align"}),(0,y.jsxs)(h.RadioButtonGroup,{"aria-label":"Column Align",value:(d=e.align)!=null?d:"left",onChange:p,children:[(0,y.jsx)(h.RadioButton,{label:"Left",value:"left"}),(0,y.jsx)(h.RadioButton,{label:"Right",value:"right"})]})]}),(0,y.jsxs)(h.FormField,{labelPlacement:"left",children:[(0,y.jsx)(h.FormFieldLabel,{children:"Pin Column"}),(0,y.jsxs)(h.RadioButtonGroup,{"aria-label":"Pin Column",value:(f=e.pin)!=null?f:"",onChange:l,children:[(0,y.jsx)(h.RadioButton,{label:"Do not pin",value:""}),(0,y.jsx)(h.RadioButton,{label:"Left",value:"left"}),(0,y.jsx)(h.RadioButton,{label:"Right",value:"right"})]})]})]}),(0,y.jsx)(St,{column:e,dispatchColumnAction:n,title:"Data Cell"}),(0,y.jsxs)(h.Panel,{title:"Vuu",variant:"secondary",children:[(0,y.jsxs)(h.FormField,{labelPlacement:"top",readOnly:!0,children:[(0,y.jsx)(h.FormFieldLabel,{children:"Name"}),(0,y.jsx)(h.Input,{value:e.name})]}),(0,y.jsxs)(h.FormField,{labelPlacement:"top",readOnly:!0,children:[(0,y.jsx)(h.FormFieldLabel,{children:"Vuu Type"}),(0,y.jsx)(h.Input,{value:e.serverDataType})]})]})]})]})};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|