@poirazis/supercomponents-shared 1.1.8 → 1.2.1
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/dist/index.js +21180 -40125
- package/dist/index.umd.cjs +19 -26
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/index.js +4 -0
- package/src/index.ts +3 -0
- package/src/lib/Actions/index.js +3 -3
- package/src/lib/Actions/position_dropdown.js +14 -7
- package/src/lib/SuperButton/SuperButton.svelte +34 -3
- package/src/lib/SuperField/SuperField.svelte +0 -11
- package/src/lib/SuperForm/InnerForm.svelte +1 -1
- package/src/lib/SuperList/SuperList.svelte +2 -2
- package/src/lib/SuperList/drag-handle.svelte +8 -8
- package/src/lib/SuperPopover/SuperPopover.svelte +2 -2
- package/src/lib/SuperTable/SuperTable.css +8 -3
- package/src/lib/SuperTable/SuperTable.svelte +3 -3
- package/src/lib/SuperTable/controls/PaginationLimitOffset.svelte +2 -0
- package/src/lib/SuperTable/controls/SelectionColumn.svelte +18 -49
- package/src/lib/SuperTable/controls/SuperTableWelcome.svelte +1 -1
- package/src/lib/SuperTable/overlays/AddNewRowOverlay.svelte +3 -3
- package/src/lib/SuperTable/overlays/EmptyResultSetOverlay.svelte +1 -1
- package/src/lib/SuperTable/overlays/ScrollbarsOverlay.svelte +43 -43
- package/src/lib/SuperTableCells/CellAttachmentExpanded.svelte +1 -1
- package/src/lib/SuperTableCells/CellAttachmentSlider.svelte +2 -3
- package/src/lib/SuperTableCells/CellBoolean.svelte +1 -1
- package/src/lib/SuperTableCells/CellColor.svelte +7 -7
- package/src/lib/SuperTableCells/CellCommon.css +1 -1
- package/src/lib/SuperTableCells/CellIcon.svelte +7 -7
- package/src/lib/SuperTableCells/CellJSON.svelte +2 -2
- package/src/lib/SuperTableCells/CellLink.svelte +50 -43
- package/src/lib/SuperTableCells/CellLinkAdvanced.svelte +2 -16
- package/src/lib/SuperTableCells/CellLinkPickerSelect.svelte +10 -11
- package/src/lib/SuperTableCells/CellLinkPickerTree.svelte +4 -2
- package/src/lib/SuperTableCells/CellNumber.svelte +24 -5
- package/src/lib/SuperTableCells/CellOptions.svelte +20 -34
- package/src/lib/SuperTableCells/CellOptionsAdvanced.svelte +5 -5
- package/src/lib/SuperTableCells/CellSQLLink.svelte +24 -36
- package/src/lib/SuperTableCells/CellSQLLinkPicker.svelte +9 -9
- package/src/lib/SuperTableCells/CellString.svelte +3 -3
- package/src/lib/SuperTableCells/CellStringMask.svelte +1 -1
- package/src/lib/SuperTableCells/CellTags.svelte +151 -108
- package/src/lib/SuperTableCells/JSDOC_GUIDE.md +163 -3
- package/src/lib/SuperTableCells/types.js +141 -192
- package/src/lib/SuperTableColumn/SuperTableColumn.svelte +1 -1
- package/src/lib/SuperTableColumn/parts/SuperColumnHeader.svelte +2 -2
- package/src/lib/SuperTableColumn/parts/SuperColumnRow.svelte +5 -3
- package/src/lib/SuperTabs/SuperTabs.svelte +2 -2
- package/src/lib/SuperTree/SuperTree.svelte +84 -38
- package/src/lib/UI/elements/Checkbox.svelte +36 -6
- package/src/lib/UI/elements/IconButton.svelte +115 -0
- package/src/lib/UI/elements/Tooltip.svelte +65 -0
|
@@ -26,7 +26,167 @@ This guide demonstrates how to use JSDoc annotations for **type definitions only
|
|
|
26
26
|
|
|
27
27
|
## Type Definitions
|
|
28
28
|
|
|
29
|
-
All types are defined in `types.js` using
|
|
29
|
+
All types are defined in `types.js` using a **unified CellOptions type**:
|
|
30
|
+
|
|
31
|
+
- `CellOptions` - Single type with common base properties + optional type-specific extensions
|
|
32
|
+
- `CellApi` - Standard API interface exported by all cells
|
|
33
|
+
- `CellRole`, `CellState`, `CellAlign` - Enum types
|
|
34
|
+
- `FieldSchema` - Budibase field schema type
|
|
35
|
+
|
|
36
|
+
### CellOptions Structure
|
|
37
|
+
|
|
38
|
+
The unified `CellOptions` type contains:
|
|
39
|
+
|
|
40
|
+
- **Common properties** (role, readonly, disabled, placeholder, etc.) - used by all cells
|
|
41
|
+
- **Type-specific properties** organized by category (Number, Boolean, Options, Datetime, etc.)
|
|
42
|
+
|
|
43
|
+
All properties are optional except where noted. Components only use the properties relevant to them.
|
|
44
|
+
|
|
45
|
+
## Cell FSM State Machine
|
|
46
|
+
|
|
47
|
+
All cell components use a finite state machine (FSM) managed by `svelte-fsm` to handle user interactions and data loading states. The FSM provides a clean, declarative way to manage component state transitions.
|
|
48
|
+
|
|
49
|
+
### Core States
|
|
50
|
+
|
|
51
|
+
The cell FSM supports three core reachable states:
|
|
52
|
+
|
|
53
|
+
| State | Usage | Transitions |
|
|
54
|
+
| ----------- | --------------------------------------- | --------------------------------------- |
|
|
55
|
+
| **View** | Default display state, read-only | → Editing (on focus) |
|
|
56
|
+
| **Editing** | User is actively editing the cell value | → View (on focusout, submit, or cancel) |
|
|
57
|
+
| **Loading** | Data is being fetched or processed | → View (when data loads) |
|
|
58
|
+
|
|
59
|
+
### State Diagram
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
┌──────────────────────────────────┐
|
|
63
|
+
│ │
|
|
64
|
+
│ View (Display Mode) │
|
|
65
|
+
│ - Shows formatted value │
|
|
66
|
+
│ - Read-only or ready to edit │
|
|
67
|
+
│ │
|
|
68
|
+
└──────────────────────────────────┘
|
|
69
|
+
↑
|
|
70
|
+
│ focusout()
|
|
71
|
+
│ submit()
|
|
72
|
+
│ cancel()
|
|
73
|
+
│
|
|
74
|
+
↓
|
|
75
|
+
┌──────────────────────────────────┐
|
|
76
|
+
│ │
|
|
77
|
+
│ Editing (Edit Mode) │
|
|
78
|
+
│ - Input field active │
|
|
79
|
+
│ - User can modify value │
|
|
80
|
+
│ - Dispatch change events │
|
|
81
|
+
│ │
|
|
82
|
+
└──────────────────────────────────┘
|
|
83
|
+
↑
|
|
84
|
+
│ focus()
|
|
85
|
+
│ (when not readonly)
|
|
86
|
+
│
|
|
87
|
+
┌──────────────────────────────────┐
|
|
88
|
+
│ │
|
|
89
|
+
│ Loading (Async Mode) │
|
|
90
|
+
│ - Fetching data from server │
|
|
91
|
+
│ - Data-dependent cells only │
|
|
92
|
+
│ - Auto-transitions to View │
|
|
93
|
+
│ │
|
|
94
|
+
└──────────────────────────────────┘
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Global Transitions (Available in All States)
|
|
98
|
+
|
|
99
|
+
All states support these global methods via the `"*"` state:
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
export const cellState = fsm("View", {
|
|
103
|
+
"*": {
|
|
104
|
+
goTo(state) {
|
|
105
|
+
// Manual state transition (for external control)
|
|
106
|
+
return state;
|
|
107
|
+
},
|
|
108
|
+
reset(value) {
|
|
109
|
+
// Reset to initial value and View state
|
|
110
|
+
localValue = undefined;
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
// ... state-specific transitions
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Lifecycle Hooks
|
|
118
|
+
|
|
119
|
+
State transitions can trigger lifecycle methods:
|
|
120
|
+
|
|
121
|
+
- **`_enter()`** - Called when entering a state
|
|
122
|
+
- **`_exit()`** - Called when exiting a state
|
|
123
|
+
|
|
124
|
+
Example from CellString:
|
|
125
|
+
|
|
126
|
+
```javascript
|
|
127
|
+
Editing: {
|
|
128
|
+
_enter() {
|
|
129
|
+
originalValue = JSON.stringify(localValue); // Save for rollback
|
|
130
|
+
dispatch("enteredit"); // Notify parent
|
|
131
|
+
},
|
|
132
|
+
_exit() {
|
|
133
|
+
dispatch("exitedit"); // Cleanup
|
|
134
|
+
},
|
|
135
|
+
focusout() {
|
|
136
|
+
this.submit(); // Submit on blur
|
|
137
|
+
},
|
|
138
|
+
submit() {
|
|
139
|
+
dispatch("change", localValue);
|
|
140
|
+
return "View"; // Transition back to View
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Usage Pattern
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
// Declare FSM with initial state
|
|
149
|
+
export const cellState = fsm(cellOptions.initialState ?? "View", {
|
|
150
|
+
View: {
|
|
151
|
+
/* ... */
|
|
152
|
+
},
|
|
153
|
+
Editing: {
|
|
154
|
+
/* ... */
|
|
155
|
+
},
|
|
156
|
+
Loading: {
|
|
157
|
+
/* ... */
|
|
158
|
+
}, // Optional, for data-dependent cells
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// Subscribe to state changes in component
|
|
162
|
+
$: inEdit = $cellState === "Editing";
|
|
163
|
+
$: isDirty = inEdit && originalValue !== JSON.stringify(localValue);
|
|
164
|
+
|
|
165
|
+
// Trigger transitions from event handlers
|
|
166
|
+
const handleFocus = () => cellState.focus();
|
|
167
|
+
const handleBlur = () => cellState.focusout();
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Data-Dependent Cells
|
|
171
|
+
|
|
172
|
+
Cells that fetch data (CellOptions, CellTags, CellOptionsAdvanced) use the Loading state:
|
|
173
|
+
|
|
174
|
+
```javascript
|
|
175
|
+
Loading: {
|
|
176
|
+
_enter() {
|
|
177
|
+
// Fetch data from server
|
|
178
|
+
loadOptions();
|
|
179
|
+
},
|
|
180
|
+
syncFetch(fetch) {
|
|
181
|
+
// Handle synchronous fetch results
|
|
182
|
+
return "View"; // Auto-transition when done
|
|
183
|
+
},
|
|
184
|
+
focus() {
|
|
185
|
+
// Allow editing while loading
|
|
186
|
+
return "Editing";
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
```
|
|
30
190
|
|
|
31
191
|
## JavaScript Example: CellString.svelte (Reference Implementation)
|
|
32
192
|
|
|
@@ -36,7 +196,7 @@ All types are defined in `types.js` using JSDoc `@typedef` syntax.
|
|
|
36
196
|
import fsm from "svelte-fsm";
|
|
37
197
|
|
|
38
198
|
/**
|
|
39
|
-
* @typedef {import('./types.js').
|
|
199
|
+
* @typedef {import('./types.js').CellOptions} CellOptions
|
|
40
200
|
* @typedef {import('./types.js').CellApi} CellApi
|
|
41
201
|
*/
|
|
42
202
|
|
|
@@ -49,7 +209,7 @@ All types are defined in `types.js` using JSDoc `@typedef` syntax.
|
|
|
49
209
|
/** @type {string | undefined} */
|
|
50
210
|
export let formattedValue = undefined;
|
|
51
211
|
|
|
52
|
-
/** @type {
|
|
212
|
+
/** @type {CellOptions} */
|
|
53
213
|
export let cellOptions = {
|
|
54
214
|
role: "formInput",
|
|
55
215
|
initialState: "Editing",
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Shared type definitions for SuperTableCells components using JSDoc
|
|
3
3
|
* These types provide IntelliSense and type checking for both JavaScript and TypeScript files.
|
|
4
|
+
*
|
|
5
|
+
* Uses a unified CellOptions type with common base properties and optional type-specific extensions.
|
|
4
6
|
*/
|
|
5
7
|
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// ENUMS & PRIMITIVE TYPES
|
|
10
|
+
// ============================================================================
|
|
11
|
+
|
|
6
12
|
/**
|
|
7
13
|
* Cell role determines the rendering context and styling
|
|
8
14
|
* @typedef {"formInput" | "tableCell" | "inlineInput"} CellRole
|
|
9
15
|
*/
|
|
10
16
|
|
|
11
17
|
/**
|
|
12
|
-
* Cell state for FSM
|
|
18
|
+
* Cell state for FSM. Represents reachable states in the cell component finite state machines.
|
|
19
|
+
* - View: Default read-only display state
|
|
20
|
+
* - Editing: User is actively editing the cell value
|
|
21
|
+
* - Loading: Data is being fetched (used by cells with data dependencies)
|
|
13
22
|
* @typedef {"View" | "Editing" | "Loading"} CellState
|
|
14
23
|
*/
|
|
15
24
|
|
|
@@ -19,211 +28,151 @@
|
|
|
19
28
|
*/
|
|
20
29
|
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @typedef {
|
|
24
|
-
* @property {CellRole} [role] - Role determines the rendering context
|
|
25
|
-
* @property {CellState} [initialState] - Initial FSM state
|
|
26
|
-
* @property {number} [debounce] - Debounce delay in milliseconds for change events
|
|
27
|
-
* @property {boolean} [readonly] - Whether the cell is read-only
|
|
28
|
-
* @property {boolean} [disabled] - Whether the cell is disabled
|
|
29
|
-
* @property {string} [placeholder] - Placeholder text when empty
|
|
30
|
-
* @property {string} [template] - Template string for formatting display value
|
|
31
|
-
* @property {string} [icon] - Icon to display (CSS class)
|
|
32
|
-
* @property {boolean} [error] - Whether the cell has an error
|
|
33
|
-
* @property {boolean} [showDirty] - Whether to show dirty indicator
|
|
34
|
-
* @property {CellAlign} [align] - Text/content alignment
|
|
35
|
-
* @property {string} [color] - Text color
|
|
36
|
-
* @property {string} [background] - Background color
|
|
31
|
+
* Control type union covering all cell variants
|
|
32
|
+
* @typedef {"input" | "textarea" | "switch" | "checkbox" | "pills" | "text" | "links" | "list" | "buttons" | "radio" | "grid" | "carousel" | "expanded" | "inputSelect"} CellControlType
|
|
37
33
|
*/
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
* @property {CellRole} [role] - Role determines the rendering context
|
|
43
|
-
* @property {CellState} [initialState] - Initial FSM state
|
|
44
|
-
* @property {number} [debounce] - Debounce delay in milliseconds
|
|
45
|
-
* @property {boolean} [readonly] - Whether the cell is read-only
|
|
46
|
-
* @property {boolean} [disabled] - Whether the cell is disabled
|
|
47
|
-
* @property {string} [placeholder] - Placeholder text when empty
|
|
48
|
-
* @property {string} [template] - Template string for formatting display value
|
|
49
|
-
* @property {string} [icon] - Icon to display (CSS class)
|
|
50
|
-
* @property {boolean} [error] - Whether the cell has an error
|
|
51
|
-
* @property {boolean} [showDirty] - Whether to show dirty indicator
|
|
52
|
-
* @property {CellAlign} [align] - Text/content alignment
|
|
53
|
-
* @property {string} [color] - Text color
|
|
54
|
-
* @property {string} [background] - Background color
|
|
55
|
-
* @property {"input" | "textarea"} [controlType] - Control type for input
|
|
56
|
-
* @property {boolean} [clearIcon] - Whether to show clear icon
|
|
57
|
-
*/
|
|
35
|
+
// ============================================================================
|
|
36
|
+
// UNIFIED CELL OPTIONS
|
|
37
|
+
// ============================================================================
|
|
58
38
|
|
|
59
39
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @property {
|
|
69
|
-
* @property {
|
|
70
|
-
* @property {
|
|
71
|
-
* @property {boolean} [showDirty] - Whether to show dirty indicator
|
|
72
|
-
* @property {CellAlign} [align] - Text/content alignment
|
|
73
|
-
* @property {string} [color] - Text color
|
|
74
|
-
* @property {string} [background] - Background color
|
|
75
|
-
* @property {number} [defaultValue] - Default value for the cell
|
|
76
|
-
* @property {boolean} [showStepper] - Whether to show stepper controls
|
|
77
|
-
* @property {number} [stepSize] - Step increment value
|
|
78
|
-
* @property {number} [min] - Minimum value
|
|
79
|
-
* @property {number} [max] - Maximum value
|
|
80
|
-
* @property {number} [decimals] - Decimal places to show
|
|
81
|
-
* @property {string} [thousandsSeparator] - Thousands separator character
|
|
82
|
-
* @property {string} [clearValueIcon] - Icon to clear value
|
|
83
|
-
* @property {boolean} [enableWheel] - Whether to enable mouse wheel
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Options specific to CellBoolean component
|
|
88
|
-
* @typedef {Object} CellBooleanOptions
|
|
89
|
-
* @property {CellRole} [role] - Role determines the rendering context
|
|
90
|
-
* @property {CellState} [initialState] - Initial FSM state
|
|
91
|
-
* @property {number} [debounce] - Debounce delay in milliseconds
|
|
92
|
-
* @property {boolean} [readonly] - Whether the cell is read-only
|
|
93
|
-
* @property {boolean} [disabled] - Whether the cell is disabled
|
|
94
|
-
* @property {string} [placeholder] - Placeholder text when empty
|
|
95
|
-
* @property {string} [template] - Template string for formatting display value
|
|
96
|
-
* @property {string} [icon] - Icon to display (CSS class)
|
|
97
|
-
* @property {boolean} [error] - Whether the cell has an error
|
|
98
|
-
* @property {boolean} [showDirty] - Whether to show dirty indicator
|
|
99
|
-
* @property {CellAlign} [align] - Text/content alignment
|
|
100
|
-
* @property {string} [color] - Text color
|
|
101
|
-
* @property {string} [background] - Background color
|
|
102
|
-
* @property {string | number} [fontWeight] - Font weight
|
|
103
|
-
* @property {"switch" | "checkbox"} [controlType] - Control type: switch or checkbox
|
|
104
|
-
* @property {string} [inlineLabel] - Label to display inline with control
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Options specific to CellOptions/CellOptionsAdvanced components
|
|
109
|
-
* @typedef {Object} CellOptionsOptions
|
|
110
|
-
* @property {CellRole} [role] - Role determines the rendering context
|
|
111
|
-
* @property {CellState} [initialState] - Initial FSM state
|
|
112
|
-
* @property {number} [debounce] - Debounce delay in milliseconds
|
|
40
|
+
* Unified options for all Cell components.
|
|
41
|
+
* Contains common base properties and optional type-specific extensions.
|
|
42
|
+
*
|
|
43
|
+
* @typedef {Object} CellOptions
|
|
44
|
+
*
|
|
45
|
+
* ---------------------------------------------------------------------------
|
|
46
|
+
* COMMON PROPERTIES (used by all/most cells)
|
|
47
|
+
* ---------------------------------------------------------------------------
|
|
48
|
+
* @property {CellRole} [role="formInput"] - Role determines the rendering context and styling
|
|
49
|
+
* @property {CellState} [initialState="View"] - Initial FSM state
|
|
50
|
+
* @property {number} [debounce] - Debounce delay in milliseconds for change events
|
|
113
51
|
* @property {boolean} [readonly] - Whether the cell is read-only
|
|
114
52
|
* @property {boolean} [disabled] - Whether the cell is disabled
|
|
115
53
|
* @property {string} [placeholder] - Placeholder text when empty
|
|
116
|
-
* @property {string} [template] - Template string for formatting display value
|
|
117
|
-
* @property {string} [icon] - Icon to display (
|
|
118
|
-
* @property {boolean} [error] - Whether the cell has an error
|
|
119
|
-
* @property {boolean} [showDirty] - Whether to show dirty indicator
|
|
54
|
+
* @property {string} [template] - Template string for formatting display value (uses processStringSync)
|
|
55
|
+
* @property {string} [icon] - Icon CSS class to display (e.g., "ph ph-warning")
|
|
56
|
+
* @property {boolean} [error] - Whether the cell has an error state
|
|
57
|
+
* @property {boolean} [showDirty] - Whether to show dirty/modified indicator
|
|
120
58
|
* @property {CellAlign} [align] - Text/content alignment
|
|
121
|
-
* @property {string} [color] - Text color
|
|
122
|
-
* @property {string} [background] - Background color
|
|
59
|
+
* @property {string} [color] - Text color (CSS value)
|
|
60
|
+
* @property {string} [background] - Background color (CSS value)
|
|
123
61
|
* @property {string | number} [fontWeight] - Font weight
|
|
62
|
+
* @property {CellControlType} [controlType] - Control type variant for the cell
|
|
63
|
+
* @property {boolean} [clearIcon] - Whether to show clear/reset icon
|
|
64
|
+
*
|
|
65
|
+
* ---------------------------------------------------------------------------
|
|
66
|
+
* NUMBER PROPERTIES
|
|
67
|
+
* ---------------------------------------------------------------------------
|
|
68
|
+
* @property {number} [defaultValue] - Default numeric value
|
|
69
|
+
* @property {boolean} [showStepper] - Whether to show increment/decrement stepper controls
|
|
70
|
+
* @property {number} [stepSize] - Step increment value for stepper
|
|
71
|
+
* @property {number} [min] - Minimum allowed value
|
|
72
|
+
* @property {number} [max] - Maximum allowed value
|
|
73
|
+
* @property {number} [decimals] - Number of decimal places to display
|
|
74
|
+
* @property {string} [thousandsSeparator] - Thousands separator character (e.g., ",")
|
|
75
|
+
* @property {string} [clearValueIcon] - Icon for clearing numeric value
|
|
76
|
+
* @property {boolean} [enableWheel] - Whether to enable mouse wheel for value changes
|
|
77
|
+
*
|
|
78
|
+
* ---------------------------------------------------------------------------
|
|
79
|
+
* BOOLEAN PROPERTIES
|
|
80
|
+
* ---------------------------------------------------------------------------
|
|
81
|
+
* @property {string} [inlineLabel] - Label to display inline with boolean control
|
|
82
|
+
* @property {boolean} [showFalse] - Whether to show icon/indicator for false value
|
|
83
|
+
*
|
|
84
|
+
* ---------------------------------------------------------------------------
|
|
85
|
+
* OPTIONS/SELECT PROPERTIES
|
|
86
|
+
* ---------------------------------------------------------------------------
|
|
124
87
|
* @property {"pills" | "text" | "links" | "list" | "buttons" | "radio"} [optionsViewMode] - View mode for options display
|
|
125
|
-
* @property {
|
|
126
|
-
* @property {boolean} [showColors] - Whether to show colors
|
|
127
|
-
* @property {"schema" | "custom" | "datasource"} [optionsSource] - Data source type
|
|
88
|
+
* @property {"schema" | "custom" | "data"} [optionsSource] - Data source type for options
|
|
128
89
|
* @property {Array<{label: string, value: any, color?: string}>} [customOptions] - Custom options array
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
*
|
|
133
|
-
* @
|
|
134
|
-
* @property {
|
|
135
|
-
* @property {
|
|
136
|
-
* @property {
|
|
137
|
-
* @property {
|
|
138
|
-
* @property {
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
* @property {
|
|
144
|
-
* @property {
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
90
|
+
* @property {boolean} [reorderOnly] - Whether to only allow reordering (no add/remove)
|
|
91
|
+
* @property {boolean} [showColors] - Whether to show option colors
|
|
92
|
+
* @property {boolean} [autocomplete] - Whether to enable autocomplete filtering
|
|
93
|
+
* @property {string} [valueColumn] - Column name for option values (datasource mode)
|
|
94
|
+
* @property {string} [labelColumn] - Column name for option labels (datasource mode)
|
|
95
|
+
* @property {string} [colorColumn] - Column name for option colors (datasource mode)
|
|
96
|
+
* @property {string} [sortColumn] - Column to sort options by
|
|
97
|
+
* @property {"ascending" | "descending"} [sortOrder] - Sort order for options
|
|
98
|
+
* @property {Object} [datasource] - Datasource configuration for options
|
|
99
|
+
* @property {Array} [filter] - Filter array for datasource options
|
|
100
|
+
*
|
|
101
|
+
* ---------------------------------------------------------------------------
|
|
102
|
+
* DATETIME PROPERTIES
|
|
103
|
+
* ---------------------------------------------------------------------------
|
|
104
|
+
* @property {"default" | "MM/DD/YYYY" | "DD/MM/YYYY" | "YYYY-MM-DD" | "MMM DD, YYYY" | "DD MMM YYYY"} [dateFormat] - Date format string
|
|
105
|
+
* @property {boolean} [showTime] - Whether to show time picker
|
|
106
|
+
*
|
|
107
|
+
* ---------------------------------------------------------------------------
|
|
108
|
+
* JSON PROPERTIES
|
|
109
|
+
* ---------------------------------------------------------------------------
|
|
110
|
+
* @property {boolean} [multiline] - Whether to enable multiline JSON editing
|
|
111
|
+
*
|
|
112
|
+
* ---------------------------------------------------------------------------
|
|
113
|
+
* LINK/RELATIONSHIP PROPERTIES
|
|
114
|
+
* ---------------------------------------------------------------------------
|
|
115
|
+
* @property {"pills" | "text"} [relViewMode] - View mode for relationship display
|
|
116
|
+
* @property {boolean} [simpleView] - Use simple text view for links
|
|
117
|
+
* @property {number} [limit] - Limit number of related records to fetch
|
|
118
|
+
* @property {string} [search] - Search term for filtering related records
|
|
119
|
+
* @property {string} [ownId] - Current row ID (for self-referencing relationships)
|
|
120
|
+
* @property {string} [joinColumn] - Join column for SQL relationships
|
|
121
|
+
*
|
|
122
|
+
* ---------------------------------------------------------------------------
|
|
123
|
+
* ATTACHMENT PROPERTIES
|
|
124
|
+
* ---------------------------------------------------------------------------
|
|
149
125
|
* @property {"landscape" | "portrait" | "square"} [imageRatio] - Image aspect ratio
|
|
150
|
-
* @property {number} [gridColumns] -
|
|
126
|
+
* @property {number} [gridColumns] - Number of grid columns (for grid mode)
|
|
151
127
|
* @property {boolean} [isGallery] - Whether in gallery mode
|
|
152
|
-
* @property {"view" | "download" | "none"} [onClickAction] - Action on click
|
|
128
|
+
* @property {"view" | "download" | "none"} [onClickAction] - Action on attachment click
|
|
153
129
|
* @property {boolean} [slotted] - Whether using slot content
|
|
154
|
-
* @property {boolean} [carouselDots] - Show carousel dots
|
|
155
|
-
* @property {boolean} [carouselArrows] - Show carousel arrows
|
|
156
|
-
* @property {boolean} [carouselInfinite] - Enable infinite carousel
|
|
157
|
-
* @property {boolean} [carouselAutoplay] - Enable autoplay
|
|
158
|
-
* @property {number} [carouselAutoplaySpeed] - Autoplay speed in
|
|
159
|
-
* @property {number} [carouselItemsToShow] - Number of items to show
|
|
160
|
-
* @property {number} [carouselItemsToScroll] - Number of items to scroll
|
|
161
|
-
* @property {"standard" | "marquee"} [carouselMode] - Carousel mode
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
*
|
|
166
|
-
* @
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* @property {boolean} [
|
|
172
|
-
* @property {
|
|
173
|
-
* @property {
|
|
174
|
-
* @property {
|
|
175
|
-
* @property {
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* @property {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
* @property {string} [background] - Background color
|
|
201
|
-
* @property {string | number} [fontWeight] - Font weight
|
|
202
|
-
* @property {boolean} [multiline] - Whether to enable multiline editing
|
|
203
|
-
*/
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Options specific to CellLink/CellLinkAdvanced/CellSQLLink components
|
|
207
|
-
* @typedef {Object} CellLinkOptions
|
|
208
|
-
* @property {CellRole} [role] - Role determines the rendering context
|
|
209
|
-
* @property {CellState} [initialState] - Initial FSM state
|
|
210
|
-
* @property {number} [debounce] - Debounce delay in milliseconds
|
|
211
|
-
* @property {boolean} [readonly] - Whether the cell is read-only
|
|
212
|
-
* @property {boolean} [disabled] - Whether the cell is disabled
|
|
213
|
-
* @property {string} [placeholder] - Placeholder text when empty
|
|
214
|
-
* @property {string} [template] - Template string for formatting display value
|
|
215
|
-
* @property {string} [icon] - Icon to display (CSS class)
|
|
216
|
-
* @property {boolean} [error] - Whether the cell has an error
|
|
217
|
-
* @property {boolean} [showDirty] - Whether to show dirty indicator
|
|
218
|
-
* @property {CellAlign} [align] - Text/content alignment
|
|
219
|
-
* @property {string} [color] - Text color
|
|
220
|
-
* @property {string} [background] - Background color
|
|
221
|
-
* @property {string | number} [fontWeight] - Font weight
|
|
222
|
-
* @property {boolean} [simpleView] - View mode for links display
|
|
223
|
-
* @property {*} [filter] - Filter for relationship options
|
|
224
|
-
* @property {number} [limit] - Limit number of options
|
|
225
|
-
* @property {string} [search] - Search term
|
|
226
|
-
*/
|
|
130
|
+
* @property {boolean} [carouselDots] - Show carousel navigation dots
|
|
131
|
+
* @property {boolean} [carouselArrows] - Show carousel navigation arrows
|
|
132
|
+
* @property {boolean} [carouselInfinite] - Enable infinite carousel loop
|
|
133
|
+
* @property {boolean} [carouselAutoplay] - Enable carousel autoplay
|
|
134
|
+
* @property {number} [carouselAutoplaySpeed] - Autoplay speed in milliseconds
|
|
135
|
+
* @property {number} [carouselItemsToShow] - Number of items to show in carousel
|
|
136
|
+
* @property {number} [carouselItemsToScroll] - Number of items to scroll per action
|
|
137
|
+
* @property {"standard" | "marquee"} [carouselMode] - Carousel animation mode
|
|
138
|
+
*
|
|
139
|
+
* ---------------------------------------------------------------------------
|
|
140
|
+
* ICON PROPERTIES
|
|
141
|
+
* ---------------------------------------------------------------------------
|
|
142
|
+
* @property {boolean} [showCategories] - Whether to show icon category tabs
|
|
143
|
+
*
|
|
144
|
+
* ---------------------------------------------------------------------------
|
|
145
|
+
* COLOR PROPERTIES
|
|
146
|
+
* ---------------------------------------------------------------------------
|
|
147
|
+
* @property {boolean} [allowCustom] - Whether to allow custom color input
|
|
148
|
+
* @property {"circle" | "square"} [swatch] - Color swatch shape
|
|
149
|
+
* @property {boolean} [themeColors] - Whether to show theme colors
|
|
150
|
+
* @property {boolean} [staticColors] - Whether to show static colors
|
|
151
|
+
* @property {Array<{label: string, value: string}>} [customColors] - Custom color palette
|
|
152
|
+
*
|
|
153
|
+
* ---------------------------------------------------------------------------
|
|
154
|
+
* TAGS PROPERTIES
|
|
155
|
+
* ---------------------------------------------------------------------------
|
|
156
|
+
* @property {boolean} [suggestions] - Whether to show tag suggestions from datasource
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
// ============================================================================
|
|
160
|
+
// BACKWARD-COMPATIBLE TYPE ALIASES
|
|
161
|
+
// These allow existing imports to continue working during migration
|
|
162
|
+
// ============================================================================
|
|
163
|
+
|
|
164
|
+
/** @typedef {CellOptions} BaseCellOptions - @deprecated Use CellOptions instead */
|
|
165
|
+
/** @typedef {CellOptions} CellStringOptions - @deprecated Use CellOptions instead */
|
|
166
|
+
/** @typedef {CellOptions} CellNumberOptions - @deprecated Use CellOptions instead */
|
|
167
|
+
/** @typedef {CellOptions} CellBooleanOptions - @deprecated Use CellOptions instead */
|
|
168
|
+
/** @typedef {CellOptions} CellOptionsOptions - @deprecated Use CellOptions instead */
|
|
169
|
+
/** @typedef {CellOptions} CellAttachmentOptions - @deprecated Use CellOptions instead */
|
|
170
|
+
/** @typedef {CellOptions} CellDatetimeOptions - @deprecated Use CellOptions instead */
|
|
171
|
+
/** @typedef {CellOptions} CellJSONOptions - @deprecated Use CellOptions instead */
|
|
172
|
+
/** @typedef {CellOptions} CellLinkOptions - @deprecated Use CellOptions instead */
|
|
173
|
+
/** @typedef {CellOptions} CellColorOptions - @deprecated Use CellOptions instead */
|
|
174
|
+
/** @typedef {CellOptions} CellIconOptions - @deprecated Use CellOptions instead */
|
|
175
|
+
/** @typedef {CellOptions} CellTagsOptions - @deprecated Use CellOptions instead */
|
|
227
176
|
|
|
228
177
|
/**
|
|
229
178
|
* Common API interface for all cell components
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
style="align-self: center; font-size: 14px;"
|
|
113
113
|
on:click|preventDefault={() =>
|
|
114
114
|
(showFilteringOptions = !showFilteringOptions)}
|
|
115
|
-
|
|
115
|
+
></i>
|
|
116
116
|
{/if}
|
|
117
117
|
<svelte:component
|
|
118
118
|
this={$columnOptions.headerComponent}
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<i
|
|
147
147
|
class={sorted == "ascending" ? "ri-sort-asc" : "ri-sort-desc"}
|
|
148
148
|
class:sorted
|
|
149
|
-
|
|
149
|
+
></i>
|
|
150
150
|
{/if}
|
|
151
151
|
</span>
|
|
152
152
|
{/if}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
export let disabled;
|
|
23
23
|
|
|
24
24
|
// the default height
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
let viewport;
|
|
27
27
|
let info;
|
|
28
28
|
|
|
@@ -97,8 +97,10 @@
|
|
|
97
97
|
style:justify-content={$columnSettings.align}
|
|
98
98
|
on:mouseenter={() => ($stbHovered = index)}
|
|
99
99
|
on:mouseleave={() => ($stbHovered = undefined)}
|
|
100
|
-
on:click={() =>
|
|
101
|
-
|
|
100
|
+
on:click={() => {
|
|
101
|
+
if (!meta.disabled)
|
|
102
|
+
stbState.handleRowClick(index, field, deepGet(row, field), id);
|
|
103
|
+
}}
|
|
102
104
|
on:contextmenu|preventDefault={() => {
|
|
103
105
|
stbAPI.showContextMenu(index, viewport);
|
|
104
106
|
}}
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
{#if theme === "list" && list_title}
|
|
50
50
|
<div class="tab list-title">
|
|
51
51
|
{#if list_icon}
|
|
52
|
-
<i class={list_icon}
|
|
52
|
+
<i class={list_icon}></i>
|
|
53
53
|
{/if}
|
|
54
54
|
{list_title}
|
|
55
55
|
</div>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
class={container.icon}
|
|
77
77
|
style:font-size={tabsIconsOnly ? "20px" : null}
|
|
78
78
|
style:color={container.color}
|
|
79
|
-
|
|
79
|
+
></i>
|
|
80
80
|
{/if}
|
|
81
81
|
|
|
82
82
|
{#if !tabsIconsOnly || !container.icon}
|