@ant-design/icons-react
Advanced tools
Comparing version 1.0.0-alpha.6 to 1.0.0-alpha.7
@@ -21,4 +21,4 @@ import { IconDefinition, IconDefinitionGetter } from '@ant-design/icons/lib/types'; | ||
static displayName: string; | ||
static definitions: MiniMap<IconDefinition>; | ||
static add(...icons: IconDefinition[]): void; | ||
static definitions: MiniMap<IconDefinition | IconDefinitionGetter>; | ||
static add(...icons: Array<IconDefinition | IconDefinitionGetter>): void; | ||
static clear(): void; | ||
@@ -25,0 +25,0 @@ static get(key?: string, colors?: TwoToneColorPalette): IconDefinition | undefined; |
@@ -8,3 +8,3 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
import * as React from 'react'; | ||
import { generate, getIconNameAccordingToSuffix, getSecondaryColor, isIconDefinition, isIconDefinitionGetter, log, MiniMap } from '../utils'; | ||
import { generate, getSecondaryColor, isIconDefinition, isIconDefinitionGetter, log, MiniMap } from '../utils'; | ||
var twoToneColorPalette = { | ||
@@ -50,3 +50,3 @@ primaryColor: '#333', | ||
} else if (typeof type === 'string') { | ||
target = Icon.get(getIconNameAccordingToSuffix(type), colors); | ||
target = Icon.get(type, colors); | ||
if (!target) { | ||
@@ -53,0 +53,0 @@ log('Could not find icon: ' + type); |
@@ -21,3 +21,2 @@ import { AbstractNode, IconDefinition, IconDefinitionGetter } from '@ant-design/icons/lib/types'; | ||
} | false): any; | ||
export declare function getIconNameAccordingToSuffix(type: string): string | undefined; | ||
export declare function getSecondaryColor(primaryColor: string): string; |
import _extends from 'babel-runtime/helpers/extends'; | ||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
import _createClass from 'babel-runtime/helpers/createClass'; | ||
import mapper from '@ant-design/icons/lib/mapNameToThemedName'; | ||
import { generate as generateColor } from 'ant-design-palettes'; | ||
@@ -88,10 +87,2 @@ import * as React from 'react'; | ||
} | ||
var suffixTests = /(-o|-fill|-twotone)$/; | ||
export function getIconNameAccordingToSuffix(type) { | ||
if (suffixTests.test(type)) { | ||
return type; | ||
} | ||
// use mapper from '@ant-design/icons/lib/mapNameToThemedName' | ||
return mapper[type]; | ||
} | ||
export function getSecondaryColor(primaryColor) { | ||
@@ -98,0 +89,0 @@ // choose the second color |
@@ -21,4 +21,4 @@ import { IconDefinition, IconDefinitionGetter } from '@ant-design/icons/lib/types'; | ||
static displayName: string; | ||
static definitions: MiniMap<IconDefinition>; | ||
static add(...icons: IconDefinition[]): void; | ||
static definitions: MiniMap<IconDefinition | IconDefinitionGetter>; | ||
static add(...icons: Array<IconDefinition | IconDefinitionGetter>): void; | ||
static clear(): void; | ||
@@ -25,0 +25,0 @@ static get(key?: string, colors?: TwoToneColorPalette): IconDefinition | undefined; |
@@ -80,3 +80,3 @@ 'use strict'; | ||
} else if (typeof type === 'string') { | ||
target = Icon.get((0, _utils.getIconNameAccordingToSuffix)(type), colors); | ||
target = Icon.get(type, colors); | ||
if (!target) { | ||
@@ -83,0 +83,0 @@ (0, _utils.log)('Could not find icon: ' + type); |
@@ -21,3 +21,2 @@ import { AbstractNode, IconDefinition, IconDefinitionGetter } from '@ant-design/icons/lib/types'; | ||
} | false): any; | ||
export declare function getIconNameAccordingToSuffix(type: string): string | undefined; | ||
export declare function getSecondaryColor(primaryColor: string): string; |
@@ -25,9 +25,4 @@ 'use strict'; | ||
exports.generate = generate; | ||
exports.getIconNameAccordingToSuffix = getIconNameAccordingToSuffix; | ||
exports.getSecondaryColor = getSecondaryColor; | ||
var _mapNameToThemedName = require('@ant-design/icons/lib/mapNameToThemedName'); | ||
var _mapNameToThemedName2 = _interopRequireDefault(_mapNameToThemedName); | ||
var _antDesignPalettes = require('ant-design-palettes'); | ||
@@ -125,10 +120,2 @@ | ||
} | ||
var suffixTests = /(-o|-fill|-twotone)$/; | ||
function getIconNameAccordingToSuffix(type) { | ||
if (suffixTests.test(type)) { | ||
return type; | ||
} | ||
// use mapper from '@ant-design/icons/lib/mapNameToThemedName' | ||
return _mapNameToThemedName2['default'][type]; | ||
} | ||
function getSecondaryColor(primaryColor) { | ||
@@ -135,0 +122,0 @@ // choose the second color |
{ | ||
"name": "@ant-design/icons-react", | ||
"version": "1.0.0-alpha.6", | ||
"version": "1.0.0-alpha.7", | ||
"main": "./lib/index.js", | ||
@@ -39,2 +39,4 @@ "module": "./es/index.js", | ||
"jest": "^23.4.2", | ||
"mobx": "^5.1.0", | ||
"mobx-react": "^5.2.5", | ||
"rc-tools": "^8.1.6", | ||
@@ -47,3 +49,3 @@ "react": "^16.4.2", | ||
"tslint-react": "^3.6.0", | ||
"typescript": "^2.9.2" | ||
"typescript": "^3.0.3" | ||
}, | ||
@@ -50,0 +52,0 @@ "dependencies": { |
24074
19
524