@pisell/materials 6.11.45 → 6.11.47
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.js +3 -31
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.less +5 -5
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +45 -64
- package/es/components/pisellFloorMapLayout/components/ViewControls.less +65 -131
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +1 -1
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +41 -15
- package/es/components/productCard/cartSkuCard/components/weighing/index.d.ts +18 -0
- package/es/components/productCard/cartSkuCard/components/weighing/index.js +39 -0
- package/es/components/productCard/cartSkuCard/components/weighing/index.less +25 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +20 -0
- package/es/components/productCard/cartSkuCard/locales.js +20 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.js +1 -25
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.less +5 -5
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +62 -107
- package/lib/components/pisellFloorMapLayout/components/ViewControls.less +65 -131
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +1 -1
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +50 -12
- package/lib/components/productCard/cartSkuCard/components/weighing/index.d.ts +18 -0
- package/lib/components/productCard/cartSkuCard/components/weighing/index.js +61 -0
- package/lib/components/productCard/cartSkuCard/components/weighing/index.less +25 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +20 -0
- package/lib/components/productCard/cartSkuCard/locales.js +20 -0
- package/package.json +1 -1
- package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +0 -9
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.d.ts +0 -8
- package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +0 -14
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +0 -12
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolBarI18n.d.ts +0 -13
- package/es/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.d.ts +0 -17
- package/es/components/pisellRecordBoard/shellFrame/index.d.ts +0 -30
- package/es/components/pisellRecordBoard/types.d.ts +0 -789
- package/es/index.d.ts +0 -265
- package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +0 -9
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.d.ts +0 -8
- package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +0 -14
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +0 -12
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolBarI18n.d.ts +0 -13
- package/lib/components/pisellRecordBoard/shellFrame/ToolBarQuickFilter/index.d.ts +0 -17
- package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +0 -30
- package/lib/components/pisellRecordBoard/types.d.ts +0 -789
- package/lib/index.d.ts +0 -265
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
declare type WeightUnit = 'KILOGRAMS' | 'GRAMS' | 'POUNDS' | 'OUNCES';
|
|
3
|
+
interface WeighingInfo {
|
|
4
|
+
weight?: number;
|
|
5
|
+
tare?: {
|
|
6
|
+
id?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
value?: number;
|
|
9
|
+
unit?: WeightUnit;
|
|
10
|
+
};
|
|
11
|
+
net_weight?: number;
|
|
12
|
+
unit?: WeightUnit;
|
|
13
|
+
}
|
|
14
|
+
interface WeighingProps {
|
|
15
|
+
dataSource?: WeighingInfo;
|
|
16
|
+
}
|
|
17
|
+
declare const Weighing: (props: WeighingProps) => JSX.Element | null;
|
|
18
|
+
export default Weighing;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { locales } from '@pisell/utils';
|
|
3
|
+
import { PREFIX } from "../../index";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
var UNIT_LABEL_MAP = {
|
|
6
|
+
KILOGRAMS: 'kg',
|
|
7
|
+
GRAMS: 'g',
|
|
8
|
+
POUNDS: 'lb',
|
|
9
|
+
OUNCES: 'oz'
|
|
10
|
+
};
|
|
11
|
+
var formatWeight = function formatWeight(value, unit) {
|
|
12
|
+
var parsedValue = Number(value);
|
|
13
|
+
var displayValue = Number.isFinite(parsedValue) ? parsedValue : 0;
|
|
14
|
+
var displayUnit = UNIT_LABEL_MAP[unit || 'KILOGRAMS'];
|
|
15
|
+
return "".concat(displayValue.toFixed(3), " ").concat(displayUnit);
|
|
16
|
+
};
|
|
17
|
+
var Weighing = function Weighing(props) {
|
|
18
|
+
var dataSource = props.dataSource;
|
|
19
|
+
if (!dataSource) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
var weight = dataSource.weight,
|
|
23
|
+
tare = dataSource.tare,
|
|
24
|
+
net_weight = dataSource.net_weight,
|
|
25
|
+
_dataSource$unit = dataSource.unit,
|
|
26
|
+
unit = _dataSource$unit === void 0 ? 'KILOGRAMS' : _dataSource$unit;
|
|
27
|
+
var tareValue = Number((tare === null || tare === void 0 ? void 0 : tare.value) || 0);
|
|
28
|
+
var tareLabel = (tare === null || tare === void 0 ? void 0 : tare.label) || locales.getText('pisell2.cart.sku-card.weighing.tare');
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: "".concat(PREFIX, "__weighing")
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: "".concat(PREFIX, "__weighing-row")
|
|
33
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.cart.sku-card.weighing.gross'), ":"), /*#__PURE__*/React.createElement("span", null, formatWeight(weight, unit))), tareValue > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: "".concat(PREFIX, "__weighing-row")
|
|
35
|
+
}, /*#__PURE__*/React.createElement("span", null, tareLabel, ":"), /*#__PURE__*/React.createElement("span", null, "-", formatWeight(tareValue, (tare === null || tare === void 0 ? void 0 : tare.unit) || unit))) : null, /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: "".concat(PREFIX, "__weighing-row")
|
|
37
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.cart.sku-card.weighing.net'), ":"), /*#__PURE__*/React.createElement("span", null, formatWeight(net_weight, unit))));
|
|
38
|
+
};
|
|
39
|
+
export default Weighing;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.pisell-cart-sku-card__weighing {
|
|
2
|
+
user-select: none;
|
|
3
|
+
color: #667085;
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
line-height: 20px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
|
|
11
|
+
&-row {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: 4px;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
text-overflow: ellipsis;
|
|
18
|
+
|
|
19
|
+
> span {
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -6,6 +6,10 @@ declare const _default: {
|
|
|
6
6
|
'pisell2.cart.sku-card.sales.title': string;
|
|
7
7
|
'pisell2.cart.sku-card.actions.delete': string;
|
|
8
8
|
'pisell2.cart.sku-card.unassigned': string;
|
|
9
|
+
'pisell2.cart.sku-card.weighing.gross': string;
|
|
10
|
+
'pisell2.cart.sku-card.weighing.tare': string;
|
|
11
|
+
'pisell2.cart.sku-card.weighing.net': string;
|
|
12
|
+
'pisell2.cart.sku-card.weighing.noTare': string;
|
|
9
13
|
'pisell2.cart.sku-card.gift.title': string;
|
|
10
14
|
'pisell2.cart.sku-card.gift.select.title': string;
|
|
11
15
|
'pisell2.cart.sku-card.gift.total': (num: number) => string;
|
|
@@ -41,6 +45,10 @@ declare const _default: {
|
|
|
41
45
|
'pisell2.cart.sku-card.sales.title': string;
|
|
42
46
|
'pisell2.cart.sku-card.actions.delete': string;
|
|
43
47
|
'pisell2.cart.sku-card.unassigned': string;
|
|
48
|
+
'pisell2.cart.sku-card.weighing.gross': string;
|
|
49
|
+
'pisell2.cart.sku-card.weighing.tare': string;
|
|
50
|
+
'pisell2.cart.sku-card.weighing.net': string;
|
|
51
|
+
'pisell2.cart.sku-card.weighing.noTare': string;
|
|
44
52
|
'pisell2.cart.sku-card.gift.title': string;
|
|
45
53
|
'pisell2.cart.sku-card.gift.select.title': string;
|
|
46
54
|
'pisell2.cart.sku-card.gift.total': (num: number) => string;
|
|
@@ -76,6 +84,10 @@ declare const _default: {
|
|
|
76
84
|
'pisell2.cart.sku-card.sales.title': string;
|
|
77
85
|
'pisell2.cart.sku-card.actions.delete': string;
|
|
78
86
|
'pisell2.cart.sku-card.unassigned': string;
|
|
87
|
+
'pisell2.cart.sku-card.weighing.gross': string;
|
|
88
|
+
'pisell2.cart.sku-card.weighing.tare': string;
|
|
89
|
+
'pisell2.cart.sku-card.weighing.net': string;
|
|
90
|
+
'pisell2.cart.sku-card.weighing.noTare': string;
|
|
79
91
|
'pisell2.cart.sku-card.gift.title': string;
|
|
80
92
|
'pisell2.cart.sku-card.gift.select.title': string;
|
|
81
93
|
'pisell2.cart.sku-card.gift.total': (num: number) => string;
|
|
@@ -111,6 +123,10 @@ declare const _default: {
|
|
|
111
123
|
'pisell2.cart.sku-card.sales.title': string;
|
|
112
124
|
'pisell2.cart.sku-card.actions.delete': string;
|
|
113
125
|
'pisell2.cart.sku-card.unassigned': string;
|
|
126
|
+
'pisell2.cart.sku-card.weighing.gross': string;
|
|
127
|
+
'pisell2.cart.sku-card.weighing.tare': string;
|
|
128
|
+
'pisell2.cart.sku-card.weighing.net': string;
|
|
129
|
+
'pisell2.cart.sku-card.weighing.noTare': string;
|
|
114
130
|
'pisell2.cart.sku-card.gift.title': string;
|
|
115
131
|
'pisell2.cart.sku-card.gift.select.title': string;
|
|
116
132
|
'pisell2.cart.sku-card.gift.total': (num: number) => string;
|
|
@@ -146,6 +162,10 @@ declare const _default: {
|
|
|
146
162
|
'pisell2.cart.sku-card.sales.title': string;
|
|
147
163
|
'pisell2.cart.sku-card.actions.delete': string;
|
|
148
164
|
'pisell2.cart.sku-card.unassigned': string;
|
|
165
|
+
'pisell2.cart.sku-card.weighing.gross': string;
|
|
166
|
+
'pisell2.cart.sku-card.weighing.tare': string;
|
|
167
|
+
'pisell2.cart.sku-card.weighing.net': string;
|
|
168
|
+
'pisell2.cart.sku-card.weighing.noTare': string;
|
|
149
169
|
'pisell2.cart.sku-card.gift.title': string;
|
|
150
170
|
'pisell2.cart.sku-card.gift.select.title': string;
|
|
151
171
|
'pisell2.cart.sku-card.gift.total': (num: number) => string;
|
|
@@ -13,6 +13,10 @@ export default {
|
|
|
13
13
|
'pisell2.cart.sku-card.sales.title': 'Sales',
|
|
14
14
|
'pisell2.cart.sku-card.actions.delete': 'Delete',
|
|
15
15
|
'pisell2.cart.sku-card.unassigned': 'Unassigned',
|
|
16
|
+
'pisell2.cart.sku-card.weighing.gross': 'Gross',
|
|
17
|
+
'pisell2.cart.sku-card.weighing.tare': 'Tare',
|
|
18
|
+
'pisell2.cart.sku-card.weighing.net': 'Net',
|
|
19
|
+
'pisell2.cart.sku-card.weighing.noTare': 'No tare',
|
|
16
20
|
'pisell2.cart.sku-card.gift.title': 'Gift',
|
|
17
21
|
'pisell2.cart.sku-card.gift.select.title': 'Select Gift',
|
|
18
22
|
'pisell2.cart.sku-card.gift.total': function pisell2CartSkuCardGiftTotal(num) {
|
|
@@ -26,6 +30,10 @@ export default {
|
|
|
26
30
|
'pisell2.cart.sku-card.sales.title': '销售',
|
|
27
31
|
'pisell2.cart.sku-card.actions.delete': '删除',
|
|
28
32
|
'pisell2.cart.sku-card.unassigned': '未分配',
|
|
33
|
+
'pisell2.cart.sku-card.weighing.gross': '毛重',
|
|
34
|
+
'pisell2.cart.sku-card.weighing.tare': '皮重',
|
|
35
|
+
'pisell2.cart.sku-card.weighing.net': '净重',
|
|
36
|
+
'pisell2.cart.sku-card.weighing.noTare': '无皮重',
|
|
29
37
|
'pisell2.cart.sku-card.gift.title': '赠品',
|
|
30
38
|
'pisell2.cart.sku-card.gift.select.title': '选择赠品',
|
|
31
39
|
'pisell2.cart.sku-card.gift.total': function pisell2CartSkuCardGiftTotal(num) {
|
|
@@ -39,6 +47,10 @@ export default {
|
|
|
39
47
|
'pisell2.cart.sku-card.sales.title': '銷售',
|
|
40
48
|
'pisell2.cart.sku-card.actions.delete': '刪除',
|
|
41
49
|
'pisell2.cart.sku-card.unassigned': '未分配',
|
|
50
|
+
'pisell2.cart.sku-card.weighing.gross': '毛重',
|
|
51
|
+
'pisell2.cart.sku-card.weighing.tare': '皮重',
|
|
52
|
+
'pisell2.cart.sku-card.weighing.net': '淨重',
|
|
53
|
+
'pisell2.cart.sku-card.weighing.noTare': '無皮重',
|
|
42
54
|
'pisell2.cart.sku-card.gift.title': '贈品',
|
|
43
55
|
'pisell2.cart.sku-card.gift.select.title': '選擇贈品',
|
|
44
56
|
'pisell2.cart.sku-card.gift.total': function pisell2CartSkuCardGiftTotal(num) {
|
|
@@ -52,6 +64,10 @@ export default {
|
|
|
52
64
|
'pisell2.cart.sku-card.sales.title': 'セール',
|
|
53
65
|
'pisell2.cart.sku-card.actions.delete': '削除',
|
|
54
66
|
'pisell2.cart.sku-card.unassigned': '未割り当て',
|
|
67
|
+
'pisell2.cart.sku-card.weighing.gross': '総重量',
|
|
68
|
+
'pisell2.cart.sku-card.weighing.tare': '風袋',
|
|
69
|
+
'pisell2.cart.sku-card.weighing.net': '正味重量',
|
|
70
|
+
'pisell2.cart.sku-card.weighing.noTare': '風袋なし',
|
|
55
71
|
'pisell2.cart.sku-card.gift.title': 'プレゼント',
|
|
56
72
|
'pisell2.cart.sku-card.gift.select.title': 'プレゼントを選択',
|
|
57
73
|
'pisell2.cart.sku-card.gift.total': function pisell2CartSkuCardGiftTotal(num) {
|
|
@@ -65,6 +81,10 @@ export default {
|
|
|
65
81
|
'pisell2.cart.sku-card.sales.title': 'Vendas',
|
|
66
82
|
'pisell2.cart.sku-card.actions.delete': 'Excluir',
|
|
67
83
|
'pisell2.cart.sku-card.unassigned': 'Não atribuído',
|
|
84
|
+
'pisell2.cart.sku-card.weighing.gross': 'Peso bruto',
|
|
85
|
+
'pisell2.cart.sku-card.weighing.tare': 'Tara',
|
|
86
|
+
'pisell2.cart.sku-card.weighing.net': 'Peso líquido',
|
|
87
|
+
'pisell2.cart.sku-card.weighing.noTare': 'Sem tara',
|
|
68
88
|
'pisell2.cart.sku-card.gift.title': 'Brinde',
|
|
69
89
|
'pisell2.cart.sku-card.gift.select.title': 'Escolher brinde',
|
|
70
90
|
'pisell2.cart.sku-card.gift.total': function pisell2CartSkuCardGiftTotal(num) {
|
|
@@ -87,25 +87,6 @@ function buildScenePreviewMergedItem(kind, dataSourceKey, size) {
|
|
|
87
87
|
}
|
|
88
88
|
var STAGE_PREVIEW_SIZE = { width: 160, height: 64 };
|
|
89
89
|
var IMAGE_PREVIEW_SIZE = { width: 140, height: 80 };
|
|
90
|
-
var TOOLBAR_COLLAPSED_STORAGE_KEY = "pisell-floor-map-layout.toolbar.leftbar-collapsed.v1";
|
|
91
|
-
function readToolbarCollapsedPreference() {
|
|
92
|
-
if (typeof window === "undefined") return false;
|
|
93
|
-
try {
|
|
94
|
-
return window.localStorage.getItem(TOOLBAR_COLLAPSED_STORAGE_KEY) === "1";
|
|
95
|
-
} catch {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
function writeToolbarCollapsedPreference(collapsed) {
|
|
100
|
-
if (typeof window === "undefined") return;
|
|
101
|
-
try {
|
|
102
|
-
window.localStorage.setItem(
|
|
103
|
-
TOOLBAR_COLLAPSED_STORAGE_KEY,
|
|
104
|
-
collapsed ? "1" : "0"
|
|
105
|
-
);
|
|
106
|
-
} catch {
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
90
|
function FloorMapToolbar(props) {
|
|
110
91
|
const {
|
|
111
92
|
config,
|
|
@@ -126,12 +107,7 @@ function FloorMapToolbar(props) {
|
|
|
126
107
|
onPaletteCardPointerDown,
|
|
127
108
|
consumeToolbarClickIfTouchDrag
|
|
128
109
|
} = props;
|
|
129
|
-
const [collapsed, setCollapsed] = (0, import_react.useState)(
|
|
130
|
-
() => readToolbarCollapsedPreference()
|
|
131
|
-
);
|
|
132
|
-
(0, import_react.useEffect)(() => {
|
|
133
|
-
writeToolbarCollapsedPreference(collapsed);
|
|
134
|
-
}, [collapsed]);
|
|
110
|
+
const [collapsed, setCollapsed] = (0, import_react.useState)(false);
|
|
135
111
|
const handleToggleCollapsed = (0, import_react.useCallback)(() => {
|
|
136
112
|
setCollapsed((prev) => !prev);
|
|
137
113
|
}, []);
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* 收起 /
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* 收起态下容器宽度为 0,按钮仍能完整露出(z-index 高于地图区遮罩)。
|
|
49
|
+
* 收起 / 展开按钮:左缘与侧栏**右缘对齐**(`left: 100%`),整体仍在侧栏外,不与图元预览重叠;
|
|
50
|
+
* 旧写法 `right: -22px` + `width: 28` 会让按钮左缘落在侧栏内约 6px 压到卡片。
|
|
51
|
+
* 收起态下容器宽度为 0,100% 仍锚在右缘,按钮仍能完整露出(z-index 高于地图区遮罩)。
|
|
53
52
|
*/
|
|
54
53
|
&-collapse-handle {
|
|
55
54
|
position: absolute;
|
|
56
55
|
top: 50%;
|
|
57
|
-
|
|
56
|
+
left: 100%;
|
|
57
|
+
right: auto;
|
|
58
58
|
transform: translateY(-50%);
|
|
59
59
|
width: 28px;
|
|
60
60
|
height: 72px;
|
|
@@ -63,16 +63,12 @@ function ViewControls(props) {
|
|
|
63
63
|
const showGridToggle = config.showGridToggle === true && typeof onToggleMapGrid === "function";
|
|
64
64
|
const showViewportLock = config.showViewportLock === true && typeof onToggleViewportLock === "function";
|
|
65
65
|
const horizontalAlign = config.horizontalAlign ?? "start";
|
|
66
|
-
const isDockAlignEnd = horizontalAlign === "end";
|
|
67
66
|
const scalePercent = Math.round(scale * 100);
|
|
68
67
|
const showTools = showReset || showFitBounds || showFullscreen || showGridToggle || showViewportLock;
|
|
69
68
|
const hasTrailingSlot = dockExpandedTrailing != null && dockExpandedTrailing !== false;
|
|
70
69
|
const dockHasExpandable = dockChrome && (showTools || hasTrailingSlot);
|
|
71
70
|
const showBar = showZoom || showTools || dockChrome && hasTrailingSlot;
|
|
72
71
|
const [dockExpanded, setDockExpanded] = (0, import_react.useState)(false);
|
|
73
|
-
const [dockPanelMounted, setDockPanelMounted] = (0, import_react.useState)(false);
|
|
74
|
-
const dockExpandedRef = (0, import_react.useRef)(dockExpanded);
|
|
75
|
-
dockExpandedRef.current = dockExpanded;
|
|
76
72
|
const idleTimerRef = (0, import_react.useRef)(null);
|
|
77
73
|
const clearIdleTimer = (0, import_react.useCallback)(() => {
|
|
78
74
|
if (idleTimerRef.current != null) {
|
|
@@ -104,24 +100,8 @@ function ViewControls(props) {
|
|
|
104
100
|
scheduleDockCollapse();
|
|
105
101
|
}
|
|
106
102
|
}, [dockExpanded, dockHasExpandable, scheduleDockCollapse]);
|
|
107
|
-
const handleDockSlideTransitionEnd = (0, import_react.useCallback)(
|
|
108
|
-
(e) => {
|
|
109
|
-
if (e.propertyName !== "max-width" || e.target !== e.currentTarget) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (!dockExpandedRef.current) {
|
|
113
|
-
setDockPanelMounted(false);
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
[]
|
|
117
|
-
);
|
|
118
103
|
const handleDockExpand = (0, import_react.useCallback)(() => {
|
|
119
|
-
|
|
120
|
-
requestAnimationFrame(() => {
|
|
121
|
-
requestAnimationFrame(() => {
|
|
122
|
-
setDockExpanded(true);
|
|
123
|
-
});
|
|
124
|
-
});
|
|
104
|
+
setDockExpanded(true);
|
|
125
105
|
}, []);
|
|
126
106
|
const handleDockCollapseClick = (0, import_react.useCallback)(() => {
|
|
127
107
|
clearIdleTimer();
|
|
@@ -207,8 +187,23 @@ function ViewControls(props) {
|
|
|
207
187
|
isFullscreen ? /* @__PURE__ */ import_react.default.createElement(import_icons.FullscreenExitOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.FullscreenOutlined, null)
|
|
208
188
|
) : null);
|
|
209
189
|
};
|
|
210
|
-
const dockExpandedBarHasToolButtons = showReset ||
|
|
211
|
-
const
|
|
190
|
+
const dockExpandedBarHasToolButtons = showReset || showGridToggle || showFullscreen && Boolean(api.toggleFullscreen);
|
|
191
|
+
const renderDockToggleButton = () => /* @__PURE__ */ import_react.default.createElement(
|
|
192
|
+
"button",
|
|
193
|
+
{
|
|
194
|
+
type: "button",
|
|
195
|
+
className: (0, import_classnames.default)(`${PREFIX}-view-controls-dock-toggle-btn`, {
|
|
196
|
+
[`${PREFIX}-view-controls-dock-toggle-btn--panel-open`]: dockExpanded
|
|
197
|
+
}),
|
|
198
|
+
onClick: dockExpanded ? handleDockCollapseClick : handleDockExpand,
|
|
199
|
+
"aria-expanded": dockExpanded,
|
|
200
|
+
"aria-label": import_utils.locales.getText(
|
|
201
|
+
dockExpanded ? `${I18N_VC}.collapse-tools-aria` : `${I18N_VC}.expand-tools-aria`
|
|
202
|
+
)
|
|
203
|
+
},
|
|
204
|
+
dockExpanded ? /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null)
|
|
205
|
+
);
|
|
206
|
+
const renderDockExpandableBarContents = () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderDockToggleButton(), showZoom ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
212
207
|
"button",
|
|
213
208
|
{
|
|
214
209
|
type: "button",
|
|
@@ -231,19 +226,9 @@ function ViewControls(props) {
|
|
|
231
226
|
},
|
|
232
227
|
/* @__PURE__ */ import_react.default.createElement(import_icons.PlusOutlined, null)
|
|
233
228
|
)) : null, showZoom && (dockExpandedBarHasToolButtons || hasTrailingSlot) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-bar-divider`, "aria-hidden": true }) : null, dockExpandedBarHasToolButtons ? renderToolButtons({
|
|
234
|
-
omitViewportLock:
|
|
235
|
-
omitFitBounds:
|
|
236
|
-
}) : null, hasTrailingSlot ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-dock-trailing` }, dockExpandedTrailing) : null
|
|
237
|
-
"button",
|
|
238
|
-
{
|
|
239
|
-
type: "button",
|
|
240
|
-
className: `${PREFIX}-view-controls-tool-btn`,
|
|
241
|
-
onClick: handleDockCollapseClick,
|
|
242
|
-
"aria-expanded": dockExpanded,
|
|
243
|
-
"aria-label": import_utils.locales.getText(`${I18N_VC}.collapse-tools-aria`)
|
|
244
|
-
},
|
|
245
|
-
isDockAlignEnd ? /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null)
|
|
246
|
-
));
|
|
229
|
+
omitViewportLock: true,
|
|
230
|
+
omitFitBounds: true
|
|
231
|
+
}) : null, hasTrailingSlot ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-dock-trailing` }, dockExpandedTrailing) : null);
|
|
247
232
|
if (!showBar) {
|
|
248
233
|
return null;
|
|
249
234
|
}
|
|
@@ -251,96 +236,66 @@ function ViewControls(props) {
|
|
|
251
236
|
const showLockChip = showViewportLock;
|
|
252
237
|
const showFitChip = showFitBounds && Boolean(api.fitBounds);
|
|
253
238
|
if (!showLockChip && !showFitChip) return null;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
"div",
|
|
239
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-dock-collapsed-extras` }, showLockChip ? /* @__PURE__ */ import_react.default.createElement(
|
|
240
|
+
"button",
|
|
257
241
|
{
|
|
242
|
+
type: "button",
|
|
258
243
|
className: (0, import_classnames.default)(
|
|
259
|
-
`${PREFIX}-view-controls-
|
|
244
|
+
`${PREFIX}-view-controls-tool-btn`,
|
|
245
|
+
`${PREFIX}-view-controls-dock-collapsed-extras-btn`,
|
|
260
246
|
{
|
|
261
|
-
[`${PREFIX}-view-controls-
|
|
247
|
+
[`${PREFIX}-view-controls-tool-btn--active`]: viewportLocked
|
|
262
248
|
}
|
|
263
249
|
),
|
|
264
|
-
|
|
250
|
+
onClick: () => onToggleViewportLock(),
|
|
251
|
+
"aria-pressed": viewportLocked,
|
|
252
|
+
"aria-label": import_utils.locales.getText(
|
|
253
|
+
viewportLocked ? `${I18N_VC}.viewport-unlock-aria` : `${I18N_VC}.viewport-lock-aria`
|
|
254
|
+
),
|
|
255
|
+
title: import_utils.locales.getText(
|
|
256
|
+
viewportLocked ? `${I18N_VC}.viewport-unlock-aria` : `${I18N_VC}.viewport-lock-aria`
|
|
257
|
+
)
|
|
265
258
|
},
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
viewportLocked ? /* @__PURE__ */ import_react.default.createElement(import_icons.LockOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.UnlockOutlined, null)
|
|
288
|
-
) : null,
|
|
289
|
-
showFitChip ? /* @__PURE__ */ import_react.default.createElement(
|
|
290
|
-
"button",
|
|
291
|
-
{
|
|
292
|
-
type: "button",
|
|
293
|
-
className: (0, import_classnames.default)(
|
|
294
|
-
`${PREFIX}-view-controls-tool-btn`,
|
|
295
|
-
`${PREFIX}-view-controls-dock-collapsed-extras-btn`,
|
|
296
|
-
{
|
|
297
|
-
[`${PREFIX}-view-controls-tool-btn--active`]: fitBoundsActive && !viewportLocked
|
|
298
|
-
}
|
|
299
|
-
),
|
|
300
|
-
onClick: () => api.fitBounds(),
|
|
301
|
-
disabled: viewportLocked,
|
|
302
|
-
"aria-disabled": viewportLocked,
|
|
303
|
-
"aria-pressed": fitBoundsActive,
|
|
304
|
-
tabIndex: collapseExtras ? -1 : 0,
|
|
305
|
-
"aria-label": import_utils.locales.getText(`${I18N_VC}.fit-bounds-aria`),
|
|
306
|
-
title: import_utils.locales.getText(`${I18N_VC}.fit-bounds-aria`)
|
|
307
|
-
},
|
|
308
|
-
/* @__PURE__ */ import_react.default.createElement(import_icons.ExpandOutlined, null)
|
|
309
|
-
) : null
|
|
310
|
-
);
|
|
259
|
+
viewportLocked ? /* @__PURE__ */ import_react.default.createElement(import_icons.LockOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.UnlockOutlined, null)
|
|
260
|
+
) : null, showFitChip ? /* @__PURE__ */ import_react.default.createElement(
|
|
261
|
+
"button",
|
|
262
|
+
{
|
|
263
|
+
type: "button",
|
|
264
|
+
className: (0, import_classnames.default)(
|
|
265
|
+
`${PREFIX}-view-controls-tool-btn`,
|
|
266
|
+
`${PREFIX}-view-controls-dock-collapsed-extras-btn`,
|
|
267
|
+
{
|
|
268
|
+
[`${PREFIX}-view-controls-tool-btn--active`]: fitBoundsActive && !viewportLocked
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
onClick: () => api.fitBounds(),
|
|
272
|
+
disabled: viewportLocked,
|
|
273
|
+
"aria-disabled": viewportLocked,
|
|
274
|
+
"aria-pressed": fitBoundsActive,
|
|
275
|
+
"aria-label": import_utils.locales.getText(`${I18N_VC}.fit-bounds-aria`),
|
|
276
|
+
title: import_utils.locales.getText(`${I18N_VC}.fit-bounds-aria`)
|
|
277
|
+
},
|
|
278
|
+
/* @__PURE__ */ import_react.default.createElement(import_icons.ExpandOutlined, null)
|
|
279
|
+
) : null);
|
|
311
280
|
};
|
|
312
281
|
if (dockChrome && dockHasExpandable) {
|
|
313
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
282
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
314
283
|
"div",
|
|
315
284
|
{
|
|
316
285
|
className: (0, import_classnames.default)(
|
|
317
286
|
`${PREFIX}-view-controls`,
|
|
318
287
|
`${PREFIX}-view-controls--dock`,
|
|
319
|
-
|
|
288
|
+
/* dockChrome 始终右下;保留 --align-end 类以复用既有 CSS */
|
|
289
|
+
`${PREFIX}-view-controls--align-end`,
|
|
320
290
|
className
|
|
321
291
|
)
|
|
322
292
|
},
|
|
323
293
|
/* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-view-controls-dock-row` }, renderDockCollapsedExtras(), /* @__PURE__ */ import_react.default.createElement(
|
|
324
|
-
"button",
|
|
325
|
-
{
|
|
326
|
-
type: "button",
|
|
327
|
-
className: (0, import_classnames.default)(`${PREFIX}-view-controls-dock-expand-btn`, {
|
|
328
|
-
[`${PREFIX}-view-controls-dock-expand-btn--panel-open`]: dockExpanded
|
|
329
|
-
}),
|
|
330
|
-
onClick: handleDockExpand,
|
|
331
|
-
"aria-expanded": dockExpanded,
|
|
332
|
-
"aria-hidden": dockExpanded,
|
|
333
|
-
tabIndex: dockExpanded ? -1 : 0,
|
|
334
|
-
"aria-label": import_utils.locales.getText(`${I18N_VC}.expand-tools-aria`)
|
|
335
|
-
},
|
|
336
|
-
isDockAlignEnd ? /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null) : /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null)
|
|
337
|
-
), dockPanelMounted ? /* @__PURE__ */ import_react.default.createElement(
|
|
338
294
|
"div",
|
|
339
295
|
{
|
|
340
296
|
className: (0, import_classnames.default)(`${PREFIX}-view-controls-dock-slide`, {
|
|
341
297
|
[`${PREFIX}-view-controls-dock-slide--open`]: dockExpanded
|
|
342
|
-
})
|
|
343
|
-
onTransitionEnd: handleDockSlideTransitionEnd
|
|
298
|
+
})
|
|
344
299
|
},
|
|
345
300
|
/* @__PURE__ */ import_react.default.createElement(
|
|
346
301
|
"div",
|
|
@@ -354,8 +309,8 @@ function ViewControls(props) {
|
|
|
354
309
|
},
|
|
355
310
|
renderDockExpandableBarContents()
|
|
356
311
|
)
|
|
357
|
-
)
|
|
358
|
-
)
|
|
312
|
+
))
|
|
313
|
+
);
|
|
359
314
|
}
|
|
360
315
|
const barClass = (0, import_classnames.default)(`${PREFIX}-view-controls-bar`, {
|
|
361
316
|
[`${PREFIX}-view-controls-bar--dock`]: dockChrome
|