selectic 3.0.19 → 3.0.21

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.
@@ -10,7 +10,7 @@ It defines a unique identifier (ID) which must be unique in the whole document.
10
10
 
11
11
  ```html
12
12
  <selectic
13
- options={['item1', 'item2']}
13
+ :options="['item1', 'item2']"
14
14
  value="item2"
15
15
  id="example"
16
16
  />
@@ -28,7 +28,7 @@ This is the id of the selected option or an array of id (if `multiple` is set).
28
28
 
29
29
  ```html
30
30
  <selectic
31
- options={['item1', 'item2']}
31
+ :options="['item1', 'item2']"
32
32
  value="item2"
33
33
  />
34
34
  ```
@@ -39,7 +39,7 @@ When disabled is set, `selectic` cannot be open nor changed.
39
39
 
40
40
  ```html
41
41
  <selectic
42
- options={['item1', 'item2']}
42
+ :options="['item1', 'item2']"
43
43
  disabled
44
44
  />
45
45
  ```
@@ -52,7 +52,7 @@ The `value` will be an array.
52
52
 
53
53
  ```html
54
54
  <selectic
55
- options={['item1', 'item2', 'item3']}
55
+ :options="['item1', 'item2', 'item3']"
56
56
  multiple
57
57
  />
58
58
  ```
@@ -65,7 +65,7 @@ It displays the given text if no option is selected.
65
65
 
66
66
  ```html
67
67
  <selectic
68
- options={['item1', 'item2', 'item3']}
68
+ :options="['item1', 'item2', 'item3']"
69
69
  placeholder="choose an item"
70
70
  />
71
71
  ```
@@ -76,7 +76,7 @@ It is added to the main element, and it behaves like `title` attribute of any HT
76
76
 
77
77
  ```html
78
78
  <selectic
79
- options={['item1', 'item2', 'item3']}
79
+ :options="['item1', 'item2', 'item3']"
80
80
  title="An information about this component"
81
81
  />
82
82
  ```
@@ -91,7 +91,7 @@ Note that it will be applied to the inner list element too.
91
91
 
92
92
  ```html
93
93
  <selectic
94
- options={['item1', 'item2']}
94
+ :options="['item1', 'item2']"
95
95
  value="item2"
96
96
  className="my-custom-class another-class"
97
97
  />
package/doc/dynamic.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [Back to documentation index](main.md)
4
4
 
5
- The dynamic mode allows to load options dynamically (from a server or from anything else asynchrously).
5
+ The dynamic mode allows to load options dynamically (from a server or from anything else asynchronously).
6
6
  The list of options will be built when selectic is open. It fetches the first options and fetch the following ones when it is needed.
7
- It keeps result in cache to avoid refetching when selectic is open another time.
7
+ It keeps result in cache to avoid re-fetching when selectic is open another time.
8
8
 
9
9
  ## Basic usage
10
10
 
@@ -75,11 +75,11 @@ function buildItem(id) {
75
75
 
76
76
  ```html
77
77
  <selectic
78
- value={5}
79
- params={{
78
+ :value="5"
79
+ :params="{
80
80
  fetchCallback: listItems,
81
81
  getItemsCallback: getItems,
82
- }}
82
+ }"
83
83
  />
84
84
  ```
85
85
 
@@ -115,11 +115,11 @@ If you don't want to activate this feature, then you could set the `allowRevert`
115
115
  ```html
116
116
  <selectic
117
117
  multiple
118
- params={{
118
+ :params="{
119
119
  fetchCallback: fetchCallback,
120
120
  getItemsCallback: getItemsCallback,
121
121
  allowRevert: false,
122
- }}
122
+ }"
123
123
  />
124
124
  ```
125
125
 
@@ -130,17 +130,17 @@ The list of all groups should be provided in the `groups` property and child opt
130
130
 
131
131
  ```html
132
132
  <selectic
133
- groups={[{
133
+ :groups="[{
134
134
  id: 'group 1',
135
135
  text: 'This is the first group',
136
136
  }, {
137
137
  id: 'group 2',
138
138
  text: 'This is the second group',
139
- }]}
140
- params={{
139
+ }]"
140
+ :params="{
141
141
  fetchCallback: fetchCallback,
142
142
  getItemsCallback: getItemsCallback,
143
- }}
143
+ }"
144
144
  />
145
145
  ```
146
146
 
@@ -16,7 +16,7 @@ This is the id of the selected option or an array of id (if `multiple` is set).
16
16
 
17
17
  ```html
18
18
  <selectic
19
- options={['item1', 'item2']}
19
+ :options="['item1', 'item2']"
20
20
  value="item2"
21
21
  />
22
22
  ```
@@ -37,7 +37,7 @@ This value can be changed automatically by selectic if all options are fetched.
37
37
 
38
38
  ```html
39
39
  <selectic
40
- options={['item1', 'item2']}
40
+ :options="['item1', 'item2']"
41
41
  value="item2"
42
42
  selectionIsExcluded
43
43
  />
@@ -51,7 +51,7 @@ Default: `[]`
51
51
 
52
52
  This property is to list all options available ([read how to build a list](list.md)).
53
53
 
54
- This property can be ommited in dynamic mode ([read how to build dynamic list](dynamic.md)).
54
+ This property can be omitted in dynamic mode ([read how to build dynamic list](dynamic.md)).
55
55
 
56
56
  ## groups
57
57
 
@@ -65,13 +65,13 @@ It is required to fill this property only in _dynamic_ mode in order to know to
65
65
 
66
66
  ```html
67
67
  <selectic
68
- groups={[{
68
+ :groups="[{
69
69
  id: 'g1',
70
70
  text: 'The first group',
71
71
  }, {
72
72
  id: 'g2',
73
73
  text: 'The second group',
74
- }]}
74
+ }]"
75
75
  />
