1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- /**
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
- */
- /**
- * fit content details: https://github.com/NG-ZORRO/ng-zorro-antd/pull/6154#issuecomment-745025554
- *
- * calc position x,y point
- *
- * CASE (width <= clientWidth && height <= clientHeight):
- *
- * ------------- clientWidth -------------
- * | |
- * | ------ width ------ |
- * | | | |
- * | | | |
- * client height | |
- * Height | | |
- * | | | |
- * | ------------------- |
- * | |
- * | |
- * ---------------------------------------
- * fixedPosition = { x: 0, y: 0 }
- *
- *
- *
- * CASE (width > clientWidth || height > clientHeight):
- *
- * ------------- clientWidth -------------
- * | | |
- * | top |
- * | | |
- * |--left--|--------------- width -----------------
- * | | |
- * client | |
- * Height | |
- * | | |
- * | | |
- * | height |
- * | | |
- * ---------| |
- * | |
- * | |
- * | |
- * ----------------------------------------
- *
- *
- * - left || top > 0
- * left -> 0 || top -> 0
- *
- * - (left + width) < clientWidth || (top + height) < clientHeight
- * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight
- *
- * DEFAULT:
- * - hold position
- *
- */
- export declare function getFitContentPosition(params: {
- width: number;
- height: number;
- left: number;
- top: number;
- clientWidth: number;
- clientHeight: number;
- }): {
- x?: number;
- y?: number;
- };
- export declare function getOffset(node: HTMLElement): {
- left: number;
- top: number;
- };
- export declare function getClientSize(): {
- width: number;
- height: number;
- };
|