@pisell/materials 6.11.36 → 6.11.38
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 +26 -56
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +26 -56
- package/es/components/PisellLayouts/index.d.ts +1 -1
- package/es/components/colorPicker/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +6 -6
- package/es/components/filter/components/items/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/es/components/filter/components/items/text/index.d.ts +0 -1
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +2 -1
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +47 -3
- package/es/components/pisellFloorMapLayout/types.d.ts +7 -7
- package/es/components/pisellFloorMapLayout/types.js +2 -2
- package/es/components/pisellRecordBoard/index.d.ts +1 -1
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +5 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.js +1039 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.less +323 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +5 -1
- package/es/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.js +10 -10
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +23 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.js +287 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.d.ts +4 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.js +28 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/calendarPersistGuard.d.ts +1 -1
- package/es/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +36 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.js +38 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/index.d.ts +3 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/index.js +3 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.d.ts +17 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.js +197 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +17 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.js +65 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.js +52 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.d.ts +10 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.js +58 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +232 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.js +735 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.d.ts +13 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.js +37 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +56 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.js +682 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +18 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +155 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +27 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.js +259 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.d.ts +12 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.js +19 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.d.ts +2 -1
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.js +44 -14
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.d.ts +4 -2
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.js +117 -125
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.d.ts +3 -5
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.js +71 -352
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.d.ts +17 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.js +143 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.d.ts +28 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.js +128 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewport.less +8 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.d.ts +18 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.js +115 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.d.ts +6 -4
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.js +63 -120
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.d.ts +2 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.js +2 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.d.ts +42 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.js +114 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.d.ts +26 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.js +54 -1
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +67 -12
- package/es/components/pisellRecordBoard/shellFrame/index.js +34 -7
- package/es/components/pisellRecordBoard/types.d.ts +97 -4
- package/es/components/pisellRecordBoard/types.js +18 -2
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +34 -2
- package/es/components/pisellShellFrame/PisellShellFrame.less +5 -2
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/es/hooks/useResponsive.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/locales/en-US.d.ts +74 -0
- package/es/locales/en-US.js +76 -1
- package/es/locales/ja.d.ts +74 -0
- package/es/locales/ja.js +75 -0
- package/es/locales/pt.d.ts +74 -0
- package/es/locales/pt.js +75 -0
- package/es/locales/zh-CN.d.ts +74 -0
- package/es/locales/zh-CN.js +76 -1
- package/es/locales/zh-TW.d.ts +74 -0
- package/es/locales/zh-TW.js +76 -1
- package/es/pisell-materials.tw.css +1 -1
- package/lib/components/PisellLayouts/index.d.ts +1 -1
- package/lib/components/colorPicker/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +6 -6
- package/lib/components/filter/components/items/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/index.d.ts +0 -1
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +2 -1
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +1 -1
- package/lib/components/pisellFloorMapLayout/types.d.ts +7 -7
- package/lib/components/pisellRecordBoard/index.d.ts +1 -1
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +5 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.js +892 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.less +323 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +5 -1
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.js +7 -6
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +23 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.js +268 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.d.ts +4 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.js +53 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/calendarPersistGuard.d.ts +1 -1
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +36 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.js +98 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/index.d.ts +3 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.d.ts +17 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.js +306 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +17 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.js +111 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.js +96 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.d.ts +10 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.js +92 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +232 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.js +666 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.d.ts +13 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.js +90 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +56 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.js +812 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +18 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +219 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +27 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.js +352 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.d.ts +12 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.js +57 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.d.ts +2 -1
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.js +44 -9
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.d.ts +4 -2
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.js +60 -142
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.d.ts +3 -5
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.js +40 -269
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.d.ts +17 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.js +163 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.d.ts +28 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.js +136 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewport.less +8 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.d.ts +18 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.js +175 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.d.ts +6 -4
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.js +61 -88
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.d.ts +2 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.js +29 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.d.ts +42 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.js +139 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.d.ts +26 -0
- package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.js +31 -3
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +50 -5
- package/lib/components/pisellRecordBoard/shellFrame/index.js +29 -13
- package/lib/components/pisellRecordBoard/types.d.ts +97 -4
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +34 -2
- package/lib/components/pisellShellFrame/PisellShellFrame.less +5 -2
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/lib/hooks/useResponsive.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/locales/en-US.d.ts +74 -0
- package/lib/locales/en-US.js +76 -1
- package/lib/locales/ja.d.ts +74 -0
- package/lib/locales/ja.js +75 -0
- package/lib/locales/pt.d.ts +74 -0
- package/lib/locales/pt.js +75 -0
- package/lib/locales/zh-CN.d.ts +74 -0
- package/lib/locales/zh-CN.js +76 -1
- package/lib/locales/zh-TW.d.ts +74 -0
- package/lib/locales/zh-TW.js +76 -1
- package/lib/pisell-materials.tw.css +1 -1
- package/package.json +3 -4
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.d.ts +0 -3
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.js +0 -6233
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.d.ts +0 -3
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.js +0 -7079
|
@@ -1,38 +1,15 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
14
8
|
import { getText } from "../../../../locales";
|
|
15
9
|
import { NoteTicker } from "./NoteTicker";
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function useVenueWallClockNow() {
|
|
20
|
-
var _useState = useState(function () {
|
|
21
|
-
return Date.now();
|
|
22
|
-
}),
|
|
23
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
-
now = _useState2[0],
|
|
25
|
-
setNow = _useState2[1];
|
|
26
|
-
useEffect(function () {
|
|
27
|
-
var id = window.setInterval(function () {
|
|
28
|
-
return setNow(Date.now());
|
|
29
|
-
}, 1000);
|
|
30
|
-
return function () {
|
|
31
|
-
return window.clearInterval(id);
|
|
32
|
-
};
|
|
33
|
-
}, []);
|
|
34
|
-
return now;
|
|
35
|
-
}
|
|
10
|
+
import { RESOURCE_WALL_NOTE_MARQUEE_MIN_CHARS } from "./resourceWallConstants";
|
|
11
|
+
import { buildVenueWallCardPresentation } from "./venueWallCardPresentation";
|
|
12
|
+
import { getVenueWallStatusToneMap, alphaColor, clamp } from "./venueWallUtils";
|
|
36
13
|
|
|
37
14
|
/**
|
|
38
15
|
* 将服务端给出的「整分钟」计数与收到时的墙钟对齐,随 `now` 递减;
|
|
@@ -41,15 +18,15 @@ function useVenueWallClockNow() {
|
|
|
41
18
|
*/
|
|
42
19
|
function useDriftMinutesFromEpoch(value, resourceId, now) {
|
|
43
20
|
var allowNegative = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
44
|
-
var
|
|
21
|
+
var _useState = useState(function () {
|
|
45
22
|
return {
|
|
46
23
|
min: value !== null && value !== void 0 ? value : 0,
|
|
47
24
|
at: Date.now()
|
|
48
25
|
};
|
|
49
26
|
}),
|
|
50
|
-
|
|
51
|
-
epoch =
|
|
52
|
-
setEpoch =
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
epoch = _useState2[0],
|
|
29
|
+
setEpoch = _useState2[1];
|
|
53
30
|
useEffect(function () {
|
|
54
31
|
setEpoch({
|
|
55
32
|
min: value !== null && value !== void 0 ? value : 0,
|
|
@@ -62,15 +39,15 @@ function useDriftMinutesFromEpoch(value, resourceId, now) {
|
|
|
62
39
|
|
|
63
40
|
/** `late` 等递增分钟:以收到时刻为锚,随 `now` 增长 */
|
|
64
41
|
function useDriftUpMinutesFromEpoch(value, resourceId, now) {
|
|
65
|
-
var
|
|
42
|
+
var _useState3 = useState(function () {
|
|
66
43
|
return {
|
|
67
44
|
min: value !== null && value !== void 0 ? value : 0,
|
|
68
45
|
at: Date.now()
|
|
69
46
|
};
|
|
70
47
|
}),
|
|
71
|
-
|
|
72
|
-
epoch =
|
|
73
|
-
setEpoch =
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
epoch = _useState4[0],
|
|
50
|
+
setEpoch = _useState4[1];
|
|
74
51
|
useEffect(function () {
|
|
75
52
|
setEpoch({
|
|
76
53
|
min: value !== null && value !== void 0 ? value : 0,
|
|
@@ -81,13 +58,10 @@ function useDriftUpMinutesFromEpoch(value, resourceId, now) {
|
|
|
81
58
|
}
|
|
82
59
|
var DEFAULT_OCCUPIED = '#6f4ae6';
|
|
83
60
|
var DEFAULT_AVAILABLE = '#10b981';
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* 单块场地大屏卡(由 test.tsx CardItem 迁移,样式为内联 + 少量类名,不依赖 Tailwind)。
|
|
87
|
-
*/
|
|
88
|
-
export var VenueWallCard = function VenueWallCard(_ref) {
|
|
89
|
-
var _toneMap$statusKey, _card$currentTime, _card$currentBooking, _card$nextList, _card$nextList$length, _card$nextList2, _nextItem$booking;
|
|
61
|
+
function VenueWallCardInner(_ref) {
|
|
62
|
+
var _card$nextList, _card$nextList$length, _card$nextList2, _nextItem$booking;
|
|
90
63
|
var card = _ref.card,
|
|
64
|
+
wallNowMs = _ref.wallNowMs,
|
|
91
65
|
_ref$boardingSoonBefo = _ref.boardingSoonBeforeMin,
|
|
92
66
|
boardingSoonBeforeMin = _ref$boardingSoonBefo === void 0 ? 10 : _ref$boardingSoonBefo,
|
|
93
67
|
_ref$occupiedCardColo = _ref.occupiedCardColor,
|
|
@@ -104,13 +78,13 @@ export var VenueWallCard = function VenueWallCard(_ref) {
|
|
|
104
78
|
var idleMain = isDark ? '#e2e8f0' : '#0f172a';
|
|
105
79
|
var idleSub = isDark ? '#94a3b8' : '#94a3b8';
|
|
106
80
|
var cardRef = useRef(null);
|
|
107
|
-
var
|
|
81
|
+
var _useState5 = useState({
|
|
108
82
|
width: 420,
|
|
109
83
|
height: 300
|
|
110
84
|
}),
|
|
111
|
-
|
|
112
|
-
cardSize =
|
|
113
|
-
setCardSize =
|
|
85
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
86
|
+
cardSize = _useState6[0],
|
|
87
|
+
setCardSize = _useState6[1];
|
|
114
88
|
useEffect(function () {
|
|
115
89
|
if (!cardRef.current) return;
|
|
116
90
|
var node = cardRef.current;
|
|
@@ -128,81 +102,46 @@ export var VenueWallCard = function VenueWallCard(_ref) {
|
|
|
128
102
|
return observer.disconnect();
|
|
129
103
|
};
|
|
130
104
|
}, []);
|
|
131
|
-
var
|
|
132
|
-
var
|
|
133
|
-
var
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
105
|
+
var liveRemainingMin = useDriftMinutesFromEpoch(card.remainingMin, card.resourceId, wallNowMs, true);
|
|
106
|
+
var liveStartsInMin = useDriftMinutesFromEpoch(card.startsInMin, card.resourceId, wallNowMs, false);
|
|
107
|
+
var liveLateMin = useDriftUpMinutesFromEpoch(card.lateMin, card.resourceId, wallNowMs);
|
|
108
|
+
var presentation = useMemo(function () {
|
|
109
|
+
return buildVenueWallCardPresentation({
|
|
110
|
+
card: card,
|
|
111
|
+
toneMap: toneMap,
|
|
112
|
+
liveRemainingMin: liveRemainingMin,
|
|
113
|
+
liveStartsInMin: liveStartsInMin,
|
|
114
|
+
liveLateMin: liveLateMin,
|
|
115
|
+
boardingSoonBeforeMin: boardingSoonBeforeMin,
|
|
116
|
+
idleMain: idleMain,
|
|
117
|
+
idleSub: idleSub,
|
|
118
|
+
occupiedCardColor: occupiedCardColor,
|
|
119
|
+
availableCardColor: availableCardColor
|
|
120
|
+
});
|
|
121
|
+
}, [card, toneMap, liveRemainingMin, liveStartsInMin, liveLateMin, boardingSoonBeforeMin, idleMain, idleSub, occupiedCardColor, availableCardColor]);
|
|
122
|
+
var statusKey = presentation.statusKey,
|
|
123
|
+
isOccupied = presentation.isOccupied,
|
|
124
|
+
heroText = presentation.heroText,
|
|
125
|
+
heroColor = presentation.heroColor,
|
|
126
|
+
noteText = presentation.noteText,
|
|
127
|
+
noteTextColor = presentation.noteTextColor,
|
|
128
|
+
noteBg = presentation.noteBg,
|
|
129
|
+
subColor = presentation.subColor,
|
|
130
|
+
mainColor = presentation.mainColor,
|
|
131
|
+
currentLabel = presentation.currentLabel,
|
|
132
|
+
currentTime = presentation.currentTime,
|
|
133
|
+
currentName = presentation.currentName,
|
|
134
|
+
currentNameColor = presentation.currentNameColor,
|
|
135
|
+
nextNameColor = presentation.nextNameColor,
|
|
136
|
+
progress = presentation.progress,
|
|
137
|
+
progressColor = presentation.progressColor,
|
|
138
|
+
rightTag = presentation.rightTag,
|
|
139
|
+
rightTagColor = presentation.rightTagColor,
|
|
140
|
+
rightTagBg = presentation.rightTagBg,
|
|
141
|
+
rightTagBorder = presentation.rightTagBorder,
|
|
142
|
+
surfaceAccentColor = presentation.surfaceAccentColor;
|
|
158
143
|
var nextItem = (_card$nextList = card.nextList) === null || _card$nextList === void 0 ? void 0 : _card$nextList[0];
|
|
159
144
|
var nextCountLabel = nextItem ? "1/".concat((_card$nextList$length = (_card$nextList2 = card.nextList) === null || _card$nextList2 === void 0 ? void 0 : _card$nextList2.length) !== null && _card$nextList$length !== void 0 ? _card$nextList$length : 0) : '';
|
|
160
|
-
if (statusKey === 'boardingSoon') {
|
|
161
|
-
var _card$currentBooking2;
|
|
162
|
-
heroText = getText('pisell-resource-wall-card-starts-in').replace('{n}', String(liveStartsInMin));
|
|
163
|
-
heroColor = toneMap.boardingSoon.color;
|
|
164
|
-
noteText = toneMap.boardingSoon.note;
|
|
165
|
-
noteTextColor = toneMap.boardingSoon.color;
|
|
166
|
-
noteBg = alphaColor(toneMap.boardingSoon.color, 0.18);
|
|
167
|
-
currentLabel = getText('pisell-resource-wall-card-label-next');
|
|
168
|
-
currentName = (_card$currentBooking2 = card.currentBooking) !== null && _card$currentBooking2 !== void 0 ? _card$currentBooking2 : '';
|
|
169
|
-
currentNameColor = toneMap.boardingSoon.color;
|
|
170
|
-
nextNameColor = toneMap.boardingSoon.color;
|
|
171
|
-
progress = clamp((boardingSoonBeforeMin - liveStartsInMin) / boardingSoonBeforeMin * 100, 0, 100);
|
|
172
|
-
progressColor = toneMap.boardingSoon.color;
|
|
173
|
-
rightTag = toneMap.boardingSoon.label;
|
|
174
|
-
rightTagColor = toneMap.boardingSoon.color;
|
|
175
|
-
rightTagBg = alphaColor(toneMap.boardingSoon.color, 0.12);
|
|
176
|
-
rightTagBorder = alphaColor(toneMap.boardingSoon.color, 0.35);
|
|
177
|
-
}
|
|
178
|
-
if (statusKey === 'late') {
|
|
179
|
-
var _card$currentBooking3;
|
|
180
|
-
heroText = getText('pisell-resource-wall-card-late').replace('{n}', String(liveLateMin));
|
|
181
|
-
/** 仅主文案用红色;其余视觉与 Available 对齐 */
|
|
182
|
-
heroColor = 'rgb(239, 68, 68)';
|
|
183
|
-
noteText = toneMap.late.note;
|
|
184
|
-
noteTextColor = toneMap.available.color;
|
|
185
|
-
noteBg = toneMap.available.noteBg;
|
|
186
|
-
currentLabel = getText('pisell-resource-wall-card-label-next');
|
|
187
|
-
currentName = (_card$currentBooking3 = card.currentBooking) !== null && _card$currentBooking3 !== void 0 ? _card$currentBooking3 : '';
|
|
188
|
-
currentNameColor = toneMap.available.color;
|
|
189
|
-
nextNameColor = toneMap.available.color;
|
|
190
|
-
progress = 100;
|
|
191
|
-
progressColor = toneMap.available.color;
|
|
192
|
-
rightTag = toneMap.late.label;
|
|
193
|
-
rightTagColor = toneMap.available.color;
|
|
194
|
-
rightTagBg = alphaColor(toneMap.available.color, 0.12);
|
|
195
|
-
rightTagBorder = alphaColor(toneMap.available.color, 0.35);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* 已过期:主文案应与 {@link formatVenueWallCountdown} 在负数分钟时一致(「xxm overtime」);
|
|
200
|
-
* drift 允许 remaining 为负后,仅「整分刚好为 0」时仍走 countdown(0) 的「Ending now」,改为「0m overtime」与产品预期一致。
|
|
201
|
-
*/
|
|
202
|
-
if (statusKey === 'expired') {
|
|
203
|
-
heroText = liveRemainingMin < 0 ? formatVenueWallCountdown(liveRemainingMin) : liveRemainingMin === 0 ? getText('pisell-resource-wall-countdown-zero-overtime') : formatVenueWallCountdown(liveRemainingMin);
|
|
204
|
-
}
|
|
205
|
-
var surfaceAccentColor = statusKey === 'late' ? availableCardColor : statusKey === 'boardingSoon' ? toneMap.boardingSoon.color : availableCardColor;
|
|
206
145
|
var cardBg = isOccupied ? "linear-gradient(180deg, ".concat(alphaColor(occupiedCardColor, 0.96), " 0%, ").concat(alphaColor(occupiedCardColor, 0.88), " 100%)") : alphaColor(surfaceAccentColor, statusKey === 'boardingSoon' || statusKey === 'late' ? 0.06 : 0.03);
|
|
207
146
|
var cardBorder = isOccupied ? alphaColor(occupiedCardColor, 0.5) : alphaColor(surfaceAccentColor, 0.18);
|
|
208
147
|
var moduleBorder = isOccupied ? 'rgba(255,255,255,0.10)' : alphaColor(surfaceAccentColor, 0.2);
|
|
@@ -524,6 +463,10 @@ export var VenueWallCard = function VenueWallCard(_ref) {
|
|
|
524
463
|
text: noteText,
|
|
525
464
|
color: noteTextColor,
|
|
526
465
|
duration: 24,
|
|
527
|
-
shouldMarquee: noteText.length >
|
|
466
|
+
shouldMarquee: noteText.length > RESOURCE_WALL_NOTE_MARQUEE_MIN_CHARS
|
|
528
467
|
})))));
|
|
529
|
-
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/** 单块场地大屏卡:漂移与文案由 {@link buildVenueWallCardPresentation} 统一计算 */
|
|
471
|
+
export var VenueWallCard = /*#__PURE__*/React.memo(VenueWallCardInner);
|
|
472
|
+
VenueWallCard.displayName = 'VenueWallCard';
|
package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RecordBoardResourceWallCardModel } from '../../types';
|
|
2
|
+
import { type VenueWallStatusKey, type VenueWallStatusTone } from './venueWallUtils';
|
|
3
|
+
/** 由 {@link buildVenueWallCardPresentation} 产出,供 VenueWallCard 渲染层使用 */
|
|
4
|
+
export declare type VenueWallCardPresentation = {
|
|
5
|
+
statusKey: VenueWallStatusKey;
|
|
6
|
+
isOccupied: boolean;
|
|
7
|
+
heroText: string;
|
|
8
|
+
heroColor: string;
|
|
9
|
+
noteText: string;
|
|
10
|
+
noteTextColor: string;
|
|
11
|
+
noteBg: string;
|
|
12
|
+
subColor: string;
|
|
13
|
+
mainColor: string;
|
|
14
|
+
currentLabel: string;
|
|
15
|
+
currentTime: string;
|
|
16
|
+
currentName: string;
|
|
17
|
+
currentNameColor: string;
|
|
18
|
+
nextNameColor: string;
|
|
19
|
+
progress: number;
|
|
20
|
+
progressColor: string;
|
|
21
|
+
rightTag: string;
|
|
22
|
+
rightTagColor: string;
|
|
23
|
+
rightTagBg: string;
|
|
24
|
+
rightTagBorder: string;
|
|
25
|
+
surfaceAccentColor: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 纯函数:根据实时漂移分钟数与六态配色表得到卡片主副文案、进度与标签样式。
|
|
29
|
+
* 与原先 VenueWallCard 内联分支逻辑一致,便于单测与维护。
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildVenueWallCardPresentation(args: {
|
|
32
|
+
card: RecordBoardResourceWallCardModel;
|
|
33
|
+
toneMap: Record<VenueWallStatusKey, VenueWallStatusTone>;
|
|
34
|
+
liveRemainingMin: number;
|
|
35
|
+
liveStartsInMin: number;
|
|
36
|
+
liveLateMin: number;
|
|
37
|
+
boardingSoonBeforeMin: number;
|
|
38
|
+
idleMain: string;
|
|
39
|
+
idleSub: string;
|
|
40
|
+
occupiedCardColor: string;
|
|
41
|
+
availableCardColor: string;
|
|
42
|
+
}): VenueWallCardPresentation;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { getText } from "../../../../locales";
|
|
8
|
+
import { alphaColor, clamp, deriveVenueWallStatus, formatVenueWallCountdown } from "./venueWallUtils";
|
|
9
|
+
|
|
10
|
+
/** 由 {@link buildVenueWallCardPresentation} 产出,供 VenueWallCard 渲染层使用 */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 纯函数:根据实时漂移分钟数与六态配色表得到卡片主副文案、进度与标签样式。
|
|
14
|
+
* 与原先 VenueWallCard 内联分支逻辑一致,便于单测与维护。
|
|
15
|
+
*/
|
|
16
|
+
export function buildVenueWallCardPresentation(args) {
|
|
17
|
+
var _toneMap$statusKey, _card$currentTime, _card$currentBooking;
|
|
18
|
+
var card = args.card,
|
|
19
|
+
toneMap = args.toneMap,
|
|
20
|
+
liveRemainingMin = args.liveRemainingMin,
|
|
21
|
+
liveStartsInMin = args.liveStartsInMin,
|
|
22
|
+
liveLateMin = args.liveLateMin,
|
|
23
|
+
boardingSoonBeforeMin = args.boardingSoonBeforeMin,
|
|
24
|
+
idleMain = args.idleMain,
|
|
25
|
+
idleSub = args.idleSub,
|
|
26
|
+
occupiedCardColor = args.occupiedCardColor,
|
|
27
|
+
availableCardColor = args.availableCardColor;
|
|
28
|
+
var statusKey = deriveVenueWallStatus(_objectSpread(_objectSpread({}, card), {}, {
|
|
29
|
+
remainingMin: liveRemainingMin
|
|
30
|
+
}));
|
|
31
|
+
var tone = (_toneMap$statusKey = toneMap[statusKey]) !== null && _toneMap$statusKey !== void 0 ? _toneMap$statusKey : toneMap.inUse;
|
|
32
|
+
var isOccupied = ['inUse', 'endingSoon', 'expired'].includes(statusKey);
|
|
33
|
+
var heroText = isOccupied ? formatVenueWallCountdown(liveRemainingMin) : getText('pisell-resource-wall-card-hero-available');
|
|
34
|
+
var heroColor = isOccupied ? statusKey === 'inUse' ? '#ffffff' : tone.color : toneMap.available.color;
|
|
35
|
+
var noteText = isOccupied ? tone.note : toneMap.available.note;
|
|
36
|
+
var noteTextColor = isOccupied ? '#ffffff' : idleMain;
|
|
37
|
+
var noteBg = isOccupied ? tone.noteBg : alphaColor(availableCardColor, 0.2);
|
|
38
|
+
var subColor = isOccupied ? 'rgba(255,255,255,0.80)' : idleSub;
|
|
39
|
+
var mainColor = isOccupied ? '#ffffff' : idleMain;
|
|
40
|
+
var currentLabel = getText('pisell-resource-wall-card-label-current');
|
|
41
|
+
var currentTime = (_card$currentTime = card.currentTime) !== null && _card$currentTime !== void 0 ? _card$currentTime : '';
|
|
42
|
+
var currentName = isOccupied ? (_card$currentBooking = card.currentBooking) !== null && _card$currentBooking !== void 0 ? _card$currentBooking : '' : '';
|
|
43
|
+
var currentNameColor = mainColor;
|
|
44
|
+
var nextNameColor = mainColor;
|
|
45
|
+
var progress = isOccupied ? clamp(liveRemainingMin / 60 * 100, 0, 100) : 0;
|
|
46
|
+
var progressColor = heroColor;
|
|
47
|
+
var rightTag = tone.label;
|
|
48
|
+
var rightTagColor = isOccupied ? '#ffffff' : tone.color;
|
|
49
|
+
var rightTagBg = isOccupied ? statusKey === 'inUse' ? 'rgba(255,255,255,0.14)' : tone.color : alphaColor(tone.color, 0.12);
|
|
50
|
+
var rightTagBorder = isOccupied ? 'rgba(255,255,255,0.18)' : alphaColor(tone.color, 0.35);
|
|
51
|
+
if (statusKey === 'boardingSoon') {
|
|
52
|
+
var _card$currentBooking2;
|
|
53
|
+
heroText = getText('pisell-resource-wall-card-starts-in').replace('{n}', String(liveStartsInMin));
|
|
54
|
+
heroColor = toneMap.boardingSoon.color;
|
|
55
|
+
noteText = toneMap.boardingSoon.note;
|
|
56
|
+
noteTextColor = toneMap.boardingSoon.color;
|
|
57
|
+
noteBg = alphaColor(toneMap.boardingSoon.color, 0.18);
|
|
58
|
+
currentLabel = getText('pisell-resource-wall-card-label-next');
|
|
59
|
+
currentName = (_card$currentBooking2 = card.currentBooking) !== null && _card$currentBooking2 !== void 0 ? _card$currentBooking2 : '';
|
|
60
|
+
currentNameColor = toneMap.boardingSoon.color;
|
|
61
|
+
nextNameColor = toneMap.boardingSoon.color;
|
|
62
|
+
progress = clamp((boardingSoonBeforeMin - liveStartsInMin) / boardingSoonBeforeMin * 100, 0, 100);
|
|
63
|
+
progressColor = toneMap.boardingSoon.color;
|
|
64
|
+
rightTag = toneMap.boardingSoon.label;
|
|
65
|
+
rightTagColor = toneMap.boardingSoon.color;
|
|
66
|
+
rightTagBg = alphaColor(toneMap.boardingSoon.color, 0.12);
|
|
67
|
+
rightTagBorder = alphaColor(toneMap.boardingSoon.color, 0.35);
|
|
68
|
+
}
|
|
69
|
+
if (statusKey === 'late') {
|
|
70
|
+
var _card$currentBooking3;
|
|
71
|
+
heroText = getText('pisell-resource-wall-card-late').replace('{n}', String(liveLateMin));
|
|
72
|
+
heroColor = 'rgb(239, 68, 68)';
|
|
73
|
+
noteText = toneMap.late.note;
|
|
74
|
+
noteTextColor = toneMap.available.color;
|
|
75
|
+
noteBg = toneMap.available.noteBg;
|
|
76
|
+
currentLabel = getText('pisell-resource-wall-card-label-next');
|
|
77
|
+
currentName = (_card$currentBooking3 = card.currentBooking) !== null && _card$currentBooking3 !== void 0 ? _card$currentBooking3 : '';
|
|
78
|
+
currentNameColor = toneMap.available.color;
|
|
79
|
+
nextNameColor = toneMap.available.color;
|
|
80
|
+
progress = 100;
|
|
81
|
+
progressColor = toneMap.available.color;
|
|
82
|
+
rightTag = toneMap.late.label;
|
|
83
|
+
rightTagColor = toneMap.available.color;
|
|
84
|
+
rightTagBg = alphaColor(toneMap.available.color, 0.12);
|
|
85
|
+
rightTagBorder = alphaColor(toneMap.available.color, 0.35);
|
|
86
|
+
}
|
|
87
|
+
if (statusKey === 'expired') {
|
|
88
|
+
heroText = liveRemainingMin < 0 ? formatVenueWallCountdown(liveRemainingMin) : liveRemainingMin === 0 ? getText('pisell-resource-wall-countdown-zero-overtime') : formatVenueWallCountdown(liveRemainingMin);
|
|
89
|
+
}
|
|
90
|
+
var surfaceAccentColor = statusKey === 'late' ? availableCardColor : statusKey === 'boardingSoon' ? toneMap.boardingSoon.color : availableCardColor;
|
|
91
|
+
return {
|
|
92
|
+
statusKey: statusKey,
|
|
93
|
+
isOccupied: isOccupied,
|
|
94
|
+
heroText: heroText,
|
|
95
|
+
heroColor: heroColor,
|
|
96
|
+
noteText: noteText,
|
|
97
|
+
noteTextColor: noteTextColor,
|
|
98
|
+
noteBg: noteBg,
|
|
99
|
+
subColor: subColor,
|
|
100
|
+
mainColor: mainColor,
|
|
101
|
+
currentLabel: currentLabel,
|
|
102
|
+
currentTime: currentTime,
|
|
103
|
+
currentName: currentName,
|
|
104
|
+
currentNameColor: currentNameColor,
|
|
105
|
+
nextNameColor: nextNameColor,
|
|
106
|
+
progress: progress,
|
|
107
|
+
progressColor: progressColor,
|
|
108
|
+
rightTag: rightTag,
|
|
109
|
+
rightTagColor: rightTagColor,
|
|
110
|
+
rightTagBg: rightTagBg,
|
|
111
|
+
rightTagBorder: rightTagBorder,
|
|
112
|
+
surfaceAccentColor: surfaceAccentColor
|
|
113
|
+
};
|
|
114
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 资源墙(Venue Wall)共用工具:六态键、默认色板、倒计时文案、卡片状态推导、配色合并与 diff。
|
|
3
|
+
*/
|
|
1
4
|
import type { RecordBoardResourceWallCardModel } from '../../types';
|
|
2
5
|
export declare type VenueWallStatusKey = 'inUse' | 'endingSoon' | 'expired' | 'available' | 'boardingSoon' | 'late';
|
|
3
6
|
/** 单态展示配置(与 {@link VENUE_WALL_STATUS_COLOR_MAP} 值同形) */
|
|
@@ -21,11 +24,34 @@ export declare type VenueWallAppearanceTheme = {
|
|
|
21
24
|
dark?: VenueWallAppearanceSlot;
|
|
22
25
|
};
|
|
23
26
|
export declare const VENUE_WALL_STATUS_KEYS: VenueWallStatusKey[];
|
|
27
|
+
/**
|
|
28
|
+
* 六态默认色与占位英文;`getVenueWallStatusToneMap` 会将 label/note 换为 i18n,此处仅作 merge 基底。
|
|
29
|
+
*/
|
|
24
30
|
export declare const VENUE_WALL_STATUS_COLOR_MAP: Record<VenueWallStatusKey, VenueWallStatusTone>;
|
|
31
|
+
/** 将 `#RGB` / `#RRGGBB` 转为 `rgba(...)`,供渐变与半透明底 */
|
|
25
32
|
export declare function alphaColor(hex: string, alpha: number): string;
|
|
33
|
+
/** 将数值限制在 [min, max](布局行列、主文案比例等) */
|
|
26
34
|
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
27
35
|
/** 由卡片字段推导状态键(与演示页 test.tsx 规则一致) */
|
|
28
36
|
export declare function deriveVenueWallStatus(card: RecordBoardResourceWallCardModel): VenueWallStatusKey;
|
|
37
|
+
/**
|
|
38
|
+
* ToolBar Sort 写入的 `searchParams.sort`(如 `status:asc:string`)拆出字段名与升降序。
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseRecordBoardToolbarSortParam(sort: unknown): {
|
|
41
|
+
field: string;
|
|
42
|
+
dir: 'asc' | 'desc';
|
|
43
|
+
} | null;
|
|
44
|
+
/** 当 Sort 字段名匹配这些 key(忽略大小写)时,资源墙按占用态重排卡片 */
|
|
45
|
+
export declare const DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS: readonly ["status"];
|
|
46
|
+
export declare function matchesResourceWallStatusSortField(sortField: string, keys: readonly string[]): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 用于资源墙排序:占用/将结/已结束为 1,其余为 0(与 {@link deriveVenueWallStatus} 一致)。
|
|
49
|
+
* asc → 空闲侧在前;desc → 占用侧在前。
|
|
50
|
+
*/
|
|
51
|
+
export declare function venueWallOccupiedSortRank(card: RecordBoardResourceWallCardModel): 0 | 1;
|
|
52
|
+
/**
|
|
53
|
+
* 将「剩余/超支分钟数」格式化为跑码条/主副标题用短文案(走 i18n 模板,负值表示 overtime)。
|
|
54
|
+
*/
|
|
29
55
|
export declare function formatVenueWallCountdown(min: number): string;
|
|
30
56
|
/**
|
|
31
57
|
* 合并默认六态配色与业务覆盖,供 {@link VenueWallCard} 与 Control Panel 表单初值共用。
|
|
@@ -7,6 +7,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
/**
|
|
11
|
+
* 资源墙(Venue Wall)共用工具:六态键、默认色板、倒计时文案、卡片状态推导、配色合并与 diff。
|
|
12
|
+
*/
|
|
13
|
+
|
|
10
14
|
import { getText } from "../../../../locales";
|
|
11
15
|
|
|
12
16
|
/** 单态展示配置(与 {@link VENUE_WALL_STATUS_COLOR_MAP} 值同形) */
|
|
@@ -16,6 +20,10 @@ import { getText } from "../../../../locales";
|
|
|
16
20
|
/** 单外观(浅 / 深)下的占用/空闲色与六态覆盖;持久化时 light、dark 各存一份 */
|
|
17
21
|
|
|
18
22
|
export var VENUE_WALL_STATUS_KEYS = ['inUse', 'endingSoon', 'expired', 'available', 'boardingSoon', 'late'];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 六态默认色与占位英文;`getVenueWallStatusToneMap` 会将 label/note 换为 i18n,此处仅作 merge 基底。
|
|
26
|
+
*/
|
|
19
27
|
export var VENUE_WALL_STATUS_COLOR_MAP = {
|
|
20
28
|
inUse: {
|
|
21
29
|
key: 'inUse',
|
|
@@ -61,6 +69,8 @@ export var VENUE_WALL_STATUS_COLOR_MAP = {
|
|
|
61
69
|
noteBg: 'rgba(16,185,129,0.18)'
|
|
62
70
|
}
|
|
63
71
|
};
|
|
72
|
+
|
|
73
|
+
/** 将 `#RGB` / `#RRGGBB` 转为 `rgba(...)`,供渐变与半透明底 */
|
|
64
74
|
export function alphaColor(hex, alpha) {
|
|
65
75
|
var clean = hex.replace('#', '');
|
|
66
76
|
var full = clean.length === 3 ? clean.split('').map(function (c) {
|
|
@@ -72,6 +82,8 @@ export function alphaColor(hex, alpha) {
|
|
|
72
82
|
var b = num & 255;
|
|
73
83
|
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
|
|
74
84
|
}
|
|
85
|
+
|
|
86
|
+
/** 将数值限制在 [min, max](布局行列、主文案比例等) */
|
|
75
87
|
export var clamp = function clamp(value, min, max) {
|
|
76
88
|
return Math.max(min, Math.min(max, value));
|
|
77
89
|
};
|
|
@@ -93,13 +105,54 @@ export function deriveVenueWallStatus(card) {
|
|
|
93
105
|
if (rm != null && rm <= 10) return 'endingSoon';
|
|
94
106
|
return 'inUse';
|
|
95
107
|
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* ToolBar Sort 写入的 `searchParams.sort`(如 `status:asc:string`)拆出字段名与升降序。
|
|
111
|
+
*/
|
|
112
|
+
export function parseRecordBoardToolbarSortParam(sort) {
|
|
113
|
+
if (sort == null || typeof sort !== 'string') return null;
|
|
114
|
+
var idx = sort.indexOf(':');
|
|
115
|
+
if (idx <= 0) return null;
|
|
116
|
+
var field = sort.slice(0, idx);
|
|
117
|
+
var rest = sort.slice(idx + 1);
|
|
118
|
+
var dirSep = rest.indexOf(':');
|
|
119
|
+
var dirRaw = dirSep >= 0 ? rest.slice(0, dirSep) : rest;
|
|
120
|
+
if (dirRaw !== 'asc' && dirRaw !== 'desc') return null;
|
|
121
|
+
return {
|
|
122
|
+
field: field,
|
|
123
|
+
dir: dirRaw
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** 当 Sort 字段名匹配这些 key(忽略大小写)时,资源墙按占用态重排卡片 */
|
|
128
|
+
export var DEFAULT_RESOURCE_WALL_STATUS_SORT_FIELD_KEYS = ['status'];
|
|
129
|
+
export function matchesResourceWallStatusSortField(sortField, keys) {
|
|
130
|
+
var n = sortField.trim().toLowerCase();
|
|
131
|
+
return keys.some(function (k) {
|
|
132
|
+
return k.trim().toLowerCase() === n;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 用于资源墙排序:占用/将结/已结束为 1,其余为 0(与 {@link deriveVenueWallStatus} 一致)。
|
|
138
|
+
* asc → 空闲侧在前;desc → 占用侧在前。
|
|
139
|
+
*/
|
|
140
|
+
export function venueWallOccupiedSortRank(card) {
|
|
141
|
+
var k = deriveVenueWallStatus(card);
|
|
142
|
+
return k === 'inUse' || k === 'endingSoon' || k === 'expired' ? 1 : 0;
|
|
143
|
+
}
|
|
96
144
|
function formatDurationHM(minAbs) {
|
|
97
145
|
var safe = Number.isFinite(minAbs) ? Math.max(0, Math.floor(minAbs)) : 0;
|
|
98
146
|
if (safe < 60) return "".concat(safe, "m");
|
|
99
147
|
var h = Math.floor(safe / 60);
|
|
100
148
|
var m = safe % 60;
|
|
101
|
-
|
|
149
|
+
/** `11h 28m`:h 与分钟之间加空格,避免 `11h28m` 连成一体难读 */
|
|
150
|
+
return "".concat(h, "h ").concat(String(m).padStart(2, '0'), "m");
|
|
102
151
|
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* 将「剩余/超支分钟数」格式化为跑码条/主副标题用短文案(走 i18n 模板,负值表示 overtime)。
|
|
155
|
+
*/
|
|
103
156
|
export function formatVenueWallCountdown(min) {
|
|
104
157
|
if (min < 0) {
|
|
105
158
|
var n = formatDurationHM(Math.abs(min));
|