inviton-powerduck 0.0.126 → 0.0.128
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.
|
@@ -37,7 +37,6 @@ export interface FilterableSelectDataSource {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export default function FilterableSelect(this: any, args: FilterableSelectArgs): void {
|
|
40
|
-
const self = this;
|
|
41
40
|
const iframeTopMode = !(args.iframeTopMode == false);
|
|
42
41
|
let contextWindow, contextBody;
|
|
43
42
|
|
|
@@ -69,24 +68,22 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
69
68
|
let openClickTime = null;
|
|
70
69
|
let warmupHandle = null;
|
|
71
70
|
const cssClass = args.cssClass || null;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(FilterableSelect as any).currentInstance =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
self._isGhostClick = function () {
|
|
71
|
+
this.onItemSelected = args.onItemSelected;
|
|
72
|
+
this.onCancel = null;
|
|
73
|
+
this.animate = animate;
|
|
74
|
+
this.warmupMode = args.warmupMode;
|
|
75
|
+
this.selectedIds = selectedIds;
|
|
76
|
+
this.multiselect = args.multiselect == true;
|
|
77
|
+
(FilterableSelect as any).currentInstance = this;
|
|
78
|
+
|
|
79
|
+
const htmlEscape = str => String(str)
|
|
80
|
+
.replace(/&/g, '&')
|
|
81
|
+
.replace(/"/g, '"')
|
|
82
|
+
.replace(/'/g, ''')
|
|
83
|
+
.replace(/</g, '<')
|
|
84
|
+
.replace(/>/g, '>');
|
|
85
|
+
|
|
86
|
+
this._isGhostClick = () => {
|
|
90
87
|
if (!useIscroll && !useFastClick) {
|
|
91
88
|
return false;
|
|
92
89
|
}
|
|
@@ -96,7 +93,7 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
96
93
|
return !(timeDiff > 700);
|
|
97
94
|
};
|
|
98
95
|
|
|
99
|
-
|
|
96
|
+
this._getDropDownInnerStyle = () => {
|
|
100
97
|
if (useIscroll) {
|
|
101
98
|
return '';
|
|
102
99
|
} else {
|
|
@@ -104,12 +101,12 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
104
101
|
}
|
|
105
102
|
};
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
this._getDropDownTemplate = () => {
|
|
108
105
|
let bottomCss = '';
|
|
109
106
|
let rootCss = args.multiselect ? 'fdd-multiselect-root' : 'fdd-singleselect-root';
|
|
110
107
|
let buttonHtml = `<button id="btn_fdd_FddCancel" type="button" class="fdd-cancel-btn ${cancelButtonCss}">${cancelText}</button>`;
|
|
111
108
|
|
|
112
|
-
if (
|
|
109
|
+
if (this.multiselect) {
|
|
113
110
|
bottomCss = 'fdd-bottom-hasmultiple';
|
|
114
111
|
buttonHtml += `<div class="fdd-btn-separator"></div><button id="btn_fdd_FddConfirm" type="button" class="fdd-confirm-btn ${confirmButtonCss}">${confirmText}</button>`;
|
|
115
112
|
}
|
|
@@ -118,31 +115,29 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
118
115
|
rootCss += ` ${args.containerCssClass}`;
|
|
119
116
|
}
|
|
120
117
|
|
|
121
|
-
return `<div id="filterableSelectDropDown" style="" class="${
|
|
118
|
+
return `<div id="filterableSelectDropDown" style="" class="${this._getAnimClass()}${this._getWarmupModeClass()}${this._getAllowExclusivityCss()} ${rootCss}"><div id="filterableSelectDropDownInner" class="fdd-list-block fdd-winner fdd-main${args.useListviewBuilder != true ? ' fdd-nolvbuilder' : ''}" style="${this._getDropDownInnerStyle()}"><div id="filterableSelectDropWrap" class="fdd-swrap"><div id="filterableSelectDropContainer" class="fdd-sscroll"></div></div></div><div class="fdd-bottom ${bottomCss}">${buttonHtml}</div></div>`;
|
|
122
119
|
};
|
|
123
120
|
|
|
124
|
-
|
|
121
|
+
this._getAnimClass = () => {
|
|
125
122
|
const animateClass = '';
|
|
126
|
-
if (
|
|
123
|
+
if (this.animate) {
|
|
127
124
|
return 'fdd-anim-init';
|
|
128
125
|
} else {
|
|
129
126
|
return '';
|
|
130
127
|
}
|
|
131
128
|
};
|
|
132
129
|
|
|
133
|
-
|
|
134
|
-
if (
|
|
130
|
+
this._getWarmupModeClass = () => {
|
|
131
|
+
if (this.warmupMode == true) {
|
|
135
132
|
return ' fdd-warmup-mode';
|
|
136
133
|
} else {
|
|
137
134
|
return '';
|
|
138
135
|
}
|
|
139
136
|
};
|
|
140
137
|
|
|
141
|
-
|
|
142
|
-
return (args.allowExclusiveSearch == true ? ' fdd-has-exclusive-switch ' : '');
|
|
143
|
-
};
|
|
138
|
+
this._getAllowExclusivityCss = () => args.allowExclusiveSearch == true ? ' fdd-has-exclusive-switch ' : '';
|
|
144
139
|
|
|
145
|
-
|
|
140
|
+
this._getTargetElement = (iScroll) => {
|
|
146
141
|
if (iScroll) {
|
|
147
142
|
return $(contextBody).find('#filterableSelectDropContainer');
|
|
148
143
|
} else {
|
|
@@ -150,7 +145,7 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
150
145
|
}
|
|
151
146
|
};
|
|
152
147
|
|
|
153
|
-
|
|
148
|
+
this._getClickEventName = (iScroll) => {
|
|
154
149
|
if (iScroll) {
|
|
155
150
|
return 'iscrollTap';
|
|
156
151
|
} else {
|
|
@@ -158,7 +153,7 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
158
153
|
}
|
|
159
154
|
};
|
|
160
155
|
|
|
161
|
-
|
|
156
|
+
this.removeElems = (preventGhostClick) => {
|
|
162
157
|
if (preventGhostClick == null) {
|
|
163
158
|
preventGhostClick = false;
|
|
164
159
|
}
|
|
@@ -200,21 +195,21 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
200
195
|
}
|
|
201
196
|
};
|
|
202
197
|
|
|
203
|
-
|
|
204
|
-
if (
|
|
205
|
-
|
|
198
|
+
this.cancel = () => {
|
|
199
|
+
if (this.onCancel != null) {
|
|
200
|
+
this.onCancel();
|
|
206
201
|
}
|
|
207
202
|
|
|
208
|
-
|
|
203
|
+
this.close();
|
|
209
204
|
};
|
|
210
205
|
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
this.close = () => {
|
|
207
|
+
this.removeElems();
|
|
213
208
|
};
|
|
214
209
|
|
|
215
|
-
|
|
210
|
+
this._getRowLineWithSelected = (item) => {
|
|
216
211
|
let itemLine;
|
|
217
|
-
if (
|
|
212
|
+
if (this.selectedIds == null || !this.selectedIds.includes(item.id)) {
|
|
218
213
|
itemLine = '<li class="accordion-item filterabledd-item fdd-noselected" data-id="{id}"><a href="javascript:" class="fdd-item-link fdd-item-content"><div class="fdd-item-inner fdd-inner"><div class="fdd-item-title fdd-item">{text}</div></div></a></li>';
|
|
219
214
|
} else {
|
|
220
215
|
itemLine = '<li class="accordion-item filterabledd-item fdd-selected" data-id="{id}"><a href="javascript:" class="fdd-item-link fdd-item-content"><div class="fdd-item-inner fdd-inner"><div class="fdd-item-title fdd-item">{text}</div></div></a></li>';
|
|
@@ -236,7 +231,7 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
236
231
|
};
|
|
237
232
|
|
|
238
233
|
if (args.formatResult != null) {
|
|
239
|
-
|
|
234
|
+
this._getRowValuePerf = (item) => {
|
|
240
235
|
const formatedResult = args.formatResult(item, 'fdd');
|
|
241
236
|
if ((formatedResult as any).jquery) {
|
|
242
237
|
return (formatedResult[0] as any).outerHTML;
|
|
@@ -245,26 +240,24 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
245
240
|
}
|
|
246
241
|
};
|
|
247
242
|
} else {
|
|
248
|
-
|
|
249
|
-
return htmlEscape(item.text);
|
|
250
|
-
};
|
|
243
|
+
this._getRowValuePerf = item => htmlEscape(item.text);
|
|
251
244
|
}
|
|
252
245
|
|
|
253
|
-
|
|
246
|
+
this._getRowLineWithSelectedPerf = (item): string => {
|
|
254
247
|
if (hasOptionGroups) {
|
|
255
248
|
if ((item as any).isOptionGroup == true) {
|
|
256
|
-
return `<li class="filterabledd-item filterabledd-optgroup fdd-noselected" data-id="${item.id}"><a href="javascript:" class="fdd-item-link fdd-item-content"><div class="fdd-item-inner fdd-inner"><div class="fdd-item-title fdd-item">${
|
|
249
|
+
return `<li class="filterabledd-item filterabledd-optgroup fdd-noselected" data-id="${item.id}"><a href="javascript:" class="fdd-item-link fdd-item-content"><div class="fdd-item-inner fdd-inner"><div class="fdd-item-title fdd-item">${this._getRowValuePerf(item)}</div></div></a></li>`;
|
|
257
250
|
}
|
|
258
251
|
}
|
|
259
252
|
|
|
260
|
-
if (
|
|
261
|
-
return `<li class="filterabledd-item filterabledd-item-perf fdd-noselected" data-id="${item.id}">${
|
|
253
|
+
if (this.selectedIds == null || !this.selectedIds.includes(item.id)) {
|
|
254
|
+
return `<li class="filterabledd-item filterabledd-item-perf fdd-noselected" data-id="${item.id}">${this._getRowValuePerf(item)}</li>`;
|
|
262
255
|
} else {
|
|
263
|
-
return `<li class="filterabledd-item filterabledd-item-perf fdd-selected" data-id="${item.id}">${
|
|
256
|
+
return `<li class="filterabledd-item filterabledd-item-perf fdd-selected" data-id="${item.id}">${this._getRowValuePerf(item)}</li>`;
|
|
264
257
|
}
|
|
265
258
|
};
|
|
266
259
|
|
|
267
|
-
|
|
260
|
+
this._handleItemClick = (targetElem) => {
|
|
268
261
|
const sender = $(targetElem);
|
|
269
262
|
const liSender = (sender.is('li') ? sender : sender.closest('li'));
|
|
270
263
|
const exlusivity = ($('.fdd-incl-excl-chb input').prop('checked') == true ? 1 : 0);
|
|
@@ -274,24 +267,28 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
274
267
|
return;
|
|
275
268
|
}
|
|
276
269
|
|
|
277
|
-
if (
|
|
270
|
+
if (this.elem != null) {
|
|
278
271
|
const selVal = sender.text();
|
|
279
|
-
|
|
280
|
-
|
|
272
|
+
this.elem.val(selVal);
|
|
273
|
+
this.elem.find('.dropdownSelectedItem').html(selVal);
|
|
281
274
|
}
|
|
282
275
|
|
|
283
|
-
let cbi =
|
|
276
|
+
let cbi = this.getDataFromElement(liSender);
|
|
284
277
|
if (cbi == null) {
|
|
285
278
|
cbi = {
|
|
286
|
-
id:
|
|
279
|
+
id: this.getIdFromElement(liSender),
|
|
287
280
|
text: sender.text(),
|
|
288
281
|
};
|
|
289
282
|
}
|
|
290
283
|
|
|
291
|
-
if (!
|
|
292
|
-
|
|
293
|
-
if (
|
|
294
|
-
|
|
284
|
+
if (!this.multiselect) {
|
|
285
|
+
this.hide();
|
|
286
|
+
if (this.onItemSelected != null) {
|
|
287
|
+
if (cbi?.id == selectedIds?.[0]) {
|
|
288
|
+
this.onItemSelected([], exlusivity);
|
|
289
|
+
} else {
|
|
290
|
+
this.onItemSelected([cbi], exlusivity);
|
|
291
|
+
}
|
|
295
292
|
}
|
|
296
293
|
} else {
|
|
297
294
|
if (liSender.hasClass('fdd-selected')) {
|
|
@@ -302,48 +299,48 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
302
299
|
}
|
|
303
300
|
};
|
|
304
301
|
|
|
305
|
-
|
|
302
|
+
this.hide = () => {
|
|
306
303
|
$(document).trigger('fdd-hide', $('#filterableSelectDropDown'));
|
|
307
304
|
|
|
308
|
-
if (
|
|
305
|
+
if (this.animate) {
|
|
309
306
|
$(contextBody).find('#filterableSelectOverlay').removeClass('fdd-anim-shown');
|
|
310
307
|
$(contextBody).find('#filterableSelectDropDown').removeClass('fdd-anim-shown');
|
|
311
308
|
setTimeout(() => {
|
|
312
|
-
|
|
309
|
+
this.removeElems(true);
|
|
313
310
|
}, 350);
|
|
314
311
|
} else {
|
|
315
|
-
|
|
312
|
+
this.removeElems(true);
|
|
316
313
|
}
|
|
317
314
|
};
|
|
318
315
|
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
this.open = () => {
|
|
317
|
+
this.removeElems();
|
|
321
318
|
contextWindow.isFilterableDropDownOpen = true;
|
|
322
|
-
$(contextBody).append(
|
|
323
|
-
$(contextBody).append(
|
|
319
|
+
$(contextBody).append(this.overlayTemplate);
|
|
320
|
+
$(contextBody).append(this.dropDownTemplate);
|
|
324
321
|
if (contextWindow.PreventKeyboardHack == null) {
|
|
325
322
|
contextWindow.PreventKeyboardHack = true;
|
|
326
323
|
}
|
|
327
324
|
|
|
328
325
|
if (args.useListviewBuilder) {
|
|
329
326
|
const builder = new ListviewBuilder();
|
|
330
|
-
builder.data =
|
|
327
|
+
builder.data = this.data;
|
|
331
328
|
builder.parentTemplate = '<ul>{content}</ul>';
|
|
332
329
|
builder.itemTemplate = '<li class="accordion-item filterabledd-item" data-id="{id}"><a href="javascript:" class="fdd-item-link fdd-item-content"><div class="fdd-item-inner fdd-inner"><div class="fdd-item-title fdd-item">{text}</div></div></a></li>';
|
|
333
|
-
builder.targetElem =
|
|
330
|
+
builder.targetElem = this._getTargetElement(useIscroll);
|
|
334
331
|
builder.pagingCount = pagingCount;
|
|
335
332
|
builder.filter = true;
|
|
336
333
|
builder.filterField = 'filterValue';
|
|
337
334
|
builder.useFastClick = false;
|
|
338
335
|
builder.showPagination = (builder.data.length >= builder.pagingCount);
|
|
339
336
|
builder.clickEventName = clickEventName;
|
|
340
|
-
builder.itemClicked =
|
|
341
|
-
if (!
|
|
342
|
-
|
|
337
|
+
builder.itemClicked = () => {
|
|
338
|
+
if (!this._isGhostClick()) {
|
|
339
|
+
this._handleItemClick(this);
|
|
343
340
|
}
|
|
344
341
|
};
|
|
345
342
|
|
|
346
|
-
builder.onRowsBuilt =
|
|
343
|
+
builder.onRowsBuilt = (elem, dataArr) => {
|
|
347
344
|
if (args.formatResult != null) {
|
|
348
345
|
dataArr.forEach((dataItem) => {
|
|
349
346
|
if (dataItem != null) {
|
|
@@ -361,21 +358,21 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
361
358
|
}
|
|
362
359
|
};
|
|
363
360
|
|
|
364
|
-
builder._getRowLine =
|
|
361
|
+
builder._getRowLine = this._getRowLineWithSelected;
|
|
365
362
|
builder.build();
|
|
366
363
|
} else {
|
|
367
364
|
let builder = '';
|
|
368
365
|
for (const item of data) {
|
|
369
|
-
builder +=
|
|
366
|
+
builder += this._getRowLineWithSelectedPerf(item);
|
|
370
367
|
}
|
|
371
368
|
|
|
372
369
|
const listContainer = document.createElement('ul');
|
|
373
370
|
listContainer.onclick = (e) => {
|
|
374
|
-
|
|
371
|
+
this._handleItemClick(e.target);
|
|
375
372
|
};
|
|
376
373
|
listContainer.innerHTML = builder;
|
|
377
374
|
|
|
378
|
-
const targetElem =
|
|
375
|
+
const targetElem = this._getTargetElement(useIscroll)[0];
|
|
379
376
|
targetElem.innerHTML = `<div class="lvb-filter-container filterableSelectFilter ${cssClass || ''}"><div class="lvb-filter-erase"><span class="far fa-trash-alt"></span></div><input type="text" class="lvb-filter-input" placeholder="Search..."></div>`;
|
|
380
377
|
targetElem.append(listContainer);
|
|
381
378
|
|
|
@@ -393,20 +390,20 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
393
390
|
|
|
394
391
|
currentTimeOut = setTimeout(() => {
|
|
395
392
|
currentTimeOut = null;
|
|
396
|
-
|
|
393
|
+
this._pageIndex = 0;
|
|
397
394
|
const currVal = latinize((searchInput.val() || '').toString().toLowerCase());
|
|
398
|
-
if (currVal !=
|
|
399
|
-
|
|
395
|
+
if (currVal != this._filterVal) {
|
|
396
|
+
this._filterVal = currVal;
|
|
400
397
|
|
|
401
398
|
let builder = '';
|
|
402
399
|
if (currVal == '') {
|
|
403
400
|
for (const item of data) {
|
|
404
|
-
builder +=
|
|
401
|
+
builder += this._getRowLineWithSelectedPerf(item);
|
|
405
402
|
}
|
|
406
403
|
} else {
|
|
407
404
|
for (const item of data) {
|
|
408
405
|
if ((item as any).filterValue.includes(currVal)) {
|
|
409
|
-
builder +=
|
|
406
|
+
builder += this._getRowLineWithSelectedPerf(item);
|
|
410
407
|
}
|
|
411
408
|
}
|
|
412
409
|
}
|
|
@@ -421,7 +418,7 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
421
418
|
// '<li class="accordion-item filterabledd-item" data-id="{id}"><a href="javascript:" class="fdd-item-link fdd-item-content"><div class="fdd-item-inner fdd-inner"><div class="fdd-item-title fdd-item">{text}</div></div></a></li>'
|
|
422
419
|
}
|
|
423
420
|
|
|
424
|
-
const currentContext =
|
|
421
|
+
const currentContext = this._getTargetElement(useIscroll);
|
|
425
422
|
const currentFilter = currentContext.find('.lvb-filter-container').first();
|
|
426
423
|
currentFilter.css({ 'position': 'fixed', 'margin-left': '3%', 'width': '94%', 'z-index': '999997', 'top': '12px', 'height': '48px', 'left': '0', 'margin-top': '0' });
|
|
427
424
|
currentFilter.appendTo($(contextBody).find('#filterableSelectDropDown'));
|
|
@@ -436,7 +433,7 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
436
433
|
}
|
|
437
434
|
}
|
|
438
435
|
|
|
439
|
-
if (
|
|
436
|
+
if (this.animate) {
|
|
440
437
|
setTimeout(() => {
|
|
441
438
|
$(contextBody).find('#filterableSelectOverlay').addClass('fdd-anim-shown');
|
|
442
439
|
$(contextBody).find('#filterableSelectDropDown').addClass('fdd-anim-shown');
|
|
@@ -460,12 +457,12 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
460
457
|
}
|
|
461
458
|
|
|
462
459
|
$(contextBody).find('#btn_fdd_FddCancel').click(() => {
|
|
463
|
-
|
|
460
|
+
this.hide();
|
|
464
461
|
});
|
|
465
462
|
|
|
466
|
-
if (
|
|
463
|
+
if (this.multiselect) {
|
|
467
464
|
$(contextBody).find('#btn_fdd_FddConfirm').click(() => {
|
|
468
|
-
|
|
465
|
+
this.onOkButtonClicked();
|
|
469
466
|
});
|
|
470
467
|
}
|
|
471
468
|
|
|
@@ -477,40 +474,38 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
477
474
|
|
|
478
475
|
if (args.warmupMode) {
|
|
479
476
|
warmupHandle = setTimeout(() => {
|
|
480
|
-
|
|
477
|
+
this.close();
|
|
481
478
|
}, 2000);
|
|
482
479
|
}
|
|
483
480
|
|
|
484
481
|
$(document).trigger('fdd-show', $('#filterableSelectDropDown'));
|
|
485
482
|
};
|
|
486
483
|
|
|
487
|
-
|
|
484
|
+
this.onOkButtonClicked = () => {
|
|
488
485
|
const retArr = [];
|
|
489
486
|
const selArr = $(contextBody).find('.fdd-selected');
|
|
490
487
|
const exlusivity = ($('.fdd-incl-excl-chb input').prop('checked') == true ? 1 : 0);
|
|
491
488
|
|
|
492
|
-
selArr.each(
|
|
493
|
-
const item =
|
|
489
|
+
selArr.each(() => {
|
|
490
|
+
const item = this.getDataFromElement($(this));
|
|
494
491
|
if (item != null) {
|
|
495
492
|
retArr.push(item);
|
|
496
493
|
}
|
|
497
494
|
});
|
|
498
495
|
|
|
499
|
-
|
|
500
|
-
if (
|
|
501
|
-
|
|
496
|
+
this.hide();
|
|
497
|
+
if (this.onItemSelected != null) {
|
|
498
|
+
this.onItemSelected(retArr, exlusivity);
|
|
502
499
|
}
|
|
503
500
|
};
|
|
504
501
|
|
|
505
|
-
|
|
506
|
-
return liElem.attr('data-id');
|
|
507
|
-
};
|
|
502
|
+
this.getIdFromElement = liElem => liElem.attr('data-id');
|
|
508
503
|
|
|
509
|
-
|
|
510
|
-
const selId =
|
|
511
|
-
for (let i = 0, len =
|
|
512
|
-
if (
|
|
513
|
-
return
|
|
504
|
+
this.getDataFromElement = (liElem) => {
|
|
505
|
+
const selId = this.getIdFromElement(liElem);
|
|
506
|
+
for (let i = 0, len = this.data.length; i < len; i++) {
|
|
507
|
+
if (this.data[i].id == selId) {
|
|
508
|
+
return this.data[i];
|
|
514
509
|
}
|
|
515
510
|
}
|
|
516
511
|
|
|
@@ -522,10 +517,10 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
522
517
|
(dataItem as any).filterValue = latinize(dataItem.text.toLowerCase());
|
|
523
518
|
});
|
|
524
519
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
520
|
+
this.data = data; // fadeInFddOverlay fdd-ovl-animated
|
|
521
|
+
this.overlayTemplate = `<div class="${this._getAnimClass()}${this._getWarmupModeClass()}" id="filterableSelectOverlay" style="position:fixed;top:0;height:120%; width:120%;z-index:999990;background-color:black;opacity:0.7;margin-left:-5px;"></div>`;
|
|
522
|
+
this.dropDownTemplate = this._getDropDownTemplate(useIscroll);
|
|
523
|
+
this.buttonTemplate = '<div class="ui-select"><div data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-icon="arrow-d" data-iconpos="right" data-theme="c" class="ui-btn ui-shadow ui-btn-corner-all ui-btn-icon-right ui-btn-up-c"><span class="ui-btn-inner"><span class="ui-btn-text"><span class="dropdownSelectedItem"></span></span><span class="ui-icon ui-icon-arrow-d ui-icon-shadow"> </span></span></div></div>';
|
|
529
524
|
}
|
|
530
525
|
|
|
531
526
|
if (elem != null && data != null) {
|
|
@@ -533,22 +528,22 @@ export default function FilterableSelect(this: any, args: FilterableSelectArgs):
|
|
|
533
528
|
elem = $(contextBody).find(`#${elem}`);
|
|
534
529
|
}
|
|
535
530
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
elem.html(
|
|
531
|
+
this.elem = elem;
|
|
532
|
+
this.elem.val('');
|
|
533
|
+
elem.html(this.buttonTemplate);
|
|
539
534
|
|
|
540
|
-
|
|
541
|
-
if (!
|
|
542
|
-
|
|
535
|
+
this.elem.find('.ui-select').fastClick(() => {
|
|
536
|
+
if (!this._isGhostClick()) {
|
|
537
|
+
this.open();
|
|
543
538
|
}
|
|
544
539
|
});
|
|
545
540
|
|
|
546
|
-
|
|
541
|
+
this.val = (newValue) => {
|
|
547
542
|
if (newValue == null || newValue.toString().length == 0) {
|
|
548
|
-
return
|
|
543
|
+
return this.elem.val();
|
|
549
544
|
}
|
|
550
545
|
};
|
|
551
546
|
}
|
|
552
547
|
|
|
553
|
-
return
|
|
548
|
+
return this;
|
|
554
549
|
}
|