2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-09 23:00:56 +00:00

Minor fixes

This commit is contained in:
Vjacheslav Trushkin 2021-05-06 16:49:46 +03:00
parent 8bd6d0768c
commit 0045b0e403
12 changed files with 11 additions and 52 deletions

View File

@ -4,7 +4,7 @@
"module": "commonjs", "module": "commonjs",
"declaration": true, "declaration": true,
"declarationMap": true, "declarationMap": true,
"sourceMap": true, "sourceMap": false,
"composite": true, "composite": true,
"strict": true, "strict": true,
"moduleResolution": "node", "moduleResolution": "node",

View File

@ -7,7 +7,7 @@ import {
addIcon as addOnlineIcon, addIcon as addOnlineIcon,
addCollection as addOnlineCollection, addCollection as addOnlineCollection,
disableCache, disableCache,
} from '@iconify/react/dist/iconify'; } from '@iconify/react';
import presentationPlay from '@iconify-icons/mdi-light/presentation-play'; import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
import playIcon from '@iconify-icons/mdi-light/play'; import playIcon from '@iconify-icons/mdi-light/play';
@ -31,7 +31,7 @@ addOfflineIcon('demo', presentationPlay);
// Add 'mdi-light:play' as 'demo' for full module // Add 'mdi-light:play' as 'demo' for full module
addOnlineIcon('demo', playIcon); addOnlineIcon('demo', playIcon);
// Add custom icon as 'experiment' // Add different custom icons as 'experiment2' for offline and online modes
addOfflineIcon('experiment2', { addOfflineIcon('experiment2', {
width: 16, width: 16,
height: 16, height: 16,

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { Icon as OfflineIcon } from '@iconify/react/dist/offline'; import { Icon as OfflineIcon } from '@iconify/react/dist/offline';
import { Icon as FullIcon } from '@iconify/react/dist/iconify'; import { Icon as FullIcon } from '@iconify/react';
export function InlineDemo() { export function InlineDemo() {
return ( return (

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Icon } from '@iconify/react/dist/iconify'; import { Icon } from '@iconify/react';
export function FullUsageDemo() { export function FullUsageDemo() {
return ( return (

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { Icon } from '@iconify/react/dist/iconify'; import { Icon } from '@iconify/react';
import accountIcon from '@iconify-icons/mdi-light/account'; import accountIcon from '@iconify-icons/mdi-light/account';
import alertIcon from '@iconify-icons/mdi-light/alert'; import alertIcon from '@iconify-icons/mdi-light/alert';

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { InlineIcon, addAPIProvider, _api } from '@iconify/react/dist/iconify'; import { InlineIcon, addAPIProvider, _api } from '@iconify/react';
import { mockAPIModule, mockAPIData } from '@iconify/core/lib/api/modules/mock'; import { mockAPIModule, mockAPIData } from '@iconify/core/lib/api/modules/mock';
import { TestIcons, toggleTest } from './TestIcons'; import { TestIcons, toggleTest } from './TestIcons';
import playIcon from '@iconify-icons/mdi-light/map-marker'; import playIcon from '@iconify-icons/mdi-light/map-marker';

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import { InlineIcon } from '@iconify/react/dist/iconify'; import { InlineIcon } from '@iconify/react';
import { TestIcons, toggleTest } from './TestIcons'; import { TestIcons, toggleTest } from './TestIcons';
export function TestsFullOffline() { export function TestsFullOffline() {

View File

@ -104,7 +104,7 @@ export const render = (
if (typeof value === 'string') { if (typeof value === 'string') {
customisations[key] = rotateFromString(value); customisations[key] = rotateFromString(value);
} else if (typeof value === 'number') { } else if (typeof value === 'number') {
componentProps[key] = value; customisations[key] = value;
} }
break; break;

View File

@ -4,7 +4,7 @@
addIcon as addOnlineIcon, addIcon as addOnlineIcon,
addCollection as addOnlineCollection, addCollection as addOnlineCollection,
disableCache, disableCache,
} from '@iconify/svelte/dist/iconify'; } from '@iconify/svelte';
import presentationPlay from '@iconify-icons/mdi-light/presentation-play'; import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
import playIcon from '@iconify-icons/mdi-light/play'; import playIcon from '@iconify-icons/mdi-light/play';

View File

@ -288,22 +288,6 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
} }
} }
/*
.
.
.
.
.
.
*/
/** /**
* Function to get icon status * Function to get icon status
*/ */

View File

@ -83,7 +83,7 @@ export function render(
if (typeof value === 'string') { if (typeof value === 'string') {
customisations[key] = rotateFromString(value); customisations[key] = rotateFromString(value);
} else if (typeof value === 'number') { } else if (typeof value === 'number') {
componentProps[key] = value; customisations[key] = value;
} }
break; break;

View File

@ -80,31 +80,6 @@ export function addCollection(
/** /**
* Component * Component
*/ */
/*
// Currently this cannot be used because in functional component style is inherited, overriding style generated by render()
export function Icon(props: Record<string, unknown>, context): VNode {
// Check icon
const icon =
typeof props.icon === 'string'
? storage[props.icon]
: typeof props.icon === 'object'
? fullIcon(props.icon as IconifyIcon)
: null;
// Validate icon object
if (
icon === null ||
typeof icon !== 'object' ||
typeof icon.body !== 'string'
) {
return context.slots.default ? context.slots.default() : null;
}
// Valid icon: render it
return render(icon, context.attrs as IconProps);
}
*/
export const Icon = defineComponent({ export const Icon = defineComponent({
// Do not inherit other attributes: it is handled by render() // Do not inherit other attributes: it is handled by render()
inheritAttrs: false, inheritAttrs: false,