@pisell/materials 6.11.275 → 6.11.276
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 +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/PisellCards/index.d.ts +1 -0
- package/es/components/PisellFields/index.d.ts +1 -0
- package/es/components/PisellFields/index.js +0 -11
- package/es/components/PisellLayouts/index.d.ts +1 -0
- package/es/components/PisellMetrics/index.d.ts +1 -0
- package/es/components/PisellSelectionFlow/PisellSelectionFlow.js +13 -4
- package/es/components/PisellSelectionFlow/types.d.ts +2 -0
- package/es/components/appVersionControl/types.d.ts +1 -0
- package/es/components/calendar/index.d.ts +1 -0
- package/es/components/checkbox/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/es/components/date-picker/index.d.ts +1 -0
- package/es/components/drag-sort-tree/types.d.ts +1 -0
- package/es/components/filter/components/FilterButton/types.d.ts +1 -0
- package/es/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.js +0 -2
- package/es/components/filter/components/FilterItem/index.js +0 -11
- package/es/components/input/index.d.ts +1 -0
- package/es/components/pisell-config-provider/context.d.ts +1 -0
- package/es/components/pisellDatePicker/index.d.ts +1 -0
- package/es/components/pisellGridPro/ToolBar/type.d.ts +1 -0
- package/es/components/pisellMenu/types.d.ts +1 -0
- package/es/components/pisellQuickFilter/type.d.ts +1 -0
- package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.js +0 -2
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +0 -11
- package/es/components/radio/index.d.ts +1 -0
- package/es/components/section-footers/index.d.ts +1 -0
- package/es/components/skeleton/index.d.ts +1 -0
- package/es/components/time-picker/index.d.ts +1 -0
- package/es/components/upload/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +1 -0
- package/es/index.js +0 -11
- package/lib/components/PisellCards/index.d.ts +1 -0
- package/lib/components/PisellFields/index.d.ts +1 -0
- package/lib/components/PisellLayouts/index.d.ts +1 -0
- package/lib/components/PisellMetrics/index.d.ts +1 -0
- package/lib/components/PisellSelectionFlow/PisellSelectionFlow.js +13 -4
- package/lib/components/PisellSelectionFlow/types.d.ts +2 -0
- package/lib/components/appVersionControl/types.d.ts +1 -0
- package/lib/components/calendar/index.d.ts +1 -0
- package/lib/components/checkbox/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Radio/WithMode.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +1 -0
- package/lib/components/date-picker/index.d.ts +1 -0
- package/lib/components/drag-sort-tree/types.d.ts +1 -0
- package/lib/components/filter/components/FilterButton/types.d.ts +1 -0
- package/lib/components/input/index.d.ts +1 -0
- package/lib/components/pisell-config-provider/context.d.ts +1 -0
- package/lib/components/pisellDatePicker/index.d.ts +1 -0
- package/lib/components/pisellGridPro/ToolBar/type.d.ts +1 -0
- package/lib/components/pisellMenu/types.d.ts +1 -0
- package/lib/components/pisellQuickFilter/type.d.ts +1 -0
- package/lib/components/radio/index.d.ts +1 -0
- package/lib/components/section-footers/index.d.ts +1 -0
- package/lib/components/skeleton/index.d.ts +1 -0
- package/lib/components/time-picker/index.d.ts +1 -0
- package/lib/components/upload/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +1 -0
- package/package.json +3 -3
- package/es/components/pisellCurrency/index.js +0 -13
- package/es/components/pisellEmail/index.js +0 -13
- package/es/components/pisellLongText/index.js +0 -13
- package/es/components/pisellMultipleSelect/index.js +0 -13
- package/es/components/pisellNumber/index.js +0 -13
- package/es/components/pisellPercent/index.js +0 -13
- package/es/components/pisellPhone/index.js +0 -14
- package/es/components/pisellRating/index.js +0 -13
- package/es/components/pisellSingleLineText/index.js +0 -13
- package/es/components/pisellSingleSelect/index.js +0 -13
- package/es/components/pisellUrl/index.js +0 -13
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PisellBasicCardProps } from "./types.js";
|
|
2
3
|
import { ImageDataSource, ImageFillMode, PisellImageCardProps } from "./components/PisellImageCard/types.js";
|
|
3
4
|
import { GraphicConfig, GraphicTextCardProps, GraphicTextCardSize, GraphicTextCardVariant } from "./components/GraphicTextCard/types.js";
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
import PisellSingleLineText_default from "../pisellSingleLineText/PisellSingleLineText.js";
|
|
2
|
-
import "../pisellSingleLineText/index.js";
|
|
3
2
|
import PisellLongText_default from "../pisellLongText/PisellLongText.js";
|
|
4
|
-
import "../pisellLongText/index.js";
|
|
5
3
|
import MemoizedPisellNumber from "../pisellNumber/PisellNumber.js";
|
|
6
|
-
import "../pisellNumber/index.js";
|
|
7
4
|
import MemoizedPisellCurrency from "../pisellCurrency/PisellCurrency.js";
|
|
8
|
-
import "../pisellCurrency/index.js";
|
|
9
5
|
import MemoizedPisellPercent from "../pisellPercent/PisellPercent.js";
|
|
10
|
-
import "../pisellPercent/index.js";
|
|
11
6
|
import PisellPhone_default from "../pisellPhone/PisellPhone.js";
|
|
12
|
-
import "../pisellPhone/index.js";
|
|
13
7
|
import PisellEmail_default from "../pisellEmail/PisellEmail.js";
|
|
14
|
-
import "../pisellEmail/index.js";
|
|
15
8
|
import PisellUrl_default from "../pisellUrl/PisellUrl.js";
|
|
16
|
-
import "../pisellUrl/index.js";
|
|
17
9
|
import PisellRating_default from "../pisellRating/PisellRating.js";
|
|
18
|
-
import "../pisellRating/index.js";
|
|
19
10
|
import PisellSingleSelect from "../pisellSingleSelect/PisellSingleSelect.js";
|
|
20
|
-
import "../pisellSingleSelect/index.js";
|
|
21
11
|
import PisellMultipleSelect from "../pisellMultipleSelect/PisellMultipleSelect.js";
|
|
22
|
-
import "../pisellMultipleSelect/index.js";
|
|
23
12
|
//#region src/components/PisellFields/index.tsx
|
|
24
13
|
/**
|
|
25
14
|
* PisellFields 命名空间
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PisellBasicGridProps } from "../PisellBasicGrid/types.js";
|
|
2
3
|
import { PisellScrollViewProps, PisellScrollViewRef } from "../PisellScrollView/types.js";
|
|
3
4
|
import { FloorMapFullscreenMode, FloorMapItemBase, FloorMapLayoutContextValue, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef } from "../pisellFloorMapLayout/types.js";
|
|
@@ -15,7 +15,7 @@ const createUnexpectedCompileError = (error) => {
|
|
|
15
15
|
message: `Selection flow compilation failed: ${getSelectionFlowErrorMessage(error)}`
|
|
16
16
|
}]);
|
|
17
17
|
};
|
|
18
|
-
const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialStepIndex = 0, preparePresentation = false, onPresentationReady, hostContext, services, children, onDraftChange, onStepChange, onCompiledStepsChange, onValidationFailed, onConfigurationError, onComplete }, ref) => {
|
|
18
|
+
const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialStepIndex = 0, preparePresentation = false, resolveInitialStepIndex, onPresentationReady, hostContext, services, children, onDraftChange, onStepChange, onCompiledStepsChange, onValidationFailed, onConfigurationError, onComplete }, ref) => {
|
|
19
19
|
const mountedRef = useRef(true);
|
|
20
20
|
const flowGenerationRef = useRef(1);
|
|
21
21
|
const draftRevisionRef = useRef(0);
|
|
@@ -29,6 +29,8 @@ const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialSte
|
|
|
29
29
|
const presentationTaskRef = useRef(null);
|
|
30
30
|
const onPresentationReadyRef = useRef(onPresentationReady);
|
|
31
31
|
onPresentationReadyRef.current = onPresentationReady;
|
|
32
|
+
const resolveInitialStepIndexRef = useRef(resolveInitialStepIndex);
|
|
33
|
+
resolveInitialStepIndexRef.current = resolveInitialStepIndex;
|
|
32
34
|
const processDraftChangeRef = useRef(() => void 0);
|
|
33
35
|
const onDraftChangeRef = useRef(onDraftChange);
|
|
34
36
|
onDraftChangeRef.current = onDraftChange;
|
|
@@ -362,7 +364,7 @@ const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialSte
|
|
|
362
364
|
const generation = flowGenerationRef.current;
|
|
363
365
|
const isCurrent = () => mountedRef.current && flowGenerationRef.current === generation;
|
|
364
366
|
const task = _asyncToGenerator(function* () {
|
|
365
|
-
var
|
|
367
|
+
var _visibleSteps$0$index, _visibleSteps$, _compiledStepsRef$cur, _onPresentationReadyR2;
|
|
366
368
|
const modules = compiledStepsRef.current.flatMap((step) => step.modules);
|
|
367
369
|
for (let pass = 0; pass <= modules.length; pass += 1) {
|
|
368
370
|
for (const module of modules) {
|
|
@@ -394,8 +396,15 @@ const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialSte
|
|
|
394
396
|
}).map((module) => module.key);
|
|
395
397
|
automaticModuleKeysRef.current = automatic;
|
|
396
398
|
setAutomaticModuleKeys(automatic);
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
+
const visibleSteps = compiledStepsRef.current.filter((step) => step.modules.some((module) => !automatic.includes(module.key)));
|
|
400
|
+
let initialIndex = (_visibleSteps$0$index = (_visibleSteps$ = visibleSteps[0]) === null || _visibleSteps$ === void 0 ? void 0 : _visibleSteps$.index) !== null && _visibleSteps$0$index !== void 0 ? _visibleSteps$0$index : Math.max(0, compiledStepsRef.current.length - 1);
|
|
401
|
+
try {
|
|
402
|
+
var _resolveInitialStepIn;
|
|
403
|
+
const context = getFreshContext();
|
|
404
|
+
const requestedIndex = context && ((_resolveInitialStepIn = resolveInitialStepIndexRef.current) === null || _resolveInitialStepIn === void 0 ? void 0 : _resolveInitialStepIn.call(resolveInitialStepIndexRef, context));
|
|
405
|
+
const requestedStep = visibleSteps.find((step) => step.index === requestedIndex);
|
|
406
|
+
if (requestedStep) initialIndex = requestedStep.index;
|
|
407
|
+
} catch (_unused2) {}
|
|
399
408
|
currentStepIndexRef.current = initialIndex;
|
|
400
409
|
currentStepKeyRef.current = (_compiledStepsRef$cur = compiledStepsRef.current[initialIndex]) === null || _compiledStepsRef$cur === void 0 ? void 0 : _compiledStepsRef$cur.key;
|
|
401
410
|
setCurrentStepIndex(initialIndex);
|
|
@@ -188,6 +188,8 @@ interface PisellSelectionFlowProps<TDraft, TDraftUpdate, TField extends string,
|
|
|
188
188
|
initialStepIndex?: number;
|
|
189
189
|
/** Resolve a stable presentation before mounting interactive module components. */
|
|
190
190
|
preparePresentation?: boolean;
|
|
191
|
+
/** Choose the entry step from prepared defaults without hiding earlier steps. */
|
|
192
|
+
resolveInitialStepIndex?: (context: SelectionFlowContextValue<TDraft, TDraftUpdate, TField, TModuleType, TServices, THostContext>) => number | undefined;
|
|
191
193
|
onPresentationReady?: (automaticModuleKeys: readonly string[]) => void;
|
|
192
194
|
hostContext?: THostContext;
|
|
193
195
|
services: TServices;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
|
|
3
3
|
import PisellSingleSelect from "../../../pisellSingleSelect/PisellSingleSelect.js";
|
|
4
|
-
import "../../../pisellSingleSelect/index.js";
|
|
5
4
|
import PisellMultipleSelect from "../../../pisellMultipleSelect/PisellMultipleSelect.js";
|
|
6
|
-
import "../../../pisellMultipleSelect/index.js";
|
|
7
5
|
import React, { useEffect, useState } from "react";
|
|
8
6
|
import { Spin } from "antd";
|
|
9
7
|
//#region src/components/filter/components/FilterItem/AsyncOptionsSelectWrapper.tsx
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
import { getText } from "../../../../locales/index.js";
|
|
2
2
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import PisellSingleLineText_default from "../../../pisellSingleLineText/PisellSingleLineText.js";
|
|
4
|
-
import "../../../pisellSingleLineText/index.js";
|
|
5
4
|
import PisellLongText_default from "../../../pisellLongText/PisellLongText.js";
|
|
6
|
-
import "../../../pisellLongText/index.js";
|
|
7
5
|
import MemoizedPisellNumber from "../../../pisellNumber/PisellNumber.js";
|
|
8
|
-
import "../../../pisellNumber/index.js";
|
|
9
6
|
import MemoizedPisellCurrency from "../../../pisellCurrency/PisellCurrency.js";
|
|
10
|
-
import "../../../pisellCurrency/index.js";
|
|
11
7
|
import MemoizedPisellPercent from "../../../pisellPercent/PisellPercent.js";
|
|
12
|
-
import "../../../pisellPercent/index.js";
|
|
13
8
|
import PisellPhone_default from "../../../pisellPhone/PisellPhone.js";
|
|
14
|
-
import "../../../pisellPhone/index.js";
|
|
15
9
|
import PisellEmail_default from "../../../pisellEmail/PisellEmail.js";
|
|
16
|
-
import "../../../pisellEmail/index.js";
|
|
17
10
|
import PisellUrl_default from "../../../pisellUrl/PisellUrl.js";
|
|
18
|
-
import "../../../pisellUrl/index.js";
|
|
19
11
|
import PisellRating_default from "../../../pisellRating/PisellRating.js";
|
|
20
|
-
import "../../../pisellRating/index.js";
|
|
21
12
|
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
|
|
22
13
|
import PisellSingleSelect from "../../../pisellSingleSelect/PisellSingleSelect.js";
|
|
23
|
-
import "../../../pisellSingleSelect/index.js";
|
|
24
14
|
import PisellMultipleSelect from "../../../pisellMultipleSelect/PisellMultipleSelect.js";
|
|
25
|
-
import "../../../pisellMultipleSelect/index.js";
|
|
26
15
|
import { fieldMaps } from "../../../table/Table/fields/index.js";
|
|
27
16
|
import { PisellMobileDateRangePicker } from "../../../pisellMobileDateRangePicker/PisellMobileDateRangePicker.js";
|
|
28
17
|
import AsyncOptionsSelectWrapper from "./AsyncOptionsSelectWrapper.js";
|
package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { getText } from "../../../../locales/index.js";
|
|
2
2
|
import MemoizedPisellNumber from "../../../pisellNumber/PisellNumber.js";
|
|
3
|
-
import "../../../pisellNumber/index.js";
|
|
4
3
|
import PisellSingleSelect from "../../../pisellSingleSelect/PisellSingleSelect.js";
|
|
5
|
-
import "../../../pisellSingleSelect/index.js";
|
|
6
4
|
import React from "react";
|
|
7
5
|
//#region src/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.tsx
|
|
8
6
|
/** 控制台「资源 / 布局」分页:预设、自定义行列、翻页停留、主文案宽度 */
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
import { getText } from "../../../locales/index.js";
|
|
2
2
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import PisellSingleLineText_default from "../../pisellSingleLineText/PisellSingleLineText.js";
|
|
4
|
-
import "../../pisellSingleLineText/index.js";
|
|
5
4
|
import PisellLongText_default from "../../pisellLongText/PisellLongText.js";
|
|
6
|
-
import "../../pisellLongText/index.js";
|
|
7
5
|
import MemoizedPisellNumber from "../../pisellNumber/PisellNumber.js";
|
|
8
|
-
import "../../pisellNumber/index.js";
|
|
9
6
|
import MemoizedPisellCurrency from "../../pisellCurrency/PisellCurrency.js";
|
|
10
|
-
import "../../pisellCurrency/index.js";
|
|
11
7
|
import MemoizedPisellPercent from "../../pisellPercent/PisellPercent.js";
|
|
12
|
-
import "../../pisellPercent/index.js";
|
|
13
8
|
import PisellPhone_default from "../../pisellPhone/PisellPhone.js";
|
|
14
|
-
import "../../pisellPhone/index.js";
|
|
15
9
|
import PisellEmail_default from "../../pisellEmail/PisellEmail.js";
|
|
16
|
-
import "../../pisellEmail/index.js";
|
|
17
10
|
import PisellUrl_default from "../../pisellUrl/PisellUrl.js";
|
|
18
|
-
import "../../pisellUrl/index.js";
|
|
19
11
|
import PisellRating_default from "../../pisellRating/PisellRating.js";
|
|
20
|
-
import "../../pisellRating/index.js";
|
|
21
12
|
import PisellSingleSelect from "../../pisellSingleSelect/PisellSingleSelect.js";
|
|
22
|
-
import "../../pisellSingleSelect/index.js";
|
|
23
13
|
import PisellMultipleSelect from "../../pisellMultipleSelect/PisellMultipleSelect.js";
|
|
24
|
-
import "../../pisellMultipleSelect/index.js";
|
|
25
14
|
import PisellDateTimeDisplay_default from "../../pisellDateTimeDisplay/PisellDateTimeDisplay.js";
|
|
26
15
|
import React, { useEffect, useState } from "react";
|
|
27
16
|
//#region src/components/pisellRecordBoard/utils/recordBoardColumns.tsx
|
package/es/index.js
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
import PisellContext, { globalConfig } from "./components/pisell-config-provider/context.js";
|
|
2
2
|
import PisellSingleLineText_default from "./components/pisellSingleLineText/PisellSingleLineText.js";
|
|
3
|
-
import "./components/pisellSingleLineText/index.js";
|
|
4
3
|
import PisellLongText_default from "./components/pisellLongText/PisellLongText.js";
|
|
5
|
-
import "./components/pisellLongText/index.js";
|
|
6
4
|
import MemoizedPisellNumber from "./components/pisellNumber/PisellNumber.js";
|
|
7
|
-
import "./components/pisellNumber/index.js";
|
|
8
5
|
import MemoizedPisellCurrency from "./components/pisellCurrency/PisellCurrency.js";
|
|
9
|
-
import "./components/pisellCurrency/index.js";
|
|
10
6
|
import MemoizedPisellPercent from "./components/pisellPercent/PisellPercent.js";
|
|
11
|
-
import "./components/pisellPercent/index.js";
|
|
12
7
|
import PisellPhone_default from "./components/pisellPhone/PisellPhone.js";
|
|
13
|
-
import "./components/pisellPhone/index.js";
|
|
14
8
|
import PisellEmail_default from "./components/pisellEmail/PisellEmail.js";
|
|
15
|
-
import "./components/pisellEmail/index.js";
|
|
16
9
|
import PisellUrl_default from "./components/pisellUrl/PisellUrl.js";
|
|
17
|
-
import "./components/pisellUrl/index.js";
|
|
18
10
|
import PisellRating_default from "./components/pisellRating/PisellRating.js";
|
|
19
|
-
import "./components/pisellRating/index.js";
|
|
20
11
|
import PisellSingleSelect from "./components/pisellSingleSelect/PisellSingleSelect.js";
|
|
21
|
-
import "./components/pisellSingleSelect/index.js";
|
|
22
12
|
import PisellMultipleSelect from "./components/pisellMultipleSelect/PisellMultipleSelect.js";
|
|
23
|
-
import "./components/pisellMultipleSelect/index.js";
|
|
24
13
|
import PisellFields from "./components/PisellFields/index.js";
|
|
25
14
|
import PisellCard from "./components/pisellCard/index.js";
|
|
26
15
|
import PisellMetricCard from "./components/pisellMetricCard/PisellMetricCard.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PisellBasicCardProps } from "./types.js";
|
|
2
3
|
import { ImageDataSource, ImageFillMode, PisellImageCardProps } from "./components/PisellImageCard/types.js";
|
|
3
4
|
import { GraphicConfig, GraphicTextCardProps, GraphicTextCardSize, GraphicTextCardVariant } from "./components/GraphicTextCard/types.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PisellBasicGridProps } from "../PisellBasicGrid/types.js";
|
|
2
3
|
import { PisellScrollViewProps, PisellScrollViewRef } from "../PisellScrollView/types.js";
|
|
3
4
|
import { FloorMapFullscreenMode, FloorMapItemBase, FloorMapLayoutContextValue, PisellFloorMapLayoutProps, PisellFloorMapLayoutRef } from "../pisellFloorMapLayout/types.js";
|
|
@@ -17,7 +17,7 @@ const createUnexpectedCompileError = (error) => {
|
|
|
17
17
|
message: `Selection flow compilation failed: ${require_utils.getSelectionFlowErrorMessage(error)}`
|
|
18
18
|
}]);
|
|
19
19
|
};
|
|
20
|
-
const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialStepIndex = 0, preparePresentation = false, onPresentationReady, hostContext, services, children, onDraftChange, onStepChange, onCompiledStepsChange, onValidationFailed, onConfigurationError, onComplete }, ref) => {
|
|
20
|
+
const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialStepIndex = 0, preparePresentation = false, resolveInitialStepIndex, onPresentationReady, hostContext, services, children, onDraftChange, onStepChange, onCompiledStepsChange, onValidationFailed, onConfigurationError, onComplete }, ref) => {
|
|
21
21
|
const mountedRef = (0, react.useRef)(true);
|
|
22
22
|
const flowGenerationRef = (0, react.useRef)(1);
|
|
23
23
|
const draftRevisionRef = (0, react.useRef)(0);
|
|
@@ -31,6 +31,8 @@ const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialSte
|
|
|
31
31
|
const presentationTaskRef = (0, react.useRef)(null);
|
|
32
32
|
const onPresentationReadyRef = (0, react.useRef)(onPresentationReady);
|
|
33
33
|
onPresentationReadyRef.current = onPresentationReady;
|
|
34
|
+
const resolveInitialStepIndexRef = (0, react.useRef)(resolveInitialStepIndex);
|
|
35
|
+
resolveInitialStepIndexRef.current = resolveInitialStepIndex;
|
|
34
36
|
const processDraftChangeRef = (0, react.useRef)(() => void 0);
|
|
35
37
|
const onDraftChangeRef = (0, react.useRef)(onDraftChange);
|
|
36
38
|
onDraftChangeRef.current = onDraftChange;
|
|
@@ -364,7 +366,7 @@ const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialSte
|
|
|
364
366
|
const generation = flowGenerationRef.current;
|
|
365
367
|
const isCurrent = () => mountedRef.current && flowGenerationRef.current === generation;
|
|
366
368
|
const task = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
367
|
-
var
|
|
369
|
+
var _visibleSteps$0$index, _visibleSteps$, _compiledStepsRef$cur, _onPresentationReadyR2;
|
|
368
370
|
const modules = compiledStepsRef.current.flatMap((step) => step.modules);
|
|
369
371
|
for (let pass = 0; pass <= modules.length; pass += 1) {
|
|
370
372
|
for (const module of modules) {
|
|
@@ -396,8 +398,15 @@ const SelectionFlow = ({ registry, draftAdapter, steps, initialDraft, initialSte
|
|
|
396
398
|
}).map((module) => module.key);
|
|
397
399
|
automaticModuleKeysRef.current = automatic;
|
|
398
400
|
setAutomaticModuleKeys(automatic);
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
+
const visibleSteps = compiledStepsRef.current.filter((step) => step.modules.some((module) => !automatic.includes(module.key)));
|
|
402
|
+
let initialIndex = (_visibleSteps$0$index = (_visibleSteps$ = visibleSteps[0]) === null || _visibleSteps$ === void 0 ? void 0 : _visibleSteps$.index) !== null && _visibleSteps$0$index !== void 0 ? _visibleSteps$0$index : Math.max(0, compiledStepsRef.current.length - 1);
|
|
403
|
+
try {
|
|
404
|
+
var _resolveInitialStepIn;
|
|
405
|
+
const context = getFreshContext();
|
|
406
|
+
const requestedIndex = context && ((_resolveInitialStepIn = resolveInitialStepIndexRef.current) === null || _resolveInitialStepIn === void 0 ? void 0 : _resolveInitialStepIn.call(resolveInitialStepIndexRef, context));
|
|
407
|
+
const requestedStep = visibleSteps.find((step) => step.index === requestedIndex);
|
|
408
|
+
if (requestedStep) initialIndex = requestedStep.index;
|
|
409
|
+
} catch (_unused2) {}
|
|
401
410
|
currentStepIndexRef.current = initialIndex;
|
|
402
411
|
currentStepKeyRef.current = (_compiledStepsRef$cur = compiledStepsRef.current[initialIndex]) === null || _compiledStepsRef$cur === void 0 ? void 0 : _compiledStepsRef$cur.key;
|
|
403
412
|
setCurrentStepIndex(initialIndex);
|
|
@@ -188,6 +188,8 @@ interface PisellSelectionFlowProps<TDraft, TDraftUpdate, TField extends string,
|
|
|
188
188
|
initialStepIndex?: number;
|
|
189
189
|
/** Resolve a stable presentation before mounting interactive module components. */
|
|
190
190
|
preparePresentation?: boolean;
|
|
191
|
+
/** Choose the entry step from prepared defaults without hiding earlier steps. */
|
|
192
|
+
resolveInitialStepIndex?: (context: SelectionFlowContextValue<TDraft, TDraftUpdate, TField, TModuleType, TServices, THostContext>) => number | undefined;
|
|
191
193
|
onPresentationReady?: (automaticModuleKeys: readonly string[]) => void;
|
|
192
194
|
hostContext?: THostContext;
|
|
193
195
|
services: TServices;
|