ywana-core8 0.0.485 → 0.0.486
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 +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +9 -0
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +9 -0
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/ContentEditor.js +1 -0
- package/src/html/textfield.js +4 -2
package/package.json
CHANGED
@@ -272,6 +272,7 @@ export const StringEditor = ({ field, value = '', onChange, content, outlined })
|
|
272
272
|
case FORMATS.COLOR: return <ColorField id={id} onChange={change} value={value} />
|
273
273
|
case FORMATS.HTML: return <Editor id={id} value={value} onChange={change} content={content} />
|
274
274
|
case FORMATS.DATE: return <TextField outlined={outlined} id={id} type="date" label={label} value={value} onChange={change} readOnly={!editable} />
|
275
|
+
case FORMATS.DATERANGE: return <DateRange id={id} label={label} value={value} onChange={change} readOnly={!editable}/>
|
275
276
|
case FORMATS.TOKENS:
|
276
277
|
return <TokenField id={id} label={label} onChange={change} options={buildOptions()} tokens={value} />
|
277
278
|
default:
|
package/src/html/textfield.js
CHANGED
@@ -187,7 +187,7 @@ export const DropDown = (props) => {
|
|
187
187
|
|
188
188
|
export const DateRange = (props) => {
|
189
189
|
|
190
|
-
const { id, onChange } = props
|
190
|
+
const { id, label, value, onChange, readOnly } = props
|
191
191
|
const [form, setForm] = useState({})
|
192
192
|
|
193
193
|
useEffect(() => {
|
@@ -199,7 +199,9 @@ export const DateRange = (props) => {
|
|
199
199
|
setForm(next)
|
200
200
|
}
|
201
201
|
|
202
|
-
return (
|
202
|
+
return readOnly ? (
|
203
|
+
<TextField id={id} type="date" label={label} value={value} readOnly={true} />
|
204
|
+
) : (
|
203
205
|
<div className="date-range">
|
204
206
|
<TextField id="from" type="date" label="From" value={form.from} onChange={change} />
|
205
207
|
<TextField id="to" type="date" label="To" value={form.to} onChange={change} />
|