mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
packages/ui-components/tooltip
Signed-off-by: Gabriel <gaccettola@mirantis.com>
This commit is contained in:
1 parent
67fa57c15c
commit
6404993432
434 files changed
+45562
-38
No files matched your search
@@ -0,0 +1,2 @@
|
||||
export { computedChannelInjectionToken, computedChannelObserverInjectionToken, } from "./src/computed-channel/computed-channel.injectable";
|
||||
export type { ChannelObserver, ComputedChannelFactory, } from "./src/computed-channel/computed-channel.injectable";
|
||||
@@ -0,0 +1 @@
|
||||
(()=>{"use strict";var e={d:(n,t)=>{for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{computedChannelInjectionToken:()=>a,computedChannelObserverInjectionToken:()=>i});const t=require("@ogre-tools/injectable"),o=require("mobx"),c=require("@k8slens/messaging"),r=(0,c.getMessageChannel)("computed-channel-administration-channel"),a=((0,c.getMessageChannelListenerInjectable)({id:"computed-channel-administration",channel:r,getHandler:e=>{const n=e.inject(c.sendMessageToChannelInjectionToken),t=new Map;return c=>{if("became-observed"===c.status){const r=e.injectMany(i).find((e=>e.channel.id===c.channelId));if(void 0===r)return;const a=(0,o.reaction)((()=>r.observer.get()),(e=>n({id:c.channelId},e)),{fireImmediately:!0});t.set(c.channelId,a)}else{const e=t.get(c.channelId);null==e||e()}}}}),(0,t.getInjectionToken)({id:"computed-channel-injection-token"})),i=(0,t.getInjectionToken)({id:"computed-channel-observer"});(0,t.getInjectable)({id:"computed-channel",instantiate:e=>{const n=e.inject(c.sendMessageToChannelInjectionToken);return(t,a)=>{const i=o.observable.box(a),s=(0,o.computed)((()=>i.get())),d=(0,c.getMessageChannelListenerInjectable)({id:`computed-channel-value-receiver-for-${t.id}`,channel:t,getHandler:()=>e=>{(0,o.runInAction)((()=>{i.set(e)}))}});return(0,o.runInAction)((()=>{e.register(d)})),(0,o.onBecomeObserved)(s,(()=>{(0,o.runInAction)((()=>{i.set(a)})),n(r,{channelId:t.id,status:"became-observed"})})),(0,o.onBecomeUnobserved)(s,(()=>{(0,o.runInAction)((()=>{i.set(a)})),n(r,{channelId:t.id,status:"became-unobserved"})})),s}},injectionToken:a}),module.exports=n})();
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
export type ComputedChannelAdminMessage = {
|
||||
channelId: string;
|
||||
status: "became-observed" | "became-unobserved";
|
||||
};
|
||||
export declare const computedChannelAdministrationChannel: import("@k8slens/messaging").MessageChannel<ComputedChannelAdminMessage>;
|
||||
export declare const computedChannelAdministrationListenerInjectable: import("@ogre-tools/injectable").Injectable<import("@k8slens/messaging").MessageChannelListener<import("@k8slens/messaging").MessageChannel<ComputedChannelAdminMessage>>, import("@k8slens/messaging").MessageChannelListener<import("@k8slens/messaging").MessageChannel<unknown>>, void>;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { IComputedValue } from "mobx";
|
||||
import type { MessageChannel } from "@k8slens/messaging";
|
||||
export type ComputedChannelFactory = <T>(channel: MessageChannel<T>, pendingValue: T) => IComputedValue<T>;
|
||||
export declare const computedChannelInjectionToken: import("@ogre-tools/injectable").InjectionToken<ComputedChannelFactory, void>;
|
||||
export type ChannelObserver<T> = {
|
||||
channel: MessageChannel<T>;
|
||||
observer: IComputedValue<T>;
|
||||
};
|
||||
export declare const computedChannelObserverInjectionToken: import("@ogre-tools/injectable").InjectionToken<ChannelObserver<unknown>, void>;
|
||||
declare const computedChannelInjectable: import("@ogre-tools/injectable").Injectable<ComputedChannelFactory, ComputedChannelFactory, void>;
|
||||
export default computedChannelInjectable;
|
||||
Reference in new issue
Block a user