@lowdefy/blocks-color-selectors 4.0.0-alpha.1 → 4.0.0-alpha.10

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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/blocks/ColorSelector/ColorPicker.js +69 -0
  3. package/dist/blocks/ColorSelector/ColorSelector.js +29 -17
  4. package/dist/blocks/ColorSelector/schema.json +8 -33
  5. package/dist/blocks/ColorSelector/style.less +58 -2
  6. package/dist/blocks/ColorSelector/useClickOutside.js +46 -0
  7. package/dist/{blocks/CompactColorSelector/style.less → blocks.js} +2 -4
  8. package/dist/{blocks/ColorSelector/index.js → types.js} +15 -18
  9. package/package.json +27 -18
  10. package/dist/blocks/ChromeColorSelector/ChromeColorSelector.js +0 -58
  11. package/dist/blocks/ChromeColorSelector/index.js +0 -33
  12. package/dist/blocks/ChromeColorSelector/schema.json +0 -99
  13. package/dist/blocks/ChromeColorSelector/style.less +0 -17
  14. package/dist/blocks/CircleColorSelector/CircleColorSelector.js +0 -77
  15. package/dist/blocks/CircleColorSelector/index.js +0 -32
  16. package/dist/blocks/CircleColorSelector/schema.json +0 -156
  17. package/dist/blocks/CircleColorSelector/style.less +0 -17
  18. package/dist/blocks/CompactColorSelector/CompactColorSelector.js +0 -54
  19. package/dist/blocks/CompactColorSelector/index.js +0 -33
  20. package/dist/blocks/CompactColorSelector/schema.json +0 -144
  21. package/dist/blocks/GithubColorSelector/GithubColorSelector.js +0 -56
  22. package/dist/blocks/GithubColorSelector/index.js +0 -33
  23. package/dist/blocks/GithubColorSelector/schema.json +0 -138
  24. package/dist/blocks/GithubColorSelector/style.less +0 -17
  25. package/dist/blocks/SliderColorSelector/SliderColorSelector.js +0 -53
  26. package/dist/blocks/SliderColorSelector/index.js +0 -32
  27. package/dist/blocks/SliderColorSelector/schema.json +0 -96
  28. package/dist/blocks/SliderColorSelector/style.less +0 -17
  29. package/dist/blocks/SwatchesColorSelector/SwatchesColorSelector.js +0 -56
  30. package/dist/blocks/SwatchesColorSelector/index.js +0 -32
  31. package/dist/blocks/SwatchesColorSelector/schema.json +0 -146
  32. package/dist/blocks/SwatchesColorSelector/style.less +0 -17
  33. package/dist/blocks/TwitterColorSelector/TwitterColorSelector.js +0 -50
  34. package/dist/blocks/TwitterColorSelector/index.js +0 -32
  35. package/dist/blocks/TwitterColorSelector/schema.json +0 -125
  36. package/dist/blocks/TwitterColorSelector/style.less +0 -17
  37. package/dist/index.js +0 -37
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # Lowdefy Color Selector
2
2
 
