Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

@blockly/field-grid-dropdown

Package Overview
Dependencies
0
Maintainers
2
Versions
54
Issues
File Explorer

Advanced tools

@blockly/field-grid-dropdown

A Blockly dropdown field with grid layout.

    2.0.12latest
    GitHub

Version published
Maintainers
2
Weekly downloads
517
decreased by-41.52%

Weekly downloads

Changelog

Source

@blockly/workspace-content-highlight@2.0.12

2.0.12 (2023-03-23)

Note: Version bump only for package @blockly/workspace-content-highlight

Readme

Source

@blockly/field-grid-dropdown Built on Blockly

A Blockly dropdown field with grid layout.

Installation

Yarn

yarn add @blockly/field-grid-dropdown

npm

npm install @blockly/field-grid-dropdown --save

Usage

This field accepts the same parameters as the Blockly.FieldDropdown in Blockly core. The config object bag passed into this field accepts additional optional parameters:

  • "columns" to specify the number of columns in the dropdown field (must be an integer greater than 0). If not provided, the default is 3 columns.
  • "primaryColour" to specify the colour of the dropdown (must be a string CSS colour). If not provided, the dropdown color will match the primary colour of the parent block.
  • "borderColour" to specify the colour of the border of the dropdown (must be a string CSS colour). If not provided, the border colour will match the tertiary colour of the parent block.

JavaScript

import * as Blockly from 'blockly'; import {FieldGridDropdown} from '@blockly/field-grid-dropdown'; Blockly.Blocks["test_field_grid_dropdown"] = { init: function () { this.appendDummyInput() .appendField("grid dropdown: ") .appendField(new FieldGridDropdown([ ["A", "A"],["B", "B"], ["C", "C"],["D", "D"], ["E", "E"], ["F", "F"], ["G", "G"], ["H", "H"]]), "FIELDNAME"); } };

JSON

import * as Blockly from 'blockly'; import '@blockly/field-grid-dropdown'; Blockly.defineBlocksWithJsonArray([ { "type": "test_field_grid_dropdown", "message0": "template: %1", "args0": [ { "type": "field_grid_dropdown", "name": "FIELDNAME", "options": [ ["A", "A"],["B", "B"], ["C", "C"],["D", "D"], ["E", "E"], ["F", "F"], ["G", "G"], ["H", "H"] ] } ] }]);

License

Apache 2.0

Keywords

FAQs

Last updated on 23 Mar 2023

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc