PluginProbe
The Innovative Form Builder – IvyForms / 1.1.1
The Innovative Form Builder – IvyForms v1.1.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 1.1.1, at frontend/src/views/_components/input/IvySelectOption.vue

150 lines 3.3 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(--ivyforms-select-option-selected-text, var(--map-base-purple-symbol-0));
100 }
101 }
102
103 background: var(--ivyforms-select-option-selected-bg, var(--map-base-brand-o10));
104 color: var(--ivyforms-select-option-selected-text, var(--map-base-dusk-symbol-2));
105 font-size: 14px;
106 font-style: normal;
107 font-weight: 400;
108 }
109
110 &.is-secondary.is-selected {
111 color: var(
112 --ivyforms-select-option-selected-text,
113 var(--map-base-purple-symbol-0)
114 ) !important;
115 background: var(--ivyforms-select-option-selected-bg, var(--map-base-purple-o05)) !important;
116
117 &:after {
118 background-color: var(
119 --ivyforms-select-option-selected-text,
120 var(--map-base-purple-symbol-0)
121 ) !important;
122 }
123 }
124
125 &:hover,
126 &.is-hovering {
127 color: var(--map-base-dusk-symbol-2);
128 background: var(--map-hover);
129 }
130
131 &:first-child {
132 margin-top: 8px !important;
133 }
134
135 &:last-child {
136 margin-bottom: 8px !important;
137 }
138
139 .ivyforms-icon {
140 display: contents;
141 }
142
143 .ivyforms-icon__svg {
144 width: auto;
145 justify-content: start;
146 }
147 }
148 }
149 </style>
150