Skip to content

Commit

Permalink
Merge branch 'master' into issue-71
Browse files Browse the repository at this point in the history
Signed-off-by: Bluefox <[email protected]>
  • Loading branch information
GermanBluefox authored Nov 9, 2023
2 parents a11fed0 + 7d2122d commit eabebf3
Show file tree
Hide file tree
Showing 21 changed files with 479 additions and 108 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,14 @@ E.g., if it was used in a menu and the menu is red, the circle would be red.
* (foxriver76) fixed problem while editing groups
* (foxriver76) do not automatically format button text as uppercase
* (foxriver76) do not automatically show page names as uppercase
* (bluefox) Implemented the signal icons for React widgets
* (bluefox) Implemented the last change indication for React widgets

### 2.4.0 (2023-11-08)
* (foxriver76) fixed issues with icon selector filter when changing category
* (foxriver76) fixed problem, that only first widget is pasted
* (foxriver76) fixed problem, that only the first widget is pasted
* (bluefox) added JSON binding operator
* (bluefox) Allowed to use function as filter for Object ID
* (bluefox) Allowed using function as filter for Object ID
* (bluefox) Implemented View bar (with no menu)

### 2.3.6 (2023-11-06)
Expand Down
9 changes: 3 additions & 6 deletions src/public/lib/js/visEditWords.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/src/Attributes/Widget/WidgetField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,8 @@ const WidgetField = props => {
onInputChange={(e, inputValue) => change(inputValue)}
onChange={(e, inputValue) => change(inputValue)}
classes={{ input: Utils.clsx(props.classes.clearPadding, props.classes.fieldContent) }}
renderOption={field.name === 'font-family' ?
(optionProps, option) => (
<div style={{ fontFamily: option }} {...optionProps}>{option}</div>) : null}
renderOption={field.name === 'font-family' || field.type === 'lc-font-family' ?
(optionProps, option) => <div style={{ fontFamily: option }} {...optionProps}>{option}</div> : null}
renderInput={params => <TextField
variant="standard"
error={!!error}
Expand Down
96 changes: 54 additions & 42 deletions src/src/Attributes/Widget/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,48 +288,58 @@ class Widget extends Component {
];
}

static getSignals(count, adapterName) {
static getSignals(count /* , adapterName */) {
const result = {
name: 'signals',
fields: [
{
name: 'signals-count',
label: 'signals-count',
type: 'select',
noTranslation: true,
options: ['1', '2', '3'],
default: '1',
// noTranslation: true,
options: ['0', '1', '2', '3'],
default: '0',
immediateChange: true,
},
],
};

for (let i = 0; i < count; i++) {
result.fields = result.fields.concat([
{ type: 'delimiter' },
{ name: `signals-oid-${i}`, type: 'id' },
{
name: `signals-cond-${i}`,
type: 'select',
noTranslation: true,
options: ['==', '!=', '<=', '>=', '<', '>', 'consist', 'not consist', 'exist', 'not exist'],
default: '==',
},
{ name: `signals-val-${i}`, default: true },
{ name: `signals-icon-${i}`, type: 'image', default: `${adapterName}/signals/lowbattery.png` },
{
name: `signals-icon-size-${i}`, type: 'slider', options: { min: 1, max: 120, step: 1 }, default: 0,
name: `signals-icon-${i}`, type: 'image', default: '', hidden: `!!data["signals-smallIcon-${i}"]`, // `${adapterName}/signals/lowbattery.png` },
},
{
name: `signals-smallIcon-${i}`, type: 'icon64', default: '', label: `signals-smallIcon-${i}`, hidden: `!!data["signals-icon-${i}"]`,
},
{
name: `signals-color-${i}`, type: 'color', default: '', hidden: `!data["signals-smallIcon-${i}"] && !data["signals-text-${i}"]`,
}, // `${adapterName}/signals/lowbattery.png` },
{
name: `signals-icon-size-${i}`, type: 'slider', min: 1, max: 120, step: 1, default: 0,
},
{ name: `signals-icon-style-${i}` },
{ name: `signals-text-${i}` },
{ name: `signals-text-style-${i}` },
{ name: `signals-text-class-${i}` },
{ name: `signals-blink-${i}`, type: 'checkbox', default: false },
{
name: `signals-horz-${i}`, type: 'slider', options: { min: -20, max: 120, step: 1 }, default: 0,
name: `signals-horz-${i}`, type: 'slider', min: -20, max: 120, step: 1, default: 0,
},
{
name: `signals-vert-${i}`, type: 'slider', options: { min: -20, max: 120, step: 1 }, default: 0,
name: `signals-vert-${i}`, type: 'slider', min: -20, max: 120, step: 1, default: 0,
},
{ name: `signals-hide-edit-${i}`, type: 'checkbox', default: false },
{ type: 'delimiter' },
]);
}

Expand Down Expand Up @@ -417,33 +427,33 @@ class Widget extends Component {
{ name: 'margin-right' },
{ name: 'margin-bottom' }],
},
{
name: 'gestures',
fields: [
{
name: 'gestures-indicator',
type: 'auto',
options: Object.keys(widgets).filter(wid => widgets[wid].tpl === 'tplValueGesture'),
},
{ name: 'gestures-offsetX', default: 0, type: 'number' },
{ name: 'gestures-offsetY', default: 0, type: 'number' },
{ type: 'delimiter' },
...(['swiping', 'rotating', 'pinching'].flatMap(gesture => [
{ name: `gestures-${gesture}-oid`, type: 'id' },
{ name: `gestures-${gesture}-value`, default: '' },
{ name: `gestures-${gesture}-minimum`, type: 'number' },
{ name: `gestures-${gesture}-maximum`, type: 'number' },
{ name: `gestures-${gesture}-delta`, type: 'number' },
{ type: 'delimiter' },
])),
...(['swipeRight', 'swipeLeft', 'swipeUp', 'swipeDown', 'rotateLeft', 'rotateRight', 'pinchIn', 'pinchOut'].flatMap(gesture => [
{ name: `gestures-${gesture}-oid`, type: 'id' },
{ name: `gestures-${gesture}-value`, default: '' },
{ name: `gestures-${gesture}-limit`, type: 'number' },
{ type: 'delimiter' },
])),
],
},
// {
// name: 'gestures',
// fields: [
// {
// name: 'gestures-indicator',
// type: 'auto',
// options: Object.keys(widgets).filter(wid => widgets[wid].tpl === 'tplValueGesture'),
// },
// { name: 'gestures-offsetX', default: 0, type: 'number' },
// { name: 'gestures-offsetY', default: 0, type: 'number' },
// { type: 'delimiter' },
// ...(['swiping', 'rotating', 'pinching'].flatMap(gesture => [
// { name: `gestures-${gesture}-oid`, type: 'id' },
// { name: `gestures-${gesture}-value`, default: '' },
// { name: `gestures-${gesture}-minimum`, type: 'number' },
// { name: `gestures-${gesture}-maximum`, type: 'number' },
// { name: `gestures-${gesture}-delta`, type: 'number' },
// { type: 'delimiter' },
// ])),
// ...(['swipeRight', 'swipeLeft', 'swipeUp', 'swipeDown', 'rotateLeft', 'rotateRight', 'pinchIn', 'pinchOut'].flatMap(gesture => [
// { name: `gestures-${gesture}-oid`, type: 'id' },
// { name: `gestures-${gesture}-value`, default: '' },
// { name: `gestures-${gesture}-limit`, type: 'number' },
// { type: 'delimiter' },
// ])),
// ],
// },
{
name: 'last_change',
fields: [
Expand All @@ -463,15 +473,17 @@ class Widget extends Component {
name: 'lc-position-horz', type: 'select', options: ['left', /* 'middle', */'right'], default: 'right',
},
{
name: 'lc-offset-vert', type: 'slider', options: { min: -120, max: 120, step: 1 }, default: 0,
name: 'lc-offset-vert', type: 'slider', min: -120, max: 120, step: 1, default: 0,
},
{
name: 'lc-offset-horz', type: 'slider', options: { min: -120, max: 120, step: 1 }, default: 0,
name: 'lc-offset-horz', type: 'slider', min: -120, max: 120, step: 1, default: 0,
},
{
name: 'lc-font-size', type: 'auto', options: ['', 'medium', 'xx-small', 'x-small', 'small', 'large', 'x-large', 'xx-large', 'smaller', 'larger', 'initial', 'inherit'], default: '12px',
},
{ name: 'lc-font-family', type: 'fontname', default: '' },
{
name: 'lc-font-family', type: 'auto', default: '', options: fonts,
},
{
name: 'lc-font-style', type: 'auto', options: ['', 'normal', 'italic', 'oblique', 'initial', 'inherit'], default: '',
},
Expand All @@ -483,11 +495,11 @@ class Widget extends Component {
},
{ name: 'lc-border-color', type: 'color', default: '' },
{
name: 'lc-border-radius', type: 'slider', options: { min: 0, max: 20, step: 1 }, default: 10,
name: 'lc-border-radius', type: 'slider', min: 0, max: 20, step: 1, default: 10,
},
{ name: 'lc-padding' },
{ name: 'lc-padding', type: 'slider', min: 0, max: 20, step: 1, default: 3 },
{
name: 'lc-zindex', type: 'slider', options: { min: -10, max: 20, step: 1 }, default: 0,
name: 'lc-zindex', type: 'slider', min: -10, max: 20, step: 1, default: 0,
},
],
},
Expand Down
Loading

0 comments on commit eabebf3

Please sign in to comment.