refactor to use hidden as the property for legacy and internal icons
This commit is contained in:
@@ -47,6 +47,7 @@ const collectDictionaryIcons = async () => {
|
||||
const icon = {
|
||||
name: iconDef.name,
|
||||
legacy: iconDef.legacy,
|
||||
hidden: iconDef.legacy ?? iconDef.internal,
|
||||
fileName: iconFileName,
|
||||
svg,
|
||||
output: `${iconsOutputDirectory}/${iconFileName}.ts`,
|
||||
|
||||
@@ -13,7 +13,7 @@ export class UmbIconRegistryContext extends UmbContextBase<UmbIconRegistryContex
|
||||
#manifestMap = new Map();
|
||||
#icons = new UmbArrayState<UmbIconDefinition>([], (x) => x.name);
|
||||
readonly icons = this.#icons.asObservable();
|
||||
readonly approvedIcons = this.#icons.asObservablePart((icons) => icons.filter((x) => x.legacy !== true));
|
||||
readonly approvedIcons = this.#icons.asObservablePart((icons) => icons.filter((x) => x.hidden !== true));
|
||||
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host, UMB_ICON_REGISTRY_CONTEXT);
|
||||
|
||||
@@ -5,7 +5,11 @@ export type * from './extensions/icons.extension.js';
|
||||
export interface UmbIconDefinition<JsType = any> {
|
||||
name: string;
|
||||
path: JsLoaderProperty<JsType>;
|
||||
/**
|
||||
* @deprecated `legacy` is deprecated and will be removed in v.17. Use `hidden` instead.
|
||||
*/
|
||||
legacy?: boolean;
|
||||
hidden?: boolean;
|
||||
}
|
||||
|
||||
export type UmbIconDictionary = Array<UmbIconDefinition>;
|
||||
|
||||
Reference in New Issue
Block a user