@jblehm/super-list 1.0.17 → 1.0.19

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.
Files changed (2) hide show
  1. package/README.md +231 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,2 +1,231 @@
1
- # superlist V1.0.17
2
- An un-styled text searchable combobox for Vue.
1
+ # superlist V1.0.19
2
+ An un-styled mobile supported text searchable combobox for Vue.
3
+
4
+ ![img_1.png](img_1.png)
5
+
6
+ Example component implementation in Vue:
7
+
8
+ ![img.png](img.png)
9
+
10
+ ```js
11
+ <template>
12
+ <super-list
13
+ :options="options"
14
+ v-model:selected="updatedSelected"
15
+ :object-label-key-name="objectLabelKeyName"
16
+ class="super-list"
17
+ :max-list-options="5"
18
+ />
19
+ </template>
20
+
21
+ <script lang="ts">
22
+ import type { PropType } from 'vue'
23
+ import { defineComponent } from 'vue'
24
+ import SuperList from '@jblehm/super-list'
25
+ import type { ListRequest } from '@jblehm/super-list/dist/DropDownLibrary'
26
+
27
+ export default defineComponent({
28
+ name: 'ListInput',
29
+ components: { SuperList },
30
+ props: {
31
+ selected: {
32
+ type: [String, Number, Object, null, undefined] as PropType<
33
+ string | number | object | null | undefined
34
+ >,
35
+ default: ''
36
+ },
37
+ options: {
38
+ type: [Array, Function] as PropType<string[] | number[] | object[] | ListRequest>,
39
+ required: true
40
+ },
41
+ objectLabelKeyName: {
42
+ type: String as PropType<string | null>,
43
+ default: ''
44
+ }
45
+ },
46
+ refs: ['dropDownComponent'],
47
+ data() {
48
+ return {
49
+ updatedSelected: '' as string | number | object
50
+ }
51
+ },
52
+ watch: {
53
+ updatedSelected: {
54
+ handler(newValue) {
55
+ if (newValue && newValue !== this.selected) {
56
+ this.$emit('update:selected', newValue) // for v-model:selected="boundValue" and @update:selected="boundValue = $event"
57
+ }
58
+ }
59
+ },
60
+ selected: {
61
+ handler(newValue) {
62
+ if (newValue) this.updatedSelected = newValue
63
+ },
64
+ deep: true,
65
+ immediate: true
66
+ }
67
+ }
68
+ })
69
+ </script>
70
+ <style>
71
+ .super-list,
72
+ .super-list > * {
73
+ --tw-ring-color: var(--button-background) !important;
74
+ --superlist-text-colour: rgb(17, 24, 39);
75
+ --superlist-list-border-radius: 0.5rem;
76
+ }
77
+
78
+ .super-list {
79
+ width: 100%;
80
+ height: 2.25rem;
81
+ --superlist-text-colour: rgb(32, 35, 35);
82
+ }
83
+
84
+ .list-button {
85
+ display: inline-flex;
86
+ background-color: rgb(248, 249, 250);
87
+ color: rgb(41 51 61 / 1);
88
+ box-shadow: 1px 1px 5px 0 rgb(0, 0, 0, 0.1);
89
+ border: 1px solid rgb(209 213 219 / 1) !important;
90
+ font-size: 0.875rem !important;
91
+ border-radius: 0.375rem;
92
+ justify-content: center;
93
+ text-align: center;
94
+ font-weight: 600 !important;
95
+ opacity: var(--button-opacity);
96
+ translate: none;
97
+ transition-property: outline-color, background, background-color, outline-width, outline-offset,
98
+ box-shadow, translate, filter, opacity, color, text-shadow;
99
+ transition-timing-function: ease-in-out;
100
+ transition-duration: 175ms;
101
+ outline-offset: 0.25rem;
102
+ -webkit-user-select: none;
103
+ -moz-user-select: none;
104
+ user-select: none;
105
+ filter: var(--button-filter);
106
+ outline: transparent solid 0.2rem;
107
+ }
108
+
109
+ .list-button,
110
+ .list-filter-text-input,
111
+ .list-filter-text-input::placeholder {
112
+ color: var(--superlist-text-colour, rgb(17, 24, 39));
113
+ }
114
+
115
+ .list-button,
116
+ .list-filter-text-input {
117
+ background-color: rgb(248, 249, 250);
118
+ color: rgb(41 51 61 / 1);
119
+ box-shadow: 1px 1px 5px 0 rgb(0, 0, 0, 0.1);
120
+ font-size: 0.875rem !important;
121
+ font-weight: 600 !important;
122
+ opacity: var(--button-opacity);
123
+ transition-property: outline-color, background, background-color, outline-width, outline-offset,
124
+ box-shadow, translate, filter, opacity, color, text-shadow;
125
+ transition-timing-function: ease-in-out;
126
+ transition-duration: 175ms;
127
+ outline-offset: 0.25rem;
128
+ outline: transparent solid 0.2rem;
129
+ }
130
+
131
+ .list-filter-text-input {
132
+ border: none;
133
+ border-radius: calc(0.375rem - 1px) !important;
134
+ }
135
+
136
+ .list-button:hover {
137
+ transition-duration: 75ms;
138
+ box-shadow:
139
+ 1px 2px 3px 2px rgb(0, 0, 0, 0.25),
140
+ inset 1px 1px 5px 2px rgb(0, 0, 0, 0);
141
+ translate: -0.0875rem -0.05rem;
142
+ opacity: 0.9;
143
+ background-color: white;
144
+ color: black;
145
+ }
146
+
147
+ .list-filter-text-input:hover {
148
+ transition-duration: 75ms;
149
+ opacity: 0.9;
150
+ background-color: white;
151
+ color: black;
152
+ box-shadow:
153
+ 0 0 0 1px var(--button-background),
154
+ 1px 2px 3px 2px rgb(0, 0, 0, 0.25),
155
+ inset 1px 1px 5px 2px rgb(0, 0, 0, 0) !important;
156
+ }
157
+
158
+ .list-filter-text-input:focus:hover {
159
+ transition-duration: 75ms;
160
+ box-shadow:
161
+ -1px -1px 2px 1px rgb(0, 0, 0, 0.1),
162
+ inset 1px 2px 5px 3px rgb(0, 0, 0, 0.2);
163
+ translate: none;
164
+ opacity: 1;
165
+ }
166
+
167
+ .list-button:active,
168
+ .list-button:focus:active .list-button:focus:hover .list-button:active:hover,
169
+ .list-button:focus:active:hover,
170
+ .list-filter-text-input:active,
171
+ .list-filter-text-input:focus:active,
172
+ .list-filter-text-input:focus:hover,
173
+ .list-filter-text-input:active:hover,
174
+ .list-filter-text-input:focus:active:hover {
175
+ transition-duration: 75ms;
176
+ box-shadow:
177
+ -1px -1px 2px 1px rgb(0, 0, 0, 0.1),
178
+ inset 1px 2px 5px 3px rgb(0, 0, 0, 0.2);
179
+ translate: none;
180
+ opacity: 1;
181
+ }
182
+
183
+ .list-filter-text-input:focus,
184
+ .list-filter-text-input:focus-visible,
185
+ .list-filter-text-input:active {
186
+ border-width: 0;
187
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width))
188
+ var(--button-background) !important;
189
+ border-color: var(--button-background) !important;
190
+ border-style: solid;
191
+ }
192
+
193
+ .select-list-fixed {
194
+ box-shadow:
195
+ 0 1px 3px 0 rgb(0 0 0 / 0.1),
196
+ 0 1px 2px -1px rgb(0 0 0 / 0.1),
197
+ 0 0 1px 1px rgba(0, 0, 0, 0.25);
198
+ }
199
+
200
+ @media (min-width: 640px) {
201
+ .list-button:focus,
202
+ .list-filter-text-input:focus {
203
+ outline: var(--button-background, rgb(79 70 229)) solid 0.125rem;
204
+ }
205
+
206
+ .list-button:hover {
207
+ transition-duration: 75ms;
208
+ box-shadow:
209
+ 1px 2px 3px 2px rgb(0, 0, 0, 0.25),
210
+ inset 1px 1px 5px 2px rgb(0, 0, 0, 0);
211
+ translate: -0.0875rem -0.05rem;
212
+ opacity: 0.9;
213
+ background-color: white;
214
+ color: black;
215
+ }
216
+ .list-filter-text-input:hover {
217
+ transition-duration: 75ms;
218
+ box-shadow:
219
+ 1px 2px 3px 2px rgb(0, 0, 0, 0.25),
220
+ inset 1px 1px 5px 2px rgb(0, 0, 0, 0);
221
+ opacity: 0.9;
222
+ background-color: white;
223
+ color: black;
224
+ }
225
+ .super-list {
226
+ height: 2rem;
227
+ }
228
+ }
229
+ </style>
230
+
231
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jblehm/super-list",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/ListInputComponents",