smbls 0.15.1 → 0.15.3
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 +1 -1
- package/src/DatePicker/index.js +0 -3
- package/src/Icon.js +2 -2
- package/src/Range/index.js +4 -4
package/package.json
CHANGED
package/src/DatePicker/index.js
CHANGED
package/src/Icon.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { SVG } from './atoms'
|
|
4
4
|
|
|
5
5
|
import { ICONS } from '@symbo.ls/scratch'
|
|
6
|
-
import {
|
|
6
|
+
import { toCamelCase } from '@symbo.ls/utils'
|
|
7
7
|
|
|
8
8
|
export const Icon = {
|
|
9
9
|
extend: SVG,
|
|
10
10
|
props: ({ key, props, parent }) => {
|
|
11
11
|
const iconName = props.inheritedString || props.name || props.icon || key
|
|
12
|
-
const camelCase =
|
|
12
|
+
const camelCase = toCamelCase(iconName)
|
|
13
13
|
const isArray = camelCase.split(/([a-z])([A-Z])/g)
|
|
14
14
|
|
|
15
15
|
const iconFromLibrary = ICONS[camelCase] || (ICONS[isArray[0] + isArray[1]]) || ICONS[isArray[0]] || ICONS['noIcon']
|
package/src/Range/index.js
CHANGED
|
@@ -69,7 +69,7 @@ export const RangeWithButtons = {
|
|
|
69
69
|
props: { theme: 'tertiary', icon: 'minus' },
|
|
70
70
|
on: {
|
|
71
71
|
click: (ev, el, s) => {
|
|
72
|
-
el.props && isFunction(el.props.
|
|
72
|
+
el.props && isFunction(el.props.onClick) && el.props.onClick(ev, el, s)
|
|
73
73
|
const input = el.parent.input
|
|
74
74
|
const props = input.props
|
|
75
75
|
const value = isFunction(props.value) ? props.value() : props.value
|
|
@@ -95,8 +95,8 @@ export const RangeWithButtons = {
|
|
|
95
95
|
step: (el, s) => listenProp(el, 'step', 1)
|
|
96
96
|
},
|
|
97
97
|
on: {
|
|
98
|
-
input: (ev, el, s) => el.props && isFunction(el.props.
|
|
99
|
-
change: (ev, el, s) => el.props && isFunction(el.props.
|
|
98
|
+
input: (ev, el, s) => el.props && isFunction(el.props.onInput) && el.props.onInput(ev, el, s),
|
|
99
|
+
change: (ev, el, s) => el.props && isFunction(el.props.onChange) && el.props.onChange(ev, el, s)
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
plus: {
|
|
@@ -104,7 +104,7 @@ export const RangeWithButtons = {
|
|
|
104
104
|
props: { theme: 'tertiary', icon: 'plus' },
|
|
105
105
|
on: {
|
|
106
106
|
click: (ev, el, s) => {
|
|
107
|
-
el.props && isFunction(el.props.
|
|
107
|
+
el.props && isFunction(el.props.onClick) && el.props.onClick(ev, el, s)
|
|
108
108
|
const input = el.parent.input
|
|
109
109
|
const props = input.props
|
|
110
110
|
const value = isFunction(props.value) ? props.value() : props.value
|