@skyux/lookup 5.6.0 → 5.6.1
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/bundles/skyux-lookup.umd.js +15 -33
- package/documentation.json +46 -40
- package/esm2015/lib/modules/autocomplete/autocomplete-adapter.service.js +0 -1
- package/esm2015/lib/modules/autocomplete/autocomplete-adapter.service.js.map +1 -1
- package/esm2015/lib/modules/autocomplete/autocomplete.component.js +8 -2
- package/esm2015/lib/modules/autocomplete/autocomplete.component.js.map +1 -1
- package/esm2015/lib/modules/lookup/lookup-autocomplete-adapter.js +7 -1
- package/esm2015/lib/modules/lookup/lookup-autocomplete-adapter.js.map +1 -1
- package/fesm2015/skyux-lookup.js +15 -33
- package/fesm2015/skyux-lookup.js.map +1 -1
- package/lib/modules/autocomplete/autocomplete-adapter.service.d.ts +0 -1
- package/lib/modules/autocomplete/autocomplete.component.d.ts +8 -2
- package/lib/modules/lookup/lookup-autocomplete-adapter.d.ts +7 -1
- package/package.json +21 -18
- package/esm2015/lib/polyfills.js +0 -30
- package/esm2015/lib/polyfills.js.map +0 -1
- package/lib/polyfills.d.ts +0 -0
|
@@ -708,36 +708,6 @@
|
|
|
708
708
|
return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
709
709
|
}
|
|
710
710
|
|
|
711
|
-
// tslint:disable:no-null-keyword
|
|
712
|
-
/* istanbul ignore file */
|
|
713
|
-
// Polyfill for Element.closest().
|
|
714
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
|
|
715
|
-
// Returns the closest ancestor of the current element (or the current element itself) which
|
|
716
|
-
// matches the selectors given in parameter. If there isn't such an ancestor, it returns null.
|
|
717
|
-
if (!Element.prototype.closest) {
|
|
718
|
-
Element.prototype.closest = function (s) {
|
|
719
|
-
var el = this;
|
|
720
|
-
if (!document.documentElement.contains(el)) {
|
|
721
|
-
return null;
|
|
722
|
-
}
|
|
723
|
-
do {
|
|
724
|
-
if (el.matches(s)) {
|
|
725
|
-
return el;
|
|
726
|
-
}
|
|
727
|
-
el = el.parentElement || el.parentNode;
|
|
728
|
-
} while (el !== null && el.nodeType === 1);
|
|
729
|
-
return null;
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
// Polyfill for Element.matches().
|
|
733
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
|
734
|
-
// Returns true if the element would be selected by the specified selector string.
|
|
735
|
-
if (!Element.prototype.matches) {
|
|
736
|
-
Element.prototype.matches =
|
|
737
|
-
Element.prototype.msMatchesSelector ||
|
|
738
|
-
/* istanbul ignore next */ Element.prototype.webkitMatchesSelector;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
711
|
/**
|
|
742
712
|
* @internal
|
|
743
713
|
*/
|
|
@@ -887,6 +857,10 @@
|
|
|
887
857
|
* Fires when users select the button to view all options.
|
|
888
858
|
*/
|
|
889
859
|
this.showMoreClick = new i0.EventEmitter();
|
|
860
|
+
/**
|
|
861
|
+
* Fires when users enter new search information and allows results to be
|
|
862
|
+
* returned via an observable.
|
|
863
|
+
*/
|
|
890
864
|
this.searchAsync = new i0.EventEmitter();
|
|
891
865
|
this.isOpen = false;
|
|
892
866
|
this.isSearchingAsync = false;
|
|
@@ -914,7 +888,7 @@
|
|
|
914
888
|
/**
|
|
915
889
|
* Specifies a static data source for the autocomplete component to search
|
|
916
890
|
* when users enter text. For a dynamic data source such as an array that
|
|
917
|
-
* changes due to server calls, use
|
|
891
|
+
* changes due to server calls, use `search` or `searchAsync` instead.
|
|
918
892
|
*/
|
|
919
893
|
set: function (value) {
|
|
920
894
|
this._data = value;
|
|
@@ -993,7 +967,9 @@
|
|
|
993
967
|
* Specifies a function to dynamically manage the data source when users
|
|
994
968
|
* change the text in the autocomplete field. The search function must return
|
|
995
969
|
* an array or a promise of an array. The `search` property is particularly
|
|
996
|
-
* useful when the data source does not live in the source code.
|
|
970
|
+
* useful when the data source does not live in the source code. If the
|
|
971
|
+
* search requires calling a remote data source, use `searchAsync` instead of
|
|
972
|
+
* `search`.
|
|
997
973
|
*/
|
|
998
974
|
set: function (value) {
|
|
999
975
|
this._search = value;
|
|
@@ -2985,6 +2961,10 @@
|
|
|
2985
2961
|
*/
|
|
2986
2962
|
var SkyLookupAutocompleteAdapter = /** @class */ (function () {
|
|
2987
2963
|
function SkyLookupAutocompleteAdapter() {
|
|
2964
|
+
/**
|
|
2965
|
+
* Fires when users enter new search information and allows results to be
|
|
2966
|
+
* returned via an observable.
|
|
2967
|
+
*/
|
|
2988
2968
|
this.searchAsync = new i0.EventEmitter();
|
|
2989
2969
|
}
|
|
2990
2970
|
Object.defineProperty(SkyLookupAutocompleteAdapter.prototype, "descriptorProperty", {
|
|
@@ -3028,7 +3008,9 @@
|
|
|
3028
3008
|
* Specifies a function to dynamically manage the data source when users
|
|
3029
3009
|
* change the text in the lookup field. The search function must return
|
|
3030
3010
|
* an array or a promise of an array. The `search` property is particularly
|
|
3031
|
-
* useful when the data source does not live in the source code.
|
|
3011
|
+
* useful when the data source does not live in the source code. If the
|
|
3012
|
+
* search requires calling a remote data source, use `searchAsync` instead of
|
|
3013
|
+
* `search`.
|
|
3032
3014
|
*/
|
|
3033
3015
|
set: function (value) {
|
|
3034
3016
|
this._search = value;
|
package/documentation.json
CHANGED
|
@@ -2766,7 +2766,7 @@
|
|
|
2766
2766
|
"sources": [
|
|
2767
2767
|
{
|
|
2768
2768
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
2769
|
-
"line":
|
|
2769
|
+
"line": 442,
|
|
2770
2770
|
"character": 2
|
|
2771
2771
|
}
|
|
2772
2772
|
],
|
|
@@ -2923,7 +2923,7 @@
|
|
|
2923
2923
|
"sources": [
|
|
2924
2924
|
{
|
|
2925
2925
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
2926
|
-
"line":
|
|
2926
|
+
"line": 306,
|
|
2927
2927
|
"character": 9
|
|
2928
2928
|
}
|
|
2929
2929
|
],
|
|
@@ -2944,7 +2944,7 @@
|
|
|
2944
2944
|
"sources": [
|
|
2945
2945
|
{
|
|
2946
2946
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
2947
|
-
"line":
|
|
2947
|
+
"line": 318,
|
|
2948
2948
|
"character": 9
|
|
2949
2949
|
}
|
|
2950
2950
|
],
|
|
@@ -2986,7 +2986,7 @@
|
|
|
2986
2986
|
"sources": [
|
|
2987
2987
|
{
|
|
2988
2988
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
2989
|
-
"line":
|
|
2989
|
+
"line": 255,
|
|
2990
2990
|
"character": 9
|
|
2991
2991
|
}
|
|
2992
2992
|
],
|
|
@@ -3006,7 +3006,7 @@
|
|
|
3006
3006
|
"sources": [
|
|
3007
3007
|
{
|
|
3008
3008
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3009
|
-
"line":
|
|
3009
|
+
"line": 308,
|
|
3010
3010
|
"character": 9
|
|
3011
3011
|
}
|
|
3012
3012
|
],
|
|
@@ -3026,7 +3026,7 @@
|
|
|
3026
3026
|
"sources": [
|
|
3027
3027
|
{
|
|
3028
3028
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3029
|
-
"line":
|
|
3029
|
+
"line": 310,
|
|
3030
3030
|
"character": 9
|
|
3031
3031
|
}
|
|
3032
3032
|
],
|
|
@@ -3043,6 +3043,9 @@
|
|
|
3043
3043
|
"flags": {
|
|
3044
3044
|
"isPublic": true
|
|
3045
3045
|
},
|
|
3046
|
+
"comment": {
|
|
3047
|
+
"shortText": "Fires when users enter new search information and allows results to be\nreturned via an observable."
|
|
3048
|
+
},
|
|
3046
3049
|
"decorators": [
|
|
3047
3050
|
{
|
|
3048
3051
|
"name": "Output",
|
|
@@ -3058,7 +3061,7 @@
|
|
|
3058
3061
|
"sources": [
|
|
3059
3062
|
{
|
|
3060
3063
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3061
|
-
"line":
|
|
3064
|
+
"line": 292,
|
|
3062
3065
|
"character": 9
|
|
3063
3066
|
}
|
|
3064
3067
|
],
|
|
@@ -3103,7 +3106,7 @@
|
|
|
3103
3106
|
"sources": [
|
|
3104
3107
|
{
|
|
3105
3108
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3106
|
-
"line":
|
|
3109
|
+
"line": 224,
|
|
3107
3110
|
"character": 9
|
|
3108
3111
|
}
|
|
3109
3112
|
],
|
|
@@ -3127,7 +3130,7 @@
|
|
|
3127
3130
|
"sources": [
|
|
3128
3131
|
{
|
|
3129
3132
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3130
|
-
"line":
|
|
3133
|
+
"line": 320,
|
|
3131
3134
|
"character": 9
|
|
3132
3135
|
}
|
|
3133
3136
|
],
|
|
@@ -3147,7 +3150,7 @@
|
|
|
3147
3150
|
"sources": [
|
|
3148
3151
|
{
|
|
3149
3152
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3150
|
-
"line":
|
|
3153
|
+
"line": 312,
|
|
3151
3154
|
"character": 9
|
|
3152
3155
|
}
|
|
3153
3156
|
],
|
|
@@ -3191,7 +3194,7 @@
|
|
|
3191
3194
|
"kindString": "Get signature",
|
|
3192
3195
|
"flags": {},
|
|
3193
3196
|
"comment": {
|
|
3194
|
-
"shortText": "Specifies a static data source for the autocomplete component to search\nwhen users enter text. For a dynamic data source such as an array that\nchanges due to server calls, use
|
|
3197
|
+
"shortText": "Specifies a static data source for the autocomplete component to search\nwhen users enter text. For a dynamic data source such as an array that\nchanges due to server calls, use `search` or `searchAsync` instead."
|
|
3195
3198
|
},
|
|
3196
3199
|
"type": {
|
|
3197
3200
|
"type": "array",
|
|
@@ -3210,7 +3213,7 @@
|
|
|
3210
3213
|
"kindString": "Set signature",
|
|
3211
3214
|
"flags": {},
|
|
3212
3215
|
"comment": {
|
|
3213
|
-
"shortText": "Specifies a static data source for the autocomplete component to search\nwhen users enter text. For a dynamic data source such as an array that\nchanges due to server calls, use
|
|
3216
|
+
"shortText": "Specifies a static data source for the autocomplete component to search\nwhen users enter text. For a dynamic data source such as an array that\nchanges due to server calls, use `search` or `searchAsync` instead."
|
|
3214
3217
|
},
|
|
3215
3218
|
"parameters": [
|
|
3216
3219
|
{
|
|
@@ -3416,7 +3419,7 @@
|
|
|
3416
3419
|
"sources": [
|
|
3417
3420
|
{
|
|
3418
3421
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3419
|
-
"line":
|
|
3422
|
+
"line": 302,
|
|
3420
3423
|
"character": 13
|
|
3421
3424
|
}
|
|
3422
3425
|
],
|
|
@@ -3551,7 +3554,7 @@
|
|
|
3551
3554
|
"sources": [
|
|
3552
3555
|
{
|
|
3553
3556
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3554
|
-
"line":
|
|
3557
|
+
"line": 171,
|
|
3555
3558
|
"character": 13
|
|
3556
3559
|
}
|
|
3557
3560
|
],
|
|
@@ -3563,7 +3566,7 @@
|
|
|
3563
3566
|
"kindString": "Get signature",
|
|
3564
3567
|
"flags": {},
|
|
3565
3568
|
"comment": {
|
|
3566
|
-
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the autocomplete field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code."
|
|
3569
|
+
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the autocomplete field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code. If the\nsearch requires calling a remote data source, use `searchAsync` instead of\n`search`."
|
|
3567
3570
|
},
|
|
3568
3571
|
"type": {
|
|
3569
3572
|
"type": "reference",
|
|
@@ -3580,7 +3583,7 @@
|
|
|
3580
3583
|
"kindString": "Set signature",
|
|
3581
3584
|
"flags": {},
|
|
3582
3585
|
"comment": {
|
|
3583
|
-
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the autocomplete field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code."
|
|
3586
|
+
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the autocomplete field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code. If the\nsearch requires calling a remote data source, use `searchAsync` instead of\n`search`."
|
|
3584
3587
|
},
|
|
3585
3588
|
"parameters": [
|
|
3586
3589
|
{
|
|
@@ -3626,7 +3629,7 @@
|
|
|
3626
3629
|
"sources": [
|
|
3627
3630
|
{
|
|
3628
3631
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3629
|
-
"line":
|
|
3632
|
+
"line": 191,
|
|
3630
3633
|
"character": 13
|
|
3631
3634
|
}
|
|
3632
3635
|
],
|
|
@@ -3703,7 +3706,7 @@
|
|
|
3703
3706
|
"sources": [
|
|
3704
3707
|
{
|
|
3705
3708
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3706
|
-
"line":
|
|
3709
|
+
"line": 298,
|
|
3707
3710
|
"character": 13
|
|
3708
3711
|
}
|
|
3709
3712
|
],
|
|
@@ -3747,7 +3750,7 @@
|
|
|
3747
3750
|
"sources": [
|
|
3748
3751
|
{
|
|
3749
3752
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3750
|
-
"line":
|
|
3753
|
+
"line": 231,
|
|
3751
3754
|
"character": 13
|
|
3752
3755
|
}
|
|
3753
3756
|
],
|
|
@@ -3820,7 +3823,7 @@
|
|
|
3820
3823
|
"sources": [
|
|
3821
3824
|
{
|
|
3822
3825
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3823
|
-
"line":
|
|
3826
|
+
"line": 206,
|
|
3824
3827
|
"character": 13
|
|
3825
3828
|
}
|
|
3826
3829
|
],
|
|
@@ -3905,7 +3908,7 @@
|
|
|
3905
3908
|
"sources": [
|
|
3906
3909
|
{
|
|
3907
3910
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3908
|
-
"line":
|
|
3911
|
+
"line": 283,
|
|
3909
3912
|
"character": 13
|
|
3910
3913
|
}
|
|
3911
3914
|
],
|
|
@@ -3946,7 +3949,7 @@
|
|
|
3946
3949
|
"sources": [
|
|
3947
3950
|
{
|
|
3948
3951
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3949
|
-
"line":
|
|
3952
|
+
"line": 314,
|
|
3950
3953
|
"character": 13
|
|
3951
3954
|
}
|
|
3952
3955
|
],
|
|
@@ -3975,7 +3978,7 @@
|
|
|
3975
3978
|
"sources": [
|
|
3976
3979
|
{
|
|
3977
3980
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
3978
|
-
"line":
|
|
3981
|
+
"line": 481,
|
|
3979
3982
|
"character": 9
|
|
3980
3983
|
}
|
|
3981
3984
|
],
|
|
@@ -4004,7 +4007,7 @@
|
|
|
4004
4007
|
"sources": [
|
|
4005
4008
|
{
|
|
4006
4009
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4007
|
-
"line":
|
|
4010
|
+
"line": 487,
|
|
4008
4011
|
"character": 9
|
|
4009
4012
|
}
|
|
4010
4013
|
],
|
|
@@ -4048,7 +4051,7 @@
|
|
|
4048
4051
|
"sources": [
|
|
4049
4052
|
{
|
|
4050
4053
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4051
|
-
"line":
|
|
4054
|
+
"line": 596,
|
|
4052
4055
|
"character": 9
|
|
4053
4056
|
}
|
|
4054
4057
|
],
|
|
@@ -4092,7 +4095,7 @@
|
|
|
4092
4095
|
"sources": [
|
|
4093
4096
|
{
|
|
4094
4097
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4095
|
-
"line":
|
|
4098
|
+
"line": 568,
|
|
4096
4099
|
"character": 9
|
|
4097
4100
|
}
|
|
4098
4101
|
],
|
|
@@ -4121,7 +4124,7 @@
|
|
|
4121
4124
|
"sources": [
|
|
4122
4125
|
{
|
|
4123
4126
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4124
|
-
"line":
|
|
4127
|
+
"line": 455,
|
|
4125
4128
|
"character": 9
|
|
4126
4129
|
}
|
|
4127
4130
|
],
|
|
@@ -4158,7 +4161,7 @@
|
|
|
4158
4161
|
"sources": [
|
|
4159
4162
|
{
|
|
4160
4163
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4161
|
-
"line":
|
|
4164
|
+
"line": 467,
|
|
4162
4165
|
"character": 9
|
|
4163
4166
|
}
|
|
4164
4167
|
],
|
|
@@ -4195,7 +4198,7 @@
|
|
|
4195
4198
|
"sources": [
|
|
4196
4199
|
{
|
|
4197
4200
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4198
|
-
"line":
|
|
4201
|
+
"line": 471,
|
|
4199
4202
|
"character": 9
|
|
4200
4203
|
}
|
|
4201
4204
|
],
|
|
@@ -4232,7 +4235,7 @@
|
|
|
4232
4235
|
"sources": [
|
|
4233
4236
|
{
|
|
4234
4237
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4235
|
-
"line":
|
|
4238
|
+
"line": 574,
|
|
4236
4239
|
"character": 9
|
|
4237
4240
|
}
|
|
4238
4241
|
],
|
|
@@ -4287,7 +4290,7 @@
|
|
|
4287
4290
|
"sources": [
|
|
4288
4291
|
{
|
|
4289
4292
|
"fileName": "projects/lookup/src/modules/autocomplete/autocomplete.component.ts",
|
|
4290
|
-
"line":
|
|
4293
|
+
"line": 587,
|
|
4291
4294
|
"character": 9
|
|
4292
4295
|
}
|
|
4293
4296
|
],
|
|
@@ -6374,6 +6377,9 @@
|
|
|
6374
6377
|
"flags": {
|
|
6375
6378
|
"isPublic": true
|
|
6376
6379
|
},
|
|
6380
|
+
"comment": {
|
|
6381
|
+
"shortText": "Fires when users enter new search information and allows results to be\nreturned via an observable."
|
|
6382
|
+
},
|
|
6377
6383
|
"decorators": [
|
|
6378
6384
|
{
|
|
6379
6385
|
"name": "Output",
|
|
@@ -6389,7 +6395,7 @@
|
|
|
6389
6395
|
"sources": [
|
|
6390
6396
|
{
|
|
6391
6397
|
"fileName": "projects/lookup/src/modules/lookup/lookup-autocomplete-adapter.ts",
|
|
6392
|
-
"line":
|
|
6398
|
+
"line": 116,
|
|
6393
6399
|
"character": 9
|
|
6394
6400
|
}
|
|
6395
6401
|
],
|
|
@@ -6438,7 +6444,7 @@
|
|
|
6438
6444
|
"sources": [
|
|
6439
6445
|
{
|
|
6440
6446
|
"fileName": "projects/lookup/src/modules/lookup/lookup-autocomplete-adapter.ts",
|
|
6441
|
-
"line":
|
|
6447
|
+
"line": 102,
|
|
6442
6448
|
"character": 9
|
|
6443
6449
|
}
|
|
6444
6450
|
],
|
|
@@ -6481,7 +6487,7 @@
|
|
|
6481
6487
|
"sources": [
|
|
6482
6488
|
{
|
|
6483
6489
|
"fileName": "projects/lookup/src/modules/lookup/lookup-autocomplete-adapter.ts",
|
|
6484
|
-
"line":
|
|
6490
|
+
"line": 83,
|
|
6485
6491
|
"character": 9
|
|
6486
6492
|
}
|
|
6487
6493
|
],
|
|
@@ -6528,7 +6534,7 @@
|
|
|
6528
6534
|
"sources": [
|
|
6529
6535
|
{
|
|
6530
6536
|
"fileName": "projects/lookup/src/modules/lookup/lookup-autocomplete-adapter.ts",
|
|
6531
|
-
"line":
|
|
6537
|
+
"line": 109,
|
|
6532
6538
|
"character": 9
|
|
6533
6539
|
}
|
|
6534
6540
|
],
|
|
@@ -6573,7 +6579,7 @@
|
|
|
6573
6579
|
"sources": [
|
|
6574
6580
|
{
|
|
6575
6581
|
"fileName": "projects/lookup/src/modules/lookup/lookup-autocomplete-adapter.ts",
|
|
6576
|
-
"line":
|
|
6582
|
+
"line": 92,
|
|
6577
6583
|
"character": 9
|
|
6578
6584
|
}
|
|
6579
6585
|
],
|
|
@@ -7015,7 +7021,7 @@
|
|
|
7015
7021
|
"sources": [
|
|
7016
7022
|
{
|
|
7017
7023
|
"fileName": "projects/lookup/src/modules/lookup/lookup-autocomplete-adapter.ts",
|
|
7018
|
-
"line":
|
|
7024
|
+
"line": 63,
|
|
7019
7025
|
"character": 13
|
|
7020
7026
|
}
|
|
7021
7027
|
],
|
|
@@ -7027,7 +7033,7 @@
|
|
|
7027
7033
|
"kindString": "Get signature",
|
|
7028
7034
|
"flags": {},
|
|
7029
7035
|
"comment": {
|
|
7030
|
-
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the lookup field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code."
|
|
7036
|
+
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the lookup field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code. If the\nsearch requires calling a remote data source, use `searchAsync` instead of\n`search`."
|
|
7031
7037
|
},
|
|
7032
7038
|
"type": {
|
|
7033
7039
|
"type": "reference",
|
|
@@ -7048,7 +7054,7 @@
|
|
|
7048
7054
|
"kindString": "Set signature",
|
|
7049
7055
|
"flags": {},
|
|
7050
7056
|
"comment": {
|
|
7051
|
-
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the lookup field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code."
|
|
7057
|
+
"shortText": "Specifies a function to dynamically manage the data source when users\nchange the text in the lookup field. The search function must return\nan array or a promise of an array. The `search` property is particularly\nuseful when the data source does not live in the source code. If the\nsearch requires calling a remote data source, use `searchAsync` instead of\n`search`."
|
|
7052
7058
|
},
|
|
7053
7059
|
"parameters": [
|
|
7054
7060
|
{
|
|
@@ -9640,7 +9646,7 @@
|
|
|
9640
9646
|
{
|
|
9641
9647
|
"fileName": "search-demo.component.ts",
|
|
9642
9648
|
"filePath": "/projects/lookup/documentation/code-examples/search/basic/search-demo.component.ts",
|
|
9643
|
-
"rawContents": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-search-demo',\n templateUrl: './search-demo.component.html',\n})\nexport class SearchDemoComponent {\n public displayedItems: any;\n\n private items: any[] = [\n {\n title: 'Call Robert Hernandez',\n note: 'Robert recently gave a very generous gift. We should call to thank him.',\n },\n {\n title: 'Send invitation to ball',\n note: \"The Spring Ball is coming up soon. Let's get those invitations out!\",\n },\n {\n title: 'Clean up desk',\n note: 'File and organize papers.',\n },\n {\n title: 'Investigate leads',\n note: 'Check out leads for important charity event funding.',\n },\n {\n title: 'Send thank you note',\n note: 'Send a thank you note to Timothy for his donation.',\n },\n ];\n\n public searchText: string;\n\n constructor() {\n this.displayedItems = this.items;\n }\n\n public searchApplied(searchText: string): void {\n let filteredItems = this.items;\n this.searchText = searchText;\n\n if (searchText) {\n filteredItems = this.items.filter(function (item: any) {\n let property: any;\n\n for (property in item) {\n if (\n
|
|
9649
|
+
"rawContents": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-search-demo',\n templateUrl: './search-demo.component.html',\n})\nexport class SearchDemoComponent {\n public displayedItems: any;\n\n private items: any[] = [\n {\n title: 'Call Robert Hernandez',\n note: 'Robert recently gave a very generous gift. We should call to thank him.',\n },\n {\n title: 'Send invitation to ball',\n note: \"The Spring Ball is coming up soon. Let's get those invitations out!\",\n },\n {\n title: 'Clean up desk',\n note: 'File and organize papers.',\n },\n {\n title: 'Investigate leads',\n note: 'Check out leads for important charity event funding.',\n },\n {\n title: 'Send thank you note',\n note: 'Send a thank you note to Timothy for his donation.',\n },\n ];\n\n public searchText: string;\n\n constructor() {\n this.displayedItems = this.items;\n }\n\n public searchApplied(searchText: string): void {\n let filteredItems = this.items;\n this.searchText = searchText;\n\n if (searchText) {\n filteredItems = this.items.filter(function (item: any) {\n let property: any;\n\n for (property in item) {\n if (\n Object.prototype.hasOwnProperty.call(item, property) &&\n (property === 'title' || property === 'note')\n ) {\n if (item[property].indexOf(searchText) > -1) {\n return true;\n }\n }\n }\n\n return false;\n });\n }\n this.displayedItems = filteredItems;\n }\n}\n"
|
|
9644
9650
|
},
|
|
9645
9651
|
{
|
|
9646
9652
|
"fileName": "search-demo.module.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lookup/src/lib/modules/autocomplete/autocomplete-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAsB,MAAM,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"autocomplete-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lookup/src/lib/modules/autocomplete/autocomplete-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAsB,MAAM,aAAa,CAAC;;;AAExE;;GAEG;AAEH,MAAM,OAAO,6BAA6B;IAGxC,YACU,kBAAyC,EACzC,eAAiC;QADjC,uBAAkB,GAAlB,kBAAkB,CAAuB;QACzC,oBAAe,GAAf,eAAe,CAAkB;QAEzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,OAAoB,EAAE,SAAiB;QACxD,kBAAkB;QAClB,0BAA0B;QAC1B,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;SAC5C;IACH,CAAC;IAEM,2BAA2B,CAChC,OAA2B;QAE3B,OAAO,IAAI,CAAC,kBAAkB,CAAC,oBAAoB;QACjD,yDAAyD;QACzD,0BAA0B;QAC1B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC,QAAQ,CAAC,aAAa,EAC5C,EAAE,cAAc,EAAE,IAAI,EAAE,CACzB,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,OAAoB,EAAE,SAAiB;QAC3D,kBAAkB;QAClB,0BAA0B;QAC1B,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;SAC/C;IACH,CAAC;IAEM,gBAAgB,CACrB,UAAsB,EACtB,WAAuB,EACvB,UAAmB;QAEnB,MAAM,aAAa,GAAG,UAAU;YAC9B,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,gBAAgB,CAAC;YACpD,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC;QAC7B,IAAI,aAAa,EAAE;YACjB,MAAM,KAAK,GAAG,aAAa,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;YAC1D,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,aAAa,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;SAC1E;IACH,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,OAAoB,EAAE,QAAgB;QACvD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,CAAC;;2HA9DU,6BAA6B;+HAA7B,6BAA6B;4FAA7B,6BAA6B;kBADzC,UAAU","sourcesContent":["import {\n ElementRef,\n Injectable,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\nimport { SkyCoreAdapterService, SkyOverlayInstance } from '@skyux/core';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyAutocompleteAdapterService {\n private renderer: Renderer2;\n\n constructor(\n private coreAdapterService: SkyCoreAdapterService,\n private rendererFactory: RendererFactory2\n ) {\n this.renderer = this.rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * Adds the className for the provided element.\n */\n public addCSSClass(element: HTMLElement, className: string): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (element) {\n this.renderer.addClass(element, className);\n }\n }\n\n public getOverlayFocusableElements(\n overlay: SkyOverlayInstance\n ): HTMLElement[] {\n return this.coreAdapterService.getFocusableChildren(\n /* Sanity check - calling function also has null check */\n /* istanbul ignore next */\n overlay?.componentRef.location.nativeElement,\n { ignoreTabIndex: true }\n );\n }\n\n /**\n * Removes the className for the provided element.\n */\n public removeCSSClass(element: HTMLElement, className: string): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (element) {\n this.renderer.removeClass(element, className);\n }\n }\n\n public setDropdownWidth(\n elementRef: ElementRef,\n dropdownRef: ElementRef,\n isInputBox: boolean\n ): void {\n const parentElement = isInputBox\n ? elementRef.nativeElement.closest('.sky-input-box')\n : elementRef.nativeElement;\n if (parentElement) {\n const width = parentElement.getBoundingClientRect().width;\n this.renderer.setStyle(dropdownRef.nativeElement, 'width', `${width}px`);\n }\n }\n\n /**\n * Sets the `tabIndex` of the `element` to the provided `tabIndex`.\n */\n public setTabIndex(element: HTMLElement, tabIndex: number): void {\n element.tabIndex = tabIndex;\n }\n}\n"]}
|
|
@@ -52,6 +52,10 @@ export class SkyAutocompleteComponent {
|
|
|
52
52
|
* Fires when users select the button to view all options.
|
|
53
53
|
*/
|
|
54
54
|
this.showMoreClick = new EventEmitter();
|
|
55
|
+
/**
|
|
56
|
+
* Fires when users enter new search information and allows results to be
|
|
57
|
+
* returned via an observable.
|
|
58
|
+
*/
|
|
55
59
|
this.searchAsync = new EventEmitter();
|
|
56
60
|
this.isOpen = false;
|
|
57
61
|
this.isSearchingAsync = false;
|
|
@@ -75,7 +79,7 @@ export class SkyAutocompleteComponent {
|
|
|
75
79
|
/**
|
|
76
80
|
* Specifies a static data source for the autocomplete component to search
|
|
77
81
|
* when users enter text. For a dynamic data source such as an array that
|
|
78
|
-
* changes due to server calls, use
|
|
82
|
+
* changes due to server calls, use `search` or `searchAsync` instead.
|
|
79
83
|
*/
|
|
80
84
|
set data(value) {
|
|
81
85
|
this._data = value;
|
|
@@ -130,7 +134,9 @@ export class SkyAutocompleteComponent {
|
|
|
130
134
|
* Specifies a function to dynamically manage the data source when users
|
|
131
135
|
* change the text in the autocomplete field. The search function must return
|
|
132
136
|
* an array or a promise of an array. The `search` property is particularly
|
|
133
|
-
* useful when the data source does not live in the source code.
|
|
137
|
+
* useful when the data source does not live in the source code. If the
|
|
138
|
+
* search requires calling a remote data source, use `searchAsync` instead of
|
|
139
|
+
* `search`.
|
|
134
140
|
*/
|
|
135
141
|
set search(value) {
|
|
136
142
|
this._search = value;
|