How to implement tabs component using ui_patterns module?

I wonder what’s the best way to implement JS Tabs component using https://www.drupal.org/project/ui_patterns module ecosystem. I plan to use custom block for outer wrapper with Paragraphs for the inner, but this can be changed. I wasn’t able to Google anything and I’m not really sure how can I implement this in a way which work both in the patterns library and on actual site.

sharepoint online – Component Inheritance from Property Pane

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

what’s the best placement for "select all" option in multiple filer component?

While researching I found 2 main ways of placing the "Select all" option. One usually appears in the top right corner and another one (used ie by Microsoft it seems) is adding a Select all option on top of all filtering options. What’s the difference from the user perspective and which one is the best practice?
select all option on the top of filtering ooptions
select all on top right corner

Add Featured Image as Post URL Path Component Extension

I would like to append an extension component to my post URL that would allow me to get the featured image of a post while preserving the URL scheme.

For example, if my final post URL was:

https://my.domain.com/posts/my-latest-post/

I would be able to retrieve the featured image using:

https://my.domain.com/posts/my-latest-post/thumbnail

The /thumbnail component would be statically named. This is a convention that I have seen around the place and would allow me, for example, to provide an image in an external RSS-based rendering where only the RSS title and URL properties are available.

Any thoughts would be very welcome.

dropdown – Read-Only state for Select Component

enter image description here

Hi,
I faced a problem that concerns the reading mode for the select components.

Imagine a situation where you set up a filter and choose some options in the dropdown. Then you run a search for suitable options. At the same time, the search options go into the inactive state (you need to reset the options to make the fields active again). But the user may need to see what options exist in this drop-down at all (actually, I didn’t get why, but there’s a requirement from the users).

Is it even possible to speak about the read mode for the select component in this situation? Can a dropdown be used only to view the options? Or does it still have 2 states – disabled, when it is impossible to open the menu, and active state, when at least one option from the list is available for selection?

*The screenshot shows how it’s implemented now and is required (They called Read-only mode as Non-editable).

typescript – How can I set the value of a field in a form that I am fetching from another component with Angular?

I’m taking my first steps in Angular and it’s having a bit of a hard time getting started with the basics. Basically I have a list of people and I want to navigate to the details of one of the people to modify them but I am unable to get their ID to appear on the form. I have managed to get the id to the url. It’s something…

component1 html

    <form (formGroup)="formOwner" (submit)="submit()">
  <div class="example-container">
    <mat-form-field appearance="fill">
      <mat-label>ID</mat-label>
      <input matInput formControlName="id">
    </mat-form-field>
    <br>
    <mat-form-field appearance="fill">
      <mat-label>First Name</mat-label>
      <input matInput formControlName="name">
    </mat-form-field>
    <br>
    <mat-form-field appearance="fill">
      <mat-label>Salary</mat-label>
      <input matInput formControlName="salary">
    </mat-form-field>
    <br>
    <mat-form-field appearance="fill">
      <mat-label>Age</mat-label>
      <input matInput formControlName="age">
    </mat-form-field>
  </div>
  <button mat-raised-button color="primary" type="submit">Actualizar</button>
  </form>

component1.ts

import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { Employer } from 'src/app/core/interfaces/employers-response.interface';
import { EmployersService } from 'src/app/services/employers.service';
import { Router, ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-modificar-empleados',
  templateUrl: './modificar-empleados.component.html',
  styleUrls: ('./modificar-empleados.component.sass')
})
export class ModificarEmpleadosComponent implements OnInit {
  @Output() formValue: EventEmitter<any> = new EventEmitter<any>();
  formOwner: FormGroup
  static formOwner: any;
  constructor(
    private formBuilder: FormBuilder,
    private router: Router,
    private route: ActivatedRoute) { }

  ngOnInit(): void {
    console.log(this.route.snapshot.paramMap.get('id'));
    this.initForm();
  }

  initForm(){
    this.formOwner = this.formBuilder.group({
      id: (),
      name: (),
      salary: (),
      age: ()
    });
  }

  submit(){
    this.formValue.emit(this.formOwner.value);
    //console.log('from form',this.formOwner.value);
  }

}

component2.html

<app-modificar-empleados (formValue)="getFormValue($event)"></app-modificar-empleados>

component2.ts

import { Component, Input, OnInit } from '@angular/core';
import { EmployersService } from 'src/app/services/employers.service';
import { Router, ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-editempleado',
  templateUrl: './editempleado.component.html',
  styleUrls: ('./editempleado.component.sass')
})
export class EditempleadoComponent implements OnInit {

  id: String = '';

  constructor(private employers: EmployersService, private router: Router, private route: ActivatedRoute) { }

  ngOnInit(): void {
    console.log(this.route.snapshot.paramMap.get('id'));
  }

  updateEmployer(values){
    this.employers.updateEmployee(values).subscribe((res) => {
      console.log('respuesta al actualizar empleado',res);
    });
  }

  getFormValue(values){
    this.updateEmployer(values);
  }

}

In the people table I have a button that invokes this method to navigate to the URL of each one. It has a parameter of the ID of each person

edit(id: number){
  this.router.navigate(('/editar', id));
}

I am thankful for any kind of help. Thanks so much!

typescript – how to store the internal state in a redux like global state management component

I would really appreciate some feedback on a state management thing I am trying to build. Here is a codesandbox that is as stripped down as I can get it

I have at the top level a class called Atom<A>

Atom is like a store that contains the global state object, exactly like the Store in redux

It is possible to create Slice<S, A> objects from the atom e.g.

const atom = new Atom<AtomState>({
  parent: {
    steps: ()
  }
});

const slice = atom.slice()("parent", "steps");  // Slice<Step(), AtomState>

I’ve used the lens package monocle-ts in the Slice class but it is internal and a user would not know what the implementation is

I’m fairly ok with how the Slice has turned out but it is the first time I have used monocle. I originally used Ramda’s lens but did not like how it turned out

the bit I am stuck about is how to handle the internal state of the object in the Atom

You can update a slice like this:

const lastStep = atom.slice()("parent", "steps", 1);
lastStep.update((prev) => ({ ...prev, status: "running" }));

which calls update on the slice

  update(fn: (value: S) => S): void {
    this.set(fn(this.get()));
  }

which calls set

  set(value: S): void {
    this.atom.update((state) => {
      return this.lens.set(value)(state);
    });
  }

and on the atom update looks like this

  update(fn: (state: A) => A) {
    this.set(fn(this.get()));
  }

that calls set

  set(value: A) {
    this.state = R.fromRecord(value) as A;
  }

any advice on how to store the raw object in the Atom object greatly. appreciated

Track Design System Component Usage

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

dnd 5e – Does the material component of Booming blade need to the same one used in the attack?

The material component weapon must be used to make the attack

The spell states (emphasis mine):

You brandish the weapon used in the spell’s casting and make a melee attack with it against one creature within 5 feet of you. (…)

The only weapon used in the spell’s casting is the material component; no other weapons is required in order to cast the spell. If they wanted it to be any weapon, they would have worded the spell differently.

Visual Studio Custom Component with Enum Property

Good Day,
long story short I’ve created many custom components for VisualStudio2005 with enum properties, and the IDE was working fine.

When I’ve passed the solution in VisualStudio2012 the custom components doesn’t show correctly becauseof those properties.

It seems that custom controls with enum properties aren’t supported in any Visual Studio after 2008, and I’ve sent many email to Microsoft about it with obviously no ansver.

Anyone have experienced a similar issue?

Thanks to all.