File tree Expand file tree Collapse file tree
frontend/app/components/ui/controls Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 :class =" classes"
1515 :disabled =" disabled"
1616 style =" width : 100px ;"
17+ @click =" clickInput"
1718 @input =" forceUpdateColor"
1819 >
1920 <textarea
2324 class =" mw-input"
2425 :rows =" rows"
2526 v-bind =" $attrs"
27+ @click =" clickInput"
2628 :disabled =" disabled"
2729 />
2830 <input
5557 :class =" classes"
5658 :type =" type"
5759 :disabled =" disabled"
60+ @click =" clickInput"
5861 :style =" { padding: type == 'range' ? 0 : undefined }"
5962 >
6063 <span v-if =" type == 'range'" class =" text-xl" >{{ vm }}</span >
64+ <slot name =" next-to" />
6165 </m-flex >
6266 <slot v-else />
6367 <label v-if =" isCheckbox && label" :for =" labelId" class =" flex-grow" >
@@ -84,8 +88,9 @@ const props = defineProps<{
8488 type? : string ;
8589 value? : string ;
8690 required? : boolean ;
91+ clickCopy? : boolean ;
8792}>();
88- const emit = defineEmits ([' update:elementRef' ]);
93+ const emit = defineEmits ([' update:elementRef' , ' clickInput ' ]);
8994const vm = defineModel <any >(' modelValue' );
9095const elementRef = defineModel <HTMLInputElement >(' elementRef' );
9196const uniqueId = useId ();
@@ -109,6 +114,13 @@ watch(() => props.validity, val => {
109114 }
110115});
111116
117+ function clickInput(e ) {
118+ emit (' clickInput' , e );
119+ if (props .clickCopy ) {
120+ navigator .clipboard .writeText (vm .value );
121+ }
122+ }
123+
112124// force refresh for firefox
113125function forceUpdateColor(element ) {
114126 vm .value = element .target .value ;
You can’t perform that action at this time.
0 commit comments