@symbo.ls/range 2.11.5 → 2.11.126
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/index.js +10 -7
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -11,6 +11,9 @@ const props = {
|
|
|
11
11
|
outline: 'none',
|
|
12
12
|
flex: 1,
|
|
13
13
|
|
|
14
|
+
onInput: (ev, el, s) => s.update({ value: el.node.value }),
|
|
15
|
+
onChange: (ev, el, s) => s.update({ value: el.node.value }),
|
|
16
|
+
|
|
14
17
|
style: {
|
|
15
18
|
appearance: 'none'
|
|
16
19
|
},
|
|
@@ -101,22 +104,22 @@ export const RangeWithButtons = {
|
|
|
101
104
|
value: {
|
|
102
105
|
style: { width: '4ch' },
|
|
103
106
|
tag: 'span',
|
|
104
|
-
text: (
|
|
105
|
-
const unit = listenProp(
|
|
106
|
-
return '' + (
|
|
107
|
+
text: ({ state, parent }) => {
|
|
108
|
+
const unit = listenProp(parent.input, 'unit', '')
|
|
109
|
+
return '' + (state.value || 50) + unit
|
|
107
110
|
}
|
|
108
111
|
},
|
|
109
112
|
input: {
|
|
110
113
|
extend: Range,
|
|
111
114
|
attr: {
|
|
112
|
-
value: (el, s) => parseFloat(
|
|
115
|
+
value: (el, s) => parseFloat(el.state.value),
|
|
113
116
|
min: (el, s) => listenProp(el, 'min', 0),
|
|
114
117
|
max: (el, s) => listenProp(el, 'max', 100),
|
|
115
118
|
step: (el, s) => listenProp(el, 'step', 1)
|
|
116
119
|
},
|
|
117
120
|
on: {
|
|
118
|
-
input: (ev, el, s) => el.props && isFunction(el.props.onInput) && el.props.onInput(ev, el,
|
|
119
|
-
change: (ev, el, s) => el.props && isFunction(el.props.onChange) && el.props.onChange(ev, el,
|
|
121
|
+
input: (ev, el, s) => el.props && isFunction(el.props.onInput) && el.props.onInput(ev, el, el.state),
|
|
122
|
+
change: (ev, el, s) => el.props && isFunction(el.props.onChange) && el.props.onChange(ev, el, el.state)
|
|
120
123
|
}
|
|
121
124
|
},
|
|
122
125
|
plus: {
|
|
@@ -124,7 +127,7 @@ export const RangeWithButtons = {
|
|
|
124
127
|
props: { theme: 'tertiary', icon: 'plus' },
|
|
125
128
|
on: {
|
|
126
129
|
click: (ev, el, s) => {
|
|
127
|
-
el.props && isFunction(el.props.onClick) && el.props.onClick(ev, el,
|
|
130
|
+
el.props && isFunction(el.props.onClick) && el.props.onClick(ev, el, el.state)
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/range",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.126",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "463c4925df4dfbed4611feafe34c6f011d3ba287",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@domql/utils": "latest",
|
|
9
9
|
"@symbo.ls/button": "latest",
|