76
76
  ```
77
77
 
@@ -91,12 +91,12 @@ It changes the texts only for this component. To change texts for all selectic c
91
91
 
92
92
  ```html
93
93
  <selectic
94
- options={['Goldfish', 'Salmon', 'Trout', 'Tuna']}
94
+ :options="['Goldfish', 'Salmon', 'Trout', 'Tuna']"
95
95
  value="Tuna"
96
- texts={{
96
+ :texts="{
97
97
  searchPlaceholder: 'Search for fish',
98
98
  noResult: 'No fish matched your search',
99
- }}
99
+ }"
100
100
  />
101
101
  ```
102
102
 
@@ -114,9 +114,9 @@ This attribute has effects only in ([dynamic mode](dynamic.md)).
114
114
 
115
115
  ```html
116
116
  <selectic
117
- params={{
117
+ :params="{
118
118
  fetchCallback: fetchData,
119
- }}
119
+ }"
120
120
  noCache
121
121
  />
122
122
  ```
@@ -134,14 +134,14 @@ This allows to force the selectic to a given state. The state may be changed due
134
134
 
135
135
  It also allows to start in an open state.
136
136
 
137
- This attribute purpose is to change the state programatically. To keep state unchanged there are several other attributes ([disabled](extendedProperties.md#disabled), [keepOpenWithOtherSelectic](params.md#keepOpenWithOtherSelectic), ...).
137
+ This attribute purpose is to change the state programmatically. To keep state unchanged there are several other attributes ([disabled](extendedProperties.md#disabled), [keepOpenWithOtherSelectic](params.md#keepOpenWithOtherSelectic), ...).
138
138
  The current state can be updated with the [open](events.md#open) and [close](events.md#close) events.
139
139
 
140
140
  It is also possible to change the "open" state with the method [toggleOpen](methods.md#toggleOpen).
141
141
 
142
142
  ```html
143
143
  <selectic
144
- options={optionList}
144
+ :options="optionList"
145
145
  open
146
146
  />
147
147
  ```
Binary file
Binary file
Binary file
package/doc/list.md CHANGED
@@ -15,9 +15,11 @@ const items = ['item1', 'second Item'];
15
15
 
16
16
  ```html
17
17
  <selectic
18
- options={items}
18
+ :options="items"
19
19
  />
20
20
  ```
21
+ ![example with simple list](./images/example1.png)
22
+
21
23
  ## object[]
22
24
 
23
25
  It is possible to define the `option` more precisely.
@@ -36,8 +38,8 @@ It is possible to define the `option` more precisely.
36
38
 
37
39
  ```javascript
