@andersonalmeidax0/webcomponents 0.1.44 → 0.1.46

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.
@@ -162,10 +162,12 @@ class JZListComponentNoRouter extends React.Component {
162
162
  var _list=null;
163
163
  if(this.props.api.findSearch)
164
164
  try {
165
+ this.setState({isLoading:true});
165
166
  _list=await this.props.api.findSearch(this.state.searchStr,this.props.apiContext);
166
167
  if(DEBUGAPICALL_UTIL)alert(JSON.stringify(_list, null, 2));
167
168
  _list=this.listModel2View(_list);
168
169
  this.setState({list:_list});
170
+ this.setState({isLoading:false});
169
171
  this.forceUpdate();
170
172
  }catch(error){
171
173
  if(error instanceof PlatAPIReturnCodeError ||
@@ -287,7 +289,7 @@ class JZListComponentNoRouter extends React.Component {
287
289
  {false&&<XButton label='Remove' icon="fa fa-trash" onClick={this.evtRemove}/>} <span> </span>
288
290
  <span>&nbsp;</span>{this.props.listConfig.filterLov&&<XSelect3 isFilter={true} list={this.props.listConfig.filterLov} width={110} onChange={this.evtRefresh} ></XSelect3>}
289
291
  <span>&nbsp;</span>{this.props.listConfig.filterSearch&&<XInputExternal readonly={false} cellStyle={true} value={this.state.searchStr} type='text' label='' onXG={(event)=>this.setState({searchStr: event.target.value})} onEnterKey={this.evtRefreshSearch} />}
290
- <span>&nbsp;</span>{this.props.listConfig.filterSearch&&<XButton label='Filter' textlabel={(this.props.textlabels)?"Search":null} icon="fa fa-search" onClick={this.evtRefreshSearch}/>} <span> </span>
292
+ <span>&nbsp;</span>{this.props.listConfig.filterSearch&&<XButton label='Filter' textlabel={(this.props.textlabels)?(this.state.isLoading?"Loading...":"Search"):null} icon={this.state.isLoading?'fa fa-spinner fa-spin':'fa fa-search'} onClick={this.evtRefreshSearch}/>} <span> </span>
291
293
  <h5 style={{color:'red'}} >{this.state.message}</h5>
292
294
 
293
295
  {<XTableRead
@@ -39,6 +39,13 @@ class XFormEdit extends React.Component {
39
39
  //this.props.notifyChangeFn();
40
40
  }
41
41
 
42
+ capitalize = (text) => {
43
+ if (typeof text !== 'string' || text.length === 0) {
44
+ return text;
45
+ }
46
+
47
+ return text[0].toUpperCase() + text.substring(1);
48
+ }
42
49
 
43
50
  render() {
44
51
  if (!this.props.metadata.fields)
@@ -53,7 +60,7 @@ class XFormEdit extends React.Component {
53
60
  if (v.type === 'l') /*list*/ {
54
61
  return <React.Fragment key={i}>
55
62
  <div xclassName="card">
56
- <div>{v.label}</div>
63
+ <div>{this.capitalize(v.label)}:</div>
57
64
  <XSelect3 list={v.lov} value={this.props.formData[v.attr]} disabled={v.readOnly} onChange={(ev) => this.props.formData[v.attr] = ev.target.value} />
58
65
  <br />
59
66
  <p> </p>
@@ -64,7 +71,8 @@ class XFormEdit extends React.Component {
64
71
  if (v.type === 'a') /* array */ {
65
72
  return (
66
73
  <React.Fragment key={i}>
67
- <div xclassName="card"><div>{v.label}</div>
74
+ <div>
75
+ <div>{this.capitalize(v.label)}:</div>
68
76
  <JZInPlaceListComponent _id={this.props.id + '_F' + i} textlabels={true} list={this.props.formData[v.attr]} listConfig={v.listConfig} newItemFN={v.newItemFN} />
69
77
  </div>
70
78
  </React.Fragment>)
@@ -73,7 +81,7 @@ class XFormEdit extends React.Component {
73
81
  if (v.type === 'd') /* date */ {
74
82
  return (
75
83
  <React.Fragment key={i}>
76
- <div className=""><div>{v.label}</div>
84
+ <div className=""><div>{this.capitalize(v.label)}:</div>
77
85
  <XDateSelect id={this.props.id + '_F' + i} width={v.width} label={v.label} disabled={v.readOnly} value={this.props.formData[v.attr]} onChange={(v) => this.props.formData[v.attr] = v} />
78
86
  </div>
79
87
  </React.Fragment>)
@@ -82,7 +90,7 @@ class XFormEdit extends React.Component {
82
90
  if (v.type === 'c') /* check */ {
83
91
  return (
84
92
  <React.Fragment key={i}>
85
- <div className=""><div>{v.label}</div>
93
+ <div className=""><div>{this.capitalize(v.label)}:</div>
86
94
  <XCheckbox id={this.props.id + '_F' + i} width={v.width} label={v.label} disabled={v.readOnly} value={this.props.formData[v.attr]} onChange={(v) => this.props.formData[v.attr] = v} />
87
95
  </div>
88
96
  </React.Fragment>)
@@ -91,7 +99,7 @@ class XFormEdit extends React.Component {
91
99
  if (v.type === 'file') /* file */ {
92
100
  return (
93
101
  <React.Fragment key={i}>
94
- <div className=""><div>{v.label}</div>
102
+ <div className=""><div>{this.capitalize(v.label)}:</div>
95
103
  <p>{this.props.formData[v.attr]?this.props.formData[v.attr]:"No file selected"}</p>
96
104
  <XButton id={this.props.id + '_F' + i} attachFile={true} disabled={v.readOnly} onClick={(e)=>{this.props.formData[v.attr]=e.target.files[0].name;this.props.formData.filedata=e.target.files[0]}} textlabel='Select File'></XButton>
97
105
  </div>
@@ -99,7 +107,7 @@ class XFormEdit extends React.Component {
99
107
  } else
100
108
  return (
101
109
  <React.Fragment key={i} >{DEBUG_ID2 && '[' + this.props.id + '_F' + i + ']'}
102
- <XInputExternal type={v.type == 'n' ? 'number' : ''} id={this.props.id + '_F' + i} width={v.width} label={v.label} readOnly={v.readOnly} value={this.props.formData[v.attr]} /*onChangeNew={(value)=>this.props.formData[v.attr]=ev.target.value}*/ onChangeNew={this.inputChangeNew} context={{ item: this.props.formData, v: v }} />
110
+ <XInputExternal type={v.type == 'n' ? 'number' : ''} id={this.props.id + '_F' + i} width={v.width} label={this.capitalize(v.label)} readOnly={v.readOnly} value={this.props.formData[v.attr]} /*onChangeNew={(value)=>this.props.formData[v.attr]=ev.target.value}*/ onChangeNew={this.inputChangeNew} context={{ item: this.props.formData, v: v }} />
103
111
  </React.Fragment>)
104
112
  }
105
113
  })}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andersonalmeidax0/webcomponents",
3
- "version": "0.1.44",
3
+ "version": "0.1.46",
4
4
  "description": "webcomponents",
5
5
  "main": "webcomponents",
6
6
  "scripts": {
package/releasenotes.txt CHANGED
@@ -20,6 +20,7 @@ WebComponents
20
20
  0.1.28: show errors / show stack unescape
21
21
  0.1.31: restAdapter: call validate from dto
22
22
  0.1.40: searchComp & searchAdapter
23
+ 0.1.45: search, errors, onKey13, validate
23
24
 
24
25
  npm login
25
26
  npm publish --access public