ng-select2-component 8.0.3 → 8.1.0

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.
package/README.md CHANGED
@@ -1,338 +1,344 @@
1
- [![npm version](https://badge.fury.io/js/ng-select2-component.svg)](https://badge.fury.io/js/ng-select2-component) [![Downloads](https://img.shields.io/npm/dm/ng-select2-component.svg)](https://www.npmjs.com/package/ng-select2-component) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Harvest-Dev/ng-select2/master/LICENSE.md)
2
-
3
- # Select2
4
-
5
- This Angular CLI module it's a fork of [select2-component](https://github.com/plantain-00/select2-component) without Vue & React. For Vue or React, please use the original component.
6
-
7
- ## Installation
8
-
9
- ```
10
- npm i ng-select2-component --save
11
- ```
12
-
13
- ## Requirements
14
-
15
- - peerDependencies:
16
- - `angular` 10.0.0 and more
17
- - `angular/cdk` 10.0.0 and more
18
-
19
- - dependencies (include):
20
- - `ngx-infinite-scroll@^10.0.1`
21
-
22
- > **Note:**<br>
23
- > For `angular` 7, 8 and 9 : use version `7.3.1`.
24
-
25
- ## Demo
26
-
27
- [See a demo](https://harvest-dev.github.io/ng-select2/dist/ng-select2/).
28
-
29
- ## Features
30
-
31
- + select one
32
- + options or groups
33
- + scroll
34
- + local search
35
- + select by keyboard
36
- + disabled option
37
- + disabled component
38
- + hide search box
39
- + placeholder
40
- + multiple selection
41
- + material style
42
- + form binding
43
- + templating
44
-
45
- ## Usage
46
-
47
- ### example
48
-
49
- ```ts
50
- import { Select2Module } from "ng-select2-component";
51
-
52
- @NgModule({
53
- imports: [BrowserModule, FormsModule, Select2Module],
54
- declarations: [MainComponent],
55
- bootstrap: [MainComponent],
56
- })
57
- class MainModule { }
58
- ```
59
-
60
- ```html
61
- <select2 [data]="data"
62
- [value]="value"
63
- (update)="update($event)">
64
- </select2>
65
- ```
66
- ### properties and events of the component
67
-
68
- name | type | status | default | description
69
- ------------------------ | ---------------------------------------- | -------- | ----------- | ---------------------------------------------------------------
70
- `data` | [`Select2Data`](#select2-data-structure) | required | | the data of the select2
71
- `value` | [`Select2Value`](#select2-data-structure)| | | initial value
72
- `minCharForSearch` | `number` | | `0` | start the search when the number of characters is reached (`0` = unlimited)
73
- `minCountForSearch` | `number` | | `6` | hide search box if `options.length < minCountForSearch`
74
- `displaySearchStatus` | `'default'`<br>`'hidden'`<br>`'always'` | | `'default'` | display the search box (`default` : is based on `minCountForSearch`)
75
- `placeholder` | `string` | | | the placeholder string if nothing selected
76
- `noResultMessage` | `string` | | | the message string if no results when using the search field
77
- `customSearchEnabled` | `boolean` | | `false` | will trigger `search` event, and disable inside filter
78
- `multiple` | `boolean` | | `false` | select multiple options
79
- `resettable` | `boolean` | | `false` | add a button to reset value (not with `multiple`)
80
- `limitSelection` | `number` | | `0` | to limit multiple selection (`0` = unlimited)
81
- `hideSelectedItems` | `boolean` | | `false` | for `multiple`, remove selected values
82
- `resultMaxHeight` | `string` | | `'200px'` | change the height size of results
83
- `listPosition` | `'below'`<br>`'above'` | | `'below'` | the position for the dropdown list
84
- `infiniteScroll` | `boolean` | | `false` | active infiniteScroll on dropdown list ( with `ngx-infinite-scroll`)
85
- `infiniteScrollDistance` | `number` | | `1.5` | infiniteScroll distance
86
- `infiniteScrollThrottle` | `number` | | `150` | infiniteScroll throttle
87
- `overlay` | `boolean` | | `false` | active an overlay mode for dropdown list (with angular cdk). (See [Overlay](#overlay))
88
- `sytleMode` | `'default'`<br>`'material'`<br>`'noStyle'` | | `'default'` | change style for material style or remove border and background color
89
- `templates` | `TemplateRef`<br> `{option?: TemplateRef, group?: TemplateRef}`<br> `{templateId1: TemplateRef, ...}` | | | use templates for formatting content (see [Templating](#templating))
90
- `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search
91
- `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control |
92
- `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option
93
- `(open)` | `(event: Select2) => void` | event | | triggered when user open the options
94
- `(close)` | `(event: Select2) => void` | event | | triggered when user close the options
95
- `(focus)` | `(event: Select2) => void` | event | | triggered when user enters the component
96
- `(blur)` | `(event: Select2) => void` | event | | triggered when user leaves the component
97
- `(search)` | `(event: `[`Select2SearchEvent`](#select2-data-structure)`) => void` | event | | triggered when search text changed
98
- `(scroll)` | `(event: `[`Select2ScrollEvent`](#select2-data-structure)`) => void` | event | | triggered when infiniteScroll is on `up` or `down` position
99
- `(removedOption)` | `(event: `[`Select2RemoveEvent`](#select2-data-structure)`) => void` | event | | for `multiple`, triggered when an option is removed from the list of selected options options list
100
-
101
- ### select2 data structure
102
-
103
- ```ts
104
- type Select2Data = (Select2Group | Select2Option)[];
105
-
106
- export interface Select2Group {
107
- /** label of group */
108
- label: string;
109
- /** options list */
110
- options: Select2Option[];
111
- /** add classes */
112
- classes?: string;
113
- /** template id */
114
- templateId?: string;
115
- /** template data */
116
- data?: any;
117
- }
118
-
119
- export interface Select2Option {
120
- /** value */
121
- value: Select2Value;
122
- /** label of option */
123
- label: string;
124
- /** no selectable is disabled */
125
- disabled?: boolean;
126
- /** for identification */
127
- id?: string;
128
- /** add classes */
129
- classes?: string;
130
- /** template id */
131
- templateId?: string;
132
- /** template data */
133
- data?: any;
134
- /** hide this option */
135
- hide?: boolean;
136
- }
137
-
138
- type Select2Value = string | number | boolean | object;
139
-
140
- type Select2UpdateValue = Select2Value | Select2Value[];
141
-
142
- export interface Select2UpdateEvent<U extends Select2UpdateValue = Select2Value> {
143
- component: Select2;
144
- value: U;
145
- options: Select2Option[];
146
- }
147
-
148
- export interface Select2SearchEvent<U extends Select2UpdateValue = Select2Value> {
149
- component: Select2;
150
- value: U;
151
- search: string;
152
- }
153
-
154
- export interface Select2RemoveEvent<U extends Select2UpdateValue = Select2Value> {
155
- component: Select2;
156
- value: U;
157
- removedOption: Select2Option;
158
- }
159
-
160
- export interface Select2ScrollEvent {
161
- component: Select2;
162
- way: 'up' | 'down';
163
- search: string;
164
- }
165
-
166
- ```
167
-
168
- ### Templating
169
-
170
- #### Unique template
171
-
172
- ```html
173
- <select2 [data]="data"
174
- [templates]="template">
175
- <ng-template #template let-data="data"><strong>{{data?.color}}</strong>: {{data?.name}}</ng-template>
176
- </select2>
177
- ```
178
-
179
- ```ts
180
- const data: Select2Data = [
181
- {
182
- value: 'heliotrope',
183
- label: 'Heliotrope',
184
- data: { color: 'white', name: 'Heliotrope' }
185
- },
186
- {
187
- value: 'hibiscus',
188
- label: 'Hibiscus',
189
- data: { color: 'red', name: 'Hibiscus' }
190
- }
191
- ]
192
- ```
193
-
194
- #### Template group & option
195
-
196
- ```html
197
- <select2 [data]="data"
198
- [templates]="{option : option, group: group}">
199
- <ng-template #option let-data="data">{{data?.name}}</ng-template>
200
- <ng-template #group let-label="label">Group: {{label}}</ng-template>
201
- </select2>
202
- ```
203
-
204
- No difference in data structure.
205
- The template is defined by its type, option or group, automatically.
206
-
207
- #### Template by templateId
208
-
209
- ```html
210
- <select2 [data]="data"
211
- [templates]="{template1 : template1, template2: template2}">
212
- <ng-template #template1 let-data="data">{{data?.name}}</ng-template>
213
- <ng-template #template2 let-label="label" let-data="data">{{label}} : {{data?.color}}</ng-template>
214
- </select2>
215
- ```
216
-
217
- ```ts
218
- const data: Select2Data = [
219
- {
220
- value: 'heliotrope',
221
- label: 'Heliotrope',
222
- data: { color: 'white', name: 'Heliotrope' },
223
- templateId: 'template1'
224
- },
225
- {
226
- value: 'hibiscus',
227
- label: 'Hibiscus',
228
- data: { color: 'red', name: 'Hibiscus'},
229
- templateId: 'template2'
230
- }
231
- ]
232
- ```
233
-
234
- ### Overlay
235
-
236
- If the overlay mode is used / activated, add to the project root in CSS (with `ViewEncapsulation.None`)
237
-
238
- ```css
239
- @import "~@angular/cdk/overlay-prebuilt.css";
240
- ```
241
-
242
- ## CSS variables (doesn't work on IE11)
243
-
244
- It's possible to change different colors (and more) with CSS variables without having to modify them with `::ng-deep` or other CSS rules :
245
-
246
- ```css
247
- :root {
248
- /* label */
249
- --select2-label-text-color: #000;
250
- --select2-required-color: red;
251
-
252
- /* selection */
253
- --select2-selection-border-radius: 4px;
254
- --select2-selection-background: #fff;
255
- --select2-selection-disabled-background: #eee;
256
- --select2-selection-border-color: #aaa;
257
- --select2-selection-focus-border-color: #000;
258
- --select2-selection-text-color: #444;
259
-
260
- /* selection: choice item (multiple) */
261
- --select2-selection-choice-background: #e4e4e4;
262
- --select2-selection-choice-text-color: #000;
263
- --select2-selection-choice-border-color: #aaa;
264
- --select2-selection-choice-close-color: #999;
265
- --select2-selection-choice-hover-close-color: #333;
266
-
267
- /* placeholder */
268
- --select2-placeholder-color: #999;
269
- --select2-placeholder-overflow: ellipsis;
270
-
271
- /* no result message */
272
- --select2-no-result-color: #888;
273
- --select2-font-style-color: italic;
274
-
275
- /* reset */
276
- --select2-reset-color: #999;
277
-
278
- /* arrow */
279
- --select2-arrow-color: #888;
280
-
281
- /* dropdown panel */
282
- --select2-dropdown-background: #fff;
283
- --select2-dropdown-border-color: #aaa;
284
-
285
- /* overlay */
286
- --select2-overlay-backdrop: transparent;
287
-
288
- /* search field */
289
- --select2-search-border-color: #aaa;
290
- --select2-search-background: #fff;
291
- --select2-search-border-radius: 0px;
292
-
293
- /* dropdown option */
294
- --select2-option-text-color: #000;
295
- --select2-option-disabled-text-color: #999;
296
- --select2-option-disabled-background: transparent;
297
- --select2-option-selected-text-color: #000;
298
- --select2-option-selected-background: #ddd;
299
- --select2-option-highlighted-text-color: #fff;
300
- --select2-option-highlighted-background: #5897fb;
301
- --select2-option-group-text-color: gray;
302
- --select2-option-group-background: transparent;
303
-
304
- /* hint */
305
- --select2-hint-text-color: #888;
306
-
307
- /* for Material ------------------------------------------*/
308
- --select2-material-underline: #ddd;
309
- --select2-material-underline-active: #5a419e;
310
- --select2-material-underline-disabled: linear-gradient(to right, rgba(0, 0, 0, 0.26) 0, rgba(0, 0, 0, 0.26) 33%, transparent 0);
311
- --select2-material-underline-invalid: red;
312
- --select2-material-placeholder-color: rgba(0, 0, 0, 0.38);
313
- --select2-material-selection-background: #ddd;
314
- --select2-material-option-selected-background: rgba(0, 0, 0, 0.04);
315
- --select2-material-option-highlighted-text-color: #000;
316
- --select2-material-option-selected-text-color: #ff5722;
317
- }
318
- ```
319
-
320
- For IE11, see [css-vars-ponyfill](https://github.com/jhildenbiddle/css-vars-ponyfill).
321
-
322
- ## Publishing the library
323
-
324
- ```
325
- npm run build:lib
326
- cd dist/ng-select2-component
327
- npm publish
328
- ```
329
-
330
- ## Update Demo
331
-
332
- ```
333
- npm run build:demo
334
- ```
335
-
336
- ## License
337
-
338
- Like Angular, this module is released under the permissive MIT license. Your contributions are always welcome.
1
+ [![npm version](https://badge.fury.io/js/ng-select2-component.svg)](https://badge.fury.io/js/ng-select2-component) [![Downloads](https://img.shields.io/npm/dm/ng-select2-component.svg)](https://www.npmjs.com/package/ng-select2-component) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Harvest-Dev/ng-select2/master/LICENSE.md)
2
+
3
+ # Select2
4
+
5
+ This Angular CLI module it's a fork of [select2-component](https://github.com/plantain-00/select2-component) without Vue & React. For Vue or React, please use the original component.
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ npm i ng-select2-component --save
11
+ ```
12
+
13
+ ## Requirements
14
+
15
+ - peerDependencies:
16
+
17
+ - `angular` 10.0.0 and more
18
+ - `angular/cdk` 10.0.0 and more
19
+
20
+ - dependencies (include):
21
+ - `ngx-infinite-scroll@^10.0.1`
22
+
23
+ > **Note:**<br>
24
+ > For `angular` 7, 8 and 9 : use version `7.3.1`.
25
+
26
+ ## Demo
27
+
28
+ [See a demo](https://harvest-dev.github.io/ng-select2/dist/ng-select2/).
29
+
30
+ ## Features
31
+
32
+ - select one
33
+ - options or groups
34
+ - scroll
35
+ - local search
36
+ - select by keyboard
37
+ - disabled option
38
+ - disabled component
39
+ - hide search box
40
+ - placeholder
41
+ - multiple selection
42
+ - material style
43
+ - form binding
44
+ - templating
45
+
46
+ ## Usage
47
+
48
+ ### example
49
+
50
+ ```ts
51
+ import { Select2Module } from 'ng-select2-component';
52
+
53
+ @NgModule({
54
+ imports: [BrowserModule, FormsModule, Select2Module],
55
+ declarations: [MainComponent],
56
+ bootstrap: [MainComponent],
57
+ })
58
+ class MainModule {}
59
+ ```
60
+
61
+ ```html
62
+ <select2 [data]="data" [value]="value" (update)="update($event)"> </select2>
63
+ ```
64
+
65
+ ### properties and events of the component
66
+
67
+ | name | type | status | default | description |
68
+ | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------------------------------------------------------------------------------------- |
69
+ | `data` | [`Select2Data`](#select2-data-structure) | required | | the data of the select2 |
70
+ | `value` | [`Select2Value`](#select2-data-structure) | | | initial value |
71
+ | `minCharForSearch` | `number` | | `0` | start the search when the number of characters is reached (`0` = unlimited) |
72
+ | `minCountForSearch` | `number` | | `6` | hide search box if `options.length < minCountForSearch` |
73
+ | `displaySearchStatus` | `'default'`<br>`'hidden'`<br>`'always'` | | `'default'` | display the search box (`default` : is based on `minCountForSearch`) |
74
+ | `placeholder` | `string` | | | the placeholder string if nothing selected |
75
+ | `noResultMessage` | `string` | | | the message string if no results when using the search field |
76
+ | `customSearchEnabled` | `boolean` | | `false` | will trigger `search` event, and disable inside filter |
77
+ | `multiple` | `boolean` | | `false` | select multiple options |
78
+ | `resettable` | `boolean` | | `false` | add a button to reset value (not with `multiple`) |
79
+ | `limitSelection` | `number` | | `0` | to limit multiple selection (`0` = unlimited) |
80
+ | `hideSelectedItems` | `boolean` | | `false` | for `multiple`, remove selected values |
81
+ | `resultMaxHeight` | `string` | | `'200px'` | change the height size of results |
82
+ | `maxResults` | `number` | | `0` | maximum results limit (`0` = unlimited)s |
83
+ | `maxResultsMessage` | `string` | | `'Too much result…'` | message when maximum result |
84
+ | `listPosition` | `'below'`<br>`'above'`<br>`'auto'` \* | | `'below'` | the position for the dropdown list<br> \* `'auto'`: only with `overlay` |
85
+ | `infiniteScroll` | `boolean` | | `false` | active infiniteScroll on dropdown list ( with `ngx-infinite-scroll`) |
86
+ | `infiniteScrollDistance` | `number` | | `1.5` | infiniteScroll distance |
87
+ | `infiniteScrollThrottle` | `number` | | `150` | infiniteScroll throttle |
88
+ | `overlay` | `boolean` | | `false` | active an overlay mode for dropdown list (with angular cdk). (See [Overlay](#overlay)) |
89
+ | `styleMode` | `'default'`<br>`'material'`<br>`'noStyle'` | | `'default'` | change style for material style or remove border and background color |
90
+ | `templates` | `TemplateRef`<br>`{option?: TemplateRef, group?: TemplateRef}`<br>`{templateId1: TemplateRef, ...}` | | | use templates for formatting content (see [Templating](#templating)) |
91
+ | `editPattern` | `(str: string) => string` | | | use it for change the pattern of the filter search |
92
+ | `ngModel`<br>`id`<br>`required`<br>`disabled`<br>`readonly`<br>`tabIndex` | | | | just like a `select` control |
93
+ | `(update)` | `(event: `[`Select2UpdateEvent`](#select2-data-structure)`) => void` | event | | triggered when user select an option |
94
+ | `(open)` | `(event: Select2) => void` | event | | triggered when user open the options |
95
+ | `(close)` | `(event: Select2) => void` | event | | triggered when user close the options |
96
+ | `(focus)` | `(event: Select2) => void` | event | | triggered when user enters the component |
97
+ | `(blur)` | `(event: Select2) => void` | event | | triggered when user leaves the component |
98
+ | `(search)` | `(event: `[`Select2SearchEvent`](#select2-data-structure)`) => void` | event | | triggered when search text changed |
99
+ | `(scroll)` | `(event: `[`Select2ScrollEvent`](#select2-data-structure)`) => void` | event | | triggered when infiniteScroll is on `up` or `down` position |
100
+ | `(removedOption)` | `(event: `[`Select2RemoveEvent`](#select2-data-structure)`) => void` | event | | for `multiple`, triggered when an option is removed from the list of selected options options list |
101
+
102
+ ### select2 data structure
103
+
104
+ ```ts
105
+ type Select2Data = (Select2Group | Select2Option)[];
106
+
107
+ export interface Select2Group {
108
+ /** label of group */
109
+ label: string;
110
+ /** options list */
111
+ options: Select2Option[];
112
+ /** add classes */
113
+ classes?: string;
114
+ /** template id */
115
+ templateId?: string;
116
+ /** template data */
117
+ data?: any;
118
+ }
119
+
120
+ export interface Select2Option {
121
+ /** value */
122
+ value: Select2Value;
123
+ /** label of option */
124
+ label: string;
125
+ /** no selectable is disabled */
126
+ disabled?: boolean;
127
+ /** for identification */
128
+ id?: string;
129
+ /** add classes */
130
+ classes?: string;
131
+ /** template id */
132
+ templateId?: string;
133
+ /** template data */
134
+ data?: any;
135
+ /** hide this option */
136
+ hide?: boolean;
137
+ }
138
+
139
+ type Select2Value = string | number | boolean | object;
140
+
141
+ type Select2UpdateValue = Select2Value | Select2Value[];
142
+
143
+ export interface Select2UpdateEvent<U extends Select2UpdateValue = Select2Value> {
144
+ component: Select2;
145
+ value: U;
146
+ options: Select2Option[];
147
+ }
148
+
149
+ export interface Select2SearchEvent<U extends Select2UpdateValue = Select2Value> {
150
+ component: Select2;
151
+ value: U;
152
+ search: string;
153
+ }
154
+
155
+ export interface Select2RemoveEvent<U extends Select2UpdateValue = Select2Value> {
156
+ component: Select2;
157
+ value: U;
158
+ removedOption: Select2Option;
159
+ }
160
+
161
+ export interface Select2ScrollEvent {
162
+ component: Select2;
163
+ way: 'up' | 'down';
164
+ search: string;
165
+ }
166
+ ```
167
+
168
+ ### Templating
169
+
170
+ #### Unique template
171
+
172
+ ```html
173
+ <select2 [data]="data" [templates]="template">
174
+ <ng-template #template let-data="data"><strong>{{data?.color}}</strong>: {{data?.name}}</ng-template>
175
+ </select2>
176
+ ```
177
+
178
+ ```ts
179
+ const data: Select2Data = [
180
+ {
181
+ value: 'heliotrope',
182
+ label: 'Heliotrope',
183
+ data: { color: 'white', name: 'Heliotrope' },
184
+ },
185
+ {
186
+ value: 'hibiscus',
187
+ label: 'Hibiscus',
188
+ data: { color: 'red', name: 'Hibiscus' },
189
+ },
190
+ ];
191
+ ```
192
+
193
+ #### Template group & option
194
+
195
+ ```html
196
+ <select2 [data]="data" [templates]="{option : option, group: group}">
197
+ <ng-template #option let-data="data">{{data?.name}}</ng-template>
198
+ <ng-template #group let-label="label">Group: {{label}}</ng-template>
199
+ </select2>
200
+ ```
201
+
202
+ No difference in data structure.
203
+ The template is defined by its type, option or group, automatically.
204
+
205
+ #### Template by templateId
206
+
207
+ ```html
208
+ <select2 [data]="data" [templates]="{template1 : template1, template2: template2}">
209
+ <ng-template #template1 let-data="data">{{data?.name}}</ng-template>
210
+ <ng-template #template2 let-label="label" let-data="data">{{label}} : {{data?.color}}</ng-template>
211
+ </select2>
212
+ ```
213
+
214
+ ```ts
215
+ const data: Select2Data = [
216
+ {
217
+ value: 'heliotrope',
218
+ label: 'Heliotrope',
219
+ data: { color: 'white', name: 'Heliotrope' },
220
+ templateId: 'template1',
221
+ },
222
+ {
223
+ value: 'hibiscus',
224
+ label: 'Hibiscus',
225
+ data: { color: 'red', name: 'Hibiscus' },
226
+ templateId: 'template2',
227
+ },
228
+ ];
229
+ ```
230
+
231
+ ### Overlay
232
+
233
+ If the overlay mode is used / activated, add to the project root in CSS (with `ViewEncapsulation.None`)
234
+
235
+ ```css
236
+ @import '~@angular/cdk/overlay-prebuilt.css';
237
+ ```
238
+
239
+ ## CSS variables (doesn't work on IE11)
240
+
241
+ It's possible to change different colors (and more) with CSS variables without having to modify them with `::ng-deep` or other CSS rules :
242
+
243
+ ```css
244
+ :root {
245
+ /* label */
246
+ --select2-label-text-color: #000;
247
+ --select2-required-color: red;
248
+
249
+ /* selection */
250
+ --select2-selection-border-radius: 4px;
251
+ --select2-selection-background: #fff;
252
+ --select2-selection-disabled-background: #eee;
253
+ --select2-selection-border-color: #aaa;
254
+ --select2-selection-focus-border-color: #000;
255
+ --select2-selection-text-color: #444;
256
+
257
+ /* selection: choice item (multiple) */
258
+ --select2-selection-choice-background: #e4e4e4;
259
+ --select2-selection-choice-text-color: #000;
260
+ --select2-selection-choice-border-color: #aaa;
261
+ --select2-selection-choice-close-color: #999;
262
+ --select2-selection-choice-hover-close-color: #333;
263
+
264
+ /* placeholder */
265
+ --select2-placeholder-color: #999;
266
+ --select2-placeholder-overflow: ellipsis;
267
+
268
+ /* no result message */
269
+ --select2-no-result-color: #888;
270
+ --select2-no-result-font-style: italic;
271
+
272
+ /* no result message */
273
+ --select2-too-much-result-color: #888;
274
+ --select2-too-much-result-style: italic;
275
+
276
+ /* reset */
277
+ --select2-reset-color: #999;
278
+
279
+ /* arrow */
280
+ --select2-arrow-color: #888;
281
+
282
+ /* dropdown panel */
283
+ --select2-dropdown-background: #fff;
284
+ --select2-dropdown-border-color: #aaa;
285
+
286
+ /* overlay */
287
+ --select2-overlay-backdrop: transparent;
288
+
289
+ /* search field */
290
+ --select2-search-border-color: #aaa;
291
+ --select2-search-background: #fff;
292
+ --select2-search-border-radius: 0px;
293
+
294
+ /* dropdown option */
295
+ --select2-option-text-color: #000;
296
+ --select2-option-disabled-text-color: #999;
297
+ --select2-option-disabled-background: transparent;
298
+ --select2-option-selected-text-color: #000;
299
+ --select2-option-selected-background: #ddd;
300
+ --select2-option-highlighted-text-color: #fff;
301
+ --select2-option-highlighted-background: #5897fb;
302
+ --select2-option-group-text-color: gray;
303
+ --select2-option-group-background: transparent;
304
+
305
+ /* hint */
306
+ --select2-hint-text-color: #888;
307
+
308
+ /* for Material ------------------------------------------*/
309
+ --select2-material-underline: #ddd;
310
+ --select2-material-underline-active: #5a419e;
311
+ --select2-material-underline-disabled: linear-gradient(
312
+ to right,
313
+ rgba(0, 0, 0, 0.26) 0,
314
+ rgba(0, 0, 0, 0.26) 33%,
315
+ transparent 0
316
+ );
317
+ --select2-material-underline-invalid: red;
318
+ --select2-material-placeholder-color: rgba(0, 0, 0, 0.38);
319
+ --select2-material-selection-background: #ddd;
320
+ --select2-material-option-selected-background: rgba(0, 0, 0, 0.04);
321
+ --select2-material-option-highlighted-text-color: #000;
322
+ --select2-material-option-selected-text-color: #ff5722;
323
+ }
324
+ ```
325
+
326
+ For IE11, see [css-vars-ponyfill](https://github.com/jhildenbiddle/css-vars-ponyfill).
327
+
328
+ ## Publishing the library
329
+
330
+ ```
331
+ npm run build:lib
332
+ cd dist/ng-select2-component
333
+ npm publish
334
+ ```
335
+
336
+ ## Update Demo
337
+
338
+ ```
339
+ npm run build:demo
340
+ ```
341
+
342
+ ## License
343
+
344
+ Like Angular, this module is released under the permissive MIT license. Your contributions are always welcome.