38
40
  const items = [{
39
- id; 1,
40
- text: 'item1',
41
+ id: 1,
42
+ text: 'a value',
41
43
  }, {
42
44
  id: 2,
43
45
  text: 'not available yet',
@@ -45,11 +47,13 @@ const items = [{
45
47
  }, {
46
48
  id: 3,
47
49
  text: 'the red option',
48
- style: 'background-color: red',
49
- }];,
50
- {
50
+ style: 'color: red',
51
+ }, {
52
+ id: 4,
53
+ text: 'another value',
54
+ }, {
51
55
  id: 'group1',
52
- text: 'some amount',
56
+ text: 'a "group" for some amounts',
53
57
  options: [{
54
58
  id: 'amount1',
55
59
  text: '1',
@@ -60,16 +64,20 @@ const items = [{
60
64
  id: 'amount3',
61
65
  text: '100',
62
66
  }],
63
- };
67
+ }];
64
68
  ```
65
69
 
66
70
  ```html
67
71
  <selectic
68
- options={items}
72
+ :options="items"
69
73
  />
70
74
  ```
75
+ ![example with object list](./images/example2.png)
71
76
 
72
- # Inner elements
77
+ # Inner elements _(deprecated)_
78
+
79
+ **:warning: This part has been deprecated with Selectic 3 +.**
80
+ _The main reason is that VueJS 3 does not allowed to read slots as easily as in VueJS 2._
73
81
 
74
82
  Another way to create a list is to write elements as child of Selectic.
75
83
 
@@ -84,22 +92,25 @@ Element properties:
84
92
  * **disabled**: will set the **disabled** attribute.
85
93
  * **class**: will set the **className** attribute.
86
94
  * **style**: will set the **style** attribute.
87
- * any **data-**: will set the **data** atribute.
95
+ * any **data-**: will set the **data** attribute.
88
96
  * Inner text will set the **text** attribute.
89
97
  * **label** _(only for optgroup)_: will set the **text** attribute.
90
98
 
91
99
  ```html
92
100
  <selectic>
93
101
  <option value="1">
94
- item1
102
+ a value
95
103
  </option>
96
104
  <option value="2" disabled>
97
105
  not available yet
98
106
  </option>
99
- <option value="3" style="background-color: red">
107
+ <option value="3" style="color: red">
100
108
  the red option
101
109
  </option>
102
- <optgroup id="group1" label="some amount">
110
+ <option value="4">
111
+ another value
112
+ </option>
113
+ <optgroup id="group1" label="a &quotes;group&quotes; for some amounts">
103
114
  <option value="amount1">
104
115
  1
105
116
  </option>
@@ -112,8 +123,10 @@ Element properties:
112
123
  </optgroup>
113
124
  </selectic>
114
125
  ```
126
+ ![example with slot elements](./images/example2.png)
127
+
115
128
  If options are set both by options attribute and by inner elements,
116
129
  the inner elements are added first and then the one described in
117
130
  options attribute.
118
131
 
119
- To change this behavior wath the **optionBehavior** property of the [params](params.md) attribute.
132
+ To change this behavior watch the **optionBehavior** property of the [params](params.md) attribute.
package/doc/methods.md CHANGED
@@ -10,7 +10,7 @@ All these methods should be called directly on the component instance.
10
10
 
11
11
  `clearCache(forceReset: boolean = false) => void`
12
12
 
13
- Whole cache in selectic are cleared, and so all options are refetched.
13
+ Whole cache in selectic are cleared, and so all options are re-fetched.
14
14
  This method is mainly useful in _dynamic_ mode when data should be completely changed (due to some context change).
15
15
 
16
16
  If `forceReset` is set to `true`, the current selection is also cleared. Otherwise it keeps previous selection.
@@ -54,4 +54,4 @@ This methods force the "open" state of the component.
54
54
  if `open` is not set, it toggles the current state.
55
55
 
56
56
  It returns the final state.
57
- Keep in mind that the state can be changed immediatley afterward by automatic settings (like [autoDisabled](params.md#autoDisabled)).
57
+ Keep in mind that the state can be changed immediately afterward by automatic settings (like [autoDisabled](params.md#autoDisabled)).
package/doc/params.md CHANGED
@@ -23,10 +23,10 @@ will not be displayed and the filter panel is always open.
23
23
 
24
24
  ```html
25
25
  <selectic
26
- params={{
26
+ :params="{
27
27
  hideFilter: false,
28
- }}
29
- options={optionList}
28
+ }"
29
+ :options="optionList"
30
30
  />
31
31
  ```
32
32
 
@@ -40,10 +40,10 @@ If `allowClearSelection` is set to `false`, it won't be possible to have nothing
40
40
 
41
41
  ```html
42
42
  <selectic
43
- params={{
43
+ :params="{
44
44
  allowClearSelection: true,
45
- }}
46
- options={optionList}
45
+ }"
46
+ :options="optionList"
47
47
  />
