Socket
Book a DemoInstallSign in
Socket

@wlindabla/sonata_classification_ui

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wlindabla/sonata_classification_ui

React components for SonataAdmin interface customization with context, category, and tag management.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Author Information

  • Name: AGBOKOUDJO Franck
  • Email: franckagbokoudjo301@gmail.com
  • Phone: +229 0167 25 18 86
  • LinkedIn: Internationales Web Services
  • Company: INTERNATIONALES WEB SERVICES
  • GitHub Repository: sonata_classification_ui

Sonata Classification UI Components

This project provides a collection of customizable React UI components to manage Sonata Classification entities such as Context, Tag, and other related entities using modern design and fully dynamic form creation.

These components are ideal for admin panels or CMS integrations.

Table of Contents

export type InputNameClassification = {
  /**
   * Placeholder text displayed inside the input field.
   */
  placeholder?: string;

  /**
   * CSS class applied to the input field for styling.
   */
  classNameField?: string;

  /**
   * Additional HTML attributes to be passed directly to the input element.
   */
  htmlInputOptions?: Record<string, unknown>;

  /**
   * List of CSS classes applied to the row container wrapping the input.
   */
  classNameRowContainer?: string[];

  /**
   * List of CSS classes applied to the container of the text field.
   */
  classNameTextFieldContainer?: string[];

  /**
   * List of CSS classes applied to the label of the text field.
   */
  classNameLabelTextField?: string[];

  /**
   * The visible label text displayed above or beside the input field.
   */
  labelTextField?: string;

  /**
   * Validation options specific to this input field.
   */
  optionsValidatorField?: OptionsInputField;
};

| Property | Type | Description|

|----------------------------|----------------------------|-----------------------------------------------------------------------------| | placeholder | string | Text to display inside the input field before the user types. | | classNameField | string | CSS class for styling the input field. | | htmlInputOptions | Record<string, unknown> | Additional HTML attributes to pass to the <input> element. | | classNameRowContainer | string[] | List of CSS classes for the row container wrapping the input. | | classNameTextFieldContainer | string[] | CSS classes applied to the main input container. | | classNameLabelTextField | string[] | CSS classes applied to the label element. | | labelTextField | string | Label displayed next to or above the input field. | | optionsValidatorField | OptionsInputField | Validation rules or config passed to the field. |

CheckboxClassification

PropertyTypeDescription
classNameCheckboxstring[]CSS classes applied to the <input type="checkbox"> element.
classNameLabelstring[]CSS classes applied to the <label> associated with the checkbox.
classNameContainerstring[]CSS classes for the container that wraps the checkbox and label.
labelCheckboxstringLabel text displayed next to the checkbox.
htmlInputOptionsCheckboxRecord<string, unknown>Additional HTML attributes for the checkbox element.

OptionsCollectionItemClassification

PropertyTypeDescription
classNameClassificationItemstring[]CSS classes applied to each classification item in the list.
classNameClassificationContainerTitlestring[]CSS classes for the title container of the classification section.
classNameContainerDeletestring[]CSS classes for the container that wraps the delete button.
classNameButtonDeletestring[]CSS classes applied to the delete button element.
labelButtonDeletestringText displayed inside or near the delete button.
classNameIconDeletestring[]CSS classes applied to the icon inside the delete button.
nameFieldOptionsInputNameClassificationConfiguration options for the input field related to the classification name.
optionsCheckboxCheckboxClassificationConfiguration options for the checkbox input.
classNameContainerAddstring[]CSS classes for the container that wraps the add button.
classNameButtonAddstring[]CSS classes applied to the add button element.
labelButtonAddstringText displayed inside or near the add button.
classNameIconAddstring[]CSS classes applied to the icon inside the add button.

ClassificationOptions

PropertyTypeDescription
classNameButtonOpenstring[]CSS classes applied to the button that opens the classification.
childrenButtonOpen`ReactNodestring`
styleButtonOpenCSSPropertiesInline styles for the button that opens the classification.
classNameDialogstring[]CSS classes applied to the dialog container.
styleDialogCSSPropertiesInline styles for the dialog container.
childrenDialogTitle`ReactNodestring`
urlActionstringThe URL to which the form data will be sent.
baseUrl`stringURL`
methodSendstringThe HTTP method to be used for sending the request (e.g., "POST", "GET").
classNameFormstring[]CSS classes applied to the form element.
classNameCancelButtonstring[]CSS classes applied to the cancel button.
childrenCancelButton`ReactNodestring`
classNameDialogActionContainerstring[]CSS classes for the container that wraps the dialog action buttons (submit/cancel).
classNameSubmitButtonstring[]CSS classes applied to the submit button.
styleSubmitedButtonCSSPropertiesInline styles for the submit button after submission.
childrenSubmitedButton`ReactNodestring`
formTokenstringToken for CSRF protection during form submission.
formatSendData`"json""formdata"`
messageBeforeSendDatastringOptional message to display before sending data.
headersFetchHeadersInitCustom headers to be added to the fetch request.

