static genNextState()

in src/ui/widget/Collapsible.tsx [73:98]


	static genNextState(self: Collapsible, open:boolean, changing:boolean): State {
		const  transition = self.props.ms ? 'all ' + self.props.ms + 'ms' : undefined;

		if(open) {
			return { css: {
				...self.props.style,
				maxHeight: changing ? self.height + "px" :  undefined,
				visibility: "visible",
				opacity: "1",
				transition
			} }
		} else {
			const r: State = { css: {
				... self.closeStyle,
				maxHeight: "0px",
				visibility: "hidden",
				opacity: "0",
				transition
			} }

			if(!changing) {
				r.css.display = "none";
			}
			return r;
		}
	}