@@ -80,135 +80,3 @@ export class Modulizer extends Component<any, any> {
8080 return createElement ( Incorporator , output ) ;
8181 }
8282}
83-
84- // export function Modulizer(Comp: any): ComponentType<any> {
85- // class ModulizerComponent extends Component<any, any> {
86- // private ref: any;
87- // private element: any;
88- // private setRef: any;
89- // constructor(props) {
90- // super(props);
91- // this.element = null
92-
93- // const {targetProps, targetRef} = props.modularizerProps
94- // const useRef = hasModuleProps(targetProps)
95- // if (targetRef) {
96- // if (typeof targetRef === 'function' && useRef) {
97- // this.setRef = element => {
98- // this.element = element;
99- // targetRef(element);
100- // };
101-
102- // this.ref = this.setRef;
103- // } else {
104- // this.ref = targetRef;
105- // }
106- // } else {
107- // this.ref = useRef ? createRef() : null;
108- // }
109- // }
110-
111- // public componentDidMount() {
112- // moduleProcessor(onMounts, this.element || (this.ref && this.ref.current), this.props.modularizerProps.targetProps)
113- // }
114-
115- // public componentDidUpdate() {
116- // moduleProcessor(onUpdates, this.element || (this.ref && this.ref.current), this.props.modularizerProps.targetProps)
117- // }
118-
119- // public componentWillUnmount() {
120- // moduleProcessor(onUnmounts, this.element || (this.ref && this.ref.current), this.props.modularizerProps.targetProps)
121- // }
122-
123- // render() {
124- // const targetProps = {...this.props.modularizerProps.targetProps}
125- // moduleEntries.forEach(pair => delete targetProps[pair[0]])
126- // const output: any = {...this.props.modularizerProps, targetRef: this.ref, targetProps};
127-
128- // return createElement(Comp, output);
129- // }
130- // }
131-
132- // return forwardRef<any, any>((props, ref) => {
133- // return createElement(ModulizerComponent, {modularizerProps: props, targetRef: ref} )
134- // });
135- // }
136-
137- // export default class Modulizer extends PureComponent<Props, State> {
138- // private ref: any;
139- // private element: any;
140- // private setRef: any;
141-
142- // constructor(props: Props) {
143- // super(props);
144- // this.element = null
145-
146- // const useRef = hasModuleProps(props.targetProps)
147- // if (props.targetRef) {
148- // if (typeof props.targetRef === 'function' && useRef) {
149- // this.setRef = element => {
150- // this.element = element;
151- // props.targetRef(element);
152- // };
153-
154- // this.ref = this.setRef;
155- // } else {
156- // this.ref = props.targetRef;
157- // }
158- // } else {
159- // this.ref = useRef ? createRef() : null;
160- // }
161- // }
162-
163- // public componentDidMount() {
164- // this.unsubscribe = this.props.scope.subscribe(this.selector, () => {
165- // this.setState((prev: any) => ({flip: !prev.flip}));
166- // });
167-
168- // moduleProcessor(onMounts, this.element || (this.ref && this.ref.current), this.props.targetProps)
169- // }
170-
171- // public componentDidUpdate() {
172- // moduleProcessor(onUpdates, this.element || (this.ref && this.ref.current), this.props.targetProps)
173- // }
174-
175- // public componentWillUnmount() {
176- // moduleProcessor(onUnmounts, this.element || (this.ref && this.ref.current), this.props.targetProps)
177-
178- // this.unsubscribe();
179- // }
180-
181- // private incorporateHandlers<P>(props: P, scope: Scope): P {
182- // const handlers = scope.getSelectorHandlers(this.selector);
183- // for (const evType of Object.keys(handlers)) {
184- // const onFoo = `on${evType[0].toUpperCase()}${evType.slice(1)}`;
185- // props[onFoo] = (ev: any) => handlers[evType]._n(ev);
186- // }
187- // return props;
188- // }
189-
190- // private materializeTargetProps() {
191- // const {targetProps, scope} = this.props;
192- // let output = {...targetProps};
193- // output = this.incorporateHandlers(output, scope);
194- // if (this.ref) {
195- // output.ref = this.ref;
196- // }
197- // delete output.sel;
198- // moduleEntries.forEach(pair => delete output[pair[0]])
199- // return output;
200- // }
201-
202- // public render() {
203- // const {target} = this.props;
204- // const targetProps = this.materializeTargetProps();
205-
206- // if (targetProps.children) {
207- // return createElement(target, targetProps, targetProps.children);
208- // } else {
209- // return createElement(target, targetProps);
210- // }
211- // }
212-
213-
214- // }
0 commit comments