carbon-custom-elements
Version:
A Carbon Design System variant that's as easy to use as native HTML elements, with no framework tax, no framework silo.
1 lines • 2.2 kB
Source Map (JSON)
{"version":3,"sources":["components/multi-select/multi-select-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,cAAc,MAAM,2BAA2B,CAAC;AAKvD;;;GAGG;AACH,cACM,iBAAkB,SAAQ,cAAc;IAC5C;;OAEG;IAEH,aAAa,SAAM;IAEnB,MAAM;IAwBN;;OAEG;IACH,MAAM,KAAK,YAAY,WAEtB;IAED,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,iBAAiB,CAAC","file":"multi-select-item.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2020\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, property, customElement } from 'lit-element';\nimport BXDropdownItem from '../dropdown/dropdown-item';\nimport styles from './multi-select.scss';\n\nconst { prefix } = settings;\n\n/**\n * Multi select item.\n * @element bx-multi-select-item\n */\n@customElement(`${prefix}-multi-select-item`)\nclass BXMultiSelectItem extends BXDropdownItem {\n /**\n * The `name` attribute for the `<input>` for selection.\n */\n @property({ attribute: 'selection-name' })\n selectionName = '';\n\n render() {\n const { disabled, selected, selectionName, value } = this;\n return html`\n <div class=\"${prefix}--list-box__menu-item__option\">\n <div class=\"${prefix}--form-item ${prefix}--checkbox-wrapper\">\n <input\n id=\"input\"\n type=\"checkbox\"\n class=\"${prefix}--checkbox\"\n tabindex=\"-1\"\n readonly\n ?disabled=${disabled}\n .checked=${selected}\n name=\"${ifDefined(selectionName || undefined)}\"\n value=\"${value}\"\n />\n <label for=\"input\" class=\"${prefix}--checkbox-label\">\n <span class=\"${prefix}--checkbox-label-text\"><slot></slot></span>\n </label>\n </div>\n </div>\n `;\n }\n\n /**\n * A selector that will return multi select.\n */\n static get selectorList() {\n return `${prefix}-multi-select`;\n }\n\n static styles = styles;\n}\n\nexport default BXMultiSelectItem;\n"]}