@andersonalmeidax0/webcomponents 0.1.45 → 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.
@@ -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.45",
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