3
- A Lowdefy Color Selector block based on react-color.
3
+ A Lowdefy Color Selector block based on react-colorful.
@@ -0,0 +1,69 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import React, { useCallback, useRef, useState } from 'react';
16
+ import { HexColorPicker, HexColorInput } from 'react-colorful';
17
+ import classNames from 'classnames';
18
+ import useClickOutside from './useClickOutside.js';
19
+ const DEFAULT_COLOR = '#000000';
20
+ export const ColorPicker = ({ className , disabled , hideInput , onChange , size , undefinedColor , value , })=>{
21
+ const popover = useRef();
22
+ const [isOpen, toggle] = useState(false);
23
+ const [color, setColor] = useState(value || undefinedColor || DEFAULT_COLOR);
24
+ const close = useCallback((newColor)=>{
25
+ toggle(false);
26
+ onChange(newColor);
27
+ }, []);
28
+ useClickOutside(popover, close, color);
29
+ return(/*#__PURE__*/ React.createElement("div", {
30
+ className: classNames({
31
+ 'color-picker': true,
32
+ [className]: true
33
+ })
34
+ }, /*#__PURE__*/ React.createElement("div", {
35
+ className: classNames({
36
+ 'color-picker-swatch': true,
37
+ 'color-picker-swatch-sm': size === 'small',
38
+ 'color-picker-swatch-lg': size === 'large',
39
+ 'color-picker-swatch-disabled': disabled
40
+ }),
41
+ style: {
42
+ backgroundColor: color
43
+ },
44
+ onClick: ()=>!disabled && toggle(true)
45
+ }), !hideInput && /*#__PURE__*/ React.createElement(HexColorInput, {
46
+ className: classNames({
47
+ 'color-picker-input': true,
48
+ 'color-picker-input-sm ': size === 'small',
49
+ 'color-picker-input-lg': size === 'large',
50
+ 'ant-input': true,
51
+ 'ant-input-sm': size === 'small',
52
+ 'ant-input-lg': size === 'large'
53
+ }),
54
+ color: color,
55
+ onChange: (newColor)=>{
56
+ setColor(newColor);
57
+ onChange(newColor);
58
+ },
59
+ prefixed: true,
60
+ disabled: disabled
61
+ }), isOpen && /*#__PURE__*/ React.createElement("div", {
62
+ className: "color-picker-popover",
63
+ ref: popover
64
+ }, /*#__PURE__*/ React.createElement(HexColorPicker, {
65
+ color: color,
66
+ onChange: setColor
67
+ }))));
68
+ };
69
+ export default ColorPicker;
@@ -1,6 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /*
3
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
4
3
 
5
4
  Licensed under the Apache License, Version 2.0 (the "License");
6
5
  you may not use this file except in compliance with the License.
@@ -14,13 +13,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
13
  See the License for the specific language governing permissions and
15
14
  limitations under the License.
16
15
  */ import React from 'react';
17
- import { BlockPicker } from 'react-color';
18
16
  import { blockDefaultProps } from '@lowdefy/block-utils';
