Questions tagged [components]

1

votes
0

answer
46

Views

Apache Flink's Iterative Stream won't loop

I'm implementing the connected components algorithm using Flink's DataStream API, since there is not yet an implementation of it using this API. For this algorithm, I'm separating the data by tumbling windows. So, for each window, I`m trying to compute the algorithm independently. My problem comes f...
Henrique
1

votes
2

answer
96

Views

Advantage of Reselect over container component

https://redux.js.org/recipes/computing-derived-data describes how to use reselect createSelector() to avoid unnecessary updates when a component depends on properties that are computed values. An alternative seems to be to move the necessary computations into a (hopefully) lightweight container comp...
S. I. Svendsen
1

votes
0

answer
28

Views

Get the node indexes of connected components in a graph (matlab)

I have two Adjacency Matrix (same size), and I want to check how many nodes in a given connected components of the two graphs are same. For example, if A has three connected components of size 4,5 and 6 and B has two connected components of size 3 and 7. Suppose I want to compare the number of node...
Shew
1

votes
1

answer
799

Views

Background color issue of TextInputLayout in android material-components

I'm new here for android material-components , I just tried the basic TextInputLayout with FilledBox style for the first time, by default the background looks like translucent , according to our design I need to change it to pure white. But I tried app:boxBackgroundColor='#ffffff', then the text and...
Dangui
1

votes
0

answer
30

Views

Layout: Have component content push the next components content down with overlapping backgrounds

This trend has been here for a while, yet I haven't come up with a decent solution. I have two separate components that have a different coloured background and I need the content of the first component to push over into the second component, and thus push its content down. I'm not even sure if its...
Dustin Silk
1

votes
1

answer
196

Views

Can't test Styled Component in Jest

