ng-select2-component 12.0.0 → 12.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/CHANGELOG.md +7 -0
- package/README.md +34 -15
- package/esm2022/lib/select2-const.mjs +47 -47
- package/esm2022/lib/select2-hint.component.mjs +10 -10
- package/esm2022/lib/select2-interfaces.mjs +2 -2
- package/esm2022/lib/select2-label.component.mjs +10 -10
- package/esm2022/lib/select2-utils.mjs +279 -279
- package/esm2022/lib/select2.component.mjs +914 -900
- package/esm2022/lib/select2.module.mjs +22 -22
- package/esm2022/ng-select2-component.mjs +4 -4
- package/esm2022/public_api.mjs +11 -11
- package/fesm2022/ng-select2-component.mjs +1254 -1240
- package/fesm2022/ng-select2-component.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/select2-const.d.ts +7 -7
- package/lib/select2-hint.component.d.ts +5 -5
- package/lib/select2-interfaces.d.ts +72 -54
- package/lib/select2-interfaces.d.ts.map +1 -1
- package/lib/select2-label.component.d.ts +5 -5
- package/lib/select2-utils.d.ts +24 -24
- package/lib/select2.component.d.ts +237 -235
- package/lib/select2.component.d.ts.map +1 -1
- package/lib/select2.module.d.ts +13 -13
- package/package.json +1 -1
- package/public_api.d.ts +8 -8
|
@@ -1,55 +1,73 @@
|
|
|
1
|
-
import { Select2 } from './select2.component';
|
|
2
|
-
export interface Select2Group {
|
|
3
|
-
/** label of group */
|
|
4
|
-
label: string;
|
|
5
|
-
/** options list */
|
|
6
|
-
options: Select2Option[];
|
|
7
|
-
/** add classes */
|
|
8
|
-
classes?: string;
|
|
9
|
-
/** template id */
|
|
10
|
-
templateId?: string;
|
|
11
|
-
/** template data */
|
|
12
|
-
data?: any;
|
|
13
|
-
}
|
|
14
|
-
export interface Select2Option {
|
|
15
|
-
/** value */
|
|
16
|
-
value: Select2Value;
|
|
17
|
-
/** label of option */
|
|
18
|
-
label: string;
|
|
19
|
-
/** no selectable is disabled */
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/** for identification */
|
|
22
|
-
id?: string;
|
|
23
|
-
/** add classes */
|
|
24
|
-
classes?: string;
|
|
25
|
-
/** template id */
|
|
26
|
-
templateId?: string;
|
|
27
|
-
/** template data */
|
|
28
|
-
data?: any;
|
|
29
|
-
/** hide this option */
|
|
30
|
-
hide?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export type Select2Value = string | number | boolean | object;
|
|
33
|
-
export type Select2UpdateValue = Select2Value | Select2Value[];
|
|
34
|
-
export type Select2Data = (Select2Group | Select2Option)[];
|
|
35
|
-
export interface Select2UpdateEvent<U extends Select2UpdateValue = Select2Value> {
|
|
36
|
-
component
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
value: U;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
1
|
+
import { Select2 } from './select2.component';
|
|
2
|
+
export interface Select2Group {
|
|
3
|
+
/** label of group */
|
|
4
|
+
label: string;
|
|
5
|
+
/** options list */
|
|
6
|
+
options: Select2Option[];
|
|
7
|
+
/** add classes */
|
|
8
|
+
classes?: string;
|
|
9
|
+
/** template id */
|
|
10
|
+
templateId?: string;
|
|
11
|
+
/** template data */
|
|
12
|
+
data?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface Select2Option {
|
|
15
|
+
/** value */
|
|
16
|
+
value: Select2Value;
|
|
17
|
+
/** label of option */
|
|
18
|
+
label: string;
|
|
19
|
+
/** no selectable is disabled */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** for identification */
|
|
22
|
+
id?: string;
|
|
23
|
+
/** add classes */
|
|
24
|
+
classes?: string;
|
|
25
|
+
/** template id */
|
|
26
|
+
templateId?: string;
|
|
27
|
+
/** template data */
|
|
28
|
+
data?: any;
|
|
29
|
+
/** hide this option */
|
|
30
|
+
hide?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export type Select2Value = string | number | boolean | object;
|
|
33
|
+
export type Select2UpdateValue = Select2Value | Select2Value[];
|
|
34
|
+
export type Select2Data = (Select2Group | Select2Option)[];
|
|
35
|
+
export interface Select2UpdateEvent<U extends Select2UpdateValue = Select2Value> {
|
|
36
|
+
/** component */
|
|
37
|
+
readonly component: Select2;
|
|
38
|
+
/** current selected value */
|
|
39
|
+
readonly value: U;
|
|
40
|
+
/** selected option */
|
|
41
|
+
readonly options: Select2Option[];
|
|
42
|
+
}
|
|
43
|
+
export interface Select2SearchEvent<U extends Select2UpdateValue = Select2Value> {
|
|
44
|
+
/** component */
|
|
45
|
+
readonly component: Select2;
|
|
46
|
+
/** current selected value */
|
|
47
|
+
readonly value: U;
|
|
48
|
+
/** search text */
|
|
49
|
+
readonly search: string;
|
|
50
|
+
/** current data source */
|
|
51
|
+
readonly data: Select2Data;
|
|
52
|
+
/** method to call to update the data */
|
|
53
|
+
readonly filteredData: (data: Select2Data) => void;
|
|
54
|
+
}
|
|
55
|
+
export interface Select2RemoveEvent<U extends Select2UpdateValue = Select2Value> {
|
|
56
|
+
/** component */
|
|
57
|
+
readonly component: Select2;
|
|
58
|
+
/** current selected value */
|
|
59
|
+
readonly value: U;
|
|
60
|
+
/** remove */
|
|
61
|
+
readonly removedOption: Select2Option;
|
|
62
|
+
}
|
|
63
|
+
export interface Select2ScrollEvent {
|
|
64
|
+
/** component */
|
|
65
|
+
readonly component: Select2;
|
|
66
|
+
/** scroll way */
|
|
67
|
+
readonly way: 'up' | 'down';
|
|
68
|
+
/** search text */
|
|
69
|
+
readonly search: string;
|
|
70
|
+
/** current data */
|
|
71
|
+
readonly data: Select2Data;
|
|
72
|
+
}
|
|
55
73
|
//# sourceMappingURL=select2-interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select2-interfaces.d.ts","sourceRoot":"","sources":["../../../projects/ng-select2-component/src/lib/select2-interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,MAAM,WAAW,YAAY;IACzB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC1B,aAAa;IACb,KAAK,EAAE,YAAY,CAAC;IACpB,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yBAAyB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,uBAAuB;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,CAAC,YAAY,GAAG,aAAa,CAAC,EAAE,CAAC;AAE3D,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,kBAAkB,GAAG,YAAY;IAC3E,SAAS,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"select2-interfaces.d.ts","sourceRoot":"","sources":["../../../projects/ng-select2-component/src/lib/select2-interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE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kB,GAAG,YAAY;IAC3E,gBAAgB;IAChB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,kBAAkB;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,kBAAkB,GAAG,YAAY;IAC3E,gBAAgB;IAChB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,aAAa;IACb,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IAC/B,gBAAgB;IAChB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,iBAAiB;IACjB,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,kBAAkB;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mBAAmB;IACnB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class Select2Label {
|
|
3
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<Select2Label, never>;
|
|
4
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<Select2Label, "select2-label", never, {}, {}, never, never, false, never>;
|
|
5
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class Select2Label {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Select2Label, never>;
|
|
4
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<Select2Label, "select2-label", never, {}, {}, never, never, false, never>;
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=select2-label.component.d.ts.map
|
package/lib/select2-utils.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Select2Data, Select2Option, Select2UpdateValue, Select2Value } from './select2-interfaces';
|
|
2
|
-
export declare class Select2Utils {
|
|
3
|
-
static getOptionByValue(data: Select2Data, value: Select2Value | null | undefined): Select2Option;
|
|
4
|
-
static getOptionsByValue(data: Select2Data, value: Select2UpdateValue | null | undefined, multiple: boolean | null | undefined): Select2Option | Select2Option[];
|
|
5
|
-
static getFirstAvailableOption(data: Select2Data): Select2Value;
|
|
6
|
-
static valueIsNotInFilteredData(filteredData: Select2Data, value: Select2Value | null | undefined): boolean;
|
|
7
|
-
static getPreviousOption(filteredData: Select2Data, hoveringValue: Select2Value | null | undefined): Select2Option;
|
|
8
|
-
static getNextOption(filteredData: Select2Data, hoveringValue: Select2Value | null | undefined): Select2Option;
|
|
9
|
-
static getReduceData(data: Select2Data, maxResults?: number): {
|
|
10
|
-
result: Select2Data;
|
|
11
|
-
reduce: boolean;
|
|
12
|
-
};
|
|
13
|
-
static getFilteredData(data: Select2Data, searchText: string | null, editPattern?: (str: string) => string): Select2Data;
|
|
14
|
-
static getFilteredSelectedData(data: Select2Data, selectedOptions: Select2Option | Select2Option[] | null): Select2Data;
|
|
15
|
-
static isSearchboxHiddex(data: Select2Data, minCountForSearch?: number | string): boolean;
|
|
16
|
-
static isSelected(options: Select2Option | Select2Option[] | null, option: Select2Option, multiple: boolean | null | undefined): "true" | "false";
|
|
17
|
-
static removeSelection(options: Select2Option | Select2Option[] | null, option: Select2Option): void;
|
|
18
|
-
private static getOptionsCount;
|
|
19
|
-
private static isNullOrUndefined;
|
|
20
|
-
private static containSearchText;
|
|
21
|
-
private static protectPattern;
|
|
22
|
-
private static formatSansUnicode;
|
|
23
|
-
private static formatPattern;
|
|
24
|
-
}
|
|
1
|
+
import { Select2Data, Select2Option, Select2UpdateValue, Select2Value } from './select2-interfaces';
|
|
2
|
+
export declare class Select2Utils {
|
|
3
|
+
static getOptionByValue(data: Select2Data, value: Select2Value | null | undefined): Select2Option;
|
|
4
|
+
static getOptionsByValue(data: Select2Data, value: Select2UpdateValue | null | undefined, multiple: boolean | null | undefined): Select2Option | Select2Option[];
|
|
5
|
+
static getFirstAvailableOption(data: Select2Data): Select2Value;
|
|
6
|
+
static valueIsNotInFilteredData(filteredData: Select2Data, value: Select2Value | null | undefined): boolean;
|
|
7
|
+
static getPreviousOption(filteredData: Select2Data, hoveringValue: Select2Value | null | undefined): Select2Option;
|
|
8
|
+
static getNextOption(filteredData: Select2Data, hoveringValue: Select2Value | null | undefined): Select2Option;
|
|
9
|
+
static getReduceData(data: Select2Data, maxResults?: number): {
|
|
10
|
+
result: Select2Data;
|
|
11
|
+
reduce: boolean;
|
|
12
|
+
};
|
|
13
|
+
static getFilteredData(data: Select2Data, searchText: string | null, editPattern?: (str: string) => string): Select2Data;
|
|
14
|
+
static getFilteredSelectedData(data: Select2Data, selectedOptions: Select2Option | Select2Option[] | null): Select2Data;
|
|
15
|
+
static isSearchboxHiddex(data: Select2Data, minCountForSearch?: number | string): boolean;
|
|
16
|
+
static isSelected(options: Select2Option | Select2Option[] | null, option: Select2Option, multiple: boolean | null | undefined): "true" | "false";
|
|
17
|
+
static removeSelection(options: Select2Option | Select2Option[] | null, option: Select2Option): void;
|
|
18
|
+
private static getOptionsCount;
|
|
19
|
+
private static isNullOrUndefined;
|
|
20
|
+
private static containSearchText;
|
|
21
|
+
private static protectPattern;
|
|
22
|
+
private static formatSansUnicode;
|
|
23
|
+
private static formatPattern;
|
|
24
|
+
}
|
|
25
25
|
//# sourceMappingURL=select2-utils.d.ts.map
|