48
48
  ```
49
49
 
@@ -59,10 +59,10 @@ By default, it is set to `true` if `multiple` is not set, to `false` otherwise.
59
59
 
60
60
  ```html
61
61
  <selectic
62
- params={{
62
+ :params="{
63
63
  autoSelect: false,
64
- }}
65
- options={optionList}
64
+ }"
65
+ :options="optionList"
66
66
  />
67
67
  ```
68
68
 
@@ -72,16 +72,16 @@ Type: `boolean`
72
72
 
73
73
  If `autoDisabled` is set to `true`, it will disable automatically the component if the list of options is empty or if there is only one which must be selected (`allowClearSelection` is not set).
74
74
 
75
- It doesn't apply for dynamic list ([see dymanic configuration](dynamic.md)).
75
+ It doesn't apply for dynamic list ([see dynamic configuration](dynamic.md)).
76
76
 
77
77
  By default, it is set to `true`.
78
78
 
79
79
  ```html
80
80
  <selectic
81
- params={{
81
+ :params="{
82
82
  autoDisabled: true,
83
- }}
84
- options={optionList}
83
+ }"
84
+ :options="optionList"
85
85
  />
86
86
  ```
87
87
 
@@ -89,16 +89,16 @@ By default, it is set to `true`.
89
89
 
90
90
  Type: `boolean`
91
91
 
92
- If `stricValue` is set to `true`, it will consider value as `undefined` if its value is not an id of `options`.
92
+ If `strictValue` is set to `true`, it will consider value as `undefined` if its value is not an id of `options`.
93
93
 
94
94
  By default, it is set to `false`.
95
95
 
96
96
  ```html
97
97
  <selectic
98
- params={{
98
+ :params="{
99
99
  strictValue: true,
100
- }}
101
- options={optionList}
100
+ }"
101
+ :options="optionList"
102
102
  />
103
103
  ```
104
104
 
@@ -106,7 +106,7 @@ By default, it is set to `false`.
106
106
 
107
107
  Type: `'collapsed'` | `'multiline'`
108
108
 
109
- `selectOverflow` is to describe how selected options should be displayed when theyr are not enough space to display them all (in _multiple_ mode).
109
+ `selectOverflow` is to describe how selected options should be displayed when they are not enough space to display them all (in _multiple_ mode).
110
110
 
111
111
  Currently there are two supported behavior:
112
112
  * `'collapsed'`: the size of selectic input is not changed. If there is not enough space to display all selected options then it displays the possible ones then displays a _"+x others"_ in a badge (_x_ is the number of not displayed options). It is possible to watch these options with `title` or by opening selectic and see which options are selected. _This is the default value_.
@@ -114,10 +114,10 @@ Currently there are two supported behavior:
114
114
 
115
115
  ```html
116
116
  <selectic
117
- params={{
117
+ :params="{
118
118
  selectionOverflow: 'multiple',
119
- }}
120
- options={optionList}
119
+ }"
120
+ :options="optionList"
121
121
  />
122
122
  ```
123
123
 
@@ -131,10 +131,10 @@ By default, if there is no selected options, the result given by `getValue()` re
131
131
 
132
132
  ```html
133
133
  <selectic
134
- params={{
134
+ :params="{
135
135
  emptyValue: '',
136
- }}
137
- options={optionList}
136
+ }"
137
+ :options="optionList"
138
138
  />
139
139
  ```
140
140
 
@@ -148,7 +148,7 @@ As argument, it receives an option item and should also return an option item.
148
148
 
149
149
  ```html
150
150
  <selectic
151
- params={{
151
+ :params="{
152
152
  formatOption: (option) => {
153
153
  if (option.id === 2) {
154
154
  return Object.assign({}, option, {
@@ -158,8 +158,8 @@ As argument, it receives an option item and should also return an option item.
158
158
  }
159
159
  return option;
160
160
  },
161
- }}
162
- options={optionList}
161
+ }"
162
+ :options="optionList"
163
163
  />
164
164
  ```
165
165
 
@@ -173,14 +173,14 @@ As argument, it receives an option item and should also return an option item.
173
173
 
174
174
  ```html
175
175
  <selectic
176
- params={{
176
+ :params="{
177
177
  formatSelection: (option) => {
178
178
  return Object.assign({}, option, {
179
179
  style: 'background-color: rgb(250, 250, 20 * option.id)',
180
180
  });
181
181
  },
182
- }}
183
- options={optionList}
182
+ }"
183
+ :options="optionList"
184
184
  />
