@simplysm/angular 14.0.23 → 14.0.25

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/docs/ui-layout.md DELETED
@@ -1,216 +0,0 @@
1
- # UI Layout
2
-
3
- Layout components for structuring page content: dock panels, panes, views, cards, and kanban boards.
4
-
5
- ## `SdDockContainerControl`
6
-
7
- Flex container that positions child `SdDockControl` panels around a central content area.
8
-
9
- ```typescript
10
- @Component({ selector: "sd-dock-container" })
11
- class SdDockContainerControl {
12
- contentClass = input<string>();
13
- }
14
- ```
15
-
16
- | Input | Type | Description |
17
- |-------|------|-------------|
18
- | `contentClass` | `string \| undefined` | CSS class applied to the inner content div |
19
-
20
- ## `SdDockControl`
21
-
22
- Dockable panel that attaches to a side of `SdDockContainerControl`. Supports resizing with optional config persistence.
23
-
24
- ```typescript
25
- @Component({ selector: "sd-dock" })
26
- class SdDockControl {
27
- key = input<string>();
28
- position = input<"top" | "bottom" | "right" | "left">("top");
29
- resizable = input(false, { transform: booleanAttribute });
30
- size = signal(0);
31
- }
32
- ```
33
-
34
- | Input | Type | Default | Description |
35
- |-------|------|---------|-------------|
36
- | `key` | `string \| undefined` | — | Persistence key for resize state |
37
- | `position` | `"top" \| "bottom" \| "right" \| "left"` | `"top"` | Dock position |
38
- | `resizable` | `boolean` | `false` | Enable drag-to-resize |
39
-
40
- ## `SdPaneDirective`
41
-
42
- CSS utility directive that makes the host element fill its container with scrollable overflow.
43
-
44
- ```typescript
45
- @Directive({ selector: "sd-pane, [sd-pane]" })
46
- class SdPaneDirective { }
47
- ```
48
-
49
- Applies `class="fill"` and `style="display: block"`.
50
-
51
- ## `SdGapControl`
52
-
53
- Empty spacer element with configurable width and/or height.
54
-
55
- ```typescript
56
- @Component({ selector: "sd-gap" })
57
- class SdGapControl {
58
- height = input<"xxs" | "xs" | "sm" | "default" | "lg" | "xl" | "xxl">();
59
- heightPx = input<number>();
60
- width = input<"xxs" | "xs" | "sm" | "default" | "lg" | "xl" | "xxl">();
61
- widthPx = input<number>();
62
- widthEm = input<number>();
63
- }
64
- ```
65
-
66
- | Input | Type | Description |
67
- |-------|------|-------------|
68
- | `height` | size token \| undefined | Named vertical gap |
69
- | `heightPx` | `number \| undefined` | Explicit height in px |
70
- | `width` | size token \| undefined | Named horizontal gap |
71
- | `widthPx` | `number \| undefined` | Explicit width in px |
72
- | `widthEm` | `number \| undefined` | Explicit width in em |
73
-
74
- ## `SdViewControl`
75
-
76
- Container that shows one child `SdViewItemControl` at a time based on a matched value.
77
-
78
- ```typescript
79
- @Component({ selector: "sd-view" })
80
- class SdViewControl {
81
- value = input<any>();
82
- fill = input(false, { transform: booleanAttribute });
83
- }
84
- ```
85
-
86
- | Input | Type | Default | Description |
87
- |-------|------|---------|-------------|
88
- | `value` | `any` | — | Currently active view value |
89
- | `fill` | `boolean` | `false` | When true, sets `height: 100%` |
90
-
91
- ## `SdViewItemControl`
92
-
93
- Content panel shown only when its `value` matches the parent `SdViewControl.value`.
94
-
95
- ```typescript
96
- @Component({ selector: "sd-view-item" })
97
- class SdViewItemControl {
98
- value = input<any>();
99
- isSelected = computed(/* parent.value() === this.value() */);
100
- }
101
- ```
102
-
103
- ## `SdCardDirective`
104
-
105
- CSS marker directive that applies the `.card` class (background, border-radius, shadow, hover elevation).
106
-
107
- ```typescript
108
- @Directive({ selector: "sd-card, [sd-card]" })
109
- class SdCardDirective { }
110
- ```
111
-
112
- ## `SdKanbanBoardControl`
113
-
114
- Container for kanban lanes. Manages drag-and-drop state and multi-selection.
115
-
116
- ```typescript
117
- @Component({ selector: "sd-kanban-board" })
118
- class SdKanbanBoardControl<L, T> {
119
- selectedValues = model<T[]>([]);
120
- drop = output<ISdKanbanBoardDropInfo<L, T>>();
121
- dragKanban = signal<ISdKanbanDragRef<L, T> | undefined>(undefined);
122
- }
123
- ```
124
-
125
- | Model/Output | Type | Description |
126
- |--------------|------|-------------|
127
- | `selectedValues` | `T[]` | Two-way bound selected kanban card values |
128
- | `drop` | `ISdKanbanBoardDropInfo<L, T>` | Emitted when a card is dropped |
129
-
130
- ## `ISdKanbanBoardDropInfo`
131
-
132
- ```typescript
133
- interface ISdKanbanBoardDropInfo<L, T> {
134
- sourceKanbanValue?: T;
135
- targetLaneValue?: L;
136
- targetKanbanValue?: T;
137
- }
138
- ```
139
-
140
- | Field | Type | Description |
141
- |-------|------|-------------|
142
- | `sourceKanbanValue` | `T \| undefined` | Value of the dragged card |
143
- | `targetLaneValue` | `L \| undefined` | Value of the target lane |
144
- | `targetKanbanValue` | `T \| undefined` | Value of the card dropped before |
145
-
146
- ## `ISdKanbanDragRef`
147
-
148
- ```typescript
149
- interface ISdKanbanDragRef<_L, T> {
150
- value(): T | undefined;
151
- heightOnDrag(): number;
152
- }
153
- ```
154
-
155
- | Field | Type | Description |
156
- |-------|------|-------------|
157
- | `value` | `() => T \| undefined` | Dragged card value |
158
- | `heightOnDrag` | `() => number` | Card height at drag start (for placeholder) |
159
-
160
- ## `ISdKanbanDropTarget`
161
-
162
- ```typescript
163
- interface ISdKanbanDropTarget<L, T> {
164
- targetLaneValue(): L | undefined;
165
- targetKanbanValue?(): T | undefined;
166
- }
167
- ```
168
-
169
- | Field | Type | Description |
170
- |-------|------|-------------|
171
- | `targetLaneValue` | `() => L \| undefined` | Lane value of drop target |
172
- | `targetKanbanValue` | `(() => T \| undefined) \| undefined` | Card value if dropping before a card |
173
-
174
- ## `SdKanbanControl`
175
-
176
- Individual kanban card. Supports drag-and-drop and shift-click selection. Implements `ISdKanbanDragRef` and `ISdKanbanDropTarget`.
177
-
178
- ```typescript
179
- @Component({ selector: "sd-kanban" })
180
- class SdKanbanControl<L, T> implements ISdKanbanDragRef<L, T>, ISdKanbanDropTarget<L, T> {
181
- value = input<T>();
182
- selectable = input(false, { transform: booleanAttribute });
183
- draggable = input(false, { transform: booleanAttribute });
184
- contentClass = input<string>();
185
- }
186
- ```
187
-
188
- | Input | Type | Default | Description |
189
- |-------|------|---------|-------------|
190
- | `value` | `T \| undefined` | — | Card identity value |
191
- | `selectable` | `boolean` | `false` | Enable shift-click selection |
192
- | `draggable` | `boolean` | `false` | Enable drag-and-drop |
193
- | `contentClass` | `string \| undefined` | — | CSS class for inner card |
194
-
195
- ## `SdKanbanLaneControl`
196
-
197
- Kanban lane (column) that holds kanban cards. Implements `ISdKanbanDropTarget`. Supports collapse, select-all, and custom title/tool templates.
198
-
199
- ```typescript
200
- @Component({ selector: "sd-kanban-lane" })
201
- class SdKanbanLaneControl<L, T> implements ISdKanbanDropTarget<L, T> {
202
- value = input<L>();
203
- busy = input(false, { transform: booleanAttribute });
204
- useCollapse = input(false, { transform: booleanAttribute });
205
- collapse = model(false);
206
- }
207
- ```
208
-
209
- | Input | Type | Default | Description |
210
- |-------|------|---------|-------------|
211
- | `value` | `L \| undefined` | — | Lane identity value |
212
- | `busy` | `boolean` | `false` | Shows busy indicator |
213
- | `useCollapse` | `boolean` | `false` | Enables collapse toggle |
214
- | `collapse` | `boolean` | `false` | Two-way collapsed state |
215
-
216
- Content templates: `#toolTpl`, `#titleTpl`.
@@ -1,243 +0,0 @@
1
- # UI Navigation
2
-
3
- Navigation components: collapse, tabs, pagination, sidebar, and topbar.
4
-
5
- ## `SdCollapseControl`
6
-
7
- Animated collapse/expand container using height-based margin transition.
8
-
9
- ```typescript
10
- @Component({ selector: "sd-collapse" })
11
- class SdCollapseControl {
12
- open = input(false, { transform: booleanAttribute });
13
- }
14
- ```
15
-
16
- | Input | Type | Default | Description |
17
- |-------|------|---------|-------------|
18
- | `open` | `boolean` | `false` | Whether content is expanded |
19
-
20
- ## `SdCollapseIconControl`
21
-
22
- Animated chevron icon that rotates when the associated collapse is open.
23
-
24
- ```typescript
25
- @Component({ selector: "sd-collapse-icon" })
26
- class SdCollapseIconControl {
27
- open = input(false, { transform: booleanAttribute });
28
- openRotate = input(90, { transform: numberAttribute });
29
- }
30
- ```
31
-
32
- | Input | Type | Default | Description |
33
- |-------|------|---------|-------------|
34
- | `open` | `boolean` | `false` | Rotation active state |
35
- | `openRotate` | `number` | `90` | Degrees to rotate when open |
36
-
37
- ## `SdTabControl`
38
-
39
- Tab bar container. Manages the selected tab value.
40
-
41
- ```typescript
42
- @Component({ selector: "sd-tab" })
43
- class SdTabControl {
44
- value = model<any>();
45
- }
46
- ```
47
-
48
- ## `SdTabItemControl`
49
-
50
- Individual tab button. Must be a child of `SdTabControl`.
51
-
52
- ```typescript
53
- @Component({ selector: "sd-tab-item" })
54
- class SdTabItemControl {
55
- value = input<any>();
56
- isSelected = computed(/* parent.value() === this.value() */);
57
- }
58
- ```
59
-
60
- ## `SdTabviewControl`
61
-
62
- Combined tab bar + content panel container. Builds tabs from projected `SdTabviewItemControl` children.
63
-
64
- ```typescript
65
- @Component({ selector: "sd-tabview" })
66
- class SdTabviewControl<T> {
67
- value = model<T | undefined>();
68
- }
69
- ```
70
-
71
- ## `SdTabviewItemControl`
72
-
73
- Content panel for a single tab within `SdTabviewControl`. Hidden unless selected.
74
-
75
- ```typescript
76
- @Component({ selector: "sd-tabview-item" })
77
- class SdTabviewItemControl<T> {
78
- value = input.required<T>();
79
- header = input<string>();
80
- isSelected = computed(/* parent.value() === this.value() */);
81
- }
82
- ```
83
-
84
- | Input | Type | Description |
85
- |-------|------|-------------|
86
- | `value` | `T` | Tab identity value (required) |
87
- | `header` | `string \| undefined` | Tab bar label (falls back to `value`) |
88
-
89
- ## `SdPaginationControl`
90
-
91
- Pagination bar with first/last/prev-group/next-group navigation.
92
-
93
- ```typescript
94
- @Component({ selector: "sd-pagination" })
95
- class SdPaginationControl {
96
- currentPage = model(0);
97
- totalPageCount = input(0, { transform: numberAttribute });
98
- visiblePageCount = input(10, { transform: numberAttribute });
99
-
100
- hasPrev: Signal<boolean>;
101
- hasNext: Signal<boolean>;
102
- displayPages: Signal<number[]>;
103
-
104
- goToPage(page: number): void;
105
- goToNextGroup(): void;
106
- goToPrevGroup(): void;
107
- goToFirst(): void;
108
- goToLast(): void;
109
- }
110
- ```
111
-
112
- | Input | Type | Default | Description |
113
- |-------|------|---------|-------------|
114
- | `currentPage` | `number` | `0` | Zero-based current page (two-way) |
115
- | `totalPageCount` | `number` | `0` | Total number of pages |
116
- | `visiblePageCount` | `number` | `10` | Max page buttons per group |
117
-
118
- ## `SdSidebarContainerControl`
119
-
120
- Layout wrapper for sidebar + main content. Manages sidebar toggle state; auto-closes on router `NavigationStart`.
121
-
122
- ```typescript
123
- @Component({ selector: "sd-sidebar-container" })
124
- class SdSidebarContainerControl {
125
- toggle: WritableSignal<boolean>;
126
- }
127
- ```
128
-
129
- ## `SdSidebarControl`
130
-
131
- The sidebar panel. Must be a child of `SdSidebarContainerControl`.
132
-
133
- ```typescript
134
- @Component({ selector: "sd-sidebar" })
135
- class SdSidebarControl {
136
- toggle: Signal<boolean>; // mirrors parent
137
- }
138
- ```
139
-
140
- ## `SdSidebarMenuControl`
141
-
142
- Recursive sidebar navigation menu. Supports accordion and flat layouts, router links, and icons.
143
-
144
- ```typescript
145
- @Component({ selector: "sd-sidebar-menu" })
146
- class SdSidebarMenuControl {
147
- menus = input<ISdMenu[]>([]);
148
- layout = input<"accordion" | "flat">();
149
- getMenuIsSelectedFn = input<(menu: ISdMenu) => boolean>();
150
- }
151
- ```
152
-
153
- | Input | Type | Default | Description |
154
- |-------|------|---------|-------------|
155
- | `menus` | `ISdMenu[]` | `[]` | Menu items (from `SdAppStructureProvider.usableMenus`) |
156
- | `layout` | `"accordion" \| "flat" \| undefined` | auto | Flat when ≤3 root menus |
157
- | `getMenuIsSelectedFn` | `((menu: ISdMenu) => boolean) \| undefined` | — | Custom selection predicate |
158
-
159
- Uses `ISdMenu` from `@simplysm/angular` (exported via `SdAppStructureProvider`).
160
-
161
- ## `SdSidebarUserControl`
162
-
163
- Sidebar user section with a collapsible dropdown menu.
164
-
165
- ```typescript
166
- @Component({ selector: "sd-sidebar-user" })
167
- class SdSidebarUserControl {
168
- userMenu = input<ISidebarUserMenu>();
169
- }
170
- ```
171
-
172
- ## `ISidebarUserMenu`
173
-
174
- ```typescript
175
- interface ISidebarUserMenu {
176
- title: string;
177
- menus: { title: string; onClick: () => void }[];
178
- }
179
- ```
180
-
181
- | Field | Type | Description |
182
- |-------|------|-------------|
183
- | `title` | `string` | User display name |
184
- | `menus` | `{ title: string; onClick: () => void }[]` | Dropdown action items |
185
-
186
- ## `SdTopbarContainerControl`
187
-
188
- Simple flex column layout shell for topbar + content area.
189
-
190
- ```typescript
191
- @Component({ selector: "sd-topbar-container" })
192
- class SdTopbarContainerControl { }
193
- ```
194
-
195
- ## `SdTopbarControl`
196
-
197
- Top navigation bar. Optionally renders a hamburger button to toggle an associated sidebar.
198
-
199
- ```typescript
200
- @Component({ selector: "sd-topbar" })
201
- class SdTopbarControl {
202
- sidebarContainer = input<SdSidebarContainerControl>();
203
- }
204
- ```
205
-
206
- ## `SdTopbarMenuControl`
207
-
208
- Horizontal topbar navigation menu with dropdown sub-menus.
209
-
210
- ```typescript
211
- @Component({ selector: "sd-topbar-menu" })
212
- class SdTopbarMenuControl {
213
- menus = input<ISdMenu[]>([]);
214
- getMenuIsSelectedFn = input<(menu: ISdMenu) => boolean>();
215
- }
216
- ```
217
-
218
- Uses `ISdMenu` from `@simplysm/angular` (exported via `SdAppStructureProvider`).
219
-
220
- ## `SdTopbarUserControl`
221
-
222
- Topbar user button with a dropdown menu.
223
-
224
- ```typescript
225
- @Component({ selector: "sd-topbar-user" })
226
- class SdTopbarUserControl {
227
- menus = input.required<ISdTopbarUserMenu[]>();
228
- }
229
- ```
230
-
231
- ## `ISdTopbarUserMenu`
232
-
233
- ```typescript
234
- interface ISdTopbarUserMenu {
235
- title: string;
236
- onClick: () => void;
237
- }
238
- ```
239
-
240
- | Field | Type | Description |
241
- |-------|------|-------------|
242
- | `title` | `string` | Menu item label |
243
- | `onClick` | `() => void` | Click handler |