[feat] Add WidgetToggleSwitch Vue component

- New WidgetToggleSwitch component for boolean values
- Added export to vueWidgets index
This commit is contained in:
Benjamin Lu
2025-07-01 13:49:11 -04:00
parent 56f59103a5
commit 36955407e7
2 changed files with 48 additions and 1 deletions

View File

@@ -3,7 +3,27 @@
<label v-if="widget.name" class="text-sm opacity-80">{{
widget.name
}}</label>
<ToggleSwitch v-model="value" v-bind="filteredProps" :disabled="readonly" />
<ToggleSwitch
v-model="value"
v-bind="filteredProps"
:disabled="readonly"
:pt="{
root: {
class:
'hover:outline hover:outline-1 hover:outline-[#5B5E7D] rounded-full'
},
slider: ({ props }) => ({
style: {
backgroundColor: props.modelValue ? '#0b8ce9' : '#0e0e12'
}
}),
handle: ({ props }) => ({
style: {
backgroundColor: props.modelValue ? '#ffffff' : '#5b5e7d'
}
})
}"
/>
</div>
</template>

View File

@@ -0,0 +1,27 @@
/**
* Central export file for all Vue widget components and utilities
*/
// Widget Components
export { default as WidgetButton } from './WidgetButton.vue'
export { default as WidgetChart } from './WidgetChart.vue'
export { default as WidgetColorPicker } from './WidgetColorPicker.vue'
export { default as WidgetFileUpload } from './WidgetFileUpload.vue'
export { default as WidgetGalleria } from './WidgetGalleria.vue'
export { default as WidgetImage } from './WidgetImage.vue'
export { default as WidgetImageCompare } from './WidgetImageCompare.vue'
export { default as WidgetInputText } from './WidgetInputText.vue'
export { default as WidgetMultiSelect } from './WidgetMultiSelect.vue'
export { default as WidgetSelect } from './WidgetSelect.vue'
export { default as WidgetSelectButton } from './WidgetSelectButton.vue'
export { default as WidgetSlider } from './WidgetSlider.vue'
export { default as WidgetTextarea } from './WidgetTextarea.vue'
export { default as WidgetToggleSwitch } from './WidgetToggleSwitch.vue'
export { default as WidgetTreeSelect } from './WidgetTreeSelect.vue'
// Registry and Utilities
export {
WidgetType,
widgetTypeToComponent,
getWidgetComponent
} from './widgetRegistry'