@lowdefy/blocks-color-selectors 4.0.0-alpha.7 → 4.0.0-alpha.8
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/README.md +1 -1
- package/dist/blocks/ColorSelector/ColorPicker.js +66 -0
- package/dist/blocks/ColorSelector/ColorSelector.js +18 -15
- package/dist/blocks/ColorSelector/schema.json +8 -33
- package/dist/blocks/ColorSelector/style.less +56 -0
- package/dist/blocks/ColorSelector/useClickOutside.js +46 -0
- package/dist/blocks.js +0 -7
- package/package.json +9 -8
- package/dist/blocks/ChromeColorSelector/ChromeColorSelector.js +0 -75
- package/dist/blocks/ChromeColorSelector/schema.json +0 -99
- package/dist/blocks/ChromeColorSelector/style.less +0 -17
- package/dist/blocks/CircleColorSelector/CircleColorSelector.js +0 -93
- package/dist/blocks/CircleColorSelector/schema.json +0 -156
- package/dist/blocks/CircleColorSelector/style.less +0 -17
- package/dist/blocks/CompactColorSelector/CompactColorSelector.js +0 -71
- package/dist/blocks/CompactColorSelector/schema.json +0 -144
- package/dist/blocks/CompactColorSelector/style.less +0 -17
- package/dist/blocks/GithubColorSelector/GithubColorSelector.js +0 -73
- package/dist/blocks/GithubColorSelector/schema.json +0 -138
- package/dist/blocks/GithubColorSelector/style.less +0 -17
- package/dist/blocks/SliderColorSelector/SliderColorSelector.js +0 -69
- package/dist/blocks/SliderColorSelector/schema.json +0 -96
- package/dist/blocks/SliderColorSelector/style.less +0 -17
- package/dist/blocks/SwatchesColorSelector/SwatchesColorSelector.js +0 -72
- package/dist/blocks/SwatchesColorSelector/schema.json +0 -146
- package/dist/blocks/SwatchesColorSelector/style.less +0 -17
- package/dist/blocks/TwitterColorSelector/TwitterColorSelector.js +0 -66
- package/dist/blocks/TwitterColorSelector/schema.json +0 -125
- package/dist/blocks/TwitterColorSelector/style.less +0 -17
|
@@ -1,69 +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 from 'react';
|
|
17
|
-
import SliderPicker from 'react-color/lib/Slider.js';
|
|
18
|
-
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
import Label from '@lowdefy/blocks-antd/blocks/Label/Label.js';
|
|
20
|
-
const Selector = ({ blockId , loading , methods , properties , required , validation , value })=>{
|
|
21
|
-
return(/*#__PURE__*/ _jsx(Label, {
|
|
22
|
-
blockId: blockId,
|
|
23
|
-
loading: loading,
|
|
24
|
-
methods: methods,
|
|
25
|
-
properties: {
|
|
26
|
-
title: properties.title,
|
|
27
|
-
size: properties.size,
|
|
28
|
-
...properties.label
|
|
29
|
-
},
|
|
30
|
-
required: required,
|
|
31
|
-
validation: validation,
|
|
32
|
-
content: {
|
|
33
|
-
content: ()=>/*#__PURE__*/ _jsx(SliderPicker, {
|
|
34
|
-
id: `${blockId}_input`,
|
|
35
|
-
className: methods.makeCssClass([
|
|
36
|
-
{
|
|
37
|
-
marginBottom: '0px !important'
|
|
38
|
-
},
|
|
39
|
-
properties.inputStyle,
|
|
40
|
-
]),
|
|
41
|
-
color: value || properties.defaultColor || '#000000',
|
|
42
|
-
onChangeComplete: (color)=>{
|
|
43
|
-
methods.setValue(color.hex ? color.hex : '#000000');
|
|
44
|
-
methods.triggerEvent({
|
|
45
|
-
name: 'onChange'
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
}));
|
|
51
|
-
};
|
|
52
|
-
Selector.defaultProps = blockDefaultProps;
|
|
53
|
-
Selector.meta = {
|
|
54
|
-
valueType: 'string',
|
|
55
|
-
category: 'input',
|
|
56
|
-
loading: {
|
|
57
|
-
type: 'Skeleton',
|
|
58
|
-
properties: {
|
|
59
|
-
height: 44
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
icons: [
|
|
63
|
-
...Label.meta.icons
|
|
64
|
-
],
|
|
65
|
-
styles: [
|
|
66
|
-
'blocks/SliderColorSelector/style.less'
|
|
67
|
-
]
|
|
68
|
-
};
|
|
69
|
-
export default Selector;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"properties": {
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"defaultColor": {
|
|
7
|
-
"type": "string",
|
|
8
|
-
"default": "#000000",
|
|
9
|
-
"description": "Default color to display if input value is null.",
|
|
10
|
-
"docs": {
|
|
11
|
-
"displayType": "color"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"inputStyle": {
|
|
15
|
-
"type": "object",
|
|
16
|
-
"description": "Css style to applied to input.",
|
|
17
|
-
"docs": {
|
|
18
|
-
"displayType": "yaml"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"label": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"description": "Label properties.",
|
|
24
|
-
"additionalProperties": false,
|
|
25
|
-
"properties": {
|
|
26
|
-
"align": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"enum": ["left", "right"],
|
|
29
|
-
"default": "left",
|
|
30
|
-
"description": "Align label left or right when inline."
|
|
31
|
-
},
|
|
32
|
-
"colon": {
|
|
33
|
-
"type": "boolean",
|
|
34
|
-
"default": true,
|
|
35
|
-
"description": "Append label with colon."
|
|
36
|
-
},
|
|
37
|
-
"extra": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"description": "Extra text to display beneath the content."
|
|
40
|
-
},
|
|
41
|
-
"title": {
|
|
42
|
-
"type": "string",
|
|
43
|
-
"description": "Label title."
|
|
44
|
-
},
|
|
45
|
-
"span": {
|
|
46
|
-
"type": "number",
|
|
47
|
-
"description": "Label inline span."
|
|
48
|
-
},
|
|
49
|
-
"disabled": {
|
|
50
|
-
"type": "boolean",
|
|
51
|
-
"default": false,
|
|
52
|
-
"description": "Hide input label."
|
|
53
|
-
},
|
|
54
|
-
"hasFeedback": {
|
|
55
|
-
"type": "boolean",
|
|
56
|
-
"default": true,
|
|
57
|
-
"description": "Display feedback extra from validation, this does not disable validation."
|
|
58
|
-
},
|
|
59
|
-
"inline": {
|
|
60
|
-
"type": "boolean",
|
|
61
|
-
"default": false,
|
|
62
|
-
"description": "Render input and label inline."
|
|
63
|
-
},
|
|
64
|
-
"extraStyle": {
|
|
65
|
-
"type": "object",
|
|
66
|
-
"description": "Css style to applied to label extra.",
|
|
67
|
-
"docs": {
|
|
68
|
-
"displayType": "yaml"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"feedbackStyle": {
|
|
72
|
-
"type": "object",
|
|
73
|
-
"description": "Css style to applied to label feedback.",
|
|
74
|
-
"docs": {
|
|
75
|
-
"displayType": "yaml"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"title": {
|
|
81
|
-
"type": "string",
|
|
82
|
-
"description": "Title to describe the input component, if no title is specified the block id is displayed."
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"events": {
|
|
87
|
-
"type": "object",
|
|
88
|
-
"additionalProperties": false,
|
|
89
|
-
"properties": {
|
|
90
|
-
"onChange": {
|
|
91
|
-
"type": "array",
|
|
92
|
-
"description": "Trigger actions when color is picked."
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -1,17 +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
|
-
*/
|
|
16
|
-
|
|
17
|
-
@import '@lowdefy/blocks-antd/blocks/Label/style.less';
|
|
@@ -1,72 +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 from 'react';
|
|
17
|
-
import SwatchesPicker from 'react-color/lib/Swatches.js';
|
|
18
|
-
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
import Label from '@lowdefy/blocks-antd/blocks/Label/Label.js';
|
|
20
|
-
const Selector = ({ blockId , loading , methods , properties , required , validation , value })=>{
|
|
21
|
-
return(/*#__PURE__*/ _jsx(Label, {
|
|
22
|
-
blockId: blockId,
|
|
23
|
-
loading: loading,
|
|
24
|
-
methods: methods,
|
|
25
|
-
properties: {
|
|
26
|
-
title: properties.title,
|
|
27
|
-
size: properties.size,
|
|
28
|
-
...properties.label
|
|
29
|
-
},
|
|
30
|
-
required: required,
|
|
31
|
-
validation: validation,
|
|
32
|
-
content: {
|
|
33
|
-
content: ()=>/*#__PURE__*/ _jsx(SwatchesPicker, {
|
|
34
|
-
id: `${blockId}_input`,
|
|
35
|
-
className: methods.makeCssClass([
|
|
36
|
-
{
|
|
37
|
-
marginBottom: '0px !important'
|
|
38
|
-
},
|
|
39
|
-
properties.inputStyle,
|
|
40
|
-
]),
|
|
41
|
-
color: value || properties.defaultColor || '#000000',
|
|
42
|
-
colors: properties.colors,
|
|
43
|
-
width: properties.width || '100%',
|
|
44
|
-
height: properties.height || '135px',
|
|
45
|
-
onChangeComplete: (color)=>{
|
|
46
|
-
methods.setValue(color.hex ? color.hex : '#000000');
|
|
47
|
-
methods.triggerEvent({
|
|
48
|
-
name: 'onChange'
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
};
|
|
55
|
-
Selector.defaultProps = blockDefaultProps;
|
|
56
|
-
Selector.meta = {
|
|
57
|
-
valueType: 'string',
|
|
58
|
-
category: 'input',
|
|
59
|
-
loading: {
|
|
60
|
-
type: 'Skeleton',
|
|
61
|
-
properties: {
|
|
62
|
-
height: 175
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
icons: [
|
|
66
|
-
...Label.meta.icons
|
|
67
|
-
],
|
|
68
|
-
styles: [
|
|
69
|
-
'blocks/SwatchesColorSelector/style.less'
|
|
70
|
-
]
|
|
71
|
-
};
|
|
72
|
-
export default Selector;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"properties": {
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"colors": {
|
|
7
|
-
"type": "array",
|
|
8
|
-
"description": "List of swatch colors options to display.",
|
|
9
|
-
"items": {
|
|
10
|
-
"type": "array",
|
|
11
|
-
"items": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"docs": {
|
|
14
|
-
"displayType": "color"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"default": [
|
|
19
|
-
["#b71c1c", "#d32f2f", "#f44336", "#e57373", "#ffcdd2"],
|
|
20
|
-
["#880e4f", "#c2185b", "#e91e63", "#f06292", "#f8bbd0"],
|
|
21
|
-
["#4a148c", "#7b1fa2", "#9c27b0", "#ba68c8", "#e1bee7"],
|
|
22
|
-
["#311b92", "#512da8", "#673ab7", "#9575cd", "#d1c4e9"],
|
|
23
|
-
["#1a237e", "#303f9f", "#3f51b5", "#7986cb", "#c5cae9"],
|
|
24
|
-
["#0d47a1", "#1976d2", "#2196f3", "#64b5f6", "#bbdefb"],
|
|
25
|
-
["#01579b", "#0288d1", "#03a9f4", "#4fc3f7", "#b3e5fc"],
|
|
26
|
-
["#006064", "#0097a7", "#00bcd4", "#4dd0e1", "#b2ebf2"],
|
|
27
|
-
["#004d40", "#00796b", "#009688", "#4db6ac", "#b2dfdb"],
|
|
28
|
-
["#194d33", "#388e3c", "#4caf50", "#81c784", "#c8e6c9"],
|
|
29
|
-
["#33691e", "#689f38", "#8bc34a", "#aed581", "#dcedc8"],
|
|
30
|
-
["#827717", "#afb42b", "#cddc39", "#dce775", "#f0f4c3"],
|
|
31
|
-
["#f57f17", "#fbc02d", "#ffeb3b", "#fff176", "#fff9c4"],
|
|
32
|
-
["#ff6f00", "#ffa000", "#ffc107", "#ffd54f", "#ffecb3"],
|
|
33
|
-
["#e65100", "#f57c00", "#ff9800", "#ffb74d", "#ffe0b2"],
|
|
34
|
-
["#bf360c", "#e64a19", "#ff5722", "#ff8a65", "#ffccbc"],
|
|
35
|
-
["#3e2723", "#5d4037", "#795548", "#a1887f", "#d7ccc8"],
|
|
36
|
-
["#263238", "#455a64", "#607d8b", "#90a4ae", "#cfd8dc"],
|
|
37
|
-
["#000000", "#525252", "#969696", "#d9d9d9", "#ffffff"]
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
"defaultColor": {
|
|
41
|
-
"type": "string",
|
|
42
|
-
"default": "#000000",
|
|
43
|
-
"description": "Default color to display if input value is null.",
|
|
44
|
-
"docs": {
|
|
45
|
-
"displayType": "color"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"height": {
|
|
49
|
-
"type": ["string", "number"],
|
|
50
|
-
"description": "Color selector height.",
|
|
51
|
-
"default": "135px",
|
|
52
|
-
"docs": {
|
|
53
|
-
"displayType": "string"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"inputStyle": {
|
|
57
|
-
"type": "object",
|
|
58
|
-
"description": "Css style to applied to input.",
|
|
59
|
-
"docs": {
|
|
60
|
-
"displayType": "yaml"
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"label": {
|
|
64
|
-
"type": "object",
|
|
65
|
-
"description": "Label properties.",
|
|
66
|
-
"additionalProperties": false,
|
|
67
|
-
"properties": {
|
|
68
|
-
"align": {
|
|
69
|
-
"type": "string",
|
|
70
|
-
"enum": ["left", "right"],
|
|
71
|
-
"default": "left",
|
|
72
|
-
"description": "Align label left or right when inline."
|
|
73
|
-
},
|
|
74
|
-
"colon": {
|
|
75
|
-
"type": "boolean",
|
|
76
|
-
"default": true,
|
|
77
|
-
"description": "Append label with colon."
|
|
78
|
-
},
|
|
79
|
-
"extra": {
|
|
80
|
-
"type": "string",
|
|
81
|
-
"description": "Extra text to display beneath the content."
|
|
82
|
-
},
|
|
83
|
-
"title": {
|
|
84
|
-
"type": "string",
|
|
85
|
-
"description": "Label title."
|
|
86
|
-
},
|
|
87
|
-
"span": {
|
|
88
|
-
"type": "number",
|
|
89
|
-
"description": "Label inline span."
|
|
90
|
-
},
|
|
91
|
-
"disabled": {
|
|
92
|
-
"type": "boolean",
|
|
93
|
-
"default": false,
|
|
94
|
-
"description": "Hide input label."
|
|
95
|
-
},
|
|
96
|
-
"hasFeedback": {
|
|
97
|
-
"type": "boolean",
|
|
98
|
-
"default": true,
|
|
99
|
-
"description": "Display feedback extra from validation, this does not disable validation."
|
|
100
|
-
},
|
|
101
|
-
"inline": {
|
|
102
|
-
"type": "boolean",
|
|
103
|
-
"default": false,
|
|
104
|
-
"description": "Render input and label inline."
|
|
105
|
-
},
|
|
106
|
-
"extraStyle": {
|
|
107
|
-
"type": "object",
|
|
108
|
-
"description": "Css style to applied to label extra.",
|
|
109
|
-
"docs": {
|
|
110
|
-
"displayType": "yaml"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"feedbackStyle": {
|
|
114
|
-
"type": "object",
|
|
115
|
-
"description": "Css style to applied to label feedback.",
|
|
116
|
-
"docs": {
|
|
117
|
-
"displayType": "yaml"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
"title": {
|
|
123
|
-
"type": "string",
|
|
124
|
-
"description": "Title to describe the input component, if no title is specified the block id is displayed."
|
|
125
|
-
},
|
|
126
|
-
"width": {
|
|
127
|
-
"type": ["string", "number"],
|
|
128
|
-
"description": "Color selector width.",
|
|
129
|
-
"default": "100%",
|
|
130
|
-
"docs": {
|
|
131
|
-
"displayType": "string"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"events": {
|
|
137
|
-
"type": "object",
|
|
138
|
-
"additionalProperties": false,
|
|
139
|
-
"properties": {
|
|
140
|
-
"onChange": {
|
|
141
|
-
"type": "array",
|
|
142
|
-
"description": "Trigger actions when color is picked."
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
@@ -1,17 +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
|
-
*/
|
|
16
|
-
|
|
17
|
-
@import '@lowdefy/blocks-antd/blocks/Label/style.less';
|
|
@@ -1,66 +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 from 'react';
|
|
17
|
-
import TwitterPicker from 'react-color/lib/Twitter.js';
|
|
18
|
-
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
import Label from '@lowdefy/blocks-antd/blocks/Label/Label.js';
|
|
20
|
-
const Selector = ({ blockId , loading , methods , properties , required , validation , value })=>{
|
|
21
|
-
return(/*#__PURE__*/ _jsx(Label, {
|
|
22
|
-
blockId: blockId,
|
|
23
|
-
loading: loading,
|
|
24
|
-
methods: methods,
|
|
25
|
-
properties: {
|
|
26
|
-
title: properties.title,
|
|
27
|
-
size: properties.size,
|
|
28
|
-
...properties.label
|
|
29
|
-
},
|
|
30
|
-
required: required,
|
|
31
|
-
validation: validation,
|
|
32
|
-
content: {
|
|
33
|
-
content: ()=>/*#__PURE__*/ _jsx(TwitterPicker, {
|
|
34
|
-
id: `${blockId}_input`,
|
|
35
|
-
color: value || properties.defaultColor || '#000000',
|
|
36
|
-
colors: properties.colors,
|
|
37
|
-
triangle: properties.triangle || 'hide',
|
|
38
|
-
width: properties.width || '100%',
|
|
39
|
-
onChangeComplete: (color)=>{
|
|
40
|
-
methods.setValue(color.hex ? color.hex : '#000000');
|
|
41
|
-
methods.triggerEvent({
|
|
42
|
-
name: 'onChange'
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
}));
|
|
48
|
-
};
|
|
49
|
-
Selector.defaultProps = blockDefaultProps;
|
|
50
|
-
Selector.meta = {
|
|
51
|
-
valueType: 'string',
|
|
52
|
-
category: 'input',
|
|
53
|
-
loading: {
|
|
54
|
-
type: 'Skeleton',
|
|
55
|
-
properties: {
|
|
56
|
-
height: 96
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
icons: [
|
|
60
|
-
...Label.meta.icons
|
|
61
|
-
],
|
|
62
|
-
styles: [
|
|
63
|
-
'blocks/TwitterColorSelector/style.less'
|
|
64
|
-
]
|
|
65
|
-
};
|
|
66
|
-
export default Selector;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"properties": {
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"colors": {
|
|
7
|
-
"type": "array",
|
|
8
|
-
"description": "Colors to display.",
|
|
9
|
-
"default": [
|
|
10
|
-
"#FF6900",
|
|
11
|
-
"#FCB900",
|
|
12
|
-
"#7BDCB5",
|
|
13
|
-
"#00D084",
|
|
14
|
-
"#8ED1FC",
|
|
15
|
-
"#0693E3",
|
|
16
|
-
"#ABB8C3",
|
|
17
|
-
"#EB144C",
|
|
18
|
-
"#F78DA7",
|
|
19
|
-
"#9900EF"
|
|
20
|
-
],
|
|
21
|
-
"items": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"docs": {
|
|
24
|
-
"displayType": "color"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"defaultColor": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"default": "#000000",
|
|
31
|
-
"description": "Default color to display if input value is null.",
|
|
32
|
-
"docs": {
|
|
33
|
-
"displayType": "color"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"label": {
|
|
37
|
-
"type": "object",
|
|
38
|
-
"description": "Label properties.",
|
|
39
|
-
"additionalProperties": false,
|
|
40
|
-
"properties": {
|
|
41
|
-
"align": {
|
|
42
|
-
"type": "string",
|
|
43
|
-
"enum": ["left", "right"],
|
|
44
|
-
"default": "left",
|
|
45
|
-
"description": "Align label left or right when inline."
|
|
46
|
-
},
|
|
47
|
-
"colon": {
|
|
48
|
-
"type": "boolean",
|
|
49
|
-
"default": true,
|
|
50
|
-
"description": "Append label with colon."
|
|
51
|
-
},
|
|
52
|
-
"extra": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"description": "Extra text to display beneath the content."
|
|
55
|
-
},
|
|
56
|
-
"title": {
|
|
57
|
-
"type": "string",
|
|
58
|
-
"description": "Label title."
|
|
59
|
-
},
|
|
60
|
-
"span": {
|
|
61
|
-
"type": "number",
|
|
62
|
-
"description": "Label inline span."
|
|
63
|
-
},
|
|
64
|
-
"disabled": {
|
|
65
|
-
"type": "boolean",
|
|
66
|
-
"default": false,
|
|
67
|
-
"description": "Hide input label."
|
|
68
|
-
},
|
|
69
|
-
"hasFeedback": {
|
|
70
|
-
"type": "boolean",
|
|
71
|
-
"default": true,
|
|
72
|
-
"description": "Display feedback extra from validation, this does not disable validation."
|
|
73
|
-
},
|
|
74
|
-
"inline": {
|
|
75
|
-
"type": "boolean",
|
|
76
|
-
"default": false,
|
|
77
|
-
"description": "Render input and label inline."
|
|
78
|
-
},
|
|
79
|
-
"extraStyle": {
|
|
80
|
-
"type": "object",
|
|
81
|
-
"description": "Css style to applied to label extra.",
|
|
82
|
-
"docs": {
|
|
83
|
-
"displayType": "yaml"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"feedbackStyle": {
|
|
87
|
-
"type": "object",
|
|
88
|
-
"description": "Css style to applied to label feedback.",
|
|
89
|
-
"docs": {
|
|
90
|
-
"displayType": "yaml"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"title": {
|
|
96
|
-
"type": "string",
|
|
97
|
-
"description": "Title to describe the input component, if no title is specified the block id is displayed."
|
|
98
|
-
},
|
|
99
|
-
"triangle": {
|
|
100
|
-
"type": "string",
|
|
101
|
-
"enum": ["hide", "top-left", "top-right"],
|
|
102
|
-
"default": "hide",
|
|
103
|
-
"description": "Show triangle on color selector border."
|
|
104
|
-
},
|
|
105
|
-
"width": {
|
|
106
|
-
"type": ["string", "number"],
|
|
107
|
-
"description": "Color selector width.",
|
|
108
|
-
"default": "100%",
|
|
109
|
-
"docs": {
|
|
110
|
-
"displayType": "string"
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"events": {
|
|
116
|
-
"type": "object",
|
|
117
|
-
"additionalProperties": false,
|
|
118
|
-
"properties": {
|
|
119
|
-
"onChange": {
|
|
120
|
-
"type": "array",
|
|
121
|
-
"description": "Trigger actions when color is picked."
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
@@ -1,17 +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
|
-
*/
|
|
16
|
-
|
|
17
|
-
@import '@lowdefy/blocks-antd/blocks/Label/style.less';
|