When trying to run a simple Snapshot test, I get the following: TypeError: _styledComponents2.default.View is not a function 2 | import styled from 'styled-components'; 3 | > 4 | const ButtonContainer = styled.View` 5 | flex-direction: row; 6 | align-items: center; 7 | justify-content: center;...
Dan
1

votes
0

answer
722

Views

Android Room multiple embedded fields of same type

Let's suppose I have the below model: @Entity public class Session { @Embedded Student student; @Embedded Tutor tutor; String location; Long timestamp; } public class student { Person person; double rating; } public class Tutor { Person person; double rating; double hourlyRate; } public class Person...
PampaZiya
1

votes
1

answer
889

Views

Creating A Custom Page in SAP Hybris

I am trying to create a unique page. In general, i create a page template , from that template i create a page(in this case it is content page) then i create content slot with a component within it and create a content slot name for its position at template or page, afterwards i relate this slot wit...
İlker Demirci
1

votes
1

answer
564

Views

styled-components animation back and forth based on props

I want to have my main content slide in and back on specific prop so I created the animation, and I thought I'll add reverse to it in the case the prop changes. Now the below code works, but the only problem is on the first page load I can see the 'slideOutContent' animation I don't want it to happe...
Tzook Bar Noy
1

votes
1

answer
412

Views

React, change const to component with props

React, Hello i need change const for component with props. How can i do it? const renderFieldOne = ({ input, label, type, meta: { touched, error, warning } }) => ( {label} {touched && ((error && {error}) || (warning && {warning}))} )
Piotr Żak
1

votes
1

answer
269

Views

styled-components: using `& + &` selector and adapt based on props

I have some components rendered with the same styled-component, and I want to make some margin-top between them const Item = styled.div` color: ${props => props.active ? 'red' : '#333'}; & + & { margin-top: 10px; } ` so far so good, but when one of them has a true active prop, the margin-top is mis...
Littlee
1

votes
0

answer
30

Views

AngualrJS - controller as syntax in component broke functionality

I am working with AngularJS 1.5. I am writing a component and if I stick with the $ctrl syntax my component works but if I try to use controllerAs it doesn't work. 'use strict'; angular .module('myApp') .component('attachments', { bindings: { add: '&', remove: '&', attachments: '
user1261710
1

votes
0

answer
397

Views

Android paging library retry loadRange() or loadAfter()

I am trying to implement the new paging library from android architecture components. Basic functions are working fine but I need to add a retry function for loadRange() or loadAfter(). I need to retry these in case a network error occurs or if the device is offline. I already tried dataSource.inval...
1

votes
0

answer
29

Views

How to bind adapter list item view with boolean in service

I have a recyclerAdapter with multiple view types, in one row I have a button which starts a service and I replace the button by a spinning wheel when the service starts. The service sends a broadcast when it starts and stops so I can update the list row. Is there a way to use architecture component...
David
1

votes
1

answer
153

Views

Use ng-model to avoid $digest delay in Component Directives

How to call controller's any function in directive in angularJs I'm trying to call parent controller's function, which has not much to do with the directive, when directive's bind value has changed. I've been looking through the Q&A in stack, but all of them are related to passing a value from direc...
David Han
1

votes
1

answer
253

Views

Inject Object using dagger 2 like DbManager in Worker, to do db operation inside doWork() method, #WorkerManager

Hi I am trying out new WorkerManager in my project and I am not able to figure out how to inject my DbManager class inside my TaskWorker to make use of dbmanager inside doWork() method of workermanager. Also not able to figure out due to TaskWorker Object creation in some what hidden. code example m...
1

votes
0

answer
32

Views

Reactive Streams support for Room

Subscriber doesn't receive any data from Flowable. Neither onNext() nor onError() are called. But when org.reactivestreams.Subscriber was replaced by io.reactivex.functions.Consumer it works perfect. repository.getAgentInfo() .observeOn(AndroidSchedulers.mainThread()) .subscribe(new org.reactivestr...
1

votes
2

answer
165

Views

Rollup not excluding excluded packages

I'm using Rollup to bundle a number of React components. The components are styled using styled-components. I have included styled-components, react, and some other packages in the options.external array. When I import my components into my other application I having an error that states that styled...
Jeffpowrs
1

votes
0

answer
30

Views

Is it possible to handle props callback function of wrapped component by its wrapper div?

Let say I have component FilterItem as export const FilterItem = (props: Props) => { const { value, action, checked, label, index } = props; return ( action(value, index) } /> { label } ); }; and Checkbox component as: export const Checkbox = (props: Props) => { const { checked, onChange, className,...
Ganesh Kakade
1

votes
0

answer
101

Views

Android Studio does't check/highlight Kotlin Room DAO queries when string occupies more than 1 row

When I'm trying to break query for better readability/comprehension it stops being checked by IDE. This occurs on Android Studio 3.2 canary 16 and 3.1.2 stable, kotlin version 1.2.41. When Room DAO is java class/interface everything works fine. Is it possible to have the same checking/highlighting...
yaroslav
24

votes
4

answer
4.4k

Views

How to use shared element transitions in Navigation Controller

I would like to add a shared elements transition using the navigation architecture components, when navigating to an other fragment. But I have no idea how. Also in the documentations there is nothing about it. Can someone help me?
sativa
1

votes
0

answer
98

Views

Basic MDCSelect not displaying correctly

I can't get a basic select control working with MDC. Does anyone know what I'm doing wrong? (other mdc-components works just fine with on same setup) UI-bug (PNG) Javascript: import {MDCSelect} from '@material/select'; var selTEST = new MDCSelect(document.getElementById('selTEST')); CSS: @import '@m...
Chris W.
1

votes
0

answer
107

Views

ngValue is ignored when used inside ng-content in Angular

I have created a custom control say my-select-input in Angular that wraps native select input. Template looks like this. my-select-input component looks like this. ngOnInit() { this.value$ = new BehaviorSubject(this._value); this.valueSubscription = this.value$.subscribe((value) => { this._value = v...
Birju Shah
1

votes
0

answer
213

Views

Understanding React Higher Order Components (HOC) and typescript

Short version: Why do I have to import types which I don't use in files which are wrapped by a Higher Order Component in typescript? Long version: While creating a Higher Order Component (short HOC) in typescript I get the following two typescript errors a lot: TS4082: ERROR in ./A.tsx error TS4082:...
Andru
1

votes
0

answer
816

Views

Styled SVG component

I am using React to help manage my SVG icons: const Trash = ({ fill, width, height, }) => ( ... ); I manage changing colours based on state in a wrapper: const makeIcon = Icon => props => ; export const TrashIcon = makeIcon(Trash); The wrapper looks like this (heavily abridged): class IconWrapper ex...
Mister Epic
1

votes
1

answer
33

Views

React-Native: How to define component based on device type

From React-Native document, we can define the component in different file by adding .android.js or .ios.js. Is there a way to define whether the device is tablet or phone so i can define different layout of the component based on their type not the platform of the device.
LittleFunny
1

votes
0

answer
113

Views

Can you specify a ViewChild as the ControlValueAccessor in a custom form control?

In reading this blog, I came across the following quote: It’s usually the class of the component or directive that registers the provider Meaning that it's specified as a NG_VALUE_ACCESSOR provider in the @Component decorator. I am curious about any unusual ways. I've seen examples settting it d...
Daniel Smith
1

votes
0

answer
48

Views

Angular: How to use inheritance to extend a dynamic component?

I create a dynamic component with a instance like this and the name of the component is dynamicComponent1 : createComponent() { const componentType = this.getComponentType(this.type); const factory = this.componentFactoryResolver.resolveComponentFactory(componentType); this.componentRef = this.conta...
privateFlo
1

votes
0

answer
23

Views

Generate deterministic ID for each instance of a repeated component

I have an Angular 5 component that can be repeated any number of times within its parent. I need a deterministic and unique ID for each instance of that component, which may be based on the component's @ContentChild if necessary. I've tried working through the available properties on the component's...
tomfumb
1

votes
0

answer
29

Views

Get current value to display in component of edit view

I have a method in component.ts who executes service like: this._usuariosServices.listarPerfiles().subscribe(perfiles => { this.perfilesList = perfiles; this.perfiles = perfiles.map(item => { return { id: item.id, text: item.nombre }; }); }); By this way I and install dropdown SELECT2 Now in the sam...
Pepe
1

votes
0

answer
42

Views

Styling with style-like attribute in compound components

There are some custom components which wrap more than one element, but allow you to style them individually with multiple style-like attributes. For example in react-native-elements there's Button: https://react-native-training.github.io/react-native-elements/docs/button.html The above can accept bu...
Attila Szeremi
1

votes
0

answer
341

Views

Cannot read property 'NullLogger' of undefined

I am using this error when i am trying to create a new project. Cannot read property 'NullLogger' of undefined TypeError: Cannot read property 'NullLogger' of undefined I am using cli version 1.4.4 and i don't want to update my cli version. Does anyone know about this?
Rakesh Baskaran
1

votes
0

answer
20

Views

Enforce creation and execution of activities in the current Android process

Let's assume that there are 3 activities namely ActivityA, ActivityB and ActivityC. The flow of instantiation of the activities is as follows: ActivityA is running in the main application process. ActivityA starts ActivityB. ActivityB is created and runs in process2 (as the android:process attribut...
vsuresh
1

votes
3

answer
781

Views

How to inject a component using services. Angular 4

I'm new on Angular 4 and I'm trying to create a component that shows a loading box while some content is being loaded... like login, loading a chart, etc. I don't want to use plugins to do it because I want to learn how to do. I've created the component using the CLI command ng g component loading a...
jraspante
1

votes
1

answer
186

Views

Conditionally add pseudo-class on hover

I am trying to use styled-components and I need a way to conditionally add a pseudo-class on hover. Here is an example of my code: buildRating(numberRating, totalRating) { const Star = styled.div` display: inline; div&:hover:before { color: ${Colors.goldColor}; } &:before { unicode-bidi: bidi-overri...
null_pointer
1

votes
1

answer
507

Views

Forwarding refs through multiple components

I'm using Material-UI and styled-components for an app, and I'm trying to pass a ref down to the root node created by MUI. MUI has a buttonRef prop for accessing it, so that's simple, however I'm using styled-components to style MUI's Button component like so: const NavButtonMain = styled(Button)`...
Matthew Masurka
1

votes
2

answer
45

Views

Creating Objects in Iterator with React.js

I have an array let ability = ['100', '500' , '90' , '90' , '90' , '90' , '90' , '90' , '90' , '90'] I'm creating objects in an iterator and want to pass each value of the array to through the props of 'Progress Circle'. So the width of the first object is 100 the width of the second is 500 and so o...
Stephen Thomas
1

votes
0

answer
14

Views

How to send an image throw a post-request while changing components in reactjs

I am uploading the image from my computer and saving it in the component state using reader.onload. I then later have a Link button that renders a different component while sending my image throw a post request. When I console.log the image when I load it it shows, but then I console log right befo...
asking0096
1

votes
0

answer
155

Views

Use Auth0 service into custom element with angular 6

I created a simple cutom element component and use simple service to get an jsonplaceholder data; it works :-) Based on this simple tuto: a6 custom element This is my repo: repo element I would like inject 3rd party auth0 service into the component. But i get this error in my console when get the A...
Tony Ster
1

votes
0

answer
75

Views

Enzyme shallow styled component output snapshot that does not have className

I have a simple test with enzyme to shallow a styled.div`` with some css in it. But the snapshot does not className in it This is the snapshot: exports[` should render correctly 1`] = ` This is left `; What i expected is but i had styled.div
Minh Nguyen

View additional questions