diff --git a/package.json b/package.json index 3b0f82b11..e2942b7f8 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "clean-webpack-plugin": "^3.0.0", "css-loader": "^5.0.1", "file-loader": "^6.1.0", - "fork-ts-checker-webpack-plugin": "^6.0.8", "fs-extra-plus": "^0.5.20", "git-revision-webpack-plugin": "^3.0.6", "gitlog": "^4.0.0", @@ -58,8 +57,8 @@ "html-webpack-plugin": "^4.4.1", "jest": "^26.4.2", "jest-snapshot": "^26.4.2", - "less": "^3.12.2", - "less-loader": "^7.1.0", + "less": "^4.1.1", + "less-loader": "7.3.0", "react-hot-loader": "^4.12.21", "request": "^2.88.2", "request-promise-native": "^1.0.9", @@ -92,12 +91,12 @@ }, "dependencies": { "@blueprintjs/core": "^3.36.0", + "@blueprintjs/table": "^3.8.27", "@types/react-virtualized-auto-sizer": "^1.0.0", "@types/react-window": "^1.8.2", "detect-browser": "^5.1.1", "dxf-parser-2": "^1.0.0-alpha.4", "flatbush": "^3.3.0", - "golden-layout": "^1.5.9", "js-angusj-clipper": "^1.1.0", "mobx": "^5.15.6", "mobx-react": "^6.3.0", diff --git a/src/UI/Components/Board/BoardProcessModal.tsx b/src/UI/Components/Board/BoardProcessModal.tsx index 87a67e679..81dc3710c 100644 --- a/src/UI/Components/Board/BoardProcessModal.tsx +++ b/src/UI/Components/Board/BoardProcessModal.tsx @@ -216,6 +216,7 @@ export class BoardProcessModal extends React.Component{ /> { diff --git a/src/UI/Components/Modal/ModalStyle/BoardModal.less b/src/UI/Components/Modal/ModalStyle/BoardModal.less index 102a94cd0..fba0251a7 100644 --- a/src/UI/Components/Modal/ModalStyle/BoardModal.less +++ b/src/UI/Components/Modal/ModalStyle/BoardModal.less @@ -4,7 +4,7 @@ } .long-select>.bp3-select>select { - width: @infoSelectWidth + width: @infoSelectWidth; } .board-info>.bp3-label input { @@ -151,11 +151,6 @@ position : relative; margin-bottom: 0.5rem; - // justify-content: space-between; - button { - width: 2rem; - } - input { width: 6.5rem; } diff --git a/src/UI/Components/SourceManage/Pagination.tsx b/src/UI/Components/SourceManage/Pagination.tsx index bff86ac59..c094f74aa 100644 --- a/src/UI/Components/SourceManage/Pagination.tsx +++ b/src/UI/Components/SourceManage/Pagination.tsx @@ -1,7 +1,7 @@ +import { Button, ButtonGroup, Classes, Icon, Label, NumericInput } from '@blueprintjs/core'; +import { IconNames } from '@blueprintjs/icons'; import { observer } from 'mobx-react'; import * as React from 'react'; -import { Label, Classes, Icon } from '@blueprintjs/core'; -import { IconNames } from '@blueprintjs/icons'; import { safeEval } from '../../../Common/eval'; interface IPaginationProps @@ -131,3 +131,134 @@ export class Pagination extends React.Component CELL_COUNT) + { + // Fill in first and last positions + cells[0] = { nr: 1 }; + cells[1] = { nr: 2 }; + cells[CELL_COUNT - 2] = { nr: n - 1 }; + cells[CELL_COUNT - 1] = { nr: n }; + + if (pos <= pivot) + { + // last ellipse is enabled and the rest of the array is filled + cells[CELL_COUNT - 2].ellipsis = true; + for (let i = 2; i < CELL_COUNT - 2; i++) + { + cells[i] = { nr: i + 1 }; + } + } else if (offset < pivot) + { + // a ellipsis is enabled and the later part of array is filled + cells[1].ellipsis = true; + for (let i = 2; i < CELL_COUNT - 2; i++) + { + cells[i] = { nr: n - CELL_COUNT + i + 1 }; + } + } else + { + // both a and b ellipsis are enabled + cells[1].ellipsis = true; + cells[CELL_COUNT - 2].ellipsis = true; + + // Current selected is put in centre + cells[pivot] = { nr: pos }; + // Fill next and prev to mid point + // CELL_COUNT - 5 := n{MID, FIRST, SECOND, LAST, SECONDLAST} + for (let i = 1; i < CELL_COUNT - 5; i++) + { + cells[pivot + i] = { nr: pos + i }; + cells[pivot - i] = { nr: pos - i }; + } + } + } else + { + for (let i = 0; i < n; i++) + { + cells[i] = { nr: i + 1, ellipsis: false }; + } + } + return cells; +} + +function name({ a, b }) +{ + +} + +interface PaginationProps +{ + count: number; + cursor: number, + onPaginate: (number) => void; + maxCells?: number; +} + +export const Pagination2 = ({ count, cursor, onPaginate, maxCells = CELL_COUNT }: PaginationProps) => +{ + // Renders a Pagination Button Group, inserting ellipsis based on cursor. + // ┌───┬───┬───┬───┬───┐ + // │ < │ 1 │ 2 │ 3 │ > │ + // └───┴───┴───┴───┴───┘ + // ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ + // │ < │ 1 │ 2 │ 3 │ 4 │...│ 9 │10 │ > │ + // └───┴───┴───┴───┴───┴───┴───┴───┴───┘ + // ┌───┬───┬───┬───┬───┬───┬───┬───┬───┐ + // │ < │ 1 │...│ 4 │ 5 │ 6 │...│10 │ > │ + // └───┴───┴───┴───┴───┴───┴───┴───┴───┘ + + const PrevPage =