JSPM

  • Created
  • Published
  • Downloads 1418
  • Score
    100M100P100Q127493F
  • License Apache 2.0

A Blockly dropdown field with grid layout.

Package Exports

  • @blockly/field-grid-dropdown

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@blockly/field-grid-dropdown) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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

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