ywana-core8 0.0.391 → 0.0.392
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 +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +18 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +13 -6
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +17 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/color.css +18 -0
- package/src/html/color.js +8 -6
- package/src/html/color.test.js +2 -1
- package/src/html/textfield.test.js +1 -0
- package/src/html/color1.css +0 -3
package/package.json
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
.color-field {
|
2
|
+
flex: 1;
|
3
|
+
display: flex;
|
4
|
+
align-items: flex-end;
|
5
|
+
padding: .5rem;
|
6
|
+
overflow: hidden;
|
7
|
+
display: flex;
|
8
|
+
max-height: 3.5rem;
|
9
|
+
min-height: 3.5;
|
10
|
+
}
|
11
|
+
|
12
|
+
.color-field>label {
|
13
|
+
flex:1;
|
14
|
+
color: var(--primary-color);
|
15
|
+
font-size: .9rem;
|
16
|
+
font-weight: normal;
|
17
|
+
pointer-events: none;
|
18
|
+
}
|
package/src/html/color.js
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import
|
1
|
+
import React, {useState} from 'react'
|
2
|
+
import './color.css'
|
3
3
|
|
4
4
|
export const ColorField = (props) => {
|
5
5
|
|
6
|
-
const {id, onChange} = props
|
6
|
+
const {id, label="Color", value, onChange} = props
|
7
7
|
|
8
|
-
function change(
|
9
|
-
|
8
|
+
function change(event) {
|
9
|
+
const color = event.target.value
|
10
|
+
if (onChange) onChange(id, color)
|
10
11
|
}
|
11
12
|
|
12
13
|
return (
|
13
14
|
<div className="color-field">
|
14
|
-
<
|
15
|
+
<label for={id}>{label}</label>
|
16
|
+
<input id={id} type="color" onChange={change} value={value}/>
|
15
17
|
</div>
|
16
18
|
)
|
17
19
|
}
|
package/src/html/color.test.js
CHANGED
@@ -7,13 +7,14 @@ const ColorFieldTest = (prop) => {
|
|
7
7
|
})
|
8
8
|
|
9
9
|
function change(id, value) {
|
10
|
+
console.log(id, value)
|
10
11
|
const next = Object.assign({}, form, { [id] : value })
|
11
12
|
setForm(next)
|
12
13
|
}
|
13
14
|
|
14
15
|
return (
|
15
16
|
<>
|
16
|
-
<ColorField onChange={change} />
|
17
|
+
<ColorField id="color1" onChange={change} value={form.color1} />
|
17
18
|
</>
|
18
19
|
)
|
19
20
|
}
|
@@ -27,6 +27,7 @@ const TextFieldTest = (prop) => {
|
|
27
27
|
<DropDown id="gender2" label="Dropdown 2" value={form.gender2} onChange={change} options={options} predictive={true}/>
|
28
28
|
<TextArea id="text1" label="Text 1" value={form.text1} onChange={change} />
|
29
29
|
<TextField id="date1" type="DATE" label="Date" value={form.date1} onChange={change} />
|
30
|
+
<TextField id="color1" type="COLOR" label="Color" value={form.date1} onChange={change} />
|
30
31
|
</>
|
31
32
|
)
|
32
33
|
}
|
package/src/html/color1.css
DELETED