Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
.subscribe(currentInputNode => {
this.currentInput = currentInputNode;
});
state$
.pipe(
selectMappings,
takeUntil(stop$)
)
.subscribe(change => this.mappingsChange.emit(change));
this.dragOverEditor
.pipe(
takeUntil(stop$),
debounceTime(300),
map((ev: DragEvent) => ({ x: ev.clientX, y: ev.clientY })),
distinctUntilChanged((prev, next) => prev.x === next.x && prev.y === next.y)
)
.subscribe(position => this.editorService.dragOver(position));
this.mapperService.state$
.pipe(
distinctUntilChanged(),
takeUntil(stop$),
first()
)
.subscribe((state: MapperState) => {
const inputsData = state.inputs;
// open first input by default
if (inputsData.nodes && inputsData.nodes[0]) {
this.mapperService.selectInput(inputsData.nodes[0]);
ngAfterViewInit() {
setTimeout(() => this.fixColumns());
// Listen to resize event and fix column start again
fromEvent(window, 'resize', { passive: true })
.pipe(
this.untilDestroyed(),
debounceTime(250)
)
.subscribe(() => {
this.fixColumns();
});
}
constructor (
private userPreferencesService: UserPreferencesService
) {
this.toggleSearch
.pipe(
debounceTime(200),
takeUntil(this.onDestroy$)
)
.subscribe(() => {
if (this.expandable) {
this.subscriptAnimationState = this.toggleAnimation();
if (this.subscriptAnimationState.value === 'inactive') {
this.searchTerm = '';
this.reset.emit(true);
if ( document.activeElement.id === this.searchInput.nativeElement.id) {
this.searchInput.nativeElement.blur();
}
}
}
});
}
constructor(props: ServerURLFormProps) {
super(props)
this.subscriptions.add(
this.changes.subscribe(value => {
this.props.onChange(value)
this.setState({ isUpdating: true })
})
)
const submitAfterInactivity = this.changes.pipe(debounceTime(5000), takeUntil(this.submits))
this.subscriptions.add(
merge(this.submits, submitAfterInactivity).subscribe(() => {
this.props.onSubmit()
this.setState({ isUpdating: false })
})
)
}
ngOnInit(): void {
this.routeSub = combineLatest(
this.route.params.pipe(
distinctUntilChanged(),
debounceTime(30)
),
this.mostsService.getMenu(),
(params, menu) => ({ params, menu })
)
.pipe(
tap(data => {
this.ratingCatname = data.params.rating_catname;
this.typeCatname = data.params.type_catname;
this.yearsCatname = data.params.years_catname;
this.years = data.menu.years;
this.ratings = data.menu.ratings;
this.vehilceTypes = vehicleTypesToList(data.menu.vehilce_types);
this.defaultTypeCatname = this.vehilceTypes[0].catname;
writeValue(port: CommandOutputParameterModel | CommandInputParameterModel): void {
this.port = port;
this.form = this.formBuilder.group({
label: [{value: this.port.label, disabled: this.readonly}],
description: [{value: this.port.description, disabled: this.readonly}],
altPrefix: [{value: this.port.customProps["sbg:altPrefix"], disabled: this.readonly}],
category: [{value: this.port.customProps["sbg:category"], disabled: this.readonly}],
toolDefaults: [{value: this.port.customProps["sbg:toolDefaultValue"], disabled: this.readonly}],
fileTypes: [{value: this.port.fileTypes, disabled: this.readonly}]
});
this.form.valueChanges.pipe(
distinctUntilChanged(),
debounceTime(300)
).subscribeTracked(this, value => {
if (this.isInputPort()) {
this.setTextProperty("sbg:altPrefix", value.altPrefix, true);
this.setTextProperty("sbg:category", value.category, true);
if (!this.isFileType()) {
this.setTextProperty("sbg:toolDefaultValue", value.toolDefaults, true);
}
}
if (value.fileTypes) {
this.setFileTypes(value.fileTypes);
}
this.setTextProperty("label", value.label);
this.setTextProperty("description", value.description);
import { IPlaygroundProvider } from '../../../../../interfaces/IPlaygroundProvider';
const chance = new Chance();
const DEPARTMENTS = ['Finance', 'Operations', 'Investor Relations', 'Technical', 'Auditing', 'Labs'];
@Component({
selector: 'uxd-components-infinite-scroll',
templateUrl: 'infinite-scroll.component.html',
styleUrls: ['./infinite-scroll.component.less']
})
@DocumentationSectionComponent('ComponentsInfiniteScrollComponent')
export class ComponentsInfiniteScrollComponent extends BaseDocumentationSection implements IPlaygroundProvider {
filterText = new BehaviorSubject('');
debouncedFilterText = this.filterText.pipe(debounceTime(500));
allEmployees: any[] = [];
loadedEmployees: any[] = [];
loadCallback = this.load.bind(this);
loadOnScroll = true;
loading = false;
pageSize = 20;
totalItems = 111;
load(pageNum: number, pageSize: number, filter: any): Promise {
this._liveAnnouncer.announce('Loading more items at the end of the list, please wait.');
let promise = new Promise((resolve, reject) => {
setTimeout(() => {
const pageStart = pageNum * pageSize;
const newItems = this.allEmployees
.filter(e => this.isFilterMatch(e))
.slice(pageStart, pageStart + pageSize);
constructor(
private storageBlobService: StorageBlobService,
private autoStorageService: AutoStorageService,
private dialog: DialogService) {
this._subscriptions.push(this.value.valueChanges.pipe(
debounceTime(400),
distinctUntilChanged(),
).subscribe((value) => {
this._checkValid(value);
if (this._propagateChange) {
this._propagateChange(value);
}
}));
}
search = (text$: Observable) =>
text$.pipe(
debounceTime(300),
distinctUntilChanged(),
map(term => term === '' ? []
: this.externalIDTypeCache.filter(v => v.name.toLowerCase().indexOf(term.toLowerCase()) > -1).slice(0, 10))
);
private getFilteredResults(): void {
this.myControl.valueChanges.pipe(debounceTime(200),
takeUntil(this.unsubscribed$),
tap(() => this.isLoading = true),
switchMap(value => {
const query = new SearchQuery();
const unQuery = new UserNameQuery();
unQuery.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
unQuery.setUserName(value);
query.setUserNameQuery(unQuery);
if (this.target === UserTarget.SELF) {
return from(this.userService.listUsers(10, 0, [query]));
} else {
return of();
}