SelectContext Props

PropertyTypeDescription
nameSelectstringThe name attribute of the select input.
urlRoutestringThe URL route to fetch context data.
baseUrlstring | URLOptional base URL used to construct full request URLs.
labelSelectstringLabel for the input field rendered by TextField.
labelPlaceholderstringPlaceholder text displayed when no context is selected.
colorItemstringCSS color used to style each option in the list.
labelLoadMorestringText displayed on the "Load More" button.
labelRefreshDatastringText displayed on the "Refresh" button to reload context data.
           |
  import { SelectContext } from '@wlindabla/sonata_classification_ui';

function MyComponent() {
  return (
    <SelectContext
      nameSelect="context[name]"
      labelSelect="Context"
      urlRoute="/api/admin.sonata.classification/context/list"
      baseUrl="http://127.0.0.1:8001"
    />
  );
}
import { SonataContext } from  '@wlindabla/sonata_classification_ui';

function MyComponent() {
  return (
    <SonataContext
      urlAction='/api/admin.sonata.classification/context/create'
      baseUrl="http://127.0.0.1:8001"
      childrenCancelButton={'Cancel'}
      childrenDialogTitle={
        <h3 className="float-md-start form-title-heading text-info text-center mb-2 fw-bolder"
            style={{ textTransform: 'uppercase', color: '#283c63' }}>
          creating of collection new objet context
        </h3>
      }
      optionscollectionitem={{
        labelButtonDelete: "remove",
        classNameClassificationItem: ["border", "border-1", "border-white", "mb-3", "mt-2"],
        labelButtonAdd: 'Add',
        nameFieldOptions: {
          labelTextField: "Name",
          classNameLabelTextField: ["form-label", "text-warning", "fw-bold"]
        },
        optionsCheckbox: {
          labelCheckbox: "Enabled",
          classNameLabel: ["text-warning", "form-check-label", "fw-bolder"]
        }
      }}
    />
  );
}

Used to create a new Tag entity, including the ability to select a Context dynamically.

  import { SonataTag } from  '@wlindabla/sonata_classification_ui';
function MyComponent() {
  return (
    <SonataTag
      urlAction='/api/admin.sonata.classification/tag/create'
      baseUrl="http://127.0.0.1:8001"
      childrenCancelButton={'Cancel'}
      childrenDialogTitle={
        <h3 className="float-md-start form-title-heading text-info text-center mb-2 fw-bolder"
            style={{ textTransform: 'uppercase', color: '#283c63' }}>
          creating of collection new objet tag
        </h3>
      }
      optionscollectionitem={{
        labelButtonDelete: "remove",
        classNameClassificationItem: ["border", "border-1", "border-white", "mb-3", "mt-2"],
        labelButtonAdd: 'Add',
        nameFieldOptions: {
          labelTextField: "Name",
          classNameLabelTextField: ["form-label", "text-warning", "fw-bold"]
        },
        optionsCheckbox: {
          labelCheckbox: "Enabled",
          classNameLabel: ["text-warning", "form-check-label", "fw-bolder"]
        }
      }}
      context_options={{
        urlRoute: "/api/admin.sonata.classification/context/list",
        nameSelect: 'context',
        labelSelect: 'Context'
      }}
    />
  );
}
import { SelectTag } from  '@wlindabla/sonata_classification_ui';
function MyComponent(){
  return(<SelectTag
        nameSelect='tag[name]'
        labelSelect='Tag'
        urlRoute='/api/admin.sonata.classification/tag/list'
        baseUrl='http://127.0.0.1:8001'
      />)
}

Used to create a new Category entity, including the ability to select a Context dynamically and set the Enabled status

import { SonataCategory } from  '@wlindabla/sonata_classification_ui';
function MyComponent(){
  return(
    <SonataCategory
  urlAction='/api/admin.sonata.classification/category/create'
  baseUrl="http://127.0.0.1:8001"
  childrenCancelButton={'Cancel'}
  childrenDialogTitle={
    <h3 className="float-md-start form-title-heading text-info text-center mb-2 fw-bolder"
        style={{ textTransform: 'uppercase', color: '#283c63' }}>
        Creating a new category
    </h3>
  }
  optionsCheckbox={{
    labelCheckbox: "Enabled",
    classNameLabel: ["text-warning", "form-check-label", "fw-bolder"]
  }}
  context_options={{
    nameSelect: 'context',
    labelSelect: 'Context',
    urlRoute: '/api/admin.sonata.classification/context/list'
  }}
/>
  )
}

Keywords

sonata-admin-bundle

FAQs

Package last updated on 13 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts