TMRAppBle/components/avm-ui/icon/index.js

318 lines
6.6 KiB
JavaScript

// packages/avm-ui/src/components/icon/icon.config.json
var fontName = "avm-icon";
var startUnicode = 6e4;
var defaultCode = 8;
// packages/avm-ui/src/components/icon/icon.json
var props = [
{
name: "name",
tip: "\u56FE\u6807\u540D\u79F0",
type: "string",
enum: [
"AaOutline",
"AddCircleOutline",
"AddOutline",
"AddSquareOutline",
"AddressBookFill",
"AlipayCircleFill",
"AlipaySquareFill",
"AntOutline",
"ApiCloudlogo",
"AppOutline",
"AppstoreOutline",
"ArrowDownCircleOutline",
"ArrowsAltOutline",
"AudioFill",
"AudioMutedOutline",
"AudioOutline",
"BankcardOutline",
"BellMuteOutline",
"BellOutline",
"BillOutline",
"CalculatorOutline",
"CalendarOutline",
"CameraOutline",
"ChatAddOutline",
"ChatCheckOutline",
"ChatWrongOutline",
"CheckCircleFill",
"CheckCircleOutline",
"CheckOutline",
"CheckShieldFill",
"CheckShieldOutline",
"ClockCircleFill",
"ClockCircleOutline",
"CloseCircleFill",
"CloseCircleOutline",
"CloseOutline",
"CloseShieldOutline",
"CollectMoneyOutline",
"CompassOutline",
"ContentOutline",
"CouponOutline",
"DeleteOutline",
"DownCircleOutline",
"DownFill",
"DownOutline",
"DownlandOutline",
"EditFill",
"EditSFill",
"EditSOutline",
"EnvironmentOutline",
"ExclamationCircleFill",
"ExclamationCircleOutline",
"ExclamationOutline",
"ExclamationShieldFill",
"ExclamationShieldOutline",
"ExclamationTriangleOutline",
"EyeFill",
"EyeInvisibleFill",
"EyeInvisibleOutline",
"EyeOutline",
"FaceRecognitionOutline",
"FileOutline",
"FileWrongOutline",
"FillinOutline",
"FilterOutline",
"FingerdownOutline",
"FireFill",
"FlagOutline",
"FolderOutline",
"ForbidFill",
"FrownFill",
"FrownOutline",
"GiftOutline",
"GlobalOutline",
"HandPayCircleOutline",
"HeartFill",
"HeartOutline",
"HistogramOutline",
"InformationCircleFill",
"InformationCircleOutline",
"KeyOutline",
"KoubeiFill",
"KoubeiOutline",
"LeftOutline",
"LikeOutline",
"LinkOutline",
"LocationFill",
"LocationOutline",
"LockFill",
"LockOutline",
"LoopOutline",
"MailFill",
"MailOpenOutline",
"MailOutline",
"MessageFill",
"MessageOutline",
"MinusCircleOutline",
"MinusOutline",
"MoreOutline",
"MovieOutline",
"PayCircleOutline",
"PhoneFill",
"PhonebookFill",
"PhonebookOutline",
"PictureOutline",
"PictureWrongOutline",
"PicturesOutline",
"PieOutline",
"PlayOutline",
"QuestionCircleFill",
"QuestionCircleOutline",
"ReceiptOutline",
"ReceivePaymentOutline",
"RedoOutline",
"RightOutline",
"ScanCodeOutline",
"ScanningFaceOutline",
"ScanningOutline",
"SearchOutline",
"SendOutline",
"SetOutline",
"ShopbagOutline",
"ShrinkOutline",
"SmileFill",
"SmileOutline",
"SoundMuteFill",
"SoundMuteOutline",
"SoundOutline",
"StarFill",
"StarOutline",
"StopOutline",
"SystemQRcodeOutline",
"TagOutline",
"TeamFill",
"TeamOutline",
"TextDeletionOutline",
"TextOutline",
"TransportQRcodeOutline",
"TravelOutline",
"TruckOutline",
"Uiwinbox",
"UndoOutline",
"UnlockOutline",
"UnorderedListOutline",
"UpCircleOutline",
"UpOutline",
"UploadOutline",
"UserAddOutline",
"UserCircleOutline",
"UserContactOutline",
"UserOutline",
"UserSetOutline",
"VideoOutline",
"Y1",
"Y10",
"Y11",
"Y12",
"Y13",
"Y14",
"Y15",
"Y16",
"Y17",
"Y18",
"Y19",
"Y2",
"Y20",
"Y21",
"Y22",
"Y23",
"Y24",
"Y25",
"Y26",
"Y27",
"Y28",
"Y29",
"Y3",
"Y30",
"Y31",
"Y32",
"Y33",
"Y34",
"Y35",
"Y36",
"Y37",
"Y38",
"Y39",
"Y4",
"Y40",
"Y41",
"Y42",
"Y43",
"Y44",
"Y45",
"Y46",
"Y47",
"Y48",
"Y49",
"Y5",
"Y50",
"Y51",
"Y52",
"Y53",
"Y54",
"Y55",
"Y56",
"Y57",
"Y58",
"Y59",
"Y6",
"Y60",
"Y61",
"Y62",
"Y63",
"Y64",
"Y65",
"Y66",
"Y67",
"Y68",
"Y69",
"Y7",
"Y70",
"Y71",
"Y72",
"Y73",
"Y74",
"Y75",
"Y76",
"Y77",
"Y78",
"Y79",
"Y8",
"Y80",
"Y81",
"Y82",
"Y83",
"Y84",
"Y85",
"Y86",
"Y87",
"Y88",
"Y89",
"Y9",
"Y90",
"ZCheck",
"ZCheckBox",
"ZCheckFilling",
"ZCheckHalf"
],
default: "ApiCloudlogo"
},
{
name: "color",
tip: "\u989C\u8272",
type: "string",
propType: "color",
default: "#666"
},
{
name: "size",
tip: "\u5C3A\u5BF8",
type: "number",
default: 32
}
];
// packages/avm-ui/src/components/icon/icon.tsx
var classPrefix = `adm-icon`;
var name = "avm-icon";
var Icon = class extends Component {
css = () => {
return `
@font-face {
font-family: "${fontName}";
src: url('https://avm-ui-icon-1313265164.cos.ap-beijing.myqcloud.com/avm-icon.ttf') format('truetype'), url('../../components/avm-ui/icon/avm-icon.ttf') format('truetype');
}
.${classPrefix} {font-family: ${fontName};font-size:32px;color:#666;align-self: center;}`;
};
render = (props2) => {
let name2 = props2.name || props2.type;
if (/\d/.test(name2)) {
name2.replace(/(\d)/);
}
if (props2.size) {
props2.fontSize = typeof props2.size === "number" ? props2.size + "px" : props2.size.replace("px", "") + "px";
}
let { code = defaultCode } = props2;
if (name2) {
const [{ enum: icons }] = props;
code = icons.indexOf(name2);
if (code === -1) {
code = -4644;
}
}
code += startUnicode;
return <text role={classPrefix} char={name2} style={{ ...props2 }} class={`${classPrefix} ${classPrefix}-font-icon-text ${props2.class || props2.className || ""}`}>{String.fromCharCode(code) || props2.children}</text>;
};
};
avm.define(name, Icon);
// packages/avm-ui/src/components/icon/index.ts
var icon_default = Icon;
export {
Icon,
icon_default as default
};