From ebff5f01add87cd8b2518c76f18b4536ce0a08c7 Mon Sep 17 00:00:00 2001 From: AmauryD Date: Fri, 3 Jan 2025 14:13:59 +0100 Subject: [PATCH] refactor: remove lazy image --- doc-app/app/router.ts | 1 - doc-app/app/templates/docs.hbs | 1 - .../app/templates/docs/ember-ui/lazy-image.md | 11 ------ packages/ember-ui/package.json | 1 - .../src/components/tpk-lazy-image.gts | 35 ------------------- packages/ember-ui/src/template-registry.ts | 3 -- 6 files changed, 52 deletions(-) delete mode 100644 doc-app/app/templates/docs/ember-ui/lazy-image.md delete mode 100644 packages/ember-ui/src/components/tpk-lazy-image.gts diff --git a/doc-app/app/router.ts b/doc-app/app/router.ts index 68ecf5c9..e83809a9 100644 --- a/doc-app/app/router.ts +++ b/doc-app/app/router.ts @@ -15,7 +15,6 @@ Router.map(function (this: RouterDSL) { this.route('confirm-modal') }) this.route('installation'); - this.route('lazy-image'); this.route('actions-menu'); this.route('modal'); this.route('table-generic'); diff --git a/doc-app/app/templates/docs.hbs b/doc-app/app/templates/docs.hbs index a1490aa1..076616c9 100644 --- a/doc-app/app/templates/docs.hbs +++ b/doc-app/app/templates/docs.hbs @@ -7,7 +7,6 @@ - diff --git a/doc-app/app/templates/docs/ember-ui/lazy-image.md b/doc-app/app/templates/docs/ember-ui/lazy-image.md deleted file mode 100644 index d196c303..00000000 --- a/doc-app/app/templates/docs/ember-ui/lazy-image.md +++ /dev/null @@ -1,11 +0,0 @@ -# Lazy image - -A component that shows a placeholder image until the real image is loaded. - - - - - - - - diff --git a/packages/ember-ui/package.json b/packages/ember-ui/package.json index 9f0770ed..5129a303 100644 --- a/packages/ember-ui/package.json +++ b/packages/ember-ui/package.json @@ -131,7 +131,6 @@ "./components/tpk-confirm-modal.js": "./dist/_app_/components/tpk-confirm-modal.js", "./components/tpk-confirm-modal/cancel.js": "./dist/_app_/components/tpk-confirm-modal/cancel.js", "./components/tpk-confirm-modal/confirm.js": "./dist/_app_/components/tpk-confirm-modal/confirm.js", - "./components/tpk-lazy-image.js": "./dist/_app_/components/tpk-lazy-image.js", "./components/tpk-loading-indicator.js": "./dist/_app_/components/tpk-loading-indicator.js", "./components/tpk-modal.js": "./dist/_app_/components/tpk-modal.js", "./components/tpk-modal/content.js": "./dist/_app_/components/tpk-modal/content.js", diff --git a/packages/ember-ui/src/components/tpk-lazy-image.gts b/packages/ember-ui/src/components/tpk-lazy-image.gts deleted file mode 100644 index a8265bf2..00000000 --- a/packages/ember-ui/src/components/tpk-lazy-image.gts +++ /dev/null @@ -1,35 +0,0 @@ -import { on } from '@ember/modifier'; -import { action } from '@ember/object'; -import Component from '@glimmer/component'; -import { tracked } from 'tracked-built-ins'; - -export interface LazyImageComponentSignature { - Args: { - defaultImage: string; - }; - Element: HTMLImageElement; - Blocks: { - default: []; - }; -} - -export default class TpkLazyImageComponent extends Component { - @tracked isLoaded = false; - - @action imageLoaded() { - this.isLoaded = true; - } - - -} diff --git a/packages/ember-ui/src/template-registry.ts b/packages/ember-ui/src/template-registry.ts index 31e35ea4..1f968370 100644 --- a/packages/ember-ui/src/template-registry.ts +++ b/packages/ember-ui/src/template-registry.ts @@ -21,7 +21,6 @@ import type StackListItemComponent from './components/tpk-stack-list/item.gts'; import type TpkStackListContentComponent from './components/tpk-stack-list/content.gts'; import type TpkActionsMenuElementComponent from './components/tpk-actions-menu/element.gts'; import type TpkStackListTitleComponent from './components/tpk-stack-list/title.gts'; -import type TpkLazyImageComponent from './components/tpk-lazy-image.gts'; import type TpkConfirmModalPrefabComponent from './components/prefabs/tpk-confirm-modal-prefab.gts'; export default interface Registry { @@ -29,8 +28,6 @@ export default interface Registry { 'tpk-stack-list/title': typeof TpkStackListTitleComponent; 'tpk-stack-list/content': typeof TpkStackListContentComponent; 'tpk-stack-list/item': typeof StackListItemComponent; - 'tpk-lazy-image': typeof TpkLazyImageComponent; - TpkLazyImage: typeof TpkLazyImageComponent; 'TpkStackList::Item': typeof StackListItemComponent; 'tpk-stack-list/head': typeof TpkStackListHeadComponent; 'TpkStackList::Head': typeof TpkStackListHeadComponent;