smbls 0.15.0 → 0.15.2

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI Library built on Scratch and DOMQL",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.15.0",
6
+ "version": "0.15.2",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
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 { camelize } from '@symbo.ls/utils'
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 = camelize(iconName)
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']
@@ -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.click) && el.props.click(ev, el, s)
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.input) && el.props.input(ev, el, s),
99
- change: (ev, el, s) => el.props && isFunction(el.props.change) && el.props.change(ev, el, s)
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.click) && el.props.click(ev, el, s)
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
@@ -14,22 +14,22 @@ export const depth = {
14
14
  const getComputedBackgroundColor = el => {
15
15
  const { props, node } = el
16
16
  const propsColor = getColor(props.borderColor) || getColor(props.backgroundColor) || getColor(props.background)
17
- const propsTheme = getTheme(props.theme)
17
+ // const propsTheme = getTheme(props.theme)
18
18
 
19
19
  if (!propsColor) {
20
20
  const computedStyle = window.getComputedStyle(node)
21
- if (props.shapeDirection) {
22
- console.group(el.parent.parent.parent.key + ' - ' + el.parent.key)
23
- console.log(propsTheme)
24
- console.log(getColor(props.borderColor))
25
- console.log(getColor(props.backgroundColor))
26
- console.log(getColor(props.background))
27
- console.log(computedStyle.getPropertyValue('border-color'))
28
- console.log(computedStyle.getPropertyValue('background'))
29
- console.log(computedStyle.getPropertyValue('background-color'))
30
- console.log(el)
31
- console.groupEnd(el.parent.parent.parent.key + ' - ' + el.parent.key)
32
- }
21
+ // if (props.shapeDirection) {
22
+ // console.group(el.parent.parent.parent.key + ' - ' + el.parent.key)
23
+ // console.log(propsTheme)
24
+ // console.log(getColor(props.borderColor))
25
+ // console.log(getColor(props.backgroundColor))
26
+ // console.log(getColor(props.background))
27
+ // console.log(computedStyle.getPropertyValue('border-color'))
28
+ // console.log(computedStyle.getPropertyValue('background'))
29
+ // console.log(computedStyle.getPropertyValue('background-color'))
30
+ // console.log(el)
31
+ // console.groupEnd(el.parent.parent.parent.key + ' - ' + el.parent.key)
32
+ // }
33
33
  return computedStyle.getPropertyValue('border-color') ||
34
34
  computedStyle.getPropertyValue('background') ||
35
35
  computedStyle.getPropertyValue('background-color')