ywana-core8 0.0.642 → 0.0.645
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/dist/index.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +6 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +6 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentType.js +0 -1
- package/src/html/textfield.js +9 -6
- package/src/html/textfield.test.js +3 -1
package/package.json
CHANGED
@@ -80,7 +80,6 @@ export class ContentType {
|
|
80
80
|
return attributes
|
81
81
|
.filter(([name, attr]) => attr.required === true)
|
82
82
|
.every(([name, attr]) => {
|
83
|
-
console.log("validate", name, data[name], data[name] === null ? "NULL" : data[name] === undefined ? "UNDEFINED" : data[name])
|
84
83
|
return data[name] === null ? false : data[name] === undefined ? false : data[name] === "" ? false: this.checkType(attr, data[name])
|
85
84
|
})
|
86
85
|
}
|
package/src/html/textfield.js
CHANGED
@@ -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 === "")
|
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 {
|
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, {
|
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
|
-
{
|
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>
|