185
185
  ```
186
186
 
@@ -196,10 +196,10 @@ It should return a promise which resolves with an object which contains the tota
196
196
 
197
197
  ```html
198
198
  <selectic
199
- params={{
199
+ :params="{
200
200
  fetchCallback: (search, offset, limit) => fetch(`list?search=${search}&offset=${offset}&limit=${limit}`),
201
- }}
202
- options={optionList}
201
+ }"
202
+ :options="optionList"
203
203
  />
204
204
  ```
205
205
 
@@ -216,12 +216,12 @@ It should return a promise which resolves with an array of options corresponding
216
216
 
217
217
  ```html
218
218
  <selectic
219
- params={{
219
+ :params="{
220
220
  getItemsCallback: (ids) => Promise.all(
221
221
  ids.map(id => fetch(`getItem?id=${id}`))
222
222
  ),
223
- }}
224
- options={optionList}
223
+ }"
224
+ :options="optionList"
225
225
  />
226
226
  ```
227
227
 
@@ -241,10 +241,10 @@ _`pageSize` default value is `100`._
241
241
 
242
242
  ```html
243
243
  <selectic
244
- params={{
244
+ :params="{
245
245
  pageSize: 500,
246
- }}
247
- options={optionList}
246
+ }"
247
+ :options="optionList"
248
248
  />
249
249
  ```
250
250
 
@@ -271,10 +271,10 @@ Read [the extended properties documentation](extendedProperties.md) for more inf
271
271
 
272
272
  ```html
273
273
  <selectic
274
- params={{
274
+ :params="{
275
275
  allowRevert: true,
276
- }}
277
- options={optionList}
276
+ }"
277
+ :options="optionList"
278
278
  />
279
279
  ```
280
280
 
@@ -296,10 +296,10 @@ This option allows you to change the behavior.
296
296
 
297
297
  ```html
298
298
  <selectic
299
- params={{
299
+ :params="{
300
300
  forceSelectAll: 'auto',
301
- }}
302
- options={optionList}
301
+ }"
302
+ :options="optionList"
303
303
  />
304
304
  ```
305
305
 
@@ -312,14 +312,14 @@ Default value: `'auto'`
312
312
 
313
313
  `listPosition` defines where the list should be displayed (at top or at bottom of the select button).
314
314
 
315
- With the `'auto'` value it displays the list at bottom, but if there is not enought space (the select is at bottom of the page). It displays the list at top instead.
315
+ With the `'auto'` value it displays the list at bottom, but if there is not enough space (the select is at bottom of the page). It displays the list at top instead.
316
316
 
317
317
  ```html
318
318
  <selectic
319
- params={{
319
+ :params={
320
320
  listPosition: 'top',
321
- }}
322
- options={optionList}
321
+ }"
322
+ :options="optionList"
323
323
  />
324
324
  ```
325
325
 
@@ -356,10 +356,10 @@ Display only one source (the first which is not empty).
356
356
 
357
357
  ```html
358
358
  <selectic
359
- params={{
359
+ :params="{
360
360
  optionBehavior: 'sort-DOE',
361
- }}
362
- options={optionList}
361
+ }"
362
+ :options="optionList"
363
363
  />
364
364
  ```
365
365
 
@@ -369,16 +369,16 @@ Type: `boolean`
369
369
 
370
370
  Default value: `false`
371
371
 
372
- By default, only one selectic component can be open at the same time. So if another Selectic component is open (mainly programmtically) then any previously open component is closed.
372
+ By default, only one selectic component can be open at the same time. So if another Selectic component is open (mainly programmatically) then any previously open component is closed.
373
373
  If `keepOpenWithOtherSelectic` is set to `true`, this component stays open when another Selectic component opens.
374
374
 
375
375
  Note: This attribute does not prevent closing when user clicks outside the component.
376
376
 
377
377
  ```html
378
378
  <selectic
379
- params={{
379
+ :params="{
380
380
  keepOpenWithOtherSelectic: true,
381
- }}
382
- options={optionList}
381
+ }"
382
+ :options="optionList"
383
383
  />
384
384
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "selectic",
3
- "version": "3.0.19",
3
+ "version": "3.0.21",
4
4
  "description": "Smart Select for VueJS 3.x",
5
5
  "main": "dist/selectic.common.js",
6
6
  "module": "dist/selectic.esm.js",