ywana-core8 0.0.643 → 0.0.644

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.643",
3
+ "version": "0.0.644",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -128,17 +128,20 @@ export const DropDown = (props) => {
128
128
  if (Array.isArray(options)) {
129
129
  const option = options.find(option => option.value === value)
130
130
  const label = option ? option.label : ""
131
- if (editable && label === "") setLabel(value)
131
+ if (editable && label === "") {
132
+ setLabel(value)
133
+ } else {
134
+ setLabel(label)
135
+ }
132
136
  if (!editable) setLabel(label)
133
137
  }
134
138
 
135
139
  }, [value])
136
-
140
+
137
141
  function change(id, value) {
138
142
  if (predictive) {
139
143
  setLabel(value)
140
144
  } else {
141
- console.log('change',id, value)
142
145
  if (onChange) onChange(id, value)
143
146
  }
144
147
  }
@@ -196,7 +199,7 @@ export const DropDown = (props) => {
196
199
 
197
200
  export const DateRange = (props) => {
198
201
 
199
- const { id, label, value, onChange } = props
202
+ const { id, label, value, onChange } = props
200
203
  const [form, setForm] = useState({})
201
204
 
202
205
  useEffect(() => {
@@ -204,13 +207,13 @@ export const DateRange = (props) => {
204
207
  }, [form])
205
208
 
206
209
  function change(id, value) {
207
- const next = Object.assign({}, form, { [id]: value })
210
+ const next = Object.assign({}, form, { [id]: value })
208
211
  setForm(next)
209
212
  }
210
213
 
211
214
  return (
212
215
  <div className="date-range">
213
- { label ? <label>{label}</label> : null }
216
+ {label ? <label>{label}</label> : null}
214
217
  <TextField id="from" type="date" label="From" value={form.from} onChange={change} />
215
218
  <TextField id="to" type="date" label="To" value={form.to} onChange={change} />
216
219
  </div>
@@ -5,7 +5,9 @@ import { DateRange } from './textfield'
5
5
 
6
6
  const TextFieldTest = (prop) => {
7
7
 
8
- const [form, setForm] = useState({})
8
+ const [form, setForm] = useState({
9
+ gender3: "3"
10
+ })
9
11
 
10
12
  function change(id, value) {
11
13
  console.log('2', id, value)