Creates an instance of Dsm.
Initialization parameters.
Core dataset structure.
Optional
debug?: booleanDebug mode flag.
Optional
hooks?: DsCommonHooksHooks configuration.
Optional
useClone?: booleanWhether to use cloning.
Checks if the current state is busy (not normal).
true
if the state is busy, otherwise false
.
Checks if the current state is applying.
true
if the state is applying, otherwise false
.
Checks if the current state is normal.
true
if the state is normal, otherwise false
.
Checks if the current state is starting.
true
if the state is starting, otherwise false
.
Checks if the current state is submitting.
true
if the state is submitting, otherwise false
.
Gets the current mode.
The current mode name.
Gets the row count of the first table. tables[0], useful for single table case
The number of rows in the first table or undefined if no tables exist.
Gets the selected row location if only one row is selected. Row loc of rowsSel[0], useful for single selection case
The selected row location or undefined if multiple or no rows are selected.
Gets the reference to the selected row if only one row is selected. Row reference of rowsSel[0], useful for single selection case
The selected row or undefined if multiple or no rows are selected.
Gets the current state as a string.
The string representation of the current state.
Gets the first table from the core tables. tables[0], useful for single table case
The first table or undefined if no tables exist.
Gets the total number of tables in the dataset.
The number of tables.
Gets the selected table index if only one table is selected. table tid of tablesSel[0], useful for single selection case
The selected table index or undefined if multiple or no tables are selected.
Gets the reference to the selected table if only one table is selected. table reference of tablesSel[0], useful for single selection case
The selected table or an empty array if multiple or no tables are selected.
Gets the selected table indices.
An array of selected table indices.
Applies the current process and updates the state accordingly.
Optional
option: "cancel"Determines how the state transitions:
undefined
: Moves to Appling
state and triggers processing."cancel"
: Reverts to the previous state.true
if the application was successful, otherwise false
.
Handles row selection on mouse click with support for multi-selection modes. Only intended for frontend usage.
An object indicating whether the selection was successful.
Handles table selection on mouse click with support for multi-selection modes. Only intended for frontend usage.
The table reference or index.
The mouse event triggering the selection.
Optional
sort: "reverse" | "forward"The sorting direction.
An object indicating whether the selection was successful.
Deselects all selected tables and rows.
Deselects all selected rows.
Deselects all selected tables.
Retrieves the mode configuration registry or a specific mode's configuration.
Optional
mode: stringThe mode to retrieve the configuration for.
The entire mode registry if no mode is specified, otherwise the configuration for the given mode.
Find table if a table exists at the given index(tid).
The index of the table.
An object indicating whether the table exists and its reference if found.
Find table if a given table reference exists in the core tables.
The reference to the table.
An object indicating whether the table reference exists and its index if found.
Checks if both the current mode and state match the specified values.
The mode to check.
The state to check.
true
if both the mode and state match, otherwise false
.
Checks if the current mode matches the specified mode.
The mode to check.
true
if the current mode matches, otherwise false
.
Checks if a table or row (by index or location) is selected.
The table index or row location.
True if the table or row is selected, otherwise false.
Checks if a row at the given location is selected.
The row location.
True if the row is selected, otherwise false.
Checks if a row reference is selected.
The row reference.
True if the row is selected, otherwise false.
Checks if a table with the given index is selected.
The table index.
True if the table is selected, otherwise false.
Checks if a table reference is selected.
The table reference.
True if the table is selected, otherwise false.
Checks if the current state matches the specified state.
The state to check.
true
if the current state matches, otherwise false
.
Checks if all given row locations are valid.
The array of row locations.
True if all row locations are valid, otherwise false.
Checks if the specified mode is registered.
The mode to check.
true
if the mode is registered, otherwise false
.
Checks if all given table IDs are valid.
The array of table IDs.
True if all table IDs are valid, otherwise false.
Registers a new mode with an optional configuration.
The name of the mode to register.
Optional
config: DsModeConfig<D>Optional configuration for the mode.
Manipulates rows based on selection and placement rules.
Modifies rows or creates new tables based on placement rules.
Optional
target: {Sorts the selected rows based on table and row indices in the specified direction.
Optional
direction: "reverse" | "forward"The sorting direction, defaults to "forward".
Sorts the selected table indices in the specified direction.
Optional
direction: "reverse" | "forward"The sorting direction, defaults to "forward".
Starts a new mode and updates the state accordingly. Fsm start point, start the specified mode
The mode to start.
Optional
option: "submitted" | "applied"Determines how the state transitions:
undefined
: Moves to Starting
state."submitted"
: Skips Starting
and moves directly to Submitting
state."applied"
: Skips Starting
and Submitting
, moves directly to Appling
state, and triggers processing.true
if the mode was successfully started, otherwise false
.
Submits the current process and updates the state accordingly.
Optional
option: "applied" | "cancel"Determines how the state transitions:
undefined
: Moves to Submitting
state."cancel"
: Cancels the process and returns to Normal
state."applied"
: Skips Submitting
, moves directly to Appling
state, and triggers processing.true
if the submission was successful, otherwise false
.
Converts table references to their corresponding table indices.
An array of table references.
An object indicating whether all tables were found and their corresponding indices.
Extended dataset manager with state machine.