UNPKG

@cuvp1225/tango-mail

Version:
40 lines (39 loc) 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListItem = exports.List = void 0; exports.ListView = ListView; exports.ListItemView = ListItemView; const tslib_1 = require("tslib"); const tango_boot_1 = require("@music163/tango-boot"); const react_1 = tslib_1.__importDefault(require("react")); const classnames_1 = tslib_1.__importDefault(require("classnames")); const placeholder_1 = require("../placeholder"); function ListView(_a) { var { marker = 'disc', children, style, className } = _a, props = tslib_1.__rest(_a, ["marker", "children", "style", "className"]); const classNames = (0, classnames_1.default)('m-0 p-0 list-inside text-slate-900', { 'list-none': marker === 'none', 'list-disc': marker === 'disc', }, className); return (react_1.default.createElement("ul", Object.assign({}, props, { className: classNames, style: listStyle(style) }), children)); } const listStyle = (style) => { return Object.assign({}, style); }; exports.List = (0, tango_boot_1.defineComponent)(ListView, { name: 'List', designerConfig: { defaultProps: { children: react_1.default.createElement(placeholder_1.Placeholder, null), }, }, }); function ListItemView(_a) { var { text, children, style } = _a, props = tslib_1.__rest(_a, ["text", "children", "style"]); return (react_1.default.createElement("li", Object.assign({}, props, { style: listItemStyle(style) }), text || children)); } const listItemStyle = (style) => { return Object.assign({ marginBottom: 8 }, style); }; exports.ListItem = (0, tango_boot_1.defineComponent)(ListItemView, { name: 'ListItem', });