@evergis/react 4.0.144 → 4.0.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dashboard/components/ResizeHandle/constants.d.ts +15 -0
- package/dist/components/Dashboard/components/ResizeHandle/index.d.ts +3 -0
- package/dist/components/Dashboard/components/ResizeHandle/styled.d.ts +17 -0
- package/dist/components/Dashboard/components/ResizeHandle/types.d.ts +2 -0
- package/dist/components/Dashboard/components/index.d.ts +1 -0
- package/dist/components/Dashboard/elements/ElementTable/components/TableColumnResizer.d.ts +10 -0
- package/dist/components/Dashboard/elements/ElementTable/hooks/useColumnResize.d.ts +15 -16
- package/dist/components/Dashboard/elements/ElementTable/hooks/useTableView.d.ts +3 -5
- package/dist/components/Dashboard/elements/ElementTable/styled.d.ts +0 -7
- package/dist/components/Dashboard/elements/ElementTable/types.d.ts +7 -4
- package/dist/components/Dashboard/elements/ElementTable/utils/columnStyle.d.ts +11 -3
- package/dist/components/Dashboard/grid/constants.d.ts +0 -14
- package/dist/components/Dashboard/grid/hooks/useGridHeightResize.d.ts +2 -2
- package/dist/components/Dashboard/grid/hooks/useGridResize.d.ts +6 -10
- package/dist/components/Dashboard/hooks/index.d.ts +1 -0
- package/dist/components/Dashboard/hooks/useResizeDrag.d.ts +29 -0
- package/dist/index.js +291 -222
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +290 -222
- package/dist/react.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/react.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { createGlobalStyle, css, useTheme } from 'styled-components';
|
|
2
|
-
import { Icon, IconButtonInnerChild, IconButton, Flex, transition, Chip, shadows, Description, Divider, Popup, Menu, IconToggleButton, LinearProgress, Tooltip as Tooltip$1, IconToggle, Preview, LegendToggler, DropdownField, MultiSelectContainer, IconButtonButton,
|
|
2
|
+
import { Icon, IconButtonInnerChild, IconButton, Flex, transition, Chip, shadows, Description, Divider, useDragAndDropEffect, Popup, Menu, IconToggleButton, LinearProgress, Tooltip as Tooltip$1, IconToggle, Preview, LegendToggler, DropdownField, MultiSelectContainer, IconButtonButton, FlatButton, DraggableTreeContainer, DraggableTree, FlexSpan, Dialog, DialogTitle, ActionsGroup, DialogContent, DialogActions, RaisedButton, UploaderItemArea, UploaderTitleWrapper, RadioGroup, Dropdown, Input, Switch, Checkbox, Radio, ThemeProvider, darkTheme, CircularProgress, AutoComplete, Slider, DatePicker, getLocale, H2, Blank, Popover, NumberInput, Uploader, NumberRangeSlider, useAsyncAutocomplete, RangeNumberInput, TreeDropdown, defaultTheme, dateFormat } from '@evergis/uilib-gl';
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
4
4
|
import { isValidElement, Fragment, createContext, memo, useRef, useState, useCallback, useEffect, useContext, useMemo, createElement, useLayoutEffect, forwardRef } from 'react';
|
|
5
5
|
import { barChartClassNames, lineChartClassNames, BarChart as BarChart$1, LineChart, PieChart } from '@evergis/charts';
|
|
@@ -8168,6 +8168,70 @@ const useProjectDashboardInit = () => {
|
|
|
8168
8168
|
}, [projectInfo, updateProject]);
|
|
8169
8169
|
};
|
|
8170
8170
|
|
|
8171
|
+
/**
|
|
8172
|
+
* Съесть клик, которым закончилось перетаскивание.
|
|
8173
|
+
*
|
|
8174
|
+
* Мышь отпускают уже за пределами ручки, поэтому браузер шлёт `click` не ей, а общему предку —
|
|
8175
|
+
* ячейке или заголовку. Без этого перетаскивание границы заканчивалось бы сортировкой таблицы
|
|
8176
|
+
* по колонке или сменой выделения в сетке.
|
|
8177
|
+
*/
|
|
8178
|
+
const swallowNextClick = () => {
|
|
8179
|
+
const swallow = (event) => {
|
|
8180
|
+
event.stopPropagation();
|
|
8181
|
+
event.preventDefault();
|
|
8182
|
+
};
|
|
8183
|
+
window.addEventListener("click", swallow, { capture: true, once: true });
|
|
8184
|
+
// Клика может и не быть — например, мышь отпустили за пределами окна. Тогда снимаем слушатель
|
|
8185
|
+
// сами, иначе он съел бы следующий, уже осмысленный клик.
|
|
8186
|
+
window.setTimeout(() => window.removeEventListener("click", swallow, { capture: true }), 0);
|
|
8187
|
+
};
|
|
8188
|
+
/**
|
|
8189
|
+
* Перетаскивание границы: подписка на ручку, снимок на старте, предпросмотр на движении,
|
|
8190
|
+
* запись результата на отпускании.
|
|
8191
|
+
*
|
|
8192
|
+
* Общий для сетки дашборда и колонок таблицы. Различаются они только тем, что именно меряют и
|
|
8193
|
+
* куда пишут; сам жест обязан ощущаться одинаково — включая то, что мышь ведут по документу, а
|
|
8194
|
+
* не по самой ручке, и отпускание за пределами окна тоже завершает жест.
|
|
8195
|
+
*/
|
|
8196
|
+
const useResizeDrag = ({ onStart, onMove, onEnd }) => {
|
|
8197
|
+
const [handle, setHandle] = useState(null);
|
|
8198
|
+
const [dragging, setDragging] = useState(false);
|
|
8199
|
+
const stateRef = useRef(null);
|
|
8200
|
+
const movedRef = useRef(false);
|
|
8201
|
+
const mouseDown = useCallback((event) => {
|
|
8202
|
+
const state = onStart(event);
|
|
8203
|
+
if (state === null) {
|
|
8204
|
+
return;
|
|
8205
|
+
}
|
|
8206
|
+
// Гасим выделение текста: жест ведут мышью по документу, и без этого он выделял бы всё,
|
|
8207
|
+
// над чем проходит курсор.
|
|
8208
|
+
event.preventDefault();
|
|
8209
|
+
stateRef.current = state;
|
|
8210
|
+
movedRef.current = false;
|
|
8211
|
+
setDragging(true);
|
|
8212
|
+
}, [onStart]);
|
|
8213
|
+
const mouseMove = useCallback((event) => {
|
|
8214
|
+
if (stateRef.current !== null) {
|
|
8215
|
+
movedRef.current = true;
|
|
8216
|
+
onMove(stateRef.current, event);
|
|
8217
|
+
}
|
|
8218
|
+
}, [onMove]);
|
|
8219
|
+
const mouseUp = useCallback((event) => {
|
|
8220
|
+
const state = stateRef.current;
|
|
8221
|
+
if (state === null) {
|
|
8222
|
+
return;
|
|
8223
|
+
}
|
|
8224
|
+
stateRef.current = null;
|
|
8225
|
+
setDragging(false);
|
|
8226
|
+
if (movedRef.current) {
|
|
8227
|
+
swallowNextClick();
|
|
8228
|
+
}
|
|
8229
|
+
onEnd(state, event);
|
|
8230
|
+
}, [onEnd]);
|
|
8231
|
+
useDragAndDropEffect(handle, { mouseDown, mouseMove, mouseUp });
|
|
8232
|
+
return { setHandle, dragging };
|
|
8233
|
+
};
|
|
8234
|
+
|
|
8171
8235
|
const useRelatedDataSourceAttributes = ({ type = WidgetType.Dashboard, elementConfig, dataSources, feature, }) => {
|
|
8172
8236
|
const { layerInfos } = useWidgetContext(type);
|
|
8173
8237
|
const { currentPage } = useWidgetPage(type);
|
|
@@ -9602,6 +9666,92 @@ const FiltersContainer = memo(({ elementConfig, config, type, renderElement }) =
|
|
|
9602
9666
|
return (jsxs(ContainerRoot, { ...root, children: [jsx(ContainerBackground, { elementConfig: elementConfig, renderElement: renderElement }), jsx(Flex, { mb: !isVisible && selectedItems.length ? "2rem" : 0, children: jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }) }), isLoading && jsx(ContainerLoading, {}), !isLoading && isVisible && (jsx(FiltersContainerWrapper, { ...body, "$padding": padding, "$bgColor": bgColor, "$fontSize": fontSize, "$fontColor": fontColor, children: filterItems?.map(renderFilter) })), jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type, filter: filterItems[0]?.options?.filterName })] }));
|
|
9603
9667
|
});
|
|
9604
9668
|
|
|
9669
|
+
/**
|
|
9670
|
+
* Заход зоны захвата на содержимое с каждой стороны границы, px.
|
|
9671
|
+
*
|
|
9672
|
+
* Без него попасть курсором ровно в границу невозможно: у таблицы её толщина — один пиксель,
|
|
9673
|
+
* а у сетки зазора может не быть вовсе. Ручка абсолютная и в раскладке не участвует, поэтому
|
|
9674
|
+
* расширение ничего не сдвигает.
|
|
9675
|
+
*/
|
|
9676
|
+
const HANDLE_BLEED_PX = 3;
|
|
9677
|
+
/**
|
|
9678
|
+
* Маркер ручки: нажатие на ней тянет границу, а не ячейку сетки.
|
|
9679
|
+
*
|
|
9680
|
+
* Ставит его сам компонент. Ручка колонки таблицы, оказавшейся внутри ячейки сетки, обязана
|
|
9681
|
+
* помечаться так же — иначе нажатие на ней начинало бы перетаскивание всей ячейки.
|
|
9682
|
+
*/
|
|
9683
|
+
const RESIZE_HANDLE_ATTR = "data-grid-handle";
|
|
9684
|
+
|
|
9685
|
+
/**
|
|
9686
|
+
* Зона захвата = зазор плюс небольшой заход на содержимое с обеих сторон.
|
|
9687
|
+
*
|
|
9688
|
+
* Смещение уводит дальний край ручки за зазор ровно на `HANDLE_BLEED_PX`, поэтому вместе с
|
|
9689
|
+
* шириной она оказывается симметрично «надета» на границу: от `-bleed` до `gap + bleed`.
|
|
9690
|
+
*/
|
|
9691
|
+
const handleSize = `calc(var(--grid-gap, 0px) + ${HANDLE_BLEED_PX * 2}px)`;
|
|
9692
|
+
const handleOffset = `calc(-1 * (var(--grid-gap, 0px) + ${HANDLE_BLEED_PX}px))`;
|
|
9693
|
+
/**
|
|
9694
|
+
* Ручка перетаскивания границы. Общая для сетки дашборда и колонок таблицы: жест один и тот же,
|
|
9695
|
+
* и выглядеть он обязан одинаково.
|
|
9696
|
+
*
|
|
9697
|
+
* Абсолютная и целиком лежит в зазоре, поэтому включение режима редактирования не сдвигает
|
|
9698
|
+
* раскладку ни на пиксель. Сам ползунок (`::after`) появляется только при наведении и во время
|
|
9699
|
+
* перетаскивания — в покое раскладка выглядит как обычно.
|
|
9700
|
+
*
|
|
9701
|
+
* Ширину зазора берёт из переменной: у сетки её объявляет тело сетки, у таблицы зазора нет вовсе,
|
|
9702
|
+
* и зона захвата сжимается до одного захода на содержимое с каждой стороны.
|
|
9703
|
+
*/
|
|
9704
|
+
const ResizeHandle = styled.div.attrs({ [RESIZE_HANDLE_ATTR]: true }).withConfig({ displayName: "ResizeHandle", componentId: "sc-1n6ja5b" }) `
|
|
9705
|
+
position: absolute;
|
|
9706
|
+
z-index: 3;
|
|
9707
|
+
touch-action: none;
|
|
9708
|
+
|
|
9709
|
+
::after {
|
|
9710
|
+
content: "";
|
|
9711
|
+
position: absolute;
|
|
9712
|
+
border-radius: 0.0625rem;
|
|
9713
|
+
background: transparent;
|
|
9714
|
+
transition: background-color 120ms ease;
|
|
9715
|
+
}
|
|
9716
|
+
|
|
9717
|
+
:hover::after,
|
|
9718
|
+
&[data-dragging="true"]::after {
|
|
9719
|
+
background: ${({ theme: { palette } }) => palette.primary};
|
|
9720
|
+
}
|
|
9721
|
+
|
|
9722
|
+
${({ $axis }) => $axis === "column"
|
|
9723
|
+
? css `
|
|
9724
|
+
top: 0;
|
|
9725
|
+
bottom: 0;
|
|
9726
|
+
right: ${handleOffset};
|
|
9727
|
+
width: ${handleSize};
|
|
9728
|
+
cursor: col-resize;
|
|
9729
|
+
|
|
9730
|
+
::after {
|
|
9731
|
+
top: 20%;
|
|
9732
|
+
bottom: 20%;
|
|
9733
|
+
left: 50%;
|
|
9734
|
+
width: 0.125rem;
|
|
9735
|
+
transform: translateX(-50%);
|
|
9736
|
+
}
|
|
9737
|
+
`
|
|
9738
|
+
: css `
|
|
9739
|
+
left: 0;
|
|
9740
|
+
right: 0;
|
|
9741
|
+
bottom: ${handleOffset};
|
|
9742
|
+
height: ${handleSize};
|
|
9743
|
+
cursor: row-resize;
|
|
9744
|
+
|
|
9745
|
+
::after {
|
|
9746
|
+
left: 20%;
|
|
9747
|
+
right: 20%;
|
|
9748
|
+
top: 50%;
|
|
9749
|
+
height: 0.125rem;
|
|
9750
|
+
transform: translateY(-50%);
|
|
9751
|
+
}
|
|
9752
|
+
`};
|
|
9753
|
+
`;
|
|
9754
|
+
|
|
9605
9755
|
/** Размер, при котором контейнер занимает всю ячейку родителя. */
|
|
9606
9756
|
const FILL_SIZE = "100%";
|
|
9607
9757
|
/** Собственные горизонтальные дефолты обёртки, мешающие контейнеру занять всю ширину ячейки. */
|
|
@@ -9681,6 +9831,7 @@ const getWrapperSizeStyle = ({ style, width: widthOption, height: heightOption,
|
|
|
9681
9831
|
};
|
|
9682
9832
|
};
|
|
9683
9833
|
|
|
9834
|
+
// Прямой импорт листового модуля, а не барреля components: тот тянет за собой контейнеры.
|
|
9684
9835
|
/**
|
|
9685
9836
|
* Минимальный размер трека, px. Ниже него ресайз не пускает — иначе ячейку не за что схватить.
|
|
9686
9837
|
*
|
|
@@ -9716,14 +9867,6 @@ const GRID_AUTO_FILL_DEFAULTS = { ...CONTAINERS_GROUP_DEFAULTS, minHeight: FILL_
|
|
|
9716
9867
|
* раскладки, поэтому задаётся явно через `options.gap`, а не навязывается всем сеткам.
|
|
9717
9868
|
*/
|
|
9718
9869
|
const DEFAULT_GRID_GAP = 0;
|
|
9719
|
-
/**
|
|
9720
|
-
* Насколько ручка ресайза заходит на содержимое с каждой стороны, px.
|
|
9721
|
-
*
|
|
9722
|
-
* По умолчанию зазора нет вовсе, так что попасть курсором ровно в границу невозможно — зона
|
|
9723
|
-
* захвата всегда шире зазора на эту величину с каждой стороны. Ручка абсолютная и в раскладке
|
|
9724
|
-
* не участвует, поэтому расширение ничего не сдвигает.
|
|
9725
|
-
*/
|
|
9726
|
-
const HANDLE_BLEED_PX = 3;
|
|
9727
9870
|
/**
|
|
9728
9871
|
* Сдвиг курсора, после которого нажатие на ячейке считается перетаскиванием, px.
|
|
9729
9872
|
*
|
|
@@ -9733,17 +9876,13 @@ const HANDLE_BLEED_PX = 3;
|
|
|
9733
9876
|
const DRAG_THRESHOLD_PX = 4;
|
|
9734
9877
|
/** Маркер ячейки в DOM: по нему ищется цель перетаскивания под курсором. */
|
|
9735
9878
|
const GRID_CELL_ATTR = "data-grid-cell";
|
|
9736
|
-
/** Маркер ручки ресайза: нажатие на ней тянет границу, а не ячейку. */
|
|
9737
|
-
const GRID_HANDLE_ATTR = "data-grid-handle";
|
|
9738
|
-
/** Тот же маркер пропсами: имя атрибута вычисляемое, а в JSX такое подставляется только спредом. */
|
|
9739
|
-
const GRID_HANDLE_PROPS = { [GRID_HANDLE_ATTR]: true };
|
|
9740
9879
|
/**
|
|
9741
9880
|
* Нажатия, которые перетаскиванием ячейки не считаются.
|
|
9742
9881
|
*
|
|
9743
9882
|
* Ручка тянет границу трека, а поля ввода живут своей жизнью: там нажатие ставит каретку и
|
|
9744
9883
|
* выделяет текст, и подменять это перестановкой ячеек нельзя.
|
|
9745
9884
|
*/
|
|
9746
|
-
const NO_CELL_DRAG_SELECTOR = `[${
|
|
9885
|
+
const NO_CELL_DRAG_SELECTOR = `[${RESIZE_HANDLE_ATTR}], input, textarea, select, [contenteditable="true"]`;
|
|
9747
9886
|
/**
|
|
9748
9887
|
* Разметка идущего жеста: ячейка-источник, цель под курсором и сам факт перетаскивания.
|
|
9749
9888
|
*
|
|
@@ -9764,72 +9903,6 @@ const FR_PRECISION = 1000;
|
|
|
9764
9903
|
const GRID_ROW_ID_PREFIX = "gridRow_";
|
|
9765
9904
|
const GRID_CELL_ID_PREFIX = "gridCell_";
|
|
9766
9905
|
|
|
9767
|
-
/**
|
|
9768
|
-
* Зона захвата = зазор плюс небольшой заход на содержимое с обеих сторон.
|
|
9769
|
-
*
|
|
9770
|
-
* Смещение уводит дальний край ручки за зазор ровно на `HANDLE_BLEED_PX`, поэтому вместе с
|
|
9771
|
-
* шириной она оказывается симметрично «надета» на границу: от `-bleed` до `gap + bleed`.
|
|
9772
|
-
*/
|
|
9773
|
-
const handleSize = `calc(var(--grid-gap, 0px) + ${HANDLE_BLEED_PX * 2}px)`;
|
|
9774
|
-
const handleOffset = `calc(-1 * (var(--grid-gap, 0px) + ${HANDLE_BLEED_PX}px))`;
|
|
9775
|
-
/**
|
|
9776
|
-
* Ручка перетаскивания границы треков.
|
|
9777
|
-
*
|
|
9778
|
-
* Абсолютная и целиком лежит в зазоре, поэтому включение режима редактирования не сдвигает
|
|
9779
|
-
* раскладку ни на пиксель. Сам ползунок (`::after`) появляется только при наведении и во время
|
|
9780
|
-
* перетаскивания — в покое сетка выглядит как обычно.
|
|
9781
|
-
*/
|
|
9782
|
-
const ResizeHandle = styled.div.withConfig({ displayName: "ResizeHandle", componentId: "sc-1dtcak4" }) `
|
|
9783
|
-
position: absolute;
|
|
9784
|
-
z-index: 3;
|
|
9785
|
-
touch-action: none;
|
|
9786
|
-
|
|
9787
|
-
::after {
|
|
9788
|
-
content: "";
|
|
9789
|
-
position: absolute;
|
|
9790
|
-
border-radius: 0.0625rem;
|
|
9791
|
-
background: transparent;
|
|
9792
|
-
transition: background-color 120ms ease;
|
|
9793
|
-
}
|
|
9794
|
-
|
|
9795
|
-
:hover::after,
|
|
9796
|
-
&[data-dragging="true"]::after {
|
|
9797
|
-
background: ${({ theme: { palette } }) => palette.primary};
|
|
9798
|
-
}
|
|
9799
|
-
|
|
9800
|
-
${({ $axis }) => $axis === "column"
|
|
9801
|
-
? css `
|
|
9802
|
-
top: 0;
|
|
9803
|
-
bottom: 0;
|
|
9804
|
-
right: ${handleOffset};
|
|
9805
|
-
width: ${handleSize};
|
|
9806
|
-
cursor: col-resize;
|
|
9807
|
-
|
|
9808
|
-
::after {
|
|
9809
|
-
top: 20%;
|
|
9810
|
-
bottom: 20%;
|
|
9811
|
-
left: 50%;
|
|
9812
|
-
width: 0.125rem;
|
|
9813
|
-
transform: translateX(-50%);
|
|
9814
|
-
}
|
|
9815
|
-
`
|
|
9816
|
-
: css `
|
|
9817
|
-
left: 0;
|
|
9818
|
-
right: 0;
|
|
9819
|
-
bottom: ${handleOffset};
|
|
9820
|
-
height: ${handleSize};
|
|
9821
|
-
cursor: row-resize;
|
|
9822
|
-
|
|
9823
|
-
::after {
|
|
9824
|
-
left: 20%;
|
|
9825
|
-
right: 20%;
|
|
9826
|
-
top: 50%;
|
|
9827
|
-
height: 0.125rem;
|
|
9828
|
-
transform: translateY(-50%);
|
|
9829
|
-
}
|
|
9830
|
-
`};
|
|
9831
|
-
`;
|
|
9832
|
-
|
|
9833
9906
|
const getTemplateProperty = (axis) => axis === "row" ? "gridTemplateRows" : "gridTemplateColumns";
|
|
9834
9907
|
/**
|
|
9835
9908
|
* Пиксельные размеры треков отрисованной сетки.
|
|
@@ -9917,29 +9990,24 @@ const toShares = (pixels, total) => {
|
|
|
9917
9990
|
* снова раздувалась содержимым.
|
|
9918
9991
|
*/
|
|
9919
9992
|
const useGridHeightResize = ({ sizes, autoHeight, getGrid, onCommit, }) => {
|
|
9920
|
-
const [handle, setHandle] = useState(null);
|
|
9921
|
-
const [dragging, setDragging] = useState(false);
|
|
9922
|
-
const dragRef = useRef(null);
|
|
9923
9993
|
const sizesRef = useRef(sizes);
|
|
9924
9994
|
sizesRef.current = sizes;
|
|
9925
9995
|
/** Свойство корня, которым жест двигает нижнюю границу: жёсткая высота либо её минимум. */
|
|
9926
9996
|
const heightProperty = autoHeight ? "minHeight" : "height";
|
|
9927
|
-
const
|
|
9997
|
+
const onStart = useCallback((event) => {
|
|
9928
9998
|
const grid = getGrid();
|
|
9929
9999
|
const root = grid?.parentElement;
|
|
9930
10000
|
if (!grid || !root)
|
|
9931
|
-
return;
|
|
10001
|
+
return null;
|
|
9932
10002
|
const pixels = readTrackPixels(grid, "row");
|
|
9933
10003
|
if (!pixels?.length || pixels.length !== sizesRef.current.length)
|
|
9934
|
-
return;
|
|
9935
|
-
|
|
9936
|
-
dragRef.current = {
|
|
10004
|
+
return null;
|
|
10005
|
+
return {
|
|
9937
10006
|
start: event.clientY,
|
|
9938
10007
|
pixels,
|
|
9939
10008
|
root,
|
|
9940
10009
|
rootHeight: root.getBoundingClientRect().height,
|
|
9941
10010
|
};
|
|
9942
|
-
setDragging(true);
|
|
9943
10011
|
}, [getGrid]);
|
|
9944
10012
|
/** Пиксели треков после сдвига: меняется только последний, минимум — текущий, если он уже мал. */
|
|
9945
10013
|
const getNextPixels = useCallback((state, event) => {
|
|
@@ -9947,22 +10015,16 @@ const useGridHeightResize = ({ sizes, autoHeight, getGrid, onCommit, }) => {
|
|
|
9947
10015
|
const min = Math.min(MIN_TRACK_PX, last);
|
|
9948
10016
|
return [...state.pixels.slice(0, -1), Math.max(last + event.clientY - state.start, min)];
|
|
9949
10017
|
}, []);
|
|
9950
|
-
const
|
|
9951
|
-
const state = dragRef.current;
|
|
10018
|
+
const onMove = useCallback((state, event) => {
|
|
9952
10019
|
const grid = getGrid();
|
|
9953
|
-
if (!
|
|
10020
|
+
if (!grid)
|
|
9954
10021
|
return;
|
|
9955
10022
|
const pixels = getNextPixels(state, event);
|
|
9956
10023
|
const delta = pixels[pixels.length - 1] - state.pixels[state.pixels.length - 1];
|
|
9957
10024
|
state.root.style[heightProperty] = `${state.rootHeight + delta}px`;
|
|
9958
10025
|
grid.style[getTemplateProperty("row")] = buildTrackTemplate(pixels.map(size => `${size}px`), autoHeight);
|
|
9959
10026
|
}, [autoHeight, getGrid, getNextPixels, heightProperty]);
|
|
9960
|
-
const
|
|
9961
|
-
const state = dragRef.current;
|
|
9962
|
-
if (!state)
|
|
9963
|
-
return;
|
|
9964
|
-
dragRef.current = null;
|
|
9965
|
-
setDragging(false);
|
|
10027
|
+
const onEnd = useCallback((state, event) => {
|
|
9966
10028
|
const grid = getGrid();
|
|
9967
10029
|
if (grid)
|
|
9968
10030
|
grid.style[getTemplateProperty("row")] = "";
|
|
@@ -9974,8 +10036,7 @@ const useGridHeightResize = ({ sizes, autoHeight, getGrid, onCommit, }) => {
|
|
|
9974
10036
|
const total = sizesRef.current.reduce((value, size) => value + size, 0);
|
|
9975
10037
|
onCommit(`${Math.round(state.rootHeight + delta)}px`, toShares(pixels, total));
|
|
9976
10038
|
}, [getGrid, getNextPixels, heightProperty, onCommit]);
|
|
9977
|
-
|
|
9978
|
-
return { setHandle, dragging };
|
|
10039
|
+
return useResizeDrag({ onStart, onMove, onEnd });
|
|
9979
10040
|
};
|
|
9980
10041
|
|
|
9981
10042
|
/**
|
|
@@ -9988,7 +10049,7 @@ const GridHeightResizer = memo(({ sizes, autoHeight, getGrid, onCommit }) => {
|
|
|
9988
10049
|
// Ручка лежит внутри трека: без остановки всплытия перетаскивание границы заканчивалось бы
|
|
9989
10050
|
// кликом по ячейке, то есть меняло бы выделение.
|
|
9990
10051
|
const stopPropagation = useCallback((event) => event.stopPropagation(), []);
|
|
9991
|
-
return (jsx(ResizeHandle, {
|
|
10052
|
+
return (jsx(ResizeHandle, { ref: setHandle, "$axis": "row", "data-dragging": dragging, onClick: stopPropagation }));
|
|
9992
10053
|
});
|
|
9993
10054
|
|
|
9994
10055
|
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
@@ -10009,31 +10070,26 @@ const buildPreviewTemplate = (pixels, index, first, second) => buildTrackTemplat
|
|
|
10009
10070
|
/**
|
|
10010
10071
|
* Перетаскивание границы между двумя соседними треками.
|
|
10011
10072
|
*
|
|
10012
|
-
*
|
|
10013
|
-
*
|
|
10014
|
-
* на отпускание мыши.
|
|
10073
|
+
* Сам жест — общий {@link useResizeDrag}: он же двигает и границы колонок таблицы, поэтому
|
|
10074
|
+
* ощущаются они одинаково. Здесь остаётся только грид-специфичное: во время жеста раскладка
|
|
10075
|
+
* меняется ИНЛАЙН-стилем на самом гриде, а в конфиг доли уходят один раз, на отпускание мыши.
|
|
10015
10076
|
*
|
|
10016
|
-
* Пиксельный снимок треков берётся однократно на
|
|
10077
|
+
* Пиксельный снимок треков берётся однократно на нажатии — если пересчитывать его на каждом
|
|
10017
10078
|
* шаге уже после применения новых долей, округление `fr → px → fr` даёт дрейф границы.
|
|
10018
10079
|
*/
|
|
10019
10080
|
const useGridResize = ({ axis, index, sizes, getGrid, onCommit }) => {
|
|
10020
|
-
const [handle, setHandle] = useState(null);
|
|
10021
|
-
const [dragging, setDragging] = useState(false);
|
|
10022
|
-
const dragRef = useRef(null);
|
|
10023
10081
|
const sizesRef = useRef(sizes);
|
|
10024
10082
|
sizesRef.current = sizes;
|
|
10025
10083
|
const isRow = axis === "row";
|
|
10026
10084
|
const getPosition = useCallback((event) => (isRow ? event.clientY : event.clientX), [isRow]);
|
|
10027
|
-
const
|
|
10085
|
+
const onStart = useCallback((event) => {
|
|
10028
10086
|
const grid = getGrid();
|
|
10029
10087
|
if (!grid)
|
|
10030
|
-
return;
|
|
10088
|
+
return null;
|
|
10031
10089
|
const pixels = readTrackPixels(grid, axis);
|
|
10032
10090
|
if (!pixels || index + 1 >= pixels.length)
|
|
10033
|
-
return;
|
|
10034
|
-
event
|
|
10035
|
-
dragRef.current = { start: getPosition(event), pixels };
|
|
10036
|
-
setDragging(true);
|
|
10091
|
+
return null;
|
|
10092
|
+
return { start: getPosition(event), pixels };
|
|
10037
10093
|
}, [axis, getGrid, getPosition, index]);
|
|
10038
10094
|
/** Новый пиксельный размер первого трека пары с учётом минимального размера обоих. */
|
|
10039
10095
|
const getNextFirstSize = useCallback((state, event) => {
|
|
@@ -10044,10 +10100,9 @@ const useGridResize = ({ axis, index, sizes, getGrid, onCommit }) => {
|
|
|
10044
10100
|
const min = getMinTrackSize(total);
|
|
10045
10101
|
return clamp(first + getPosition(event) - state.start, min, total - min);
|
|
10046
10102
|
}, [getPosition, index]);
|
|
10047
|
-
const
|
|
10048
|
-
const state = dragRef.current;
|
|
10103
|
+
const onMove = useCallback((state, event) => {
|
|
10049
10104
|
const grid = getGrid();
|
|
10050
|
-
if (!
|
|
10105
|
+
if (!grid)
|
|
10051
10106
|
return;
|
|
10052
10107
|
const first = getNextFirstSize(state, event);
|
|
10053
10108
|
if (first === null)
|
|
@@ -10055,12 +10110,7 @@ const useGridResize = ({ axis, index, sizes, getGrid, onCommit }) => {
|
|
|
10055
10110
|
const total = state.pixels[index] + state.pixels[index + 1];
|
|
10056
10111
|
grid.style[getTemplateProperty(axis)] = buildPreviewTemplate(state.pixels, index, first, total - first);
|
|
10057
10112
|
}, [axis, getGrid, getNextFirstSize, index]);
|
|
10058
|
-
const
|
|
10059
|
-
const state = dragRef.current;
|
|
10060
|
-
if (!state)
|
|
10061
|
-
return;
|
|
10062
|
-
dragRef.current = null;
|
|
10063
|
-
setDragging(false);
|
|
10113
|
+
const onEnd = useCallback((state, event) => {
|
|
10064
10114
|
const grid = getGrid();
|
|
10065
10115
|
if (grid)
|
|
10066
10116
|
grid.style[getTemplateProperty(axis)] = "";
|
|
@@ -10075,8 +10125,7 @@ const useGridResize = ({ axis, index, sizes, getGrid, onCommit }) => {
|
|
|
10075
10125
|
return;
|
|
10076
10126
|
onCommit(index, [nextFirst, roundFr(share - nextFirst)]);
|
|
10077
10127
|
}, [axis, getGrid, getNextFirstSize, index, onCommit]);
|
|
10078
|
-
|
|
10079
|
-
return { setHandle, dragging };
|
|
10128
|
+
return useResizeDrag({ onStart, onMove, onEnd });
|
|
10080
10129
|
};
|
|
10081
10130
|
|
|
10082
10131
|
const GridResizer = memo(({ axis, index, sizes, getGrid, onCommit }) => {
|
|
@@ -10084,7 +10133,7 @@ const GridResizer = memo(({ axis, index, sizes, getGrid, onCommit }) => {
|
|
|
10084
10133
|
// Ручка лежит внутри трека, и без этого перетаскивание границы заканчивалось бы кликом
|
|
10085
10134
|
// по ячейке — то есть меняло бы выделение.
|
|
10086
10135
|
const stopPropagation = useCallback((event) => event.stopPropagation(), []);
|
|
10087
|
-
return (jsx(ResizeHandle, {
|
|
10136
|
+
return (jsx(ResizeHandle, { ref: setHandle, "$axis": axis, "data-dragging": dragging, onClick: stopPropagation }));
|
|
10088
10137
|
});
|
|
10089
10138
|
|
|
10090
10139
|
/**
|
|
@@ -15504,8 +15553,9 @@ const TableHead = styled.thead.withConfig({ displayName: "TableHead", componentI
|
|
|
15504
15553
|
z-index: 1;
|
|
15505
15554
|
`;
|
|
15506
15555
|
const TableHeadCell = styled.th.withConfig({ displayName: "TableHeadCell", componentId: "sc-1m6xil2" }) `
|
|
15507
|
-
/* Относительное позиционирование держит захват границы
|
|
15556
|
+
/* Относительное позиционирование держит захват границы колонки. */
|
|
15508
15557
|
position: relative;
|
|
15558
|
+
box-sizing: border-box;
|
|
15509
15559
|
padding: 0.375rem 0.5rem;
|
|
15510
15560
|
text-align: left;
|
|
15511
15561
|
font-weight: 600;
|
|
@@ -15533,33 +15583,13 @@ const TableHeadContent = styled.span.withConfig({ displayName: "TableHeadContent
|
|
|
15533
15583
|
overflow: hidden;
|
|
15534
15584
|
text-overflow: ellipsis;
|
|
15535
15585
|
`;
|
|
15536
|
-
/**
|
|
15537
|
-
* Захват правой границы колонки. Лежит поверх края ячейки и ловит указатель сам, поэтому
|
|
15538
|
-
* перетаскивание не доходит до заголовка и не переключает сортировку.
|
|
15539
|
-
*
|
|
15540
|
-
* Ширина в пикселах, а не в rem: это зона попадания курсора, и от размера шрифта она не зависит.
|
|
15541
|
-
*/
|
|
15542
|
-
const TableResizeHandle = styled.span.withConfig({ displayName: "TableResizeHandle", componentId: "sc-1g0q105" }) `
|
|
15543
|
-
position: absolute;
|
|
15544
|
-
top: 0;
|
|
15545
|
-
right: 0;
|
|
15546
|
-
bottom: 0;
|
|
15547
|
-
width: 8px;
|
|
15548
|
-
cursor: col-resize;
|
|
15549
|
-
touch-action: none;
|
|
15550
|
-
user-select: none;
|
|
15551
|
-
|
|
15552
|
-
:hover {
|
|
15553
|
-
background: ${({ theme }) => theme.palette.elementDeep};
|
|
15554
|
-
}
|
|
15555
|
-
`;
|
|
15556
15586
|
/**
|
|
15557
15587
|
* Место под значок сортировки. Занято всегда, пока сортировка включена, а сам значок только
|
|
15558
15588
|
* прячется: появляясь и исчезая, он менял бы ширину колонки — и таблицу дёргало бы на каждый
|
|
15559
15589
|
* клик по заголовку, вместе с телом. Оба направления рисуются значком в 1rem, поэтому
|
|
15560
15590
|
* переключение asc/des ширину тоже не трогает.
|
|
15561
15591
|
*/
|
|
15562
|
-
const TableSortSlot = styled.span.withConfig({ displayName: "TableSortSlot", componentId: "sc-
|
|
15592
|
+
const TableSortSlot = styled.span.withConfig({ displayName: "TableSortSlot", componentId: "sc-z378vf" }) `
|
|
15563
15593
|
display: inline-flex;
|
|
15564
15594
|
visibility: ${({ $active }) => ($active ? "visible" : "hidden")};
|
|
15565
15595
|
`;
|
|
@@ -15568,26 +15598,30 @@ const TableSortSlot = styled.span.withConfig({ displayName: "TableSortSlot", com
|
|
|
15568
15598
|
* её нижнюю кромку и сквозь прозрачную шапку не проступают. Величину пишет {@link useHeadOverlap},
|
|
15569
15599
|
* без неё отсечка нулевая и разметка не меняется.
|
|
15570
15600
|
*/
|
|
15571
|
-
const TableBody = styled.tbody.withConfig({ displayName: "TableBody", componentId: "sc-
|
|
15601
|
+
const TableBody = styled.tbody.withConfig({ displayName: "TableBody", componentId: "sc-1pxpl5v" }) `
|
|
15572
15602
|
clip-path: inset(var(${HEAD_OVERLAP_VARIABLE}, 0px) 0 0 0);
|
|
15573
15603
|
`;
|
|
15574
15604
|
/**
|
|
15575
15605
|
* Строка. Разделитель рисуют её ячейки: собственная рамка строки при раздельных рамках не
|
|
15576
15606
|
* рисуется вовсе, а при схлопнутых её рисовала бы таблица — и отсечка тела её бы не резала.
|
|
15577
15607
|
*/
|
|
15578
|
-
const TableRow = styled.tr.withConfig({ displayName: "TableRow", componentId: "sc-
|
|
15608
|
+
const TableRow = styled.tr.withConfig({ displayName: "TableRow", componentId: "sc-j62zvd" }) `
|
|
15579
15609
|
td {
|
|
15580
15610
|
border-bottom: 1px solid ${({ theme }) => theme.palette.elementDeep};
|
|
15581
15611
|
}
|
|
15582
15612
|
`;
|
|
15583
|
-
const TableCellWrapper = styled.td.withConfig({ displayName: "TableCellWrapper", componentId: "sc-
|
|
15613
|
+
const TableCellWrapper = styled.td.withConfig({ displayName: "TableCellWrapper", componentId: "sc-ziu5rk" }) `
|
|
15614
|
+
/* Относительное позиционирование держит захват границы колонки. */
|
|
15615
|
+
position: relative;
|
|
15616
|
+
/* Как и у заголовка: ширина колонки считается по внешнему краю ячейки. */
|
|
15617
|
+
box-sizing: border-box;
|
|
15584
15618
|
padding: 0.125rem 0.25rem;
|
|
15585
15619
|
vertical-align: middle;
|
|
15586
15620
|
/* Предел снимает заданная ширина: с колонками по содержимому обрезать значение незачем. */
|
|
15587
15621
|
max-width: var(--table-cell-max-width, 20rem);
|
|
15588
15622
|
`;
|
|
15589
15623
|
/** Колонка действий: узкая, не растягивается содержимым. */
|
|
15590
|
-
const TableActionsCell = styled(TableCellWrapper).withConfig({ displayName: "TableActionsCell", componentId: "sc-
|
|
15624
|
+
const TableActionsCell = styled(TableCellWrapper).withConfig({ displayName: "TableActionsCell", componentId: "sc-18w13t3" }) `
|
|
15591
15625
|
width: 2rem;
|
|
15592
15626
|
text-align: right;
|
|
15593
15627
|
`;
|
|
@@ -15610,7 +15644,7 @@ const cellWrapMixin = css `
|
|
|
15610
15644
|
white-space: nowrap;
|
|
15611
15645
|
`}
|
|
15612
15646
|
`;
|
|
15613
|
-
const CellText = styled.div.withConfig({ displayName: "CellText", componentId: "sc-
|
|
15647
|
+
const CellText = styled.div.withConfig({ displayName: "CellText", componentId: "sc-ok630s" }) `
|
|
15614
15648
|
padding: 0.375rem 0.25rem;
|
|
15615
15649
|
/* Та же высота строки, что у редактора — иначе строка подпрыгивала бы по вертикали. */
|
|
15616
15650
|
line-height: 1.25rem;
|
|
@@ -15624,7 +15658,7 @@ const CellText = styled.div.withConfig({ displayName: "CellText", componentId: "
|
|
|
15624
15658
|
* Кнопка, а не просто текст, именно ради фокуса: она — таб-стоп ячейки, и Tab по таблице
|
|
15625
15659
|
* открывает редактор с курсором внутри.
|
|
15626
15660
|
*/
|
|
15627
|
-
const CellButton = styled.button.withConfig({ displayName: "CellButton", componentId: "sc-
|
|
15661
|
+
const CellButton = styled.button.withConfig({ displayName: "CellButton", componentId: "sc-98k9cz" }) `
|
|
15628
15662
|
width: 100%;
|
|
15629
15663
|
padding: 0.375rem 0.25rem;
|
|
15630
15664
|
line-height: 1.25rem;
|
|
@@ -15642,7 +15676,7 @@ const CellButton = styled.button.withConfig({ displayName: "CellButton", compone
|
|
|
15642
15676
|
border-color: ${({ theme }) => theme.palette.elementDeep};
|
|
15643
15677
|
}
|
|
15644
15678
|
`;
|
|
15645
|
-
const CellPlaceholder = styled.span.withConfig({ displayName: "CellPlaceholder", componentId: "sc-
|
|
15679
|
+
const CellPlaceholder = styled.span.withConfig({ displayName: "CellPlaceholder", componentId: "sc-7tff41" }) `
|
|
15646
15680
|
color: ${({ theme }) => theme.palette.textSecondary};
|
|
15647
15681
|
`;
|
|
15648
15682
|
/**
|
|
@@ -15651,11 +15685,11 @@ const CellPlaceholder = styled.span.withConfig({ displayName: "CellPlaceholder",
|
|
|
15651
15685
|
* Копия остаётся в потоке и держит ширину колонки ровно такой, какой она была до клика, —
|
|
15652
15686
|
* иначе таблица дёргалась бы на каждый вход в правку и выход из неё.
|
|
15653
15687
|
*/
|
|
15654
|
-
const CellEditor = styled.div.withConfig({ displayName: "CellEditor", componentId: "sc-
|
|
15688
|
+
const CellEditor = styled.div.withConfig({ displayName: "CellEditor", componentId: "sc-qa22du" }) `
|
|
15655
15689
|
position: relative;
|
|
15656
15690
|
min-height: 2rem;
|
|
15657
15691
|
`;
|
|
15658
|
-
const CellGhost = styled.span.withConfig({ displayName: "CellGhost", componentId: "sc-
|
|
15692
|
+
const CellGhost = styled.span.withConfig({ displayName: "CellGhost", componentId: "sc-1i1yvb2" }) `
|
|
15659
15693
|
display: block;
|
|
15660
15694
|
padding: 0.375rem 0.25rem;
|
|
15661
15695
|
/* Рамка повторяет CellButton — с ней высота ячейки в правке совпадает с высотой на чтении. */
|
|
@@ -15665,7 +15699,7 @@ const CellGhost = styled.span.withConfig({ displayName: "CellGhost", componentId
|
|
|
15665
15699
|
|
|
15666
15700
|
${cellWrapMixin};
|
|
15667
15701
|
`;
|
|
15668
|
-
const CellField = styled.div.withConfig({ displayName: "CellField", componentId: "sc-
|
|
15702
|
+
const CellField = styled.div.withConfig({ displayName: "CellField", componentId: "sc-1ww3875" }) `
|
|
15669
15703
|
position: absolute;
|
|
15670
15704
|
inset: 0;
|
|
15671
15705
|
display: flex;
|
|
@@ -15687,14 +15721,14 @@ const CellField = styled.div.withConfig({ displayName: "CellField", componentId:
|
|
|
15687
15721
|
* Отступы те же, что у текстовой ячейки (`CellText`): в одном ряду с обычными колонками значения
|
|
15688
15722
|
* обязаны стоять на одной линии.
|
|
15689
15723
|
*/
|
|
15690
|
-
const AttachmentsCellBox = styled.div.withConfig({ displayName: "AttachmentsCellBox", componentId: "sc-
|
|
15724
|
+
const AttachmentsCellBox = styled.div.withConfig({ displayName: "AttachmentsCellBox", componentId: "sc-1ayq7sq" }) `
|
|
15691
15725
|
display: flex;
|
|
15692
15726
|
flex-direction: column;
|
|
15693
15727
|
align-items: flex-start;
|
|
15694
15728
|
gap: 0.25rem;
|
|
15695
15729
|
padding: 0.375rem 0.25rem;
|
|
15696
15730
|
`;
|
|
15697
|
-
const TableEmpty = styled.div.withConfig({ displayName: "TableEmpty", componentId: "sc-
|
|
15731
|
+
const TableEmpty = styled.div.withConfig({ displayName: "TableEmpty", componentId: "sc-dmdhrv" }) `
|
|
15698
15732
|
padding: 0.75rem 0.25rem;
|
|
15699
15733
|
color: ${({ theme }) => theme.palette.textSecondary};
|
|
15700
15734
|
`;
|
|
@@ -15917,15 +15951,91 @@ const TableCell = memo(({ attribute, row, canEdit, onChange }) => {
|
|
|
15917
15951
|
});
|
|
15918
15952
|
|
|
15919
15953
|
/**
|
|
15920
|
-
*
|
|
15954
|
+
* Имя переменной ширины колонки.
|
|
15955
|
+
*
|
|
15956
|
+
* Через неё идёт и предпросмотр перетаскивания, и итоговая ширина: пока переменная не задана,
|
|
15957
|
+
* работает запасное значение из стиля ячейки, а жест на время перетаскивания объявляет её на
|
|
15958
|
+
* самой таблице — одним свойством на один узел, как сетка меняет свой шаблон треков.
|
|
15959
|
+
*/
|
|
15960
|
+
const getColumnWidthVariable = (index) => `--table-col-${index}`;
|
|
15961
|
+
/**
|
|
15962
|
+
* Инлайн-размер ячейки колонки с заданной или изменяемой шириной.
|
|
15921
15963
|
*
|
|
15922
15964
|
* Раскладка таблицы автоматическая (ширину колонок выбирает содержимое), и одной `width` ей мало —
|
|
15923
15965
|
* она для неё лишь пожелание. Жёстко колонку держат все три предела сразу, поэтому и ставим их
|
|
15924
15966
|
* втроём, на каждую ячейку колонки.
|
|
15925
15967
|
*
|
|
15926
|
-
*
|
|
15968
|
+
* Ни ширины, ни разрешения тянуть — стиля нет: колонка остаётся на попечении раскладки, как и была.
|
|
15927
15969
|
*/
|
|
15928
|
-
const getColumnStyle = (
|
|
15970
|
+
const getColumnStyle = (index, width, resizable) => {
|
|
15971
|
+
if (width == null && !resizable) {
|
|
15972
|
+
return undefined;
|
|
15973
|
+
}
|
|
15974
|
+
const variable = getColumnWidthVariable(index);
|
|
15975
|
+
const fixed = width == null ? null : `${width}px`;
|
|
15976
|
+
return {
|
|
15977
|
+
width: `var(${variable}, ${fixed ?? "auto"})`,
|
|
15978
|
+
minWidth: `var(${variable}, ${fixed ?? "0"})`,
|
|
15979
|
+
// Без заданной ширины предел остаётся общим для всех ячеек — тем, что задан стилем таблицы.
|
|
15980
|
+
maxWidth: `var(${variable}, ${fixed ?? "var(--table-cell-max-width, 20rem)"})`,
|
|
15981
|
+
};
|
|
15982
|
+
};
|
|
15983
|
+
|
|
15984
|
+
/**
|
|
15985
|
+
* Перетаскивание правой границы колонки.
|
|
15986
|
+
*
|
|
15987
|
+
* Жест — общий {@link useResizeDrag}, тот же, что двигает границы ячеек сетки дашборда. Здесь
|
|
15988
|
+
* остаётся только табличное: во время жеста ширина рисуется переменной на самой таблице, а в
|
|
15989
|
+
* состояние уходит один раз, на отпускание мыши. Так шаг жеста меняет одно свойство одного узла,
|
|
15990
|
+
* а не перерисовывает таблицу целиком.
|
|
15991
|
+
*
|
|
15992
|
+
* Стартовая ширина берётся с той ячейки, за границу которой потянули: у колонки без `width` её
|
|
15993
|
+
* выбрала раскладка таблицы, и тянуть надо от того, что видно.
|
|
15994
|
+
*/
|
|
15995
|
+
const useColumnResize = ({ index, onCommit }) => {
|
|
15996
|
+
const variable = getColumnWidthVariable(index);
|
|
15997
|
+
const onStart = useCallback((event) => {
|
|
15998
|
+
// Обработчик нажатия висит на самой ручке, поэтому её ячейка и таблица достаются отсюда —
|
|
15999
|
+
// отдельный ref на них не нужен. Ячейка любая: ручки стоят и в шапке, и в каждой строке.
|
|
16000
|
+
const cell = event.currentTarget?.closest("th, td");
|
|
16001
|
+
if (!cell) {
|
|
16002
|
+
return null;
|
|
16003
|
+
}
|
|
16004
|
+
return {
|
|
16005
|
+
start: event.clientX,
|
|
16006
|
+
width: cell.getBoundingClientRect().width,
|
|
16007
|
+
table: cell.closest("table"),
|
|
16008
|
+
};
|
|
16009
|
+
}, []);
|
|
16010
|
+
const getNextWidth = useCallback((state, event) => Math.max(MIN_COLUMN_WIDTH, Math.round(state.width + event.clientX - state.start)), []);
|
|
16011
|
+
const onMove = useCallback((state, event) => state.table?.style.setProperty(variable, `${getNextWidth(state, event)}px`), [getNextWidth, variable]);
|
|
16012
|
+
const onEnd = useCallback((state, event) => {
|
|
16013
|
+
state.table?.style.removeProperty(variable);
|
|
16014
|
+
const next = getNextWidth(state, event);
|
|
16015
|
+
// Клик по границе без перетаскивания ширину менять не должен.
|
|
16016
|
+
if (next === Math.round(state.width)) {
|
|
16017
|
+
return;
|
|
16018
|
+
}
|
|
16019
|
+
onCommit(next);
|
|
16020
|
+
}, [getNextWidth, onCommit, variable]);
|
|
16021
|
+
return useResizeDrag({ onStart, onMove, onEnd });
|
|
16022
|
+
};
|
|
16023
|
+
|
|
16024
|
+
/**
|
|
16025
|
+
* Ручка ширины колонки на правой границе ячейки.
|
|
16026
|
+
*
|
|
16027
|
+
* Тот же компонент и тот же жест, что двигают границы ячеек сетки дашборда: пользователю это одно
|
|
16028
|
+
* и то же действие, и выглядеть оно обязано одинаково. Поэтому и стоит она у КАЖДОЙ ячейки
|
|
16029
|
+
* колонки, как в сетке, — тянуть границу можно на любой строке, а не только в шапке.
|
|
16030
|
+
*/
|
|
16031
|
+
const TableColumnResizer = memo(({ index, attributeName, onResize }) => {
|
|
16032
|
+
const onCommit = useCallback((width) => onResize(attributeName, width), [attributeName, onResize]);
|
|
16033
|
+
const { setHandle, dragging } = useColumnResize({ index, onCommit });
|
|
16034
|
+
// Ручка лежит внутри ячейки, и без остановки всплытия перетаскивание границы заканчивалось бы
|
|
16035
|
+
// кликом по ней — то есть переключало бы сортировку в шапке и открывало бы правку в теле.
|
|
16036
|
+
const stopPropagation = useCallback((event) => event.stopPropagation(), []);
|
|
16037
|
+
return jsx(ResizeHandle, { ref: setHandle, "$axis": "column", "data-dragging": dragging, onClick: stopPropagation });
|
|
16038
|
+
});
|
|
15929
16039
|
|
|
15930
16040
|
/**
|
|
15931
16041
|
* Шапка таблицы: заголовки колонок, сортировка кликом и захват границы для ручной ширины.
|
|
@@ -15933,9 +16043,9 @@ const getColumnStyle = (width) => width == null ? undefined : { width, minWidth:
|
|
|
15933
16043
|
* Захват рисуется по разрешению атрибута (`resizable`) и не смотрит на режим правки контейнера:
|
|
15934
16044
|
* ширина колонки — это вид, а не данные.
|
|
15935
16045
|
*/
|
|
15936
|
-
const TableHeadRow = ({ columns, sort, sortEnabled, columnWidths, withActionsColumn, onSortToggle,
|
|
16046
|
+
const TableHeadRow = ({ columns, sort, sortEnabled, columnWidths, withActionsColumn, onSortToggle, onColumnResize, }) => (jsxs("tr", { children: [columns.map(({ attributeName, alias, description, resizable }, index) => {
|
|
15937
16047
|
const sorted = sort?.attributeName === attributeName;
|
|
15938
|
-
return (jsxs(TableHeadCell, { title: description || alias, style: getColumnStyle(columnWidths[attributeName]), "$sortable": sortEnabled, onClick: sortEnabled ? () => onSortToggle(attributeName) : undefined, children: [jsxs(TableHeadContent, { children: [alias, sortEnabled && (jsx(TableSortSlot, { "$active": sorted, children: jsx(Icon, { kind: sorted && sort?.direction === "desc" ? "sorting_des" : "sorting_asc" }) }))] }), resizable &&
|
|
16048
|
+
return (jsxs(TableHeadCell, { title: description || alias, style: getColumnStyle(index, columnWidths[attributeName], resizable), "$sortable": sortEnabled, onClick: sortEnabled ? () => onSortToggle(attributeName) : undefined, children: [jsxs(TableHeadContent, { children: [alias, sortEnabled && (jsx(TableSortSlot, { "$active": sorted, children: jsx(Icon, { kind: sorted && sort?.direction === "desc" ? "sorting_des" : "sorting_asc" }) }))] }), resizable && jsx(TableColumnResizer, { index: index, attributeName: attributeName, onResize: onColumnResize })] }, attributeName));
|
|
15939
16049
|
}), withActionsColumn && jsx(TableHeadCell, {})] }));
|
|
15940
16050
|
|
|
15941
16051
|
const ContainerLoading = () => (jsx(Flex, { alignContent: "center", justifyContent: "center", width: "100%", children: jsx(CircularProgress, { diameter: 1.5, mono: true }) }));
|
|
@@ -16041,53 +16151,6 @@ const getTableBoxStyle = (width, height) => {
|
|
|
16041
16151
|
};
|
|
16042
16152
|
};
|
|
16043
16153
|
|
|
16044
|
-
/**
|
|
16045
|
-
* Ручное изменение ширины колонок.
|
|
16046
|
-
*
|
|
16047
|
-
* Растянутые ширины живут только здесь: тянут их в рантайме, а `width` атрибута в конфиге задаёт
|
|
16048
|
-
* лишь стартовое значение — записывать растянутое обратно в конфиг незачем.
|
|
16049
|
-
*
|
|
16050
|
-
* Разрешение (`resizable`) от `options.editMode` не зависит: ширина колонки — это вид таблицы,
|
|
16051
|
-
* а не правка данных, и тянуть её должно быть можно и на таблице только для чтения.
|
|
16052
|
-
*
|
|
16053
|
-
* Стартовую ширину берём с самой ячейки, а не из конфига: у колонки без `width` её выбрала
|
|
16054
|
-
* раскладка таблицы, и тянуть надо ровно от того, что видно.
|
|
16055
|
-
*/
|
|
16056
|
-
const useColumnResize = (columns) => {
|
|
16057
|
-
const [widths, setWidths] = useState({});
|
|
16058
|
-
const dragRef = useRef(null);
|
|
16059
|
-
const onResizeStart = useCallback((attributeName, event) => {
|
|
16060
|
-
const handle = event.currentTarget;
|
|
16061
|
-
// Захват границы — не клик по заголовку: иначе каждое перетаскивание переключало бы сортировку.
|
|
16062
|
-
event.preventDefault();
|
|
16063
|
-
event.stopPropagation();
|
|
16064
|
-
dragRef.current = {
|
|
16065
|
-
attributeName,
|
|
16066
|
-
startX: event.clientX,
|
|
16067
|
-
startWidth: handle.closest("th")?.getBoundingClientRect().width ?? MIN_COLUMN_WIDTH,
|
|
16068
|
-
};
|
|
16069
|
-
handle.setPointerCapture(event.pointerId);
|
|
16070
|
-
}, []);
|
|
16071
|
-
const onResizeMove = useCallback((event) => {
|
|
16072
|
-
const drag = dragRef.current;
|
|
16073
|
-
if (!drag) {
|
|
16074
|
-
return;
|
|
16075
|
-
}
|
|
16076
|
-
const next = Math.max(MIN_COLUMN_WIDTH, Math.round(drag.startWidth + event.clientX - drag.startX));
|
|
16077
|
-
setWidths(current => current[drag.attributeName] === next ? current : { ...current, [drag.attributeName]: next });
|
|
16078
|
-
}, []);
|
|
16079
|
-
const onResizeEnd = useCallback((event) => {
|
|
16080
|
-
const handle = event.currentTarget;
|
|
16081
|
-
dragRef.current = null;
|
|
16082
|
-
if (handle.hasPointerCapture(event.pointerId)) {
|
|
16083
|
-
handle.releasePointerCapture(event.pointerId);
|
|
16084
|
-
}
|
|
16085
|
-
}, []);
|
|
16086
|
-
// Растянутая ширина перебивает конфигурационную: последнее слово за тем, кто тянул.
|
|
16087
|
-
const columnWidths = useMemo(() => columns.reduce((acc, { attributeName, width }) => ({ ...acc, [attributeName]: widths[attributeName] ?? width }), {}), [columns, widths]);
|
|
16088
|
-
return { columnWidths, onResizeStart, onResizeMove, onResizeEnd };
|
|
16089
|
-
};
|
|
16090
|
-
|
|
16091
16154
|
/**
|
|
16092
16155
|
* Вид таблицы: колонки плюс локальная сортировка.
|
|
16093
16156
|
*
|
|
@@ -16101,19 +16164,23 @@ const useColumnResize = (columns) => {
|
|
|
16101
16164
|
* `width`/`height` — размер собственного бокса таблицы: он ограничивает её саму и прокручивает
|
|
16102
16165
|
* то, что не влезло. Место, отведённое контейнеру, задаётся его же опциями и живёт отдельно.
|
|
16103
16166
|
*
|
|
16104
|
-
* Ширины колонок — тоже вид: конфиг задаёт стартовую, растянутая мышью живёт в
|
|
16105
|
-
*
|
|
16167
|
+
* Ширины колонок — тоже вид: конфиг задаёт стартовую, растянутая мышью живёт здесь и в конфиг
|
|
16168
|
+
* не возвращается.
|
|
16106
16169
|
*/
|
|
16107
16170
|
const useTableView = (elementConfig) => {
|
|
16108
16171
|
const context = useContext(StructuredDataContext);
|
|
16109
16172
|
const { sort: sortEnabled, width, height } = elementConfig?.options || {};
|
|
16110
16173
|
const [sort, setSort] = useState(null);
|
|
16174
|
+
const [widths, setWidths] = useState({});
|
|
16111
16175
|
const schema = context?.schema;
|
|
16112
16176
|
const rows = context?.rows;
|
|
16113
16177
|
const columns = useMemo(() => schema ?? [], [schema]);
|
|
16114
16178
|
const sortedRows = useMemo(() => sortRows(rows ?? [], sort, schema ?? []), [rows, schema, sort]);
|
|
16115
16179
|
const sizeCss = useMemo(() => getTableBoxStyle(width, height), [height, width]);
|
|
16116
|
-
|
|
16180
|
+
// Растянутая мышью ширина живёт только в рантайме и перебивает конфигурационную: последнее
|
|
16181
|
+
// слово за тем, кто тянул. Обратно в конфиг она не пишется.
|
|
16182
|
+
const columnWidths = useMemo(() => columns.reduce((acc, attribute) => ({ ...acc, [attribute.attributeName]: widths[attribute.attributeName] ?? attribute.width }), {}), [columns, widths]);
|
|
16183
|
+
const onColumnResize = useCallback((attributeName, nextWidth) => setWidths(current => ({ ...current, [attributeName]: nextWidth })), []);
|
|
16117
16184
|
const onSortToggle = useCallback((attributeName) => setSort(current => getNextSort(current, attributeName)), []);
|
|
16118
16185
|
return {
|
|
16119
16186
|
context,
|
|
@@ -16126,9 +16193,7 @@ const useTableView = (elementConfig) => {
|
|
|
16126
16193
|
contentWidth: width != null,
|
|
16127
16194
|
columnWidths,
|
|
16128
16195
|
onSortToggle,
|
|
16129
|
-
|
|
16130
|
-
onResizeMove,
|
|
16131
|
-
onResizeEnd,
|
|
16196
|
+
onColumnResize,
|
|
16132
16197
|
};
|
|
16133
16198
|
};
|
|
16134
16199
|
|
|
@@ -16140,7 +16205,7 @@ const useTableView = (elementConfig) => {
|
|
|
16140
16205
|
*/
|
|
16141
16206
|
const ElementTable = memo(({ elementConfig }) => {
|
|
16142
16207
|
const { t } = useGlobalContext();
|
|
16143
|
-
const { context, columns, rows, sort, sortEnabled, sizeCss, contentWidth, columnWidths, onSortToggle,
|
|
16208
|
+
const { context, columns, rows, sort, sortEnabled, sizeCss, contentWidth, columnWidths, onSortToggle, onColumnResize, } = useTableView(elementConfig);
|
|
16144
16209
|
// Узел таблицы держим состоянием, а не ref: отсечка должна встать сразу, как он появится.
|
|
16145
16210
|
const [table, setTable] = useState(null);
|
|
16146
16211
|
useHeadOverlap(table);
|
|
@@ -16156,10 +16221,13 @@ const ElementTable = memo(({ elementConfig }) => {
|
|
|
16156
16221
|
defaultValue: "Схема данных не задана",
|
|
16157
16222
|
}) }));
|
|
16158
16223
|
}
|
|
16159
|
-
return (jsx(TableBox, { "$sizeCss": sizeCss, children: jsxs(TableWrapper, { ref: setTable, "$contentWidth": contentWidth, children: [jsx(TableHead, { children: jsx(TableHeadRow, { columns: columns, sort: sort, sortEnabled: sortEnabled, columnWidths: columnWidths, withActionsColumn: context.canDelete, onSortToggle: onSortToggle,
|
|
16224
|
+
return (jsx(TableBox, { "$sizeCss": sizeCss, children: jsxs(TableWrapper, { ref: setTable, "$contentWidth": contentWidth, children: [jsx(TableHead, { children: jsx(TableHeadRow, { columns: columns, sort: sort, sortEnabled: sortEnabled, columnWidths: columnWidths, withActionsColumn: context.canDelete, onSortToggle: onSortToggle, onColumnResize: onColumnResize }) }), jsx(TableBody, { children: rows.map(row => (jsxs(TableRow, { children: [columns.map((attribute, columnIndex) => (jsxs(TableCellWrapper, {
|
|
16160
16225
|
// Стиль колонки из конфига идёт последним: шрифт задан для значений, и ширину
|
|
16161
16226
|
// он не трогает — своих размеров у него нет.
|
|
16162
|
-
style: {
|
|
16227
|
+
style: {
|
|
16228
|
+
...getColumnStyle(columnIndex, columnWidths[attribute.attributeName], attribute.resizable),
|
|
16229
|
+
...attribute.style,
|
|
16230
|
+
}, children: [jsx(TableCell, { attribute: attribute, row: row, canEdit: context.canEdit, onChange: context.onCellChange }), attribute.resizable && (jsx(TableColumnResizer, { index: columnIndex, attributeName: attribute.attributeName, onResize: onColumnResize }))] }, attribute.attributeName))), context.canDelete && (jsx(TableActionsCell, { children: jsx(IconButton, { kind: "delete", title: t("actions.delete", { ns: "common", defaultValue: "Удалить" }), onClick: () => context.onRowDelete(row.key) }) }))] }, row.key))) })] }) }));
|
|
16163
16231
|
});
|
|
16164
16232
|
|
|
16165
16233
|
const TooltipIcon = styled(Icon).withConfig({ displayName: "TooltipIcon", componentId: "sc-1lkxudm" }) `
|
|
@@ -19477,5 +19545,5 @@ const DEFAULT_HEATMAP_STYLE = {
|
|
|
19477
19545
|
],
|
|
19478
19546
|
};
|
|
19479
19547
|
|
|
19480
|
-
export { ALIGNMENTS, ALIGN_ITEMS, ATTRIBUTE_ICON_ELEMENT_TYPES, AddButtonRow, AddFeatureButton, AddFeatureContainer, AlertIconContainer, AttachmentContainer, AttributeGalleryContainer, AttributeLabel, BASE_CONTAINER_STYLE, BG_IMAGE_SLOT_ID, BaseMapTheme, CHART_TYPES, COMPACT_FRACTION_DIGITS, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CONTAINERS_GROUP_DEFAULTS, CONTAINER_BODY_ATTRIBUTE, CONTAINER_BODY_FILL_STYLE, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, Container, ContainerBackground, ContainerChildren, ContainerLoading, ContainerRoot, ContainerTemplate, ContainerWrapper, ContainersGroupContainer, DASHBOARD_OVERLAY_Z_INDEX, DEFAULT_ATTRIBUTE_NAME, DEFAULT_BARCHART_RADIUS, DEFAULT_BASE_MAP, DEFAULT_BLUR, DEFAULT_CHART_ANGLE, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_CIRCLE_RADIUS, DEFAULT_CIRCLE_STROKE_WIDTH, DEFAULT_CIRCLE_STYLE, DEFAULT_COLOR, DEFAULT_DASHBOARD_CONFIG, DEFAULT_DATA_SOURCE_LIMIT, DEFAULT_DROPDOWN_WIDTH, DEFAULT_FILL_EXTRUSION_BASE, DEFAULT_FILL_EXTRUSION_HEIGHT, DEFAULT_FILL_EXTRUSION_STYLE, DEFAULT_FILL_EXTRUSION_VERTICAL_GRADIENT, DEFAULT_FILL_STYLE, DEFAULT_FILTER_PADDING, DEFAULT_GRID_GAP, DEFAULT_HEATMAP_COLOR, DEFAULT_HEATMAP_INTENSITY, DEFAULT_HEATMAP_RADIUS, DEFAULT_HEATMAP_STYLE, DEFAULT_HEATMAP_WEIGHT, DEFAULT_ICON_ANCHOR, DEFAULT_ICON_OVERLAP, DEFAULT_ICON_PADDING, DEFAULT_ICON_ROTATE, DEFAULT_ICON_SIZE, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LAT, DEFAULT_LINE_CAP, DEFAULT_LINE_JOIN, DEFAULT_LINE_STYLE, DEFAULT_LINE_WIDTH, DEFAULT_LNG, DEFAULT_OPACITY, DEFAULT_PAGES_CONFIG, DEFAULT_PIECHART_RADIUS, DEFAULT_SYMBOL_COLOR, DEFAULT_SYMBOL_HALO_COLOR, DEFAULT_SYMBOL_PLACEMENT, DEFAULT_SYMBOL_SPACING, DEFAULT_SYMBOL_STYLE, DEFAULT_TEXT_ANCHOR, DEFAULT_TEXT_JUSTIFY, DEFAULT_TEXT_SIZE, DEFAULT_TEXT_TRANSFORM, DEFAULT_TRACK_FR, DEFAULT_TRANSLATE, DEFAULT_ZOOM, DRAG_THRESHOLD_PX, Dashboard, DashboardCheckbox, DashboardChip, DashboardContent, DashboardContext, DashboardDefaultHeader, DashboardHeader, DashboardLoading, DashboardPlaceholder, DashboardPlaceholderWrap, DashboardProvider, DashboardWrapper, DataSourceContainer, DataSourceError, DataSourceErrorContainer, DataSourceInnerContainer, DataSourceProgressContainer, DateFormat, DefaultAttributesContainer, DefaultHeaderContainer, DefaultHeaderWrapper, DividerContainer, EMPTY_DATA_SOURCE_LAYER_INFO, EXTENT_FILTER_NAME, EditGeometryType, ElementButton, ElementCamera, ElementChart, ElementChips, ElementControl, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementMarkdown, ElementSlideshow, ElementSvg, ElementTable, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILL_SIZE, FILTERED_VALUE_OPACITY, FILTER_PREFIX, FR_PRECISION, FeatureCardBackgroundHeader, FeatureCardButtons, FeatureCardContext, FeatureCardDefaultHeader, FeatureCardHeader, FeatureCardProvider, FeatureCardSlideshowHeader, FeatureCardTitle, FeatureControls, FeatureTitleContainer, FiltersContainer, GEOMETRY_ATTRIBUTE, GEOMETRY_FILTER_NAME, GRID_AUTO_FILL_DEFAULTS, GRID_CELL_ATTR, GRID_CELL_ID_PREFIX, GRID_DRAGGING_ATTR, GRID_DRAG_SOURCE_ATTR, GRID_DROP_TARGET_ATTR, GRID_FILL_DEFAULTS,
|
|
19548
|
+
export { ALIGNMENTS, ALIGN_ITEMS, ATTRIBUTE_ICON_ELEMENT_TYPES, AddButtonRow, AddFeatureButton, AddFeatureContainer, AlertIconContainer, AttachmentContainer, AttributeGalleryContainer, AttributeLabel, BASE_CONTAINER_STYLE, BG_IMAGE_SLOT_ID, BaseMapTheme, CHART_TYPES, COMPACT_FRACTION_DIGITS, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CONTAINERS_GROUP_DEFAULTS, CONTAINER_BODY_ATTRIBUTE, CONTAINER_BODY_FILL_STYLE, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, Container, ContainerBackground, ContainerChildren, ContainerLoading, ContainerRoot, ContainerTemplate, ContainerWrapper, ContainersGroupContainer, DASHBOARD_OVERLAY_Z_INDEX, DEFAULT_ATTRIBUTE_NAME, DEFAULT_BARCHART_RADIUS, DEFAULT_BASE_MAP, DEFAULT_BLUR, DEFAULT_CHART_ANGLE, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_CIRCLE_RADIUS, DEFAULT_CIRCLE_STROKE_WIDTH, DEFAULT_CIRCLE_STYLE, DEFAULT_COLOR, DEFAULT_DASHBOARD_CONFIG, DEFAULT_DATA_SOURCE_LIMIT, DEFAULT_DROPDOWN_WIDTH, DEFAULT_FILL_EXTRUSION_BASE, DEFAULT_FILL_EXTRUSION_HEIGHT, DEFAULT_FILL_EXTRUSION_STYLE, DEFAULT_FILL_EXTRUSION_VERTICAL_GRADIENT, DEFAULT_FILL_STYLE, DEFAULT_FILTER_PADDING, DEFAULT_GRID_GAP, DEFAULT_HEATMAP_COLOR, DEFAULT_HEATMAP_INTENSITY, DEFAULT_HEATMAP_RADIUS, DEFAULT_HEATMAP_STYLE, DEFAULT_HEATMAP_WEIGHT, DEFAULT_ICON_ANCHOR, DEFAULT_ICON_OVERLAP, DEFAULT_ICON_PADDING, DEFAULT_ICON_ROTATE, DEFAULT_ICON_SIZE, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LAT, DEFAULT_LINE_CAP, DEFAULT_LINE_JOIN, DEFAULT_LINE_STYLE, DEFAULT_LINE_WIDTH, DEFAULT_LNG, DEFAULT_OPACITY, DEFAULT_PAGES_CONFIG, DEFAULT_PIECHART_RADIUS, DEFAULT_SYMBOL_COLOR, DEFAULT_SYMBOL_HALO_COLOR, DEFAULT_SYMBOL_PLACEMENT, DEFAULT_SYMBOL_SPACING, DEFAULT_SYMBOL_STYLE, DEFAULT_TEXT_ANCHOR, DEFAULT_TEXT_JUSTIFY, DEFAULT_TEXT_SIZE, DEFAULT_TEXT_TRANSFORM, DEFAULT_TRACK_FR, DEFAULT_TRANSLATE, DEFAULT_ZOOM, DRAG_THRESHOLD_PX, Dashboard, DashboardCheckbox, DashboardChip, DashboardContent, DashboardContext, DashboardDefaultHeader, DashboardHeader, DashboardLoading, DashboardPlaceholder, DashboardPlaceholderWrap, DashboardProvider, DashboardWrapper, DataSourceContainer, DataSourceError, DataSourceErrorContainer, DataSourceInnerContainer, DataSourceProgressContainer, DateFormat, DefaultAttributesContainer, DefaultHeaderContainer, DefaultHeaderWrapper, DividerContainer, EMPTY_DATA_SOURCE_LAYER_INFO, EXTENT_FILTER_NAME, EditGeometryType, ElementButton, ElementCamera, ElementChart, ElementChips, ElementControl, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementMarkdown, ElementSlideshow, ElementSvg, ElementTable, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILL_SIZE, FILTERED_VALUE_OPACITY, FILTER_PREFIX, FR_PRECISION, FeatureCardBackgroundHeader, FeatureCardButtons, FeatureCardContext, FeatureCardDefaultHeader, FeatureCardHeader, FeatureCardProvider, FeatureCardSlideshowHeader, FeatureCardTitle, FeatureControls, FeatureTitleContainer, FiltersContainer, GEOMETRY_ATTRIBUTE, GEOMETRY_FILTER_NAME, GRID_AUTO_FILL_DEFAULTS, GRID_CELL_ATTR, GRID_CELL_ID_PREFIX, GRID_DRAGGING_ATTR, GRID_DRAG_SOURCE_ATTR, GRID_DROP_TARGET_ATTR, GRID_FILL_DEFAULTS, GRID_ROW_ID_PREFIX, GlobalContext, GlobalProvider, GridRowContainer, HANDLE_BLEED_PX, Header, HeaderContainer, HeaderFontColorMixin, HeaderFrontView, HeaderTemplate, HeaderTitleContainer, HiddenTitleItems, IconContainer, ImageContainer, LEFT_PANEL_HEADER_HEIGHT, Layer, LayerDescription, LayerGroupList, LayerIcon, LayerIconContainer, LayerListContainer, LayerTree, LayersContainer, LayersListWrapper, LinearProgressContainer, LogTerminal, LogoContainer, MAP_VIEW_FILTER_NAMES, MAX_CHART_WIDTH, MAX_TRACKS, MIN_TRACK_PX, MIN_TRACK_RATIO, Map$1 as Map, MapContext, MapProvider, NON_TRACK_SLOT_IDS, NO_CELL_DRAG_SELECTOR, NO_CONTENT_VALUE, NUMERIC_ATTRIBUTE_TYPES, NoLiveSnapshotContainer, OBJECT_FITS, OVERFLOWS, OneColumnContainer, PIE_CHART_TOOLTIP_STYLE, POLL_SUBTASK_INTERVAL_MS, POLL_SUBTASK_TIMEOUT_MS, PROJECT_ALIAS_PROP, PROJECT_FILTER_NAME, PROJECT_NAME_PROP, PROJECT_PROPS, PROVIDER_PREFIX, PageNavigator, PageTitle, PageTitleContainer, PagesContainer, Pagination, PresentationHeader, PresentationHeaderButtons, PresentationHeaderTools, PresentationPanelContainer, PresentationPanelWrapper, PresentationWrapper, ProgressContainer, ProviderPrefix, QUERY_DESCRIPTION_CACHE_TTL, RESIZE_HANDLE_ATTR, ResizeHandle, RoundedBackgroundContainer, SAVE_HOOK_RESULT_DURATION, SERVER_NOTIFICATION_EVENT, STACK_BAR_TOTAL_HEIGHT, ScalingFactor, ServerNotificationsContext, ServerNotificationsProvider, SlideshowContainer, SmallPreviewContainer$1 as SmallPreviewContainer, SmallPreviewControl, SmallPreviewCounter, SmallPreviewImages, SmallPreviewLeft, SmallPreviewRight, StackBar, StructuredDataContainer, SvgImage, TILE_ALIGNMENTS, TIME_ZONE_FORMAT, TITLE_SLOT_IDS, TabsContainer, TextTrim, ThemeName, TitleContainer, TopContainer, TopContainerButtons, TwoColumnContainer, UploadContainer, VIEW_MODES, VoteContainer, WidgetType, ZOOM_FILTER_NAME, addDataSource, addDataSources, adjustColor, applyFiltersToCondition, applyQueryFilters, applyTreeFilterToCondition, applyVarsToCondition, asAttributeName, asChartId, asContainerId, asDataSourceName, asFilterName, asLayerName, asModalId, asResourceId, asTabId, buildGridTemplate, buildTrackTemplate, checkEqualOrIncludes, checkIsLoading, collectConfigIds, containsNodeId, createConfigLayer, createConfigPage, createGridCell, createGridIdFactory, createGridRow, createNewPageId, createSaveNotificationId, dateOptions, debounce, decimalOpacityToHex, enrichStyleItemsWithIds, enrichStyleModelsWithIds, eqlParametersToPayload, fetchQueryDescription, findAttributeInExpression, findCellContext, formatArea, formatAttributeValue, formatChartRelatedValue, formatConditionValue, formatDataSourceCondition, formatDate$1 as formatDate, formatElementValue, formatLength, formatNumber, formatPolygonMeasure, geometryToEwkt, getActualExtrusionHeight, getAttributeByName, getAttributeConfigurationByName, getAttributeIconElement, getAttributeIconUrl, getAttributeValue, getAttributesConfiguration, getAverageTrackSize, getChartAxes, getChartFilterName, getChartMarkers, getConfigFilter, getContainerComponent, getDashboardHeader, getDataFromAttributes, getDataFromRelatedFeatures, getDataSource, getDataSourceFilterValue, getDataSourceLayerInfo, getDate, getDefaultConfig, getDisplayTemplateNameFromAttribute, getElementValue, getFeatureAttributes, getFeatureCardHeader, getFilterComponent, getFilterSelectedItems, getFilterValue, getFormattedAttributes, getGradientColors, getImageUrl, getLayerClientStyle, getLayerInfo, getLayerInfoAttribute, getLayerInfoFromDataSources, getLayoutChildren, getMapViewDataSources, getPagesFromConfig, getPagesFromProjectInfo, getProjectValue, getProxyService, getRelatedAttribute, getRenderElement, getResourceUrl, getRootElementId, getSelectedFilterValue, getSlideshowImages, getStyleAttributes, getSvgUrl, getTemplateNameFromAttribute, getThemeByName, getTotalFromAttributes, getTotalFromRelatedFeatures, getTrackSize, getTrackSizeKey, getTrackSizes, getWrapperSizeStyle, hasContainerBgImage, hexToRgba, isCrossOriginUrl, isEmptyElementValue, isEmptyValue, isFeaturesFilterValue, isFillSize, isFrSize, isGridNode, isHiddenEmptyValue, isHookActive, isLayerService, isNotValidSelectedTab, isNumeric, isObject, isProxyService, isRootOwningContainer, isTreeFilterValue, isVisibleContainer, mapNodeById, mergeAttributeConfigurations, metersPerPixel, noMarginMixin, numberOptions, parseFrValue, parseIconNames, parseIconNamesFromClientStyle, pieChartTooltipFromAttributes, pieChartTooltipFromRelatedFeatures, pointOptions, removeDataSource, removeTracks, replaceNodesByIds, rgbToHex, roundFr, roundTotalSum, setLayoutChildren, sizeCssMixin, sliceShownOtherItems, stretchPalette, timeOptions, toConditionsArray, toCssSize, toFrSize, toPxNumber, toRenderableValue, tooltipNameFromAttributes, tooltipValueFromAttributes, tooltipValueFromRelatedFeatures, transparentizeColor, updateDataSource, useAfterSave, useAppHeight, useAttachmentDownload, useAttachmentItems, useAttachmentPreviewImages, useAutoCompleteControl, useBeforeSave, useBgImageHost, useChartChange, useChartData, useContainerAttributes, useContainerRoot, useCurrentPageLayers, useCustomFeatureSelect, useDashboardHeader, useDataSourceLoading, useDataSources, useDebouncedCallback, useDiffPage, useEditGroupAttributes, useEqualTileWidth, useExpandableContainers, useExportPdf, useFeatureSaveHooks, useFetchImageWithAuth, useFetchWithAuth, useGetConfigLayer, useGlobalContext, useHeaderRender, useHideIfEmptyDataSource, useLayerHiddenAttributes, useLayerParams, useMapContext, useMapDraw, useMapImages, useMaxZoomTo, useProjectDashboardInit, usePythonSandbox, usePythonTask, useRedrawLayer, useRelatedDataSourceAttributes, useRemoteTask, useRenderElement, useResizeBox, useResizeDrag, useSavePrototypeBuilder, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useVisibleProjectItems, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useWrapperSize, useZoomToFeatures, useZoomToPoint, withTrackSize };
|
|
19481
19549
|
//# sourceMappingURL=react.esm.js.map
|