sinequa / ngx-ui-builder

An Angular library for creating no code tools & applications
https://sinequa.github.io/ngx-ui-builder/
MIT License
81 stars 8 forks source link

(image-selector) allow image redimension #90

Closed hebus closed 1 year ago

hebus commented 1 year ago

This PR contains 2 specifics updates:

Image Selector

New Inputs

Configuration expected

  {
    id: string,
    type: string,
    images: {
      [key: string]: { filename: string, width?: number, height?: number },
      ...
    }
  }

Usage

<uib-image-selector [sizeable]="<boolean>" [context]="<object>" param="<string>" description="<string>" />

E.g:

<uib-image-selector [context]="context" param="logoLight" description="Logo" class="d-block mb-3" />

context is a specific object containing the component configuration:

context: {
   config:   {
    id: 'home-logo',
    type: 'home-logo',
    images: {
      logoLight: { filename: 'assets/vanilla-logo.png' },
      logoDark: { filename: 'assets/vanilla-logo-dark.png' }
    }
  }
}

Updating config rule

To save the whole configuration json file in a single variable declaration.