@pisell/materials 1.0.1060 → 1.0.1062
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/meta.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -23
- package/es/components/PisellLayouts/index.js +14 -14
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +9 -4
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +34 -34
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +55 -2
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +1 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.js +5 -5
- package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +3 -2
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +2 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +4 -2
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +42 -1
- package/es/components/pisellFloorMapLayout/types.d.ts +17 -1
- package/es/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.js +2 -2
- package/es/components/pisellHierarchicalSummaryList/index.js +2 -2
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +30 -5
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.js +51 -51
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +4 -4
- package/es/components/pisellRecordBoard/shellFrame/index.js +4 -2
- package/es/components/pisellRecordBoard/types.d.ts +8 -2
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +1 -1
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +148 -51
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.less +38 -4
- package/es/components/pisellTimeNavigator/components/BackgroundLayer.js +2 -2
- package/es/components/pisellTimeNavigator/components/CursorLayer.js +4 -4
- package/es/components/pisellTimeNavigator/components/GestureLayer.js +2 -2
- package/es/components/pisellTimeNavigator/components/NowButton.js +3 -3
- package/es/components/pisellTimeNavigator/components/ScaleLayer.js +3 -3
- package/es/components/pisellTimeNavigator/hooks/useDragInertia.js +2 -2
- package/es/components/pisellTimeNavigator/hooks/useRealtime.js +2 -2
- package/es/components/pisellTimeNavigator/hooks/useTimeAxis.js +8 -8
- package/es/components/pisellTimeNavigator/types.d.ts +4 -0
- package/es/components/pisellTimeNavigator/utils/index.d.ts +4 -0
- package/es/components/pisellTimeNavigator/utils/index.js +28 -14
- package/es/index.js +16 -16
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +7 -4
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +231 -157
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +1 -0
- package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +2 -1
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +2 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +4 -2
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +47 -1
- package/lib/components/pisellFloorMapLayout/types.d.ts +17 -1
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +32 -4
- package/lib/components/pisellRecordBoard/shellFrame/index.js +1 -0
- package/lib/components/pisellRecordBoard/types.d.ts +8 -2
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +1 -1
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +143 -29
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.less +38 -4
- package/lib/components/pisellTimeNavigator/types.d.ts +4 -0
- package/lib/components/pisellTimeNavigator/utils/index.d.ts +4 -0
- package/lib/components/pisellTimeNavigator/utils/index.js +9 -0
- package/lowcode/floor-map-layout-provider/meta.ts +1 -1
- package/lowcode/pisell-floor-map-layout/meta.ts +75 -1
- package/lowcode/pisell-hierarchical-summary-list/meta.ts +244 -244
- package/lowcode/render-figma-style-round-table-card/meta.ts +1 -1
- package/lowcode/render-figma-style-table-card/meta.ts +1 -1
- package/package.json +4 -4
|
@@ -539,8 +539,8 @@ function filterDataByCriteria(list, filterValues) {
|
|
|
539
539
|
/** 平面图:与列表一致,未命中左侧快筛 / PisellFind 关键词时图元透明度 */
|
|
540
540
|
var FLOOR_MAP_DIM_OPACITY = 0.2;
|
|
541
541
|
|
|
542
|
-
/**
|
|
543
|
-
* 是否与 RecordBoard ToolBar 左侧快筛 + 搜索关键词同时匹配(用于表格行过滤与平面图压暗未命中图元)。
|
|
542
|
+
/**
|
|
543
|
+
* 是否与 RecordBoard ToolBar 左侧快筛 + 搜索关键词同时匹配(用于表格行过滤与平面图压暗未命中图元)。
|
|
544
544
|
*/
|
|
545
545
|
function recordBoardStoryRowMatchesToolbar(row, searchParams) {
|
|
546
546
|
var _searchParams$filter, _searchParams$keyword;
|
|
@@ -604,9 +604,9 @@ function createInitialCondimentStations() {
|
|
|
604
604
|
flavorCount: 8,
|
|
605
605
|
area: '露台'
|
|
606
606
|
},
|
|
607
|
-
/**
|
|
608
|
-
* 以下记录在初始平面图**无落位**,用于编辑态「蘸料摆台」新建时可选绑定;
|
|
609
|
-
* 若列表与落位一一占满是,工具栏会提示「均已落位,或列表为空」。
|
|
607
|
+
/**
|
|
608
|
+
* 以下记录在初始平面图**无落位**,用于编辑态「蘸料摆台」新建时可选绑定;
|
|
609
|
+
* 若列表与落位一一占满是,工具栏会提示「均已落位,或列表为空」。
|
|
610
610
|
*/
|
|
611
611
|
{
|
|
612
612
|
id: 'cs4',
|
|
@@ -816,8 +816,8 @@ function createInitialRestaurantFloorMapConfig() {
|
|
|
816
816
|
dataBindingPolicy: 'none',
|
|
817
817
|
showInPalette: true
|
|
818
818
|
}],
|
|
819
|
-
/**
|
|
820
|
-
* 四列栅格(同原 dataSourcePlacements 布局),现统一为 sceneElements + dataBinding
|
|
819
|
+
/**
|
|
820
|
+
* 四列栅格(同原 dataSourcePlacements 布局),现统一为 sceneElements + dataBinding
|
|
821
821
|
*/
|
|
822
822
|
sceneElements: [{
|
|
823
823
|
instanceId: 'elm_t1',
|
|
@@ -1092,8 +1092,8 @@ var condimentRecordFormColumns = [{
|
|
|
1092
1092
|
type: 'string'
|
|
1093
1093
|
}];
|
|
1094
1094
|
|
|
1095
|
-
/**
|
|
1096
|
-
* Story 演示:`dataSourceRecordForm` 自定义侧栏「数据源记录」表单(复杂逻辑可走独立 Form)
|
|
1095
|
+
/**
|
|
1096
|
+
* Story 演示:`dataSourceRecordForm` 自定义侧栏「数据源记录」表单(复杂逻辑可走独立 Form)
|
|
1097
1097
|
*/
|
|
1098
1098
|
function RestaurantTableRecordCustomForm(props) {
|
|
1099
1099
|
var ctx = props.ctx;
|
|
@@ -1190,8 +1190,8 @@ var restaurantRecordFormColumns = [{
|
|
|
1190
1190
|
type: 'string'
|
|
1191
1191
|
}];
|
|
1192
1192
|
|
|
1193
|
-
/**
|
|
1194
|
-
* **默认 Story**:餐厅 **多数据源**——**餐桌** + **蘸料摆台**;根级 `dataSources` 同时包含两者;**表格只绑定餐桌一路**(`gridDataSourceKey`);平面图同时渲染两类落位,无需 Segmented 切换列表。
|
|
1193
|
+
/**
|
|
1194
|
+
* **默认 Story**:餐厅 **多数据源**——**餐桌** + **蘸料摆台**;根级 `dataSources` 同时包含两者;**表格只绑定餐桌一路**(`gridDataSourceKey`);平面图同时渲染两类落位,无需 Segmented 切换列表。
|
|
1195
1195
|
*/
|
|
1196
1196
|
export var Default = {
|
|
1197
1197
|
parameters: {
|
|
@@ -1475,8 +1475,8 @@ export var Default = {
|
|
|
1475
1475
|
}
|
|
1476
1476
|
};
|
|
1477
1477
|
|
|
1478
|
-
/**
|
|
1479
|
-
* Grid 布局 - 带 Table、分页、多选;列 type 驱动列/筛选/排序;筛选在 Filter 弹层内;重置清空筛选与排序。
|
|
1478
|
+
/**
|
|
1479
|
+
* Grid 布局 - 带 Table、分页、多选;列 type 驱动列/筛选/排序;筛选在 Filter 弹层内;重置清空筛选与排序。
|
|
1480
1480
|
*/
|
|
1481
1481
|
export var GridLayoutWithTable = {
|
|
1482
1482
|
parameters: {
|
|
@@ -1581,8 +1581,8 @@ export var GridLayoutWithTable = {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
};
|
|
1583
1583
|
|
|
1584
|
-
/**
|
|
1585
|
-
* Grid 布局 - 多页分页示例(至少 25 页:250 条数据,每页 10 条)
|
|
1584
|
+
/**
|
|
1585
|
+
* Grid 布局 - 多页分页示例(至少 25 页:250 条数据,每页 10 条)
|
|
1586
1586
|
*/
|
|
1587
1587
|
export var GridWithMultiplePages = {
|
|
1588
1588
|
parameters: {
|
|
@@ -1675,8 +1675,8 @@ export var GridWithMultiplePages = {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
};
|
|
1677
1677
|
|
|
1678
|
-
/**
|
|
1679
|
-
* Grid 布局 - 同值列折叠:当前页某列全部同值或全部为空时,该列隐藏并在表格上方展示总结区(列名 + 统一值/空数据)。
|
|
1678
|
+
/**
|
|
1679
|
+
* Grid 布局 - 同值列折叠:当前页某列全部同值或全部为空时,该列隐藏并在表格上方展示总结区(列名 + 统一值/空数据)。
|
|
1680
1680
|
*/
|
|
1681
1681
|
export var GridLayoutWithCollapseUniformColumns = {
|
|
1682
1682
|
parameters: {
|
|
@@ -1790,8 +1790,8 @@ export var GridLayoutWithCollapseUniformColumns = {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
};
|
|
1792
1792
|
|
|
1793
|
-
/**
|
|
1794
|
-
* Grid 布局 - uniformCompare 示例:列值为对象时,用 uniformCompare(value, record) 返回用于比较的 string/number,全同则折叠。
|
|
1793
|
+
/**
|
|
1794
|
+
* Grid 布局 - uniformCompare 示例:列值为对象时,用 uniformCompare(value, record) 返回用于比较的 string/number,全同则折叠。
|
|
1795
1795
|
*/
|
|
1796
1796
|
export var GridLayoutWithUniformCompare = {
|
|
1797
1797
|
parameters: {
|
|
@@ -1908,8 +1908,8 @@ export var GridLayoutWithUniformCompare = {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
};
|
|
1910
1910
|
|
|
1911
|
-
/**
|
|
1912
|
-
* Grid 布局 - grid 透传 antd Table props:onRow(行点击)、rowClassName 等
|
|
1911
|
+
/**
|
|
1912
|
+
* Grid 布局 - grid 透传 antd Table props:onRow(行点击)、rowClassName 等
|
|
1913
1913
|
*/
|
|
1914
1914
|
export var GridWithOnRow = {
|
|
1915
1915
|
parameters: {
|
|
@@ -2022,8 +2022,8 @@ export var GridWithOnRow = {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
};
|
|
2024
2024
|
|
|
2025
|
-
/**
|
|
2026
|
-
* Grid 布局 - 与 GridLayoutWithTable 类似,列 type 驱动列/筛选/排序,筛选在弹层内。
|
|
2025
|
+
/**
|
|
2026
|
+
* Grid 布局 - 与 GridLayoutWithTable 类似,列 type 驱动列/筛选/排序,筛选在弹层内。
|
|
2027
2027
|
*/
|
|
2028
2028
|
export var GridLayoutWithColumnType = {
|
|
2029
2029
|
parameters: {
|
|
@@ -2128,9 +2128,9 @@ export var GridLayoutWithColumnType = {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
};
|
|
2130
2130
|
|
|
2131
|
-
/**
|
|
2132
|
-
* Grid 布局 - ToolBar 内直接配置 sort 与 filter(不依赖列派生)
|
|
2133
|
-
* toolBar.sort 用 getSortItems 手动配置选项,toolBar.filter 传 { defaultFilterValue }。
|
|
2131
|
+
/**
|
|
2132
|
+
* Grid 布局 - ToolBar 内直接配置 sort 与 filter(不依赖列派生)
|
|
2133
|
+
* toolBar.sort 用 getSortItems 手动配置选项,toolBar.filter 传 { defaultFilterValue }。
|
|
2134
2134
|
*/
|
|
2135
2135
|
export var GridLayoutToolBarSortAndFilter = {
|
|
2136
2136
|
parameters: {
|
|
@@ -2346,8 +2346,8 @@ export var GridLayoutToolBarSortAndFilter = {
|
|
|
2346
2346
|
}
|
|
2347
2347
|
};
|
|
2348
2348
|
|
|
2349
|
-
/**
|
|
2350
|
-
* Grid 布局 - 快速筛选在 ToolBar 左侧内联展示(toolBar.quickFilter: true),右侧筛选弹层仅保留高级筛选。
|
|
2349
|
+
/**
|
|
2350
|
+
* Grid 布局 - 快速筛选在 ToolBar 左侧内联展示(toolBar.quickFilter: true),右侧筛选弹层仅保留高级筛选。
|
|
2351
2351
|
*/
|
|
2352
2352
|
export var GridLayoutWithQuickFilterOnLeft = {
|
|
2353
2353
|
parameters: {
|
|
@@ -2453,8 +2453,8 @@ export var GridLayoutWithQuickFilterOnLeft = {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
};
|
|
2455
2455
|
|
|
2456
|
-
/**
|
|
2457
|
-
* 自定义左侧快速筛选 + Filter 弹层(高级筛选)+ 列自定义 render
|
|
2456
|
+
/**
|
|
2457
|
+
* 自定义左侧快速筛选 + Filter 弹层(高级筛选)+ 列自定义 render
|
|
2458
2458
|
*/
|
|
2459
2459
|
export var CustomQuickFilterAndColumnsRender = {
|
|
2460
2460
|
parameters: {
|
|
@@ -2593,11 +2593,11 @@ export var CustomQuickFilterAndColumnsRender = {
|
|
|
2593
2593
|
}
|
|
2594
2594
|
};
|
|
2595
2595
|
|
|
2596
|
-
/**
|
|
2597
|
-
* 自定义 filter、自定义 sort、自定义 render
|
|
2598
|
-
* 展示列上显式配置:筛选(订单状态 single 在高级筛选、下单时间 rangePickerNew + 自定义 placeholder/width 在快筛)、
|
|
2599
|
-
* 排序(订单状态无 type,用 sort.getSortItems 自定义「状态 A-Z / Z-A」)、
|
|
2600
|
-
* 以及列的自定义 render(订单号加粗蓝色、状态标签、买家加粗)。
|
|
2596
|
+
/**
|
|
2597
|
+
* 自定义 filter、自定义 sort、自定义 render
|
|
2598
|
+
* 展示列上显式配置:筛选(订单状态 single 在高级筛选、下单时间 rangePickerNew + 自定义 placeholder/width 在快筛)、
|
|
2599
|
+
* 排序(订单状态无 type,用 sort.getSortItems 自定义「状态 A-Z / Z-A」)、
|
|
2600
|
+
* 以及列的自定义 render(订单号加粗蓝色、状态标签、买家加粗)。
|
|
2601
2601
|
*/
|
|
2602
2602
|
export var CustomFilterSortRender = {
|
|
2603
2603
|
parameters: {
|
|
@@ -2699,8 +2699,8 @@ export var CustomFilterSortRender = {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
};
|
|
2701
2701
|
|
|
2702
|
-
/**
|
|
2703
|
-
* Grid 布局 - ToolBar 内使用 PisellFind(toolBar.search: true)
|
|
2702
|
+
/**
|
|
2703
|
+
* Grid 布局 - ToolBar 内使用 PisellFind(toolBar.search: true)
|
|
2704
2704
|
*/
|
|
2705
2705
|
export var GridLayoutWithPisellFindInToolBar = {
|
|
2706
2706
|
render: function GridLayoutWithPisellFindInToolBarRender() {
|
|
@@ -2792,8 +2792,8 @@ export var GridLayoutWithPisellFindInToolBar = {
|
|
|
2792
2792
|
}
|
|
2793
2793
|
};
|
|
2794
2794
|
|
|
2795
|
-
/**
|
|
2796
|
-
* Grid 布局 - ToolBar 内 PisellFind 透传(toolBar.search: { triggerType: 'input' })
|
|
2795
|
+
/**
|
|
2796
|
+
* Grid 布局 - ToolBar 内 PisellFind 透传(toolBar.search: { triggerType: 'input' })
|
|
2797
2797
|
*/
|
|
2798
2798
|
export var GridLayoutToolBarSearchInput = {
|
|
2799
2799
|
render: function GridLayoutToolBarSearchInputRender() {
|
|
@@ -2877,8 +2877,8 @@ export var GridLayoutToolBarSearchInput = {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
};
|
|
2879
2879
|
|
|
2880
|
-
/**
|
|
2881
|
-
* Grid 布局 - 完整示例(表格 + 多选 + BatchActionBar 批量操作)
|
|
2880
|
+
/**
|
|
2881
|
+
* Grid 布局 - 完整示例(表格 + 多选 + BatchActionBar 批量操作)
|
|
2882
2882
|
*/
|
|
2883
2883
|
export var GridLayoutFull = {
|
|
2884
2884
|
parameters: {
|
|
@@ -2982,8 +2982,8 @@ export var GridLayoutFull = {
|
|
|
2982
2982
|
}
|
|
2983
2983
|
};
|
|
2984
2984
|
|
|
2985
|
-
/**
|
|
2986
|
-
* 占位 / 设计态(不传 value,无数据源)
|
|
2985
|
+
/**
|
|
2986
|
+
* 占位 / 设计态(不传 value,无数据源)
|
|
2987
2987
|
*/
|
|
2988
2988
|
export var Placeholder = {
|
|
2989
2989
|
parameters: {
|
|
@@ -3006,8 +3006,8 @@ export var Placeholder = {
|
|
|
3006
3006
|
}
|
|
3007
3007
|
};
|
|
3008
3008
|
|
|
3009
|
-
/**
|
|
3010
|
-
* Card 布局占位
|
|
3009
|
+
/**
|
|
3010
|
+
* Card 布局占位
|
|
3011
3011
|
*/
|
|
3012
3012
|
export var CardLayoutPlaceholder = {
|
|
3013
3013
|
parameters: {
|
|
@@ -3031,8 +3031,8 @@ export var CardLayoutPlaceholder = {
|
|
|
3031
3031
|
}
|
|
3032
3032
|
};
|
|
3033
3033
|
|
|
3034
|
-
/**
|
|
3035
|
-
* 自定义组合:单独挂 ToolBar / BatchActionBar / Grid / Pagination
|
|
3034
|
+
/**
|
|
3035
|
+
* 自定义组合:单独挂 ToolBar / BatchActionBar / Grid / Pagination
|
|
3036
3036
|
*/
|
|
3037
3037
|
export var CustomComposition = {
|
|
3038
3038
|
parameters: {
|
|
@@ -3120,8 +3120,8 @@ export var CustomComposition = {
|
|
|
3120
3120
|
}
|
|
3121
3121
|
};
|
|
3122
3122
|
|
|
3123
|
-
/**
|
|
3124
|
-
* 使用 PisellFind 搜索槽:Search(PisellFind)+ ToolBar + Grid + Pagination
|
|
3123
|
+
/**
|
|
3124
|
+
* 使用 PisellFind 搜索槽:Search(PisellFind)+ ToolBar + Grid + Pagination
|
|
3125
3125
|
*/
|
|
3126
3126
|
export var WithPisellFindSearch = {
|
|
3127
3127
|
render: function WithPisellFindSearchRender() {
|
|
@@ -3210,8 +3210,8 @@ export var WithPisellFindSearch = {
|
|
|
3210
3210
|
}
|
|
3211
3211
|
};
|
|
3212
3212
|
|
|
3213
|
-
/**
|
|
3214
|
-
* 仅 Search + Grid + 分页(无 ToolBar)
|
|
3213
|
+
/**
|
|
3214
|
+
* 仅 Search + Grid + 分页(无 ToolBar)
|
|
3215
3215
|
*/
|
|
3216
3216
|
export var SearchAndGridOnly = {
|
|
3217
3217
|
render: function SearchAndGridOnlyRender() {
|
|
@@ -61,10 +61,10 @@ function getDefaultFilterValue() {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* RecordBoard 下的工具栏:使用 PisellToolBar。
|
|
66
|
-
* 左侧默认 PisellFind(inline);右侧默认 PisellFilter。通过 childComponentProps.toolBar.search / toolBar.filter 为对象时透传对应组件 props,为 false 时不渲染。
|
|
67
|
-
* 可透传 topLeft、topRight、bottomLeft、bottomRight、tabs。
|
|
64
|
+
/**
|
|
65
|
+
* RecordBoard 下的工具栏:使用 PisellToolBar。
|
|
66
|
+
* 左侧默认 PisellFind(inline);右侧默认 PisellFilter。通过 childComponentProps.toolBar.search / toolBar.filter 为对象时透传对应组件 props,为 false 时不渲染。
|
|
67
|
+
* 可透传 topLeft、topRight、bottomLeft、bottomRight、tabs。
|
|
68
68
|
*/
|
|
69
69
|
var RecordBoardToolBar = function RecordBoardToolBar(props) {
|
|
70
70
|
var _shellMeta$hasGridCon, _shellMeta$hasFloorMa, _shellMeta$effectiveF, _ctx$childComponentPr, _ctx$childComponentPr2, _searchParams$DEFAULT, _ctx$childComponentPr3, _formFiltersPrefix, _size, _filterResetKey;
|
|
@@ -67,7 +67,7 @@ var FILL_HEIGHT_WRAPPER_STYLE = {
|
|
|
67
67
|
* 仅表格侧、仅平面图侧、或双视图(出现 Segmented 切换)由子节点组合决定。根级 `floorMap` props 仍支持(如低代码透传),与 FloorMap 子组件 props 合并,**子组件优先**。
|
|
68
68
|
*/
|
|
69
69
|
var RecordBoardShellFrame = function RecordBoardShellFrame(_ref2) {
|
|
70
|
-
var _effectiveFloorMapPro, _effectiveFloorMapPro2, _effectiveFloorMapPro3, _ctx$setScrollAreaHei, _ctx$childComponentPr;
|
|
70
|
+
var _ctx$floorMapLayoutRe, _effectiveFloorMapPro, _effectiveFloorMapPro2, _effectiveFloorMapPro3, _ctx$setScrollAreaHei, _ctx$childComponentPr;
|
|
71
71
|
var children = _ref2.children,
|
|
72
72
|
className = _ref2.className,
|
|
73
73
|
style = _ref2.style;
|
|
@@ -143,7 +143,9 @@ var RecordBoardShellFrame = function RecordBoardShellFrame(_ref2) {
|
|
|
143
143
|
}
|
|
144
144
|
}, /*#__PURE__*/React.createElement(FloorMapLayoutProvider, {
|
|
145
145
|
value: floorMapLayoutProviderValue
|
|
146
|
-
}, /*#__PURE__*/React.createElement(PisellFloorMapLayout, _extends({
|
|
146
|
+
}, /*#__PURE__*/React.createElement(PisellFloorMapLayout, _extends({
|
|
147
|
+
ref: (_ctx$floorMapLayoutRe = ctx.floorMapLayoutRef) !== null && _ctx$floorMapLayoutRe !== void 0 ? _ctx$floorMapLayoutRe : undefined
|
|
148
|
+
}, effectiveFloorMapProps, mergedFloorMapDataSources !== undefined ? {
|
|
147
149
|
dataSources: mergedFloorMapDataSources
|
|
148
150
|
} : {}, {
|
|
149
151
|
items: (_effectiveFloorMapPro = effectiveFloorMapProps.items) !== null && _effectiveFloorMapPro !== void 0 ? _effectiveFloorMapPro : [],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode, Key, ComponentType } from 'react';
|
|
2
|
-
import type { PisellFloorMapLayoutProps, FloorMapDataSources, FloorMapLayoutContextValue } from '../pisellFloorMapLayout/types';
|
|
1
|
+
import type { ReactNode, Key, ComponentType, Ref } from 'react';
|
|
2
|
+
import type { PisellFloorMapLayoutProps, PisellFloorMapLayoutRef, FloorMapDataSources, FloorMapLayoutContextValue } from '../pisellFloorMapLayout/types';
|
|
3
3
|
import type { TableProps } from 'antd';
|
|
4
4
|
/**
|
|
5
5
|
* 布局类型:一种 layout 对应一种「视图的集合」
|
|
@@ -202,6 +202,8 @@ export interface RecordBoardContextValue {
|
|
|
202
202
|
floorMapLayoutContext?: FloorMapLayoutContextValue;
|
|
203
203
|
/** 双视图并存时首屏偏好(根 props,与 PisellRecordBoard.defaultBodyView 一致) */
|
|
204
204
|
defaultBodyView?: RecordBoardBodyView;
|
|
205
|
+
/** 挂到 ShellFrame 内 PisellFloorMapLayout,供外部 imperative 调用(如 saveLayout / fitBounds) */
|
|
206
|
+
floorMapLayoutRef?: Ref<PisellFloorMapLayoutRef | null>;
|
|
205
207
|
}
|
|
206
208
|
/**
|
|
207
209
|
* 各 layout 下子组件的可选透传配置(类似 ChildComponentProps)
|
|
@@ -364,6 +366,10 @@ export interface RecordBoardProps {
|
|
|
364
366
|
* 仅声明 FloorMap 而无 Grid/Card 内容时由 ShellFrame 固定为平面图,不出现切换器。
|
|
365
367
|
*/
|
|
366
368
|
defaultBodyView?: RecordBoardBodyView;
|
|
369
|
+
/** 与 bodyView 同步持久化到 localStorage 的 key(双视图时生效) */
|
|
370
|
+
bodyViewStorageKey?: string;
|
|
371
|
+
/** 平面图 Layout 实例 ref,由 ShellFrame 注入 */
|
|
372
|
+
floorMapLayoutRef?: Ref<PisellFloorMapLayoutRef | null>;
|
|
367
373
|
/** 其他 */
|
|
368
374
|
[key: string]: any;
|
|
369
375
|
}
|
|
@@ -14,7 +14,7 @@ import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react'
|
|
|
14
14
|
import dayjs from 'dayjs';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import PisellScrollView from "../PisellScrollView";
|
|
17
|
-
import { parseValue, getRangeBounds, snapToStepMinutes, isInDisabledRanges as checkDisabledRanges } from "./utils";
|
|
17
|
+
import { parseValue, getRangeBounds, snapToStepMinutes, isInDisabledRanges as checkDisabledRanges, getHorizontalAxisSlotCount } from "./utils";
|
|
18
18
|
import { useTimeAxis, useRealtime, useDragInertia } from "./hooks";
|
|
19
19
|
import { BackgroundLayer, CursorLayer, GestureLayer, NowButton, ScaleLayer } from "./components";
|
|
20
20
|
import { locales } from '@pisell/utils';
|
|
@@ -22,10 +22,16 @@ import pisellTimeNavigatorLocales from "./locales";
|
|
|
22
22
|
import "./PisellTimeNavigator.less";
|
|
23
23
|
import useEngineContext from "../../hooks/useEngineContext";
|
|
24
24
|
|
|
25
|
-
/** 横向每格宽度(px),Figma 约 82 */
|
|
25
|
+
/** 横向每格宽度(px),Figma 约 82;axis-moves 固定用此值,cursor-moves 时按视口压缩以看全 range */
|
|
26
26
|
var CELL_SIZE_H = 82;
|
|
27
27
|
/** 竖向每格高度(px) */
|
|
28
28
|
var CELL_SIZE_V = 20;
|
|
29
|
+
/** 横向「Now」按钮占位,避免刻度被挡 */
|
|
30
|
+
var CURSOR_MOVES_NOW_RESERVE_PX = 56;
|
|
31
|
+
/** cursor-moves 横向:轴与视口左右边距 */
|
|
32
|
+
var CURSOR_MOVES_H_PADDING_PX = 8;
|
|
33
|
+
/** cursor-moves 横向:每格最小宽度(再小刻度不可读) */
|
|
34
|
+
var CURSOR_MOVES_MIN_CELL_PX = 8;
|
|
29
35
|
|
|
30
36
|
/**
|
|
31
37
|
* PisellTimeNavigator:可拖动的时间导航轴,时间范围内浏览、选择、控制
|
|
@@ -67,7 +73,8 @@ export function PisellTimeNavigator(props) {
|
|
|
67
73
|
locale = props.locale,
|
|
68
74
|
_props$timeFormat = props.timeFormat,
|
|
69
75
|
timeFormat = _props$timeFormat === void 0 ? 'HH:mm' : _props$timeFormat,
|
|
70
|
-
renderNowButton = props.renderNowButton
|
|
76
|
+
renderNowButton = props.renderNowButton,
|
|
77
|
+
onUserInteraction = props.onUserInteraction;
|
|
71
78
|
var context = useEngineContext();
|
|
72
79
|
locales.init(pisellTimeNavigatorLocales, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
|
|
73
80
|
|
|
@@ -81,7 +88,53 @@ export function PisellTimeNavigator(props) {
|
|
|
81
88
|
}, [referenceDateProp]);
|
|
82
89
|
var referenceDate = referenceDateFromProp !== null && referenceDateFromProp !== void 0 ? referenceDateFromProp : dayjs().startOf('day');
|
|
83
90
|
var isHorizontal = orientation === 'horizontal';
|
|
84
|
-
var
|
|
91
|
+
var isAxisMoves = cursorMode === 'axis-moves';
|
|
92
|
+
var _useState = useState({
|
|
93
|
+
w: 0,
|
|
94
|
+
h: 0
|
|
95
|
+
}),
|
|
96
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
97
|
+
viewportSize = _useState2[0],
|
|
98
|
+
setViewportSize = _useState2[1];
|
|
99
|
+
|
|
100
|
+
/** 挂载和视口变化时同步尺寸(需在 cellSize 计算之前声明 state) */
|
|
101
|
+
var viewportWrapRef = useRef(null);
|
|
102
|
+
useEffect(function () {
|
|
103
|
+
var el = viewportWrapRef.current;
|
|
104
|
+
if (!el) return;
|
|
105
|
+
var setSize = function setSize() {
|
|
106
|
+
var w = el.clientWidth;
|
|
107
|
+
var h = el.clientHeight;
|
|
108
|
+
setViewportSize(function (prev) {
|
|
109
|
+
return prev.w === w && prev.h === h ? prev : {
|
|
110
|
+
w: w,
|
|
111
|
+
h: h
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
setSize();
|
|
116
|
+
var ro = new ResizeObserver(setSize);
|
|
117
|
+
ro.observe(el);
|
|
118
|
+
return function () {
|
|
119
|
+
return ro.disconnect();
|
|
120
|
+
};
|
|
121
|
+
}, []);
|
|
122
|
+
var horizontalSlotCount = useMemo(function () {
|
|
123
|
+
return isHorizontal ? getHorizontalAxisSlotCount(range, referenceDate, stepMinutes) : 0;
|
|
124
|
+
}, [isHorizontal, range === null || range === void 0 ? void 0 : range.start, range === null || range === void 0 ? void 0 : range.end, referenceDate, stepMinutes]);
|
|
125
|
+
|
|
126
|
+
/** cursor-moves + 横向:整段 range 压进一条可视区域,等比例缩小格宽 */
|
|
127
|
+
var cellSizePx = useMemo(function () {
|
|
128
|
+
if (!isHorizontal) return CELL_SIZE_V;
|
|
129
|
+
if (isAxisMoves) return CELL_SIZE_H;
|
|
130
|
+
var n = horizontalSlotCount;
|
|
131
|
+
if (n <= 0) return CELL_SIZE_H;
|
|
132
|
+
var vpW = Math.max(1, viewportSize.w || 400);
|
|
133
|
+
var reserve = showNowButton ? CURSOR_MOVES_NOW_RESERVE_PX : 0;
|
|
134
|
+
var usable = Math.max(40, vpW - reserve - CURSOR_MOVES_H_PADDING_PX * 2);
|
|
135
|
+
var raw = Math.floor(usable / n);
|
|
136
|
+
return Math.max(CURSOR_MOVES_MIN_CELL_PX, Math.min(CELL_SIZE_H, raw));
|
|
137
|
+
}, [isHorizontal, isAxisMoves, horizontalSlotCount, viewportSize.w, showNowButton]);
|
|
85
138
|
var axis = useTimeAxis({
|
|
86
139
|
range: range,
|
|
87
140
|
stepMinutes: stepMinutes,
|
|
@@ -90,37 +143,29 @@ export function PisellTimeNavigator(props) {
|
|
|
90
143
|
cellSizePx: cellSizePx
|
|
91
144
|
});
|
|
92
145
|
var isControlled = valueProp !== undefined;
|
|
93
|
-
var
|
|
146
|
+
var _useState3 = useState(function () {
|
|
94
147
|
var v = valueProp !== null && valueProp !== void 0 ? valueProp : defaultValue;
|
|
95
148
|
return parseValue(v, referenceDate);
|
|
96
149
|
}),
|
|
97
|
-
|
|
98
|
-
internalValue =
|
|
99
|
-
setInternalValue =
|
|
150
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
151
|
+
internalValue = _useState4[0],
|
|
152
|
+
setInternalValue = _useState4[1];
|
|
100
153
|
var value = isControlled ? valueProp != null ? parseValue(valueProp, referenceDate) : null : internalValue;
|
|
101
154
|
var effectiveValue = value !== null && value !== void 0 ? value : axis.rangeStart;
|
|
102
155
|
var scrollRef = useRef(null);
|
|
103
|
-
var viewportWrapRef = useRef(null);
|
|
104
156
|
/** 标记当前是否为「程序性滚动到中心」:其触发的 onScrollEnd 不再做时间判定 */
|
|
105
157
|
var scrollToCenterInProgressRef = useRef(false);
|
|
106
158
|
/** 标记 value 是否由滚动/松手更新:若是则不再根据 value 做「滚动到中心」 */
|
|
107
159
|
var valueUpdatedByScrollRef = useRef(false);
|
|
108
160
|
/** 手指是否仍按在滚动区域上;仅当完全松手后才执行吸附 */
|
|
109
161
|
var isPointerDownRef = useRef(false);
|
|
110
|
-
var
|
|
162
|
+
var _useState5 = useState({
|
|
111
163
|
scrollLeft: 0,
|
|
112
164
|
scrollTop: 0
|
|
113
165
|
}),
|
|
114
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
115
|
-
scrollPosition = _useState4[0],
|
|
116
|
-
setScrollPosition = _useState4[1];
|
|
117
|
-
var _useState5 = useState({
|
|
118
|
-
w: 0,
|
|
119
|
-
h: 0
|
|
120
|
-
}),
|
|
121
166
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
122
|
-
|
|
123
|
-
|
|
167
|
+
scrollPosition = _useState6[0],
|
|
168
|
+
setScrollPosition = _useState6[1];
|
|
124
169
|
/** 每分钟更新一次,使当前时间线/渐变块随真实时间移动 */
|
|
125
170
|
var _useState7 = useState(0),
|
|
126
171
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
@@ -135,33 +180,17 @@ export function PisellTimeNavigator(props) {
|
|
|
135
180
|
return clearInterval(id);
|
|
136
181
|
};
|
|
137
182
|
}, []);
|
|
138
|
-
|
|
183
|
+
|
|
184
|
+
/** cursor-moves:拖指针时禁止程序性滚动抢焦点 */
|
|
185
|
+
var cursorDragActiveRef = useRef(false);
|
|
186
|
+
var cursorDragBaseRef = useRef({
|
|
187
|
+
startClient: 0,
|
|
188
|
+
startOffset: 0
|
|
189
|
+
});
|
|
139
190
|
var getScrollContainer = useCallback(function () {
|
|
140
191
|
var _scrollRef$current$ge, _scrollRef$current, _scrollRef$current$ge2;
|
|
141
192
|
return (_scrollRef$current$ge = (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 || (_scrollRef$current$ge2 = _scrollRef$current.getScrollContainer) === null || _scrollRef$current$ge2 === void 0 ? void 0 : _scrollRef$current$ge2.call(_scrollRef$current)) !== null && _scrollRef$current$ge !== void 0 ? _scrollRef$current$ge : null;
|
|
142
193
|
}, []);
|
|
143
|
-
|
|
144
|
-
/** 挂载和视口变化时同步尺寸,保证两端半屏留白从首帧就正确 */
|
|
145
|
-
useEffect(function () {
|
|
146
|
-
var el = viewportWrapRef.current;
|
|
147
|
-
if (!el) return;
|
|
148
|
-
var setSize = function setSize() {
|
|
149
|
-
var w = el.clientWidth;
|
|
150
|
-
var h = el.clientHeight;
|
|
151
|
-
setViewportSize(function (prev) {
|
|
152
|
-
return prev.w === w && prev.h === h ? prev : {
|
|
153
|
-
w: w,
|
|
154
|
-
h: h
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
setSize();
|
|
159
|
-
var ro = new ResizeObserver(setSize);
|
|
160
|
-
ro.observe(el);
|
|
161
|
-
return function () {
|
|
162
|
-
return ro.disconnect();
|
|
163
|
-
};
|
|
164
|
-
}, []);
|
|
165
194
|
var inertiaHandlers = useDragInertia({
|
|
166
195
|
enabled: inertia && !userInteractionLocked,
|
|
167
196
|
orientation: orientation,
|
|
@@ -175,7 +204,8 @@ export function PisellTimeNavigator(props) {
|
|
|
175
204
|
var halfViewportW = effectiveViewportW / 2;
|
|
176
205
|
var halfViewportH = effectiveViewportH / 2;
|
|
177
206
|
var dotOffsetPx = isHorizontal ? cellSizePx / 2 : 0;
|
|
178
|
-
|
|
207
|
+
/** cursor-moves 横向:左右小边距,整轴落在视口内;axis-moves 保持半屏留白可滚动 */
|
|
208
|
+
var axisStartMarginW = isHorizontal && !isAxisMoves ? CURSOR_MOVES_H_PADDING_PX : Math.max(0, halfViewportW - dotOffsetPx);
|
|
179
209
|
var axisStartMarginH = Math.max(0, halfViewportH - dotOffsetPx);
|
|
180
210
|
|
|
181
211
|
/** 拖动中:用连续映射按 1 分钟步长显示时间(不吸附到 stepMinutes) */
|
|
@@ -305,12 +335,25 @@ export function PisellTimeNavigator(props) {
|
|
|
305
335
|
var verticalWrapHeight = axisStartMarginH + axis.totalLengthPx + verticalTailPx;
|
|
306
336
|
var maxScrollPx = isHorizontal ? Math.max(0, axis.totalLengthPx - cellSizePx) : Math.max(0, verticalWrapHeight - effectiveViewportH);
|
|
307
337
|
useEffect(function () {
|
|
308
|
-
var _scrollRef$
|
|
338
|
+
var _scrollRef$current4, _scrollRef$current4$g;
|
|
339
|
+
/** 横向 cursor-moves:整段 range 已压进视口,禁止程序性横滚 */
|
|
340
|
+
if (!isAxisMoves && isHorizontal) {
|
|
341
|
+
var _scrollRef$current3, _scrollRef$current3$g;
|
|
342
|
+
var _container = (_scrollRef$current3 = scrollRef.current) === null || _scrollRef$current3 === void 0 || (_scrollRef$current3$g = _scrollRef$current3.getScrollContainer) === null || _scrollRef$current3$g === void 0 ? void 0 : _scrollRef$current3$g.call(_scrollRef$current3);
|
|
343
|
+
if (_container && _container.scrollLeft !== 0) {
|
|
344
|
+
_container.scrollTo({
|
|
345
|
+
left: 0,
|
|
346
|
+
behavior: 'auto'
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
if (!isAxisMoves && cursorDragActiveRef.current) return;
|
|
309
352
|
if (valueUpdatedByScrollRef.current) {
|
|
310
353
|
valueUpdatedByScrollRef.current = false;
|
|
311
354
|
return;
|
|
312
355
|
}
|
|
313
|
-
var container = (_scrollRef$
|
|
356
|
+
var container = (_scrollRef$current4 = scrollRef.current) === null || _scrollRef$current4 === void 0 || (_scrollRef$current4$g = _scrollRef$current4.getScrollContainer) === null || _scrollRef$current4$g === void 0 ? void 0 : _scrollRef$current4$g.call(_scrollRef$current4);
|
|
314
357
|
if (!container) return;
|
|
315
358
|
var viewportPx = isHorizontal ? container.clientWidth : container.clientHeight;
|
|
316
359
|
var targetScroll = hasScrollPadding ? Math.max(0, Math.min(cursorOffsetPx - dotOffsetPx, maxScrollPx)) : Math.max(0, Math.min(cursorOffsetPx - viewportPx / 2, Math.max(0, axis.totalLengthPx - viewportPx)));
|
|
@@ -328,7 +371,7 @@ export function PisellTimeNavigator(props) {
|
|
|
328
371
|
behavior: 'smooth'
|
|
329
372
|
});
|
|
330
373
|
}
|
|
331
|
-
}, [effectiveValue.valueOf(), isHorizontal, cursorOffsetPx, maxScrollPx, hasScrollPadding, dotOffsetPx, cellSizePx, axis.totalLengthPx]);
|
|
374
|
+
}, [effectiveValue.valueOf(), isHorizontal, cursorOffsetPx, maxScrollPx, hasScrollPadding, dotOffsetPx, cellSizePx, axis.totalLengthPx, isAxisMoves]);
|
|
332
375
|
var scrollToCenterTime = useCallback(function (t) {
|
|
333
376
|
var container = getScrollContainer();
|
|
334
377
|
if (!container) return;
|
|
@@ -359,6 +402,50 @@ export function PisellTimeNavigator(props) {
|
|
|
359
402
|
var clamped = wall.isBefore(rangeStart) ? rangeStart : wall.isAfter(rangeEnd) ? rangeEnd : wall;
|
|
360
403
|
handleChange(clamped);
|
|
361
404
|
}, [range, referenceDate, handleChange]);
|
|
405
|
+
var applyOffsetToNavigatorValue = useCallback(function (offsetPx, snap) {
|
|
406
|
+
var maxO = Math.max(0, axis.totalLengthPx - 0.001);
|
|
407
|
+
var nextOff = Math.max(0, Math.min(offsetPx, maxO));
|
|
408
|
+
var t = axis.offsetToTimeContinuous(nextOff);
|
|
409
|
+
if (!t) return;
|
|
410
|
+
var out = snap ? snapToStep ? snapToStepMinutes(t, stepMinutes) : t.startOf('minute') : t.startOf('minute');
|
|
411
|
+
if (checkDisabledRanges(out, disabledRanges)) return;
|
|
412
|
+
if (!isControlled) setInternalValue(out);
|
|
413
|
+
onChange === null || onChange === void 0 || onChange(out);
|
|
414
|
+
}, [axis.totalLengthPx, axis.offsetToTimeContinuous, snapToStep, stepMinutes, disabledRanges, isControlled, onChange]);
|
|
415
|
+
var handleCursorDragPointerDown = useCallback(function (e) {
|
|
416
|
+
if (userInteractionLocked || isAxisMoves) return;
|
|
417
|
+
e.preventDefault();
|
|
418
|
+
e.stopPropagation();
|
|
419
|
+
onUserInteraction === null || onUserInteraction === void 0 || onUserInteraction();
|
|
420
|
+
cursorDragActiveRef.current = true;
|
|
421
|
+
cursorDragBaseRef.current = {
|
|
422
|
+
startClient: isHorizontal ? e.clientX : e.clientY,
|
|
423
|
+
startOffset: cursorOffsetPx
|
|
424
|
+
};
|
|
425
|
+
valueUpdatedByScrollRef.current = true;
|
|
426
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
427
|
+
}, [userInteractionLocked, isAxisMoves, isHorizontal, cursorOffsetPx, onUserInteraction]);
|
|
428
|
+
var handleCursorDragPointerMove = useCallback(function (e) {
|
|
429
|
+
if (!cursorDragActiveRef.current) return;
|
|
430
|
+
var client = isHorizontal ? e.clientX : e.clientY;
|
|
431
|
+
var delta = client - cursorDragBaseRef.current.startClient;
|
|
432
|
+
var nextOff = cursorDragBaseRef.current.startOffset + delta;
|
|
433
|
+
applyOffsetToNavigatorValue(nextOff, false);
|
|
434
|
+
}, [isHorizontal, applyOffsetToNavigatorValue]);
|
|
435
|
+
var handleCursorDragPointerUp = useCallback(function (e) {
|
|
436
|
+
if (!cursorDragActiveRef.current) return;
|
|
437
|
+
cursorDragActiveRef.current = false;
|
|
438
|
+
try {
|
|
439
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
440
|
+
} catch (_unused) {
|
|
441
|
+
/* already released */
|
|
442
|
+
}
|
|
443
|
+
var client = isHorizontal ? e.clientX : e.clientY;
|
|
444
|
+
var delta = client - cursorDragBaseRef.current.startClient;
|
|
445
|
+
var nextOff = cursorDragBaseRef.current.startOffset + delta;
|
|
446
|
+
valueUpdatedByScrollRef.current = false;
|
|
447
|
+
applyOffsetToNavigatorValue(nextOff, true);
|
|
448
|
+
}, [isHorizontal, applyOffsetToNavigatorValue]);
|
|
362
449
|
var businessHoursPx = useMemo(function () {
|
|
363
450
|
if (!businessHours) return undefined;
|
|
364
451
|
var _getRangeBounds5 = getRangeBounds(businessHours, referenceDate),
|
|
@@ -425,15 +512,19 @@ export function PisellTimeNavigator(props) {
|
|
|
425
512
|
snapFn: snapFn,
|
|
426
513
|
scrollPosition: scrollPosition,
|
|
427
514
|
viewportSize: viewportSize,
|
|
515
|
+
onUserInteraction: onUserInteraction,
|
|
428
516
|
onPointerDown: inertiaHandlers.onPointerDown,
|
|
429
517
|
onPointerMove: inertiaHandlers.onPointerMove,
|
|
430
518
|
onPointerUp: inertiaHandlers.onPointerUp,
|
|
431
519
|
onPointerLeave: inertiaHandlers.onPointerUp
|
|
432
520
|
}, /*#__PURE__*/React.createElement("div", {
|
|
433
521
|
className: "pisell-time-navigator-axis-wrap",
|
|
434
|
-
style: isHorizontal ? {
|
|
522
|
+
style: isHorizontal ? isAxisMoves ? {
|
|
435
523
|
width: axis.totalLengthPx + (effectiveViewportW - cellSizePx),
|
|
436
524
|
minHeight: 48
|
|
525
|
+
} : {
|
|
526
|
+
width: CURSOR_MOVES_H_PADDING_PX + axis.totalLengthPx + CURSOR_MOVES_H_PADDING_PX,
|
|
527
|
+
minHeight: 48
|
|
437
528
|
} : {
|
|
438
529
|
width: '100%'
|
|
439
530
|
/* 不设 height,由轴(marginTop + 内容 + marginBottom)自然撑开,避免固定高度与 margin 的 CSS 盒模型歧义 */
|
|
@@ -441,9 +532,9 @@ export function PisellTimeNavigator(props) {
|
|
|
441
532
|
}, isHorizontal && currentTimeOffsetPx != null && currentTimeOffsetPx >= 0 && /*#__PURE__*/React.createElement("div", {
|
|
442
533
|
className: "pisell-time-navigator-current-gradient pisell-time-navigator-current-gradient--horizontal",
|
|
443
534
|
style: {
|
|
444
|
-
left: axisStartMarginW + Math.max(0, currentTimeOffsetPx -
|
|
535
|
+
left: axisStartMarginW + Math.max(0, currentTimeOffsetPx - cellSizePx),
|
|
445
536
|
top: 0,
|
|
446
|
-
width: Math.min(
|
|
537
|
+
width: Math.min(cellSizePx, currentTimeOffsetPx),
|
|
447
538
|
height: 48
|
|
448
539
|
},
|
|
449
540
|
"aria-hidden": true
|
|
@@ -471,7 +562,8 @@ export function PisellTimeNavigator(props) {
|
|
|
471
562
|
majorStepMinutes: majorStepMinutes,
|
|
472
563
|
timeFormat: timeFormat,
|
|
473
564
|
locale: locale,
|
|
474
|
-
style: scaleStyle
|
|
565
|
+
style: scaleStyle,
|
|
566
|
+
horizontalCellSizePx: isHorizontal ? cellSizePx : undefined
|
|
475
567
|
}), !isHorizontal && currentTimeOffsetPx != null && currentTimeOffsetPx >= 0 && /*#__PURE__*/React.createElement("div", {
|
|
476
568
|
className: "pisell-time-navigator-current-line",
|
|
477
569
|
style: {
|
|
@@ -489,7 +581,12 @@ export function PisellTimeNavigator(props) {
|
|
|
489
581
|
locale: locale,
|
|
490
582
|
isRealtime: realtime,
|
|
491
583
|
offsetPx: cursorOffsetPx,
|
|
492
|
-
style: cursorStyle
|
|
584
|
+
style: cursorStyle,
|
|
585
|
+
dragInteractive: !userInteractionLocked,
|
|
586
|
+
onDragPointerDown: handleCursorDragPointerDown,
|
|
587
|
+
onDragPointerMove: handleCursorDragPointerMove,
|
|
588
|
+
onDragPointerUp: handleCursorDragPointerUp,
|
|
589
|
+
onDragPointerCancel: handleCursorDragPointerUp
|
|
493
590
|
})))))), isAxisMoves && /*#__PURE__*/React.createElement("div", {
|
|
494
591
|
className: classNames('pisell-time-navigator-cursor-fixed', "pisell-time-navigator-cursor-fixed--".concat(orientation)),
|
|
495
592
|
"aria-hidden": true
|