Skip to content

Commit c5af9e9

Browse files
ssemenkoffstbischof
authored andcommitted
Created variable inputs for the majority of widgts
1 parent 79f8350 commit c5af9e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1562
-939
lines changed

packages/app/default/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"scripts": {
1515
"dev": "vite --port 5174",
16-
"dev:host": "vite --port 5174",
16+
"dev:host": "vite --port 5174 --host",
1717
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build",
1818
"build:prod": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build && npm run minify",
1919
"minify": "for file in dist/assets/*.js; do terser \"$file\" -c -m --module -o \"${file%.js}.min.js\" && mv \"${file%.js}.min.js\" \"$file\"; done",

packages/ui/vue/composer/datatable/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"devDependencies": {
3535
"inversify": "7.11.0",
3636
"typescript": "^5.8.2",
37-
3837
"vite-plugin-dts": "4.5.4",
3938
"@types/lodash": "^4.17.16"
4039
},

packages/ui/vue/variable/components/src/VariableInput.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { VariableWrapper } from 'org.eclipse.daanse.board.app.ui.vue.composables
2121
const options = ref([] as Array<VariableOption>);
2222
const model = defineModel<VariableWrapper<any>>({ required: true });
2323
const props = defineProps<{ label?: string }>();
24+
console.log(model.value);
2425
2526
interface VariableOption {
2627
label: string;
@@ -55,6 +56,7 @@ const getVariableValue = (name: string) => {
5556
}
5657
5758
const onChange = (e: any) => {
59+
console.log('onChange triggered', e)
5860
if (model.value) {
5961
model.value.value = e.target.value;
6062
}

packages/ui/vue/widget/icon/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"dependencies": {
2727
"org.eclipse.daanse.board.app.lib.repository.widget": "0.0.1-next.1",
2828
"org.eclipse.daanse.board.app.ui.vue.composables": "0.0.1-next.1",
29+
"org.eclipse.daanse.board.app.ui.vue.variable.components": "0.0.1-next.1",
2930
"org.eclipse.daanse.board.app.ui.vue.plugins.i18next": "0.0.1-next.1",
3031
"org.eclipse.daanse.board.app.lib.annotations": "0.0.1-next.1"
3132
},

packages/ui/vue/widget/icon/src/IconWidget.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Contributors:
1212
-->
1313
<script lang="ts" setup>
1414
import { computed, onMounted, toRefs } from "vue";
15-
import { useVariableRepository } from "org.eclipse.daanse.board.app.ui.vue.composables"
15+
import { useVariableRepository, VariableWrapper } from "org.eclipse.daanse.board.app.ui.vue.composables"
1616
import { IconSettings } from './gen/IconSettings'
1717
import { container, identifiers } from 'org.eclipse.daanse.board.app.lib.core'
1818
import type { TinyEmitter } from 'tiny-emitter'
@@ -32,6 +32,17 @@ const eventBus = container.get<TinyEmitter>(identifiers.TINY_EMITTER);
3232
onMounted(() => {
3333
if (config.value) {
3434
Object.assign(config.value, { ...defaultConfig, ...config.value });
35+
36+
if (!((config.value.iconColor as any) instanceof VariableWrapper)) {
37+
const current = config.value.iconColor;
38+
if (typeof current === 'object' && current !== null && 'value' in current) {
39+
const v = new VariableWrapper((current as any).value);
40+
if ('variable' in current) v.variable = (current as any).variable;
41+
(config.value as any).iconColor = v;
42+
} else {
43+
(config.value as any).iconColor = new VariableWrapper((current as string) || '#000000');
44+
}
45+
}
3546
}
3647
});
3748
@@ -57,7 +68,7 @@ const {
5768
iconColor,
5869
iconSize,
5970
} = wrapParameters({
60-
iconColor: computed(() => config.value.iconColor),
71+
iconColor: computed(() => (config.value.iconColor as any)?.value || '#000000'),
6172
iconSize: computed(() => config.value.iconSize),
6273
});
6374

packages/ui/vue/widget/icon/src/IconWidgetSettings.vue

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ Contributors:
1212
-->
1313
<script lang="ts" setup>
1414
import type { IIconSettings } from './index'
15-
import { computed, inject, onMounted, ref, type Ref } from 'vue'
15+
import { computed, inject, onMounted, ref, type Ref, watch, markRaw } from 'vue'
1616
import MaterialIcons from './assets/output.json'
17+
import { VariableInput } from 'org.eclipse.daanse.board.app.ui.vue.variable.components'
18+
import { VariableWrapper } from 'org.eclipse.daanse.board.app.ui.vue.composables'
1719
1820
// interface MaterialIcon {
1921
// name: string;
@@ -58,6 +60,14 @@ onMounted(() => {
5860
iconsList.value = MaterialIcons
5961
})
6062
63+
watch(() => widgetSettings.value, (newVal) => {
64+
if (newVal) {
65+
if (!(newVal.iconColor instanceof VariableWrapper)) {
66+
newVal.iconColor = markRaw(new VariableWrapper<string>((newVal.iconColor as string) || '#000000'));
67+
}
68+
}
69+
}, { immediate: true, deep: true });
70+
6171
const fontColor = computed(() => {
6272
return isDarkTheme.value ? '#ffffff' : ''
6373
})
@@ -90,10 +100,15 @@ const iconStyle = computed(() => {
90100
v-model="widgetSettings.isIconFilled"
91101
:label="t('icon:IconWidget.iconFilled')"
92102
/>
93-
<va-color-input
94-
v-model="widgetSettings.iconColor"
95-
:label="t('icon:IconWidget.iconColor')"
96-
/>
103+
<VariableInput v-model="(widgetSettings.iconColor as unknown as VariableWrapper<string>)" :label="t('icon:IconWidget.iconColor')">
104+
<template #default="{ value, change }">
105+
<va-color-input
106+
:model-value="value"
107+
@input="change"
108+
:label="t('icon:IconWidget.iconColor')"
109+
/>
110+
</template>
111+
</VariableInput>
97112
<va-slider
98113
class="slider"
99114
v-model="widgetSettings.iconSize"

packages/ui/vue/widget/icon/src/index.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,16 @@ import { container } from 'org.eclipse.daanse.board.app.lib.core'
1919
import { EventRegistry, EVENT_REGISTRY } from 'org.eclipse.daanse.board.app.lib.events'
2020
import { IconWidgetEvents } from './events/IconWidgetEvents'
2121

22-
interface Variable<T> {
23-
name: string
24-
value: T
25-
}
22+
import { VariableWrapper } from 'org.eclipse.daanse.board.app.ui.vue.composables'
2623

2724
interface IIconSettings {
28-
currentIcon: string | Variable<string>
29-
iconColor: string | Variable<string>
30-
iconSize: number | Variable<number>
31-
isIconFilled: boolean | Variable<boolean>
32-
strokeWeight: number | Variable<number>
33-
opticSize: number | Variable<number>
34-
grade: number | Variable<number>
25+
currentIcon: string;
26+
iconColor: string | VariableWrapper<string>;
27+
iconSize: number;
28+
isIconFilled: boolean;
29+
strokeWeight: number;
30+
opticSize: number;
31+
grade: number;
3532
}
3633

3734
const register = () => {

packages/ui/vue/widget/progress/model/model.ecore

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,34 @@
3434
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
3535
<details key="documentation" value="Represents the visual settings for a progress indicator or bar."/>
3636
</eAnnotations>
37-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="progress" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="">
37+
<eStructuralFeatures xsi:type="ecore:EReference" name="progress" containment="false" defaultValueLiteral="">
38+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
39+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
40+
</eGenericType>
3841
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
3942
<details key="documentation" value="The current progress value, potentially as a percentage or numeric string."/>
4043
</eAnnotations>
4144
</eStructuralFeatures>
42-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="fillColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="#00FF00">
45+
<eStructuralFeatures xsi:type="ecore:EReference" name="fillColor" containment="false" defaultValueLiteral="#00FF00">
46+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
47+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
48+
</eGenericType>
4349
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
4450
<details key="documentation" value="The color representing the filled portion of the progress bar."/>
4551
</eAnnotations>
4652
</eStructuralFeatures>
47-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="gradientColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
48-
lowerBound="0" defaultValueLiteral="">
53+
<eStructuralFeatures xsi:type="ecore:EReference" name="gradientColor" containment="false" lowerBound="0" defaultValueLiteral="">
54+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
55+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
56+
</eGenericType>
4957
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
5058
<details key="documentation" value="An optional secondary color used if a gradient fill is enabled for the progress bar."/>
5159
</eAnnotations>
5260
</eStructuralFeatures>
53-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="backgroundColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="#D3D3D3">
61+
<eStructuralFeatures xsi:type="ecore:EReference" name="backgroundColor" containment="false" defaultValueLiteral="#D3D3D3">
62+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
63+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
64+
</eGenericType>
5465
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
5566
<details key="documentation" value="The background color of the progress bar, representing the unfilled portion."/>
5667
</eAnnotations>
@@ -65,32 +76,50 @@
6576
<details key="documentation" value="A flag indicating whether the progress bar is oriented vertically."/>
6677
</eAnnotations>
6778
</eStructuralFeatures>
68-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="rotation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="90">
79+
<eStructuralFeatures xsi:type="ecore:EReference" name="rotation" containment="false" defaultValueLiteral="90">
80+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
81+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
82+
</eGenericType>
6983
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
7084
<details key="documentation" value="The rotation angle of the progress bar in degrees."/>
7185
</eAnnotations>
7286
</eStructuralFeatures>
73-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="min" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="0">
87+
<eStructuralFeatures xsi:type="ecore:EReference" name="min" containment="false" defaultValueLiteral="0">
88+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
89+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
90+
</eGenericType>
7491
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
7592
<details key="documentation" value="The minimum value for the progress bar."/>
7693
</eAnnotations>
7794
</eStructuralFeatures>
78-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="max" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="100">
95+
<eStructuralFeatures xsi:type="ecore:EReference" name="max" containment="false" defaultValueLiteral="100">
96+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
97+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
98+
</eGenericType>
7999
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
80100
<details key="documentation" value="The maximum value for the progress bar."/>
81101
</eAnnotations>
82102
</eStructuralFeatures>
83-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="textColor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="#000000">
103+
<eStructuralFeatures xsi:type="ecore:EReference" name="textColor" containment="false" defaultValueLiteral="#000000">
104+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
105+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
106+
</eGenericType>
84107
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
85108
<details key="documentation" value="The color of the text displayed on the progress bar."/>
86109
</eAnnotations>
87110
</eStructuralFeatures>
88-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="barThickness" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="20px">
111+
<eStructuralFeatures xsi:type="ecore:EReference" name="barThickness" containment="false" defaultValueLiteral="20px">
112+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
113+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
114+
</eGenericType>
89115
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
90116
<details key="documentation" value="The thickness of the progress bar (e.g., '20px')."/>
91117
</eAnnotations>
92118
</eStructuralFeatures>
93-
<eStructuralFeatures xsi:type="ecore:EAttribute" name="borderRadius" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="0px">
119+
<eStructuralFeatures xsi:type="ecore:EReference" name="borderRadius" containment="false" defaultValueLiteral="0px">
120+
<eGenericType eClassifier="org.eclipse.daanse.board.app.ui.vue.composables#//VariableWrapper">
121+
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
122+
</eGenericType>
94123
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
95124
<details key="documentation" value="The border radius of the progress bar (e.g., '10px')."/>
96125
</eAnnotations>

packages/ui/vue/widget/progress/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"org.eclipse.daanse.board.app.lib.utils.helpers": "0.0.1-next.1",
2929
"org.eclipse.daanse.board.app.ui.vue.plugins.i18next": "0.0.1-next.1",
3030
"org.eclipse.daanse.board.app.lib.annotations": "0.0.1-next.1",
31-
"org.eclipse.daanse.board.app.ui.vue.composables": "^0.0.1-next.1"
31+
"org.eclipse.daanse.board.app.ui.vue.composables": "0.0.1-next.1",
32+
"org.eclipse.daanse.board.app.ui.vue.variable.components": "0.0.1-next.1"
3233
},
3334
"devDependencies": {
3435
"@types/node": "^25.0.8",

0 commit comments

Comments
 (0)