19
- import Label from '@lowdefy/blocks-antd/dist/blocks/Label/Label.js';
20
- const Selector = ({ blockId , loading , methods , properties , required , validation , value })=>{
21
- return(/*#__PURE__*/ _jsx(Label, {
17
+ import Label from '@lowdefy/blocks-antd/blocks/Label/Label.js';
18
+ import ColorPicker from './ColorPicker.js';
19
+ const ColorSelector = ({ blockId , components , events , loading , methods , properties , required , validation , value , })=>{
20
+ return(/*#__PURE__*/ React.createElement(Label, {
22
21
  blockId: blockId,
23
- loading: loading,
22
+ components: components,
23
+ events: events,
24
24
  methods: methods,
25
25
  properties: {
26
26
  title: properties.title,
@@ -30,7 +30,7 @@ const Selector = ({ blockId , loading , methods , properties , required , valida
30
30
  required: required,
31
31
  validation: validation,
32
32
  content: {
33
- content: ()=>/*#__PURE__*/ _jsx(BlockPicker, {
33
+ content: ()=>/*#__PURE__*/ React.createElement(ColorPicker, {
34
34
  id: `${blockId}_input`,
35
35
  className: methods.makeCssClass([
36
36
  {
@@ -38,19 +38,31 @@ const Selector = ({ blockId , loading , methods , properties , required , valida
38
38
  },
39
39
  properties.inputStyle,
40
40
  ]),
41
- color: value || properties.defaultColor || '#000000',
42
- colors: properties.colors,
43
- triangle: properties.triangle || 'hide',
44
- width: properties.width || '100%',
45
- onChangeComplete: (color)=>{
46
- methods.setValue(color.hex ? color.hex : '#000000');
41
+ onChange: (newColor)=>{
42
+ methods.setValue(newColor);
47
43
  methods.triggerEvent({
48
44
  name: 'onChange'
49
45
  });
50
- }
46
+ },
47
+ size: properties.size,
48
+ undefinedColor: properties.undefinedColor,
49
+ value: value,
50
+ hideInput: properties.hideInput,
51
+ disabled: properties.disabled || loading,
52
+ methods: methods
51
53
  })
52
54
  }
53
55
  }));
54
56
  };
55
- Selector.defaultProps = blockDefaultProps;
56
- export default Selector;
57
+ ColorSelector.defaultProps = blockDefaultProps;
58
+ ColorSelector.meta = {
59
+ valueType: 'string',
60
+ category: 'input',
61
+ icons: [
62
+ ...Label.meta.icons
63
+ ],
64
+ styles: [
65
+ 'blocks/ColorSelector/style.less'
66
+ ]
67
+ };
68
+ export default ColorSelector;
@@ -7,28 +7,7 @@
7
7
  "type": "string",
8
8
  "description": "Title to describe the input component, if no title is specified the block id is displayed."
9
9
  },
10
- "colors": {
11
- "type": "array",
12
- "description": "Colors to display.",
13
- "default": [
14
- "#D9E3F0",
15
- "#F47373",
16
- "#697689",
17
- "#37D67A",
18
- "#2CCCE4",
19
- "#555555",
20
- "#dce775",
21
- "#ff8a65",
22
- "#ba68c8"
23
- ],
24
- "items": {
25
- "type": "string",
26
- "docs": {
27
- "displayType": "color"
28
- }
29
- }
30
- },
31
- "defaultColor": {
10
+ "undefinedColor": {
32
11
  "type": "string",
33
12
  "default": "#000000",
34
13
  "description": "Default color to display if input value is null.",
@@ -43,19 +22,15 @@
43
22
  "displayType": "yaml"
44
23
  }
45
24
  },
46
- "triangle": {
25
+ "disabled": {
47
26
  "type": "boolean",
48
- "enum": ["hide", "top"],
49
- "default": "hide",
50
- "description": "Show triangle on color selector border."
27
+ "default": false,
28
+ "description": "If true, the input is disabled."
51
29
  },
52
- "width": {
53
- "type": ["string", "number"],
54
- "description": "Color selector width.",
55
- "default": "100%",
56
- "docs": {
57
- "displayType": "string"
58
- }
30
+ "hideInput": {
31
+ "type": "boolean",
32
+ "default": false,
33
+ "description": "If true, the input is hidden."
59
34
  },
60
35
  "label": {
61
36
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -14,4 +14,60 @@
14
14
  limitations under the License.
15
15
  */
16
16
 
17
- @import '@lowdefy/blocks-antd/blocks/Label/style.less'
17
+ @import '@lowdefy/blocks-antd/blocks/Label/style.less';
18
+ @import '@lowdefy/blocks-antd/blocks/TextInput/style.less';
19
+
20
+ .color-picker {
21
+ position: relative;
22
+ display: flex;
23
+ }
24
+
25
+ .color-picker-swatch {
26
+ flex: 0 0 auto;
27
+ width: 34px;
28
+ height: 34px;
29
+ border-radius: 2px;
30
+ border: 3px solid #fff;
31
+ box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
32
+ cursor: pointer;
33
+ }
34
+
35
+ .color-picker-swatch-disabled {
36
+ cursor: disabled;
37
+ }
38
+
39
+ .color-picker-swatch-sm {
40
+ width: 24px;
41
+ height: 24px;
42
+ }
43
+
44
+ .color-picker-swatch-lg {
45
+ width: 40px;
46
+ height: 40px;
47
+ }
48
+
49
+ .small .react-colorful {
50
+ width: 120px;
51
+ height: 120px;
52
+ }
53
+
54
+ .color-picker-popover {
55
+ position: absolute;
56
+ top: calc(100% + 2px);
57
+ left: 0;
58
+ border-radius: 3px;
59
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
60
+ z-index: 1000;
61
+ }
62
+
63
+ .color-picker-input {
64
+ margin-left: 8px;
65
+ }
66
+
67
+ .color-picker-input-sm {
68
+ margin-left: 0px;
69
+ }
70
+
71
+ .color-picker-input-lg {
72
+ margin-left: 12px;
73
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import { useEffect } from 'react';
16
+ // Improved version of https://usehooks.com/useOnClickOutside/
17
+ const useClickOutside = (ref, handler, value)=>{
18
+ useEffect(()=>{
19
+ let startedInside = false;
20
+ let startedWhenMounted = false;
21
+ const listener = (event)=>{
22
+ // Do nothing if `mousedown` or `touchstart` started inside ref element
23
+ if (startedInside || !startedWhenMounted) return;
24
+ // Do nothing if clicking ref's element or descendent elements
25
+ if (!ref.current || ref.current.contains(event.target)) return;
26
+ handler(value, event);
27
+ };
28
+ const validateEventStart = (event)=>{
29
+ startedWhenMounted = ref.current;
30
+ startedInside = ref.current && ref.current.contains(event.target);
31
+ };
32
+ document.addEventListener('mousedown', validateEventStart);
33
+ document.addEventListener('touchstart', validateEventStart);
34
+ document.addEventListener('click', listener);
35
+ return ()=>{
36
+ document.removeEventListener('mousedown', validateEventStart);
37
+ document.removeEventListener('touchstart', validateEventStart);
38
+ document.removeEventListener('click', listener);
39
+ };
40
+ }, [
41
+ ref,
42
+ handler,
43
+ value
44
+ ]);
45
+ };
46
+ export default useClickOutside;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2021 Lowdefy, Inc
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -12,6 +12,4 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */
16
-
17
- @import '@lowdefy/blocks-antd/blocks/Label/style.less'
15
+ */ export { default as ColorSelector } from './blocks/ColorSelector/ColorSelector.js';
@@ -1,5 +1,5 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
1
+ /* eslint-disable import/namespace */ /*
2
+ Copyright 2020-2022 Lowdefy, Inc
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -12,21 +12,18 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/ColorSelector/ColorSelector.js',
18
- styles: [
19
- 'blocks/ColorSelector/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'string',
24
- category: 'input',
25
- loading: {
26
- type: 'Skeleton',
27
- properties: {
28
- height: 216
29
- }
30
- }
15
+ */ import * as blocks from './blocks.js';
16
+ const icons = {};
17
+ const styles = {};
18
+ Object.keys(blocks).forEach((block)=>{
19
+ icons[block] = blocks[block].meta.icons || [];
20
+ styles[block] = blocks[block].meta.styles || [];
21
+ });
22
+ export default {
23
+ blocks: Object.keys(blocks),
24
+ icons,
25
+ styles: {
26
+ default: [],
27
+ ...styles
31
28
  }
32
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-color-selectors",
3
- "version": "4.0.0-alpha.1",
3
+ "version": "4.0.0-alpha.10",
4
4
  "license": "Apache-2.0",
5
5
  "description": "A Lowdefy color selector blocks based on react-color.",
6
6
  "homepage": "https://lowdefy.com",
@@ -8,7 +8,8 @@
8
8
  "lowdefy",
9
9
  "lowdefy blocks",
10
10
  "color picker",
11
- "react-color"
11
+ "react-color",
12
+ "lowdefy plugin"
12
13
  ],
13
14
  "bugs": {
14
15
  "url": "https://github.com/lowdefy/lowdefy/issues"
@@ -21,6 +22,10 @@
21
22
  {
22
23
  "name": "Gerrie van Wyk",
23
24
  "url": "https://github.com/Gervwyk"
25
+ },
26
+ {
27
+ "name": "Sandile Memela",
28
+ "url": "https://github.com/sah-memela"
24
29
  }
25
30
  ],
26
31
  "repository": {
@@ -28,7 +33,11 @@
28
33
  "url": "https://github.com/lowdefy/lowdefy.git"
29
34
  },
30
35
  "type": "module",
31
- "exports": "./dist/index.js",
36
+ "exports": {
37
+ "./*": "./dist/*",
38
+ "./blocks": "./dist/blocks.js",
39
+ "./types": "./dist/types.js"
40
+ },
32
41
  "files": [
33
42
  "dist/*"
34
43
  ],
@@ -42,30 +51,30 @@
42
51
  "test": "jest --coverage"
43
52
  },
44
53
  "dependencies": {
45
- "@lowdefy/block-utils": "4.0.0-alpha.1",
46
- "@lowdefy/blocks-antd": "4.0.0-alpha.1",
47
- "react": "18.0.0-alpha-327d5c484-20211106",
48
- "react-color": "2.19.3",
49
- "react-dom": "18.0.0-alpha-327d5c484-20211106"
54
+ "@lowdefy/block-utils": "4.0.0-alpha.10",
55
+ "@lowdefy/blocks-antd": "4.0.0-alpha.10",
56
+ "classnames": "2.3.1",
57
+ "react": "17.0.2",
58
+ "react-colorful": "5.5.1",
59
+ "react-dom": "17.0.2"
50
60
  },
51
61
  "devDependencies": {
52
- "@babel/preset-react": "7.16.0",
53
- "@emotion/jest": "11.5.0",
54
- "@lowdefy/block-dev": "4.0.0-alpha.1",
55
- "@swc/cli": "0.1.52",
56
- "@swc/core": "1.2.112",
57
- "@swc/jest": "0.2.9",
58
- "@testing-library/dom": "8.10.1",
62
+ "@emotion/jest": "11.7.1",
63
+ "@lowdefy/block-dev": "4.0.0-alpha.10",
64
+ "@swc/cli": "0.1.55",
65
+ "@swc/core": "1.2.135",
66
+ "@swc/jest": "0.2.17",
67
+ "@testing-library/dom": "8.11.3",
59
68
  "@testing-library/react": "13.0.0-alpha.4",
60
69
  "@testing-library/user-event": "14.0.0-alpha.14",
61
70
  "copyfiles": "2.4.1",
62
- "jest": "27.3.1",
71
+ "jest": "27.5.1",
63
72
  "jest-canvas-mock": "2.3.1",
64
73
  "jest-serializer-html": "7.1.0",
65
- "jest-transform-yaml": "0.1.2"
74
+ "jest-transform-yaml": "1.0.0"
66
75
  },
67
76
  "publishConfig": {
68
77
  "access": "public"
69
78
  },
70
- "gitHead": "c97a8fa6b5a641e7d50df09f5601a9c586eeb65a"
79
+ "gitHead": "d697b4b5f354697d9481a371b90a00ca0944f486"
71
80
  }
@@ -1,58 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /*
3
- Copyright 2020-2021 Lowdefy, Inc
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- */ import React, { useState } from 'react';
17
- import { ChromePicker } from 'react-color';
18
- import { blockDefaultProps } from '@lowdefy/block-utils';
19
- import Label from '@lowdefy/blocks-antd/dist/blocks/Label/Label.js';
20
- const Selector = ({ blockId , loading , methods , properties , required , validation , value })=>{
21
- const [color, setColor] = useState(value || properties.defaultColor || '#000000');
22
- return(/*#__PURE__*/ _jsx(Label, {
23
- blockId: blockId,
24
- loading: loading,
25
- methods: methods,
26
- properties: {
27
- title: properties.title,
28
- size: properties.size,
29
- ...properties.label
30
- },
31
- required: required,
32
- validation: validation,
33
- content: {
34
- content: ()=>/*#__PURE__*/ _jsx(ChromePicker, {
35
- id: `${blockId}_input`,
36
- className: methods.makeCssClass([
37
- {
38
- marginBottom: '0px !important'
39
- },
40
- properties.inputStyle,
41
- ]),
42
- color: color && color[color.source] || color || '#000000',
43
- disableAlpha: properties.disableAlpha,
44
- onChange: (clr)=>setColor(clr)
45
- ,
46
- onChangeComplete: (clr)=>{
47
- setColor(clr);
48
- methods.setValue(clr);
49
- methods.triggerEvent({
50
- name: 'onChange'
51
- });
52
- }
53
- })
54
- }
55
- }));
56
- };
57
- Selector.defaultProps = blockDefaultProps;
58
- export default Selector;
@@ -1,33 +0,0 @@
1
- /*
2
- Copyright 2020-2021 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ export default {
16
- import: {
17
- block: 'blocks/ChromeColorSelector/ChromeColorSelector.js',
18
- styles: [
19
- 'blocks/ChromeColorSelector/style.less'
20
- ]
21
- },
22
- meta: {
23
- valueType: 'object',
24
- category: 'input',
25
- loading: {
26
- type: 'Skeleton',
27
- properties: {
28
- width: 225,
29
- height: 240
30
- }
31
- }
32
- }
33
- };
@@ -1,99 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "type": "object",
5
- "properties": {
6
- "defaultColor": {
7
- "type": "string",
8
- "description": "Default color to display if input value is null.",
9
- "docs": {
10
- "displayType": "color"
11
- }
12
- },
13
- "disableAlpha": {
14
- "type": "boolean",
15
- "description": "Remove alpha slider and options from picker."
16
- },
17
- "inputStyle": {
18
- "type": "object",
19
- "description": "Css style to applied to input.",
20
- "docs": {
21
- "displayType": "yaml"
22
- }
23
- },
24
- "label": {
25
- "type": "object",
26
- "description": "Label properties.",
27
- "additionalProperties": false,
28
- "properties": {
29
- "align": {
30
- "type": "string",
31
- "enum": ["left", "right"],
32
- "default": "left",
33
- "description": "Align label left or right when inline."
34
- },
35
- "colon": {
36
- "type": "boolean",
37
- "default": true,
38
- "description": "Append label with colon."
39
- },
40
- "extra": {
41
- "type": "string",
42
- "description": "Extra text to display beneath the content."
43
- },
44
- "title": {
45
- "type": "string",
46
- "description": "Label title."
47
- },
48
- "span": {
49
- "type": "number",
50
- "description": "Label inline span."
51
- },
52
- "disabled": {
53
- "type": "boolean",
54
- "default": false,
55
- "description": "Hide input label."
56
- },
57
- "hasFeedback": {
58
- "type": "boolean",
59
- "default": true,
60
- "description": "Display feedback extra from validation, this does not disable validation."
61
- },
62
- "inline": {
63
- "type": "boolean",
64
- "default": false,
65
- "description": "Render input and label inline."
66
- },
67
- "extraStyle": {
68
- "type": "object",
69
- "description": "Css style to applied to label extra.",
70
- "docs": {
71
- "displayType": "yaml"
72
- }
73
- },
74
- "feedbackStyle": {
75
- "type": "object",
76
- "description": "Css style to applied to label feedback.",
77
- "docs": {
78
- "displayType": "yaml"
79
- }
80
- }
81
- }
82
- },
83
- "title": {
84
- "type": "string",
85
- "description": "Title to describe the input component, if no title is specified the block id is displayed."
86
- }
87
- }
88
- },
89
- "events": {
90
- "type": "object",
91
- "additionalProperties": false,
92
- "properties": {
93
- "onChange": {
94
- "type": "array",
95
- "description": "Trigger actions when color is picked."
96
- }
97
- }
98
- }
99
- }