@onsvisual/svelte-components 0.1.87 → 0.1.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
export let id = "autocomplete";
|
|
16
16
|
export let label = "Select an option";
|
|
17
17
|
export let hideLabel = false;
|
|
18
|
-
export let mode = "
|
|
18
|
+
export let mode = "default";
|
|
19
19
|
export let clearable = true;
|
|
20
20
|
export let autoClear = false;
|
|
21
21
|
export let placeholder = mode === "search" ? "Enter text" : "Select one";
|
|
@@ -94,29 +94,31 @@
|
|
|
94
94
|
/>
|
|
95
95
|
</svelte:head>
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
<div
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
97
|
+
<div class="ons-field">
|
|
98
|
+
{#if label}<label for="{id}" class="ons-label" class:ons-u-vh="{hideLabel}">{label}</label>{/if}
|
|
99
|
+
<div class="ons-autocomplete-wrapper">
|
|
100
|
+
<div
|
|
101
|
+
id="{id}-container"
|
|
102
|
+
class="ons-autocomplete"
|
|
103
|
+
class:hide-menu="{hideMenu}"
|
|
104
|
+
use:initAutocomplete
|
|
105
|
+
></div>
|
|
106
|
+
{#if clearable && !autoClear && value}
|
|
107
|
+
<button
|
|
108
|
+
title="Clear selection"
|
|
109
|
+
aria-label="Clear selection"
|
|
110
|
+
on:click="{clearInput}"
|
|
111
|
+
class="ons-autocomplete-clear"
|
|
112
|
+
>
|
|
113
|
+
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 14 14" width="18">
|
|
114
|
+
<path
|
|
115
|
+
fill="currentColor"
|
|
116
|
+
d="M13.6 1 l -0.71 -0.71 a 0.5 0.5 0 0 0 -0.71 0 l -5.25 5.25 l -5.25 -5.25 a 0.51 0.51 0 0 0 -0.71 0 l -0.71 0.71 a 0.5 0.5 0 0 0 0 0.71 l 5.25 5.25 l -5.25 5.25 a 0.5 0.5 0 0 0 0 0.71 l 0.71 0.71 a 0.5 0.5 0 0 0 0.71 0 l 5.25 -5.25 l 5.25 5.25 a 0.5 0.5 0 0 0 0.71 0 l 0.71 -0.71 a 0.5 0.5 0 0 0 0 -0.71 l -5.25 -5.25 l 5.25 -5.25 a 0.5 0.5 0 0 0 0 -0.71Z"
|
|
117
|
+
></path>
|
|
118
|
+
</svg>
|
|
119
|
+
</button>
|
|
120
|
+
{/if}
|
|
121
|
+
</div>
|
|
120
122
|
</div>
|
|
121
123
|
|
|
122
124
|
<style>
|
|
@@ -143,7 +145,7 @@
|
|
|
143
145
|
display: none;
|
|
144
146
|
}
|
|
145
147
|
.ons-autocomplete :global(.autocomplete__input) {
|
|
146
|
-
border-radius:
|
|
148
|
+
border-radius: 3px !important;
|
|
147
149
|
border-width: 1px !important;
|
|
148
150
|
background: white;
|
|
149
151
|
}
|
|
@@ -158,4 +160,11 @@
|
|
|
158
160
|
.ons-autocomplete :global(.muted-text) {
|
|
159
161
|
opacity: 0.8;
|
|
160
162
|
font-size: smaller;
|
|
163
|
+
}
|
|
164
|
+
.ons-autocomplete-wrapper :global(*) {
|
|
165
|
+
font-size: 18px;
|
|
166
|
+
}
|
|
167
|
+
.ons-autocomplete-wrapper :global(.autocomplete__hint),
|
|
168
|
+
.ons-autocomplete-wrapper :global(.autocomplete__input) {
|
|
169
|
+
height: 40px;
|
|
161
170
|
}</style>
|