PluginProbe
The Innovative Form Builder – IvyForms / 0.9.1
The Innovative Form Builder – IvyForms v0.9.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / frontend / src / views / _components / input / IvySelectOption.vue

IvySelectOption.vue in The Innovative Form Builder – IvyForms 0.9.1, at frontend/src/views/_components/input/IvySelectOption.vue

147 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <ElOption
3 :class="[
4 'ivyforms-select-option',
5 {
6 'is-secondary': isSecondary,
7 },
8 ]"
9 :value="props.value"
10 :label="props.label"
11 :disabled="disabled"
12 >
13 <div
14 v-if="props.iconStart"
15 class="ivyforms-flex ivyforms-align-items-center ivyforms-flex-1 ivyforms-gap-8"
16 >
17 <IvyIcon
18 :name="props.iconStart"
19 :category="props.iconStartCategory"
20 :type="props.iconStartType"
21 class="ivyforms-select-option__icon-start"
22 size="d"
23 />
24 <slot />
25 </div>
26 <slot v-else />
27 <IvyIcon
28 v-if="props.iconConfig?.name"
29 v-bind="{ ...props.iconConfig, name: props.iconConfig.name }"
30 />
31 </ElOption>
32 </template>
33
34 <script setup lang="ts">
35 import { inject, computed } from 'vue'
36 import IvyIcon from '@/views/_components/icon/IvyIcon.vue'
37 import type { IconCategory } from '@/types/icons/icon-category'
38 import type { IconType } from '@/types/icons/icon-type'
39
40 const props = defineProps<{
41 value: string | number | boolean | object
42 label?: string | number
43 disabled?: boolean
44 fieldType?: string
45 secondary?: boolean
46 iconStart?: string
47 iconStartCategory?: IconCategory
48 iconStartType?: IconType
49 iconConfig?: {
50 name: string
51 type?: IconType
52 category?: IconCategory
53 size?: 'l' | 'd' | 's' | 'xs'
54 class?: string
55 }
56 }>()
57
58 const isSecondary = computed(() => props.secondary || inject('isSecondary', false))
59 </script>
60
61 <style lang="scss">
62 // Select Option
63 .ivyforms-select-option {
64 &.el-select-dropdown__item {
65 white-space: normal;
66 min-height: 36px !important;
67 height: auto !important;
68 padding: 8px;
69 color: var(--map-base-dusk-symbol-2);
70 cursor: pointer;
71 display: flex;
72 align-items: center;
73 justify-content: space-between;
74 margin: 0;
75 font-size: 14px;
76 font-style: normal;
77 font-weight: 400;
78 line-height: 20px;
79
80 h1,
81 h2,
82 h3,
83 h4,
84 h5,
85 h6,
86 p {
87 color: var(--map-base-dusk-symbol-2);
88 }
89
90 .ivyforms-icon__svg.type-line.name-star {
91 path {
92 stroke: var(--map-base-text-0);
93 }
94 }
95
96 &.is-selected {
97 .ivyforms-icon__svg.type-line.name-star {
98 path {
99 stroke: var(--map-base-purple-symbol-0);
100 }
101 }
102
103 background: var(--map-base-brand-o10);
104 color: var(--map-base-dusk-symbol-2);
105 font-size: 14px;
106 font-style: normal;
107 font-weight: 400;
108
109 &.is-secondary {
110 background: var(--map-base-purple-o10);
111 &:after {
112 background-color: var(--map-base-purple-symbol-0) !important;
113 }
114 }
115 }
116
117 &.is-secondary.is-selected {
118 color: var(--map-base-purple-symbol-0) !important;
119 background: var(--map-base-purple-o05) !important;
120 }
121
122 &:hover,
123 &.is-hovering {
124 color: var(--map-base-dusk-symbol-2);
125 background: var(--map-hover);
126 }
127
128 &:first-child {
129 margin-top: 8px !important;
130 }
131
132 &:last-child {
133 margin-bottom: 8px !important;
134 }
135
136 .ivyforms-icon {
137 display: contents;
138 }
139
140 .ivyforms-icon__svg {
141 width: auto;
142 justify-content: start;
143 }
144 }
145 }
146 </style>
147