@retailcrm/embed-ui-v1-components 0.9.19 → 0.9.22-alpha.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/AGENTS.md +9 -1
- package/README.md +5 -2
- package/assets/sprites/actions/add-square-outlined.svg +8 -0
- package/assets/sprites/actions/drag.svg +8 -0
- package/bin/embed-ui-v1-components.mjs +231 -46
- package/bin/postinstall.mjs +3 -2
- package/dist/host.cjs +1223 -501
- package/dist/host.css +637 -10
- package/dist/host.d.ts +152 -78
- package/dist/host.js +1224 -502
- package/dist/remote.cjs +1358 -298
- package/dist/remote.d.ts +805 -67
- package/dist/remote.js +1360 -300
- package/docs/AI.md +99 -17
- package/docs/COMPONENTS.md +58 -59
- package/docs/FORMAT.md +10 -10
- package/docs/PROFILES.md +39 -22
- package/docs/README.md +11 -5
- package/docs/profiles/components/UiAddButton.yml +134 -0
- package/docs/profiles/components/UiAlert.yml +105 -0
- package/docs/profiles/components/UiAvatar.yml +88 -0
- package/docs/profiles/{UiAvatarList.yml → components/UiAvatarList.yml} +26 -0
- package/docs/profiles/{UiButton.yml → components/UiButton.yml} +14 -8
- package/docs/profiles/components/UiCalendar.yml +190 -0
- package/docs/profiles/components/UiCheckbox.yml +111 -0
- package/docs/profiles/components/UiCollapse.yml +129 -0
- package/docs/profiles/components/UiCollapseBox.yml +143 -0
- package/docs/profiles/{UiCollapseGroup.yml → components/UiCollapseGroup.yml} +24 -0
- package/docs/profiles/components/UiCopyButton.yml +104 -0
- package/docs/profiles/components/UiDate.yml +84 -0
- package/docs/profiles/components/UiDatePicker.yml +138 -0
- package/docs/profiles/components/UiError.yml +123 -0
- package/docs/profiles/{UiField.yml → components/UiField.yml} +46 -15
- package/docs/profiles/components/UiInfobox.yml +130 -0
- package/docs/profiles/components/UiLink.yml +111 -0
- package/docs/profiles/components/UiLoader.yml +71 -0
- package/docs/profiles/components/UiMenuItem.yml +93 -0
- package/docs/profiles/{UiMenuItemGroup.yml → components/UiMenuItemGroup.yml} +25 -0
- package/docs/profiles/components/UiModalSidebar.yml +156 -0
- package/docs/profiles/components/UiModalWindow.yml +181 -0
- package/docs/profiles/{UiModalWindowSurface.yml → components/UiModalWindowSurface.yml} +30 -0
- package/docs/profiles/components/UiNumberStepper.yml +100 -0
- package/docs/profiles/{UiPageHeader.yml → components/UiPageHeader.yml} +39 -23
- package/docs/profiles/components/UiPopconfirm.yml +164 -0
- package/docs/profiles/{UiPopper.yml → components/UiPopper.yml} +66 -13
- package/docs/profiles/{UiPopperConnector.yml → components/UiPopperConnector.yml} +5 -25
- package/docs/profiles/{UiPopperTarget.yml → components/UiPopperTarget.yml} +5 -25
- package/docs/profiles/components/UiRadio.yml +91 -0
- package/docs/profiles/{UiRadioSwitch.yml → components/UiRadioSwitch.yml} +55 -32
- package/docs/profiles/{UiRadioSwitchOption.yml → components/UiRadioSwitchOption.yml} +7 -13
- package/docs/profiles/components/UiScrollBox.yml +108 -0
- package/docs/profiles/{UiSelect.yml → components/UiSelect.yml} +133 -44
- package/docs/profiles/components/UiSelectOption.yml +74 -0
- package/docs/profiles/components/UiSelectOptionGroup.yml +66 -0
- package/docs/profiles/components/UiSkeleton.yml +82 -0
- package/docs/profiles/components/UiSlider.yml +161 -0
- package/docs/profiles/components/UiSwitch.yml +123 -0
- package/docs/profiles/components/UiTab.yml +234 -0
- package/docs/profiles/{UiTabGroup.yml → components/UiTabGroup.yml} +0 -30
- package/docs/profiles/components/UiTable.yml +622 -0
- package/docs/profiles/{UiTableBodyCell.yml → components/UiTableBodyCell.yml} +26 -0
- package/docs/profiles/components/UiTableColumn.yml +87 -0
- package/docs/profiles/components/UiTableFooterButton.yml +85 -0
- package/docs/profiles/components/UiTableFooterSection.yml +73 -0
- package/docs/profiles/{UiTableHeadCell.yml → components/UiTableHeadCell.yml} +26 -0
- package/docs/profiles/{UiTableSorter.yml → components/UiTableSorter.yml} +27 -0
- package/docs/profiles/components/UiTag.yml +90 -0
- package/docs/profiles/{UiTextbox.yml → components/UiTextbox.yml} +20 -32
- package/docs/profiles/components/UiTimePicker.yml +144 -0
- package/docs/profiles/{UiToggleButton.yml → components/UiToggleButton.yml} +16 -11
- package/docs/profiles/{UiToggleGroup.yml → components/UiToggleGroup.yml} +25 -13
- package/docs/profiles/{UiToggleGroupOption.yml → components/UiToggleGroupOption.yml} +7 -11
- package/docs/profiles/components/UiToolbarButton.yml +87 -0
- package/docs/profiles/components/UiToolbarLink.yml +80 -0
- package/docs/profiles/components/UiTooltip.yml +97 -0
- package/docs/profiles/components/UiTransition.yml +62 -0
- package/docs/profiles/components/UiYandexMap.yml +104 -0
- package/docs/profiles/pages/CardSettingsPage.yml +58 -0
- package/docs/profiles/pages/CollapseBlockPage.yml +46 -0
- package/docs/profiles/pages/EntityListPage.yml +66 -0
- package/docs/profiles/pages/ModalSidebar.yml +158 -0
- package/docs/profiles/pages/ModalWindow.yml +55 -0
- package/docs/profiles/pages/MultiColumnPage.yml +27 -0
- package/docs/profiles/pages/PageComposition.yml +56 -0
- package/package.json +15 -15
- package/docs/profiles/UiAddButton.yml +0 -57
- package/docs/profiles/UiAlert.yml +0 -48
- package/docs/profiles/UiAvatar.yml +0 -48
- package/docs/profiles/UiCalendar.yml +0 -48
- package/docs/profiles/UiCheckbox.yml +0 -53
- package/docs/profiles/UiCollapse.yml +0 -40
- package/docs/profiles/UiCollapseBox.yml +0 -51
- package/docs/profiles/UiCopyButton.yml +0 -52
- package/docs/profiles/UiDate.yml +0 -38
- package/docs/profiles/UiDatePicker.yml +0 -59
- package/docs/profiles/UiError.yml +0 -32
- package/docs/profiles/UiImage.yml +0 -39
- package/docs/profiles/UiInfobox.yml +0 -45
- package/docs/profiles/UiLink.yml +0 -51
- package/docs/profiles/UiLoader.yml +0 -38
- package/docs/profiles/UiMenuItem.yml +0 -57
- package/docs/profiles/UiModalSidebar.yml +0 -46
- package/docs/profiles/UiModalWindow.yml +0 -44
- package/docs/profiles/UiNumberStepper.yml +0 -52
- package/docs/profiles/UiRadio.yml +0 -38
- package/docs/profiles/UiScrollBox.yml +0 -31
- package/docs/profiles/UiSelectOption.yml +0 -44
- package/docs/profiles/UiSelectOptionGroup.yml +0 -38
- package/docs/profiles/UiSkeleton.yml +0 -41
- package/docs/profiles/UiSlider.yml +0 -38
- package/docs/profiles/UiSwitch.yml +0 -37
- package/docs/profiles/UiTab.yml +0 -119
- package/docs/profiles/UiTable.yml +0 -152
- package/docs/profiles/UiTableColumn.yml +0 -50
- package/docs/profiles/UiTableFooterButton.yml +0 -44
- package/docs/profiles/UiTableFooterSection.yml +0 -38
- package/docs/profiles/UiTag.yml +0 -41
- package/docs/profiles/UiTimePicker.yml +0 -46
- package/docs/profiles/UiToolbarButton.yml +0 -37
- package/docs/profiles/UiToolbarLink.yml +0 -32
- package/docs/profiles/UiTooltip.yml +0 -43
- package/docs/profiles/UiTransition.yml +0 -27
- package/docs/profiles/UiYandexMap.yml +0 -29
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
component: UiTable
|
|
2
|
+
summary: >
|
|
3
|
+
UiTable is the main data table component. It supports row rendering, grouping, expandable rows,
|
|
4
|
+
footer areas, and row-level interactions.
|
|
5
|
+
|
|
6
|
+
public_import:
|
|
7
|
+
from: '@retailcrm/embed-ui-v1-components/remote'
|
|
8
|
+
named:
|
|
9
|
+
- UiTable
|
|
10
|
+
|
|
11
|
+
related_components:
|
|
12
|
+
- UiAvatar
|
|
13
|
+
- UiCheckbox
|
|
14
|
+
- UiLink
|
|
15
|
+
- UiTableColumn
|
|
16
|
+
- UiTableFooterButton
|
|
17
|
+
- UiTableFooterSection
|
|
18
|
+
- UiTableSorter
|
|
19
|
+
- UiTag
|
|
20
|
+
|
|
21
|
+
examples:
|
|
22
|
+
- title: Basic table
|
|
23
|
+
notes:
|
|
24
|
+
- Use as the default bordered table composition with explicit UiTableColumn children.
|
|
25
|
+
code: |
|
|
26
|
+
<template>
|
|
27
|
+
<UiTable
|
|
28
|
+
bordered
|
|
29
|
+
:rows="rows"
|
|
30
|
+
row-key="id"
|
|
31
|
+
>
|
|
32
|
+
<UiTableColumn label="Title">
|
|
33
|
+
<template #cell="{ row }">
|
|
34
|
+
<strong>{{ row.title }}</strong>
|
|
35
|
+
</template>
|
|
36
|
+
</UiTableColumn>
|
|
37
|
+
|
|
38
|
+
<UiTableColumn label="Customer" width="180">
|
|
39
|
+
<template #cell="{ row }">
|
|
40
|
+
{{ row.customer }}
|
|
41
|
+
</template>
|
|
42
|
+
</UiTableColumn>
|
|
43
|
+
|
|
44
|
+
<UiTableColumn label="Status" width="160">
|
|
45
|
+
<template #cell="{ row }">
|
|
46
|
+
<UiTag :background="statusBackgroundByName[row.status]" size="md" saturated :ticker="false">
|
|
47
|
+
{{ row.status }}
|
|
48
|
+
</UiTag>
|
|
49
|
+
</template>
|
|
50
|
+
</UiTableColumn>
|
|
51
|
+
</UiTable>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script lang="ts" setup>
|
|
55
|
+
import { UiTable, UiTableColumn, UiTag } from '@retailcrm/embed-ui-v1-components/remote'
|
|
56
|
+
|
|
57
|
+
const rows = [
|
|
58
|
+
{ id: 101, title: 'Spring campaign', customer: 'Anna Smith', status: 'Scheduled' },
|
|
59
|
+
{ id: 102, title: 'Accessories discount', customer: 'Ilya Johnson', status: 'Sent' },
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
const statusBackgroundByName = {
|
|
63
|
+
Scheduled: '#005EEB',
|
|
64
|
+
Sent: '#1FA971',
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
- title: Expandable rows table
|
|
68
|
+
notes:
|
|
69
|
+
- Use the expand slot and cell toggle helper for expandable row details.
|
|
70
|
+
code: |
|
|
71
|
+
<template>
|
|
72
|
+
<UiTable
|
|
73
|
+
bordered
|
|
74
|
+
:rows="rows"
|
|
75
|
+
row-key="id"
|
|
76
|
+
>
|
|
77
|
+
<UiTableColumn :width="44" label="" trim>
|
|
78
|
+
<template #cell="{ expanded, toggle }">
|
|
79
|
+
<button class="table-expand" type="button" @click="toggle">
|
|
80
|
+
{{ expanded ? '-' : '+' }}
|
|
81
|
+
</button>
|
|
82
|
+
</template>
|
|
83
|
+
</UiTableColumn>
|
|
84
|
+
|
|
85
|
+
<UiTableColumn label="Title">
|
|
86
|
+
<template #cell="{ row }">
|
|
87
|
+
{{ row.title }}
|
|
88
|
+
</template>
|
|
89
|
+
</UiTableColumn>
|
|
90
|
+
|
|
91
|
+
<template #expand="{ row }">
|
|
92
|
+
<div class="table-expand-content">
|
|
93
|
+
<strong>Details</strong>
|
|
94
|
+
<div>{{ row.description }}</div>
|
|
95
|
+
<div>Contact: {{ row.phone }}</div>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
</UiTable>
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
<script lang="ts" setup>
|
|
102
|
+
import { UiTable, UiTableColumn } from '@retailcrm/embed-ui-v1-components/remote'
|
|
103
|
+
|
|
104
|
+
const rows = [
|
|
105
|
+
{
|
|
106
|
+
id: 101,
|
|
107
|
+
title: 'Spring campaign',
|
|
108
|
+
description: 'Segment: loyal customers. Channel: SMS + email.',
|
|
109
|
+
phone: '+7 (999) 123-45-67',
|
|
110
|
+
},
|
|
111
|
+
]
|
|
112
|
+
</script>
|
|
113
|
+
- title: Grouped rows table
|
|
114
|
+
notes:
|
|
115
|
+
- Use groupBy with group-head when rows need semantic grouping.
|
|
116
|
+
code: |
|
|
117
|
+
<template>
|
|
118
|
+
<UiTable
|
|
119
|
+
bordered
|
|
120
|
+
:rows="rows"
|
|
121
|
+
row-key="id"
|
|
122
|
+
:group-by="groupByStatus"
|
|
123
|
+
>
|
|
124
|
+
<UiTableColumn label="Title">
|
|
125
|
+
<template #cell="{ row }">
|
|
126
|
+
{{ row.title }}
|
|
127
|
+
</template>
|
|
128
|
+
</UiTableColumn>
|
|
129
|
+
|
|
130
|
+
<UiTableColumn label="Status" width="160">
|
|
131
|
+
<template #cell="{ row }">
|
|
132
|
+
{{ row.status }}
|
|
133
|
+
</template>
|
|
134
|
+
</UiTableColumn>
|
|
135
|
+
|
|
136
|
+
<template #group-head="{ group }">
|
|
137
|
+
<span>{{ group.data.title }}</span>
|
|
138
|
+
</template>
|
|
139
|
+
</UiTable>
|
|
140
|
+
</template>
|
|
141
|
+
|
|
142
|
+
<script lang="ts" setup>
|
|
143
|
+
import type { Group } from '@retailcrm/embed-ui-v1-components/remote'
|
|
144
|
+
import { UiTable, UiTableColumn } from '@retailcrm/embed-ui-v1-components/remote'
|
|
145
|
+
|
|
146
|
+
type Row = {
|
|
147
|
+
id: number
|
|
148
|
+
title: string
|
|
149
|
+
status: string
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const rows: Row[] = [
|
|
153
|
+
{ id: 101, title: 'Spring campaign', status: 'Scheduled' },
|
|
154
|
+
{ id: 102, title: 'Accessories discount', status: 'Sent' },
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
const groupByStatus = (items: readonly Row[]): Group<Row, { title: string }>[] => {
|
|
158
|
+
return ['Scheduled', 'Sent']
|
|
159
|
+
.map((status) => ({
|
|
160
|
+
key: status,
|
|
161
|
+
data: { title: status },
|
|
162
|
+
rows: items.filter((row) => row.status === status),
|
|
163
|
+
}))
|
|
164
|
+
.filter((group) => group.rows.length > 0)
|
|
165
|
+
}
|
|
166
|
+
</script>
|
|
167
|
+
- title: Entity list table footer
|
|
168
|
+
notes:
|
|
169
|
+
- Use structured footer slots with UiTableFooterSection and UiTableFooterButton for page-size and pagination controls.
|
|
170
|
+
- Keep footer styling scoped to a local table root class.
|
|
171
|
+
code: |
|
|
172
|
+
<template>
|
|
173
|
+
<UiTable
|
|
174
|
+
class="entity-list-table"
|
|
175
|
+
bordered
|
|
176
|
+
:rows="rows"
|
|
177
|
+
row-key="id"
|
|
178
|
+
>
|
|
179
|
+
<UiTableColumn label="Title">
|
|
180
|
+
<template #cell="{ row }">
|
|
181
|
+
{{ row.title }}
|
|
182
|
+
</template>
|
|
183
|
+
</UiTableColumn>
|
|
184
|
+
|
|
185
|
+
<template #footer-summary="{ rowsCount }">
|
|
186
|
+
<span>{{ rowsCount }} items</span>
|
|
187
|
+
</template>
|
|
188
|
+
|
|
189
|
+
<template #footer-page-size>
|
|
190
|
+
<UiTableFooterSection class="entity-list-table__page-size">
|
|
191
|
+
<span class="entity-list-table__footer-caption">Show:</span>
|
|
192
|
+
<UiTableFooterButton class="entity-list-table__footer-button entity-list-table__footer-button_passive">
|
|
193
|
+
20 per page
|
|
194
|
+
</UiTableFooterButton>
|
|
195
|
+
<span class="entity-list-table__footer-delimiter">/</span>
|
|
196
|
+
<UiTableFooterButton class="entity-list-table__footer-button">
|
|
197
|
+
50 per page
|
|
198
|
+
</UiTableFooterButton>
|
|
199
|
+
<span class="entity-list-table__footer-delimiter">/</span>
|
|
200
|
+
<UiTableFooterButton class="entity-list-table__footer-button">
|
|
201
|
+
100 per page
|
|
202
|
+
</UiTableFooterButton>
|
|
203
|
+
</UiTableFooterSection>
|
|
204
|
+
</template>
|
|
205
|
+
|
|
206
|
+
<template #footer-pagination>
|
|
207
|
+
<UiTableFooterSection class="entity-list-table__pagination-section">
|
|
208
|
+
<div class="entity-list-table__pagination">
|
|
209
|
+
<UiTableFooterButton class="entity-list-table__pagination-button">
|
|
210
|
+
1
|
|
211
|
+
</UiTableFooterButton>
|
|
212
|
+
<UiTableFooterButton class="entity-list-table__pagination-button">
|
|
213
|
+
2
|
|
214
|
+
</UiTableFooterButton>
|
|
215
|
+
<UiTableFooterButton class="entity-list-table__pagination-button entity-list-table__pagination-button_current">
|
|
216
|
+
3
|
|
217
|
+
</UiTableFooterButton>
|
|
218
|
+
<span class="entity-list-table__pagination-divider" />
|
|
219
|
+
<UiTableFooterButton
|
|
220
|
+
aria-label="Previous page"
|
|
221
|
+
class="entity-list-table__pagination-arrow"
|
|
222
|
+
>
|
|
223
|
+
<IconChevronLeft
|
|
224
|
+
aria-hidden="true"
|
|
225
|
+
class="entity-list-table__pagination-arrow-icon"
|
|
226
|
+
/>
|
|
227
|
+
</UiTableFooterButton>
|
|
228
|
+
<span class="entity-list-table__pagination-divider" />
|
|
229
|
+
<UiTableFooterButton
|
|
230
|
+
aria-label="Next page"
|
|
231
|
+
class="entity-list-table__pagination-arrow"
|
|
232
|
+
>
|
|
233
|
+
<IconChevronRight
|
|
234
|
+
aria-hidden="true"
|
|
235
|
+
class="entity-list-table__pagination-arrow-icon"
|
|
236
|
+
/>
|
|
237
|
+
</UiTableFooterButton>
|
|
238
|
+
</div>
|
|
239
|
+
</UiTableFooterSection>
|
|
240
|
+
</template>
|
|
241
|
+
</UiTable>
|
|
242
|
+
</template>
|
|
243
|
+
|
|
244
|
+
<script lang="ts" setup>
|
|
245
|
+
import IconChevronLeft from '@retailcrm/embed-ui-v1-components/assets/sprites/arrows/chevron-left.svg'
|
|
246
|
+
import IconChevronRight from '@retailcrm/embed-ui-v1-components/assets/sprites/arrows/chevron-right.svg'
|
|
247
|
+
import {
|
|
248
|
+
UiTable,
|
|
249
|
+
UiTableColumn,
|
|
250
|
+
UiTableFooterButton,
|
|
251
|
+
UiTableFooterSection,
|
|
252
|
+
} from '@retailcrm/embed-ui-v1-components/remote'
|
|
253
|
+
|
|
254
|
+
const rows = [
|
|
255
|
+
{ id: 101, title: 'Spring campaign' },
|
|
256
|
+
{ id: 102, title: 'Accessories discount' },
|
|
257
|
+
]
|
|
258
|
+
</script>
|
|
259
|
+
|
|
260
|
+
<style scoped>
|
|
261
|
+
.entity-list-table {
|
|
262
|
+
--ui-v1-table-cell-padding-x: 12px;
|
|
263
|
+
--ui-v1-table-cell-padding-y: 12px;
|
|
264
|
+
--ui-v1-table-padding-start: 16px;
|
|
265
|
+
--ui-v1-table-padding-end: 16px;
|
|
266
|
+
--ui-v1-table-rounding: 4px;
|
|
267
|
+
--ui-v1-table-head-cell-padding-block-start: 14px;
|
|
268
|
+
--ui-v1-table-head-cell-padding-block-end: 14px;
|
|
269
|
+
--ui-v1-table-body-cell-padding-block-start: 15px;
|
|
270
|
+
--ui-v1-table-body-cell-padding-block-end: 15px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.entity-list-table .ui-v1-table__head-cell {
|
|
274
|
+
height: 42px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.entity-list-table .ui-v1-table__footer-meta {
|
|
278
|
+
min-height: 40px;
|
|
279
|
+
font-weight: 400;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.entity-list-table .ui-v1-table__footer-controls {
|
|
283
|
+
min-height: 52px;
|
|
284
|
+
background: #f9fafb;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.entity-list-table .ui-v1-table__footer-section {
|
|
288
|
+
font-size: 14px;
|
|
289
|
+
line-height: 20px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.entity-list-table__page-size,
|
|
293
|
+
.entity-list-table__pagination-section {
|
|
294
|
+
color: #1e2248;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.entity-list-table__footer-caption {
|
|
298
|
+
display: inline-block;
|
|
299
|
+
margin-right: 4px;
|
|
300
|
+
vertical-align: baseline;
|
|
301
|
+
line-height: inherit;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.entity-list-table__footer-button {
|
|
305
|
+
color: #005eeb;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.entity-list-table__footer-button_passive {
|
|
309
|
+
color: #1e2248;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.entity-list-table__footer-delimiter {
|
|
313
|
+
display: inline-block;
|
|
314
|
+
padding: 0 5px;
|
|
315
|
+
color: #8a96a6;
|
|
316
|
+
vertical-align: baseline;
|
|
317
|
+
line-height: inherit;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.entity-list-table .ui-v1-table__footer-side > .entity-list-table__pagination-section {
|
|
321
|
+
padding-block: 8px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.entity-list-table__pagination {
|
|
325
|
+
display: flex;
|
|
326
|
+
align-items: center;
|
|
327
|
+
gap: 8px;
|
|
328
|
+
height: 36px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.entity-list-table__pagination-button,
|
|
332
|
+
.entity-list-table__pagination-arrow {
|
|
333
|
+
width: 36px;
|
|
334
|
+
height: 36px;
|
|
335
|
+
border-radius: 4px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.entity-list-table .ui-v1-table__footer-button.entity-list-table__pagination-button {
|
|
339
|
+
color: #1e2248;
|
|
340
|
+
font-size: 14px;
|
|
341
|
+
line-height: 20px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.entity-list-table .ui-v1-table__footer-button.entity-list-table__pagination-button_current {
|
|
345
|
+
color: #fff;
|
|
346
|
+
background: #005eeb;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.entity-list-table .ui-v1-table__footer-button.entity-list-table__pagination-arrow {
|
|
350
|
+
color: #afb9c3;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.entity-list-table__pagination-arrow-icon {
|
|
354
|
+
display: block;
|
|
355
|
+
width: 24px;
|
|
356
|
+
height: 24px;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.entity-list-table__pagination-divider {
|
|
360
|
+
width: 1px;
|
|
361
|
+
height: 52px;
|
|
362
|
+
margin-block: -8px;
|
|
363
|
+
background: #dee2e6;
|
|
364
|
+
}
|
|
365
|
+
</style>
|
|
366
|
+
|
|
367
|
+
- title: Dense table
|
|
368
|
+
notes:
|
|
369
|
+
- Use CSS variables on the table root to create a denser table layout.
|
|
370
|
+
code: |
|
|
371
|
+
<template>
|
|
372
|
+
<UiTable
|
|
373
|
+
class="campaign-table campaign-table_dense"
|
|
374
|
+
bordered
|
|
375
|
+
:rows="rows"
|
|
376
|
+
row-key="id"
|
|
377
|
+
>
|
|
378
|
+
<UiTableColumn label="Title">
|
|
379
|
+
<template #cell="{ row }">
|
|
380
|
+
{{ row.title }}
|
|
381
|
+
</template>
|
|
382
|
+
</UiTableColumn>
|
|
383
|
+
|
|
384
|
+
<UiTableColumn label="Status" width="160">
|
|
385
|
+
<template #cell="{ row }">
|
|
386
|
+
{{ row.status }}
|
|
387
|
+
</template>
|
|
388
|
+
</UiTableColumn>
|
|
389
|
+
</UiTable>
|
|
390
|
+
</template>
|
|
391
|
+
|
|
392
|
+
<script lang="ts" setup>
|
|
393
|
+
import { UiTable, UiTableColumn } from '@retailcrm/embed-ui-v1-components/remote'
|
|
394
|
+
|
|
395
|
+
const rows = [
|
|
396
|
+
{ id: 101, title: 'Spring campaign', status: 'Scheduled' },
|
|
397
|
+
{ id: 102, title: 'Accessories discount', status: 'Sent' },
|
|
398
|
+
]
|
|
399
|
+
</script>
|
|
400
|
+
|
|
401
|
+
<style lang="less">
|
|
402
|
+
.campaign-table_dense {
|
|
403
|
+
--ui-v1-table-cell-padding-x: 8px;
|
|
404
|
+
--ui-v1-table-cell-padding-y: 8px;
|
|
405
|
+
--ui-v1-table-padding-start: 8px;
|
|
406
|
+
--ui-v1-table-padding-end: 8px;
|
|
407
|
+
--ui-v1-table-head-cell-padding-block-start: 8px;
|
|
408
|
+
--ui-v1-table-head-cell-padding-block-end: 8px;
|
|
409
|
+
--ui-v1-table-body-cell-padding-block-start: 8px;
|
|
410
|
+
--ui-v1-table-body-cell-padding-block-end: 8px;
|
|
411
|
+
--ui-v1-table-group-head-padding-block-start: 4px;
|
|
412
|
+
--ui-v1-table-group-head-padding-block-end: 4px;
|
|
413
|
+
--ui-v1-table-head-background: #f4f6f8;
|
|
414
|
+
--ui-v1-table-group-head-background: #f7f9fb;
|
|
415
|
+
}
|
|
416
|
+
</style>
|
|
417
|
+
|
|
418
|
+
use_when:
|
|
419
|
+
- You need structured tabular data.
|
|
420
|
+
- You need group headers, expandable rows, or footer sections.
|
|
421
|
+
|
|
422
|
+
avoid_when:
|
|
423
|
+
- You need a simple list or card layout.
|
|
424
|
+
|
|
425
|
+
api:
|
|
426
|
+
key_props:
|
|
427
|
+
- name: rows
|
|
428
|
+
- name: rowKey
|
|
429
|
+
- name: headless
|
|
430
|
+
- name: bordered
|
|
431
|
+
- name: fixed
|
|
432
|
+
- name: groupBy
|
|
433
|
+
slots:
|
|
434
|
+
- name: default
|
|
435
|
+
zone: columns
|
|
436
|
+
creates: Column declarations.
|
|
437
|
+
- name: expand
|
|
438
|
+
zone: expanded-row
|
|
439
|
+
creates: Expanded row content.
|
|
440
|
+
- name: footer
|
|
441
|
+
zone: footer
|
|
442
|
+
creates: Full footer area.
|
|
443
|
+
- name: footer-summary
|
|
444
|
+
zone: structured-footer
|
|
445
|
+
creates: Summary or selected-count area above table footer controls.
|
|
446
|
+
- name: footer-page-size
|
|
447
|
+
zone: structured-footer
|
|
448
|
+
creates: Page-size controls in the footer control row.
|
|
449
|
+
- name: footer-export
|
|
450
|
+
zone: structured-footer
|
|
451
|
+
creates: Export controls in the footer control row.
|
|
452
|
+
- name: footer-pagination
|
|
453
|
+
zone: structured-footer
|
|
454
|
+
creates: Pagination controls in the footer control row.
|
|
455
|
+
- name: group-head
|
|
456
|
+
zone: group-head
|
|
457
|
+
creates: Group heading content.
|
|
458
|
+
- name: empty
|
|
459
|
+
zone: empty-state
|
|
460
|
+
creates: Empty-state content.
|
|
461
|
+
emits:
|
|
462
|
+
- name: row:click
|
|
463
|
+
methods:
|
|
464
|
+
- name: resetExpanded
|
|
465
|
+
- name: expand
|
|
466
|
+
- name: collapse
|
|
467
|
+
- name: toggle
|
|
468
|
+
|
|
469
|
+
rendered_structure:
|
|
470
|
+
descriptive_only: true
|
|
471
|
+
root:
|
|
472
|
+
shape: table.ui-v1-table
|
|
473
|
+
tag: table
|
|
474
|
+
zones:
|
|
475
|
+
- .ui-v1-table__section_head
|
|
476
|
+
- .ui-v1-table__section_body
|
|
477
|
+
- .ui-v1-table__section_foot
|
|
478
|
+
- .ui-v1-table__row
|
|
479
|
+
- .ui-v1-table__head-cell
|
|
480
|
+
- .ui-v1-table__body-cell
|
|
481
|
+
notes: >
|
|
482
|
+
Table layout is distributed across head, body, foot, and cell-level classes. Treat this as a
|
|
483
|
+
reasoning model for geometry and spacing, not as a stable selector contract.
|
|
484
|
+
|
|
485
|
+
geometry:
|
|
486
|
+
layout: block-width table
|
|
487
|
+
root_display: table
|
|
488
|
+
width: 100%
|
|
489
|
+
width_behavior: stretches to container width by default
|
|
490
|
+
notes:
|
|
491
|
+
- Root fills available width.
|
|
492
|
+
- fixed=true switches table-layout from auto to fixed.
|
|
493
|
+
- bordered=true adds border and corner rounding through CSS variables.
|
|
494
|
+
- Filters and search controls should usually be placed above the table, not in the table root.
|
|
495
|
+
- Table-scoped pagination belongs in footer slots when custom controls are needed.
|
|
496
|
+
|
|
497
|
+
styling:
|
|
498
|
+
notes:
|
|
499
|
+
- UiTable exposes a relatively rich CSS-variable surface for spacing and table chrome.
|
|
500
|
+
- Prefer table props and slot composition first, then CSS variables for spacing or background tuning.
|
|
501
|
+
- Internal classes are descriptive and mainly useful for debugging or narrow local integration.
|
|
502
|
+
- For reference-style footers, add a local class to UiTable and scope footer styles through that class.
|
|
503
|
+
- When styling footer pagination buttons, combine the internal footer button class with the local state class so base footer styles do not override page, active, or arrow colors.
|
|
504
|
+
root_classes:
|
|
505
|
+
- .ui-v1-table
|
|
506
|
+
state_classes:
|
|
507
|
+
- .ui-v1-table_fixed
|
|
508
|
+
- .ui-v1-table_bordered
|
|
509
|
+
- .ui-v1-table__head-cell_align-center
|
|
510
|
+
- .ui-v1-table__head-cell_align-right
|
|
511
|
+
- .ui-v1-table__body-cell_align-center
|
|
512
|
+
- .ui-v1-table__body-cell_align-right
|
|
513
|
+
- .ui-v1-table__body-cell_valign-top
|
|
514
|
+
- .ui-v1-table__body-cell_valign-bottom
|
|
515
|
+
- .ui-v1-table__body-cell_theme-group
|
|
516
|
+
- .ui-v1-table__body-cell_trim
|
|
517
|
+
- .ui-v1-table__head-cell_trim
|
|
518
|
+
zones:
|
|
519
|
+
- .ui-v1-table__head-cell
|
|
520
|
+
- .ui-v1-table__body-cell
|
|
521
|
+
- .ui-v1-table__footer-cell
|
|
522
|
+
css_variables:
|
|
523
|
+
public_theme_variables:
|
|
524
|
+
- name: --ui-v1-table-border-width
|
|
525
|
+
effect: Outer border width in bordered mode.
|
|
526
|
+
- name: --ui-v1-table-rounding
|
|
527
|
+
effect: Shared corner rounding.
|
|
528
|
+
- name: --ui-v1-table-cell-padding-x
|
|
529
|
+
effect: Base inline cell padding.
|
|
530
|
+
- name: --ui-v1-table-cell-padding-y
|
|
531
|
+
effect: Base block cell padding.
|
|
532
|
+
- name: --ui-v1-table-head-background
|
|
533
|
+
effect: Header row background.
|
|
534
|
+
- name: --ui-v1-table-group-head-background
|
|
535
|
+
effect: Group heading row background.
|
|
536
|
+
- name: --ui-v1-table-padding-start
|
|
537
|
+
effect: Effective first-column start padding.
|
|
538
|
+
- name: --ui-v1-table-padding-end
|
|
539
|
+
effect: Effective last-column end padding.
|
|
540
|
+
internal_layout_variables:
|
|
541
|
+
- name: --ui-v1-table-effective-padding-start
|
|
542
|
+
effect: Start padding after bordered adjustments.
|
|
543
|
+
- name: --ui-v1-table-effective-padding-end
|
|
544
|
+
effect: End padding after bordered adjustments.
|
|
545
|
+
- name: --ui-v1-table-head-cell-padding-block-start
|
|
546
|
+
effect: Header top padding.
|
|
547
|
+
- name: --ui-v1-table-head-cell-padding-block-end
|
|
548
|
+
effect: Header bottom padding.
|
|
549
|
+
- name: --ui-v1-table-body-cell-padding-block-start
|
|
550
|
+
effect: Body top padding.
|
|
551
|
+
- name: --ui-v1-table-body-cell-padding-block-end
|
|
552
|
+
effect: Body bottom padding.
|
|
553
|
+
- name: --ui-v1-table-group-head-padding-block-start
|
|
554
|
+
effect: Group row top padding.
|
|
555
|
+
- name: --ui-v1-table-group-head-padding-block-end
|
|
556
|
+
effect: Group row bottom padding.
|
|
557
|
+
typography:
|
|
558
|
+
default:
|
|
559
|
+
mixin: text-small
|
|
560
|
+
size: 14px
|
|
561
|
+
line_height: 20px
|
|
562
|
+
weight: 400
|
|
563
|
+
head_cells:
|
|
564
|
+
mixin: text-tiny-accent
|
|
565
|
+
size: 12px
|
|
566
|
+
line_height: 14px
|
|
567
|
+
weight: 500
|
|
568
|
+
group_rows:
|
|
569
|
+
mixin: text-tiny
|
|
570
|
+
size: 12px
|
|
571
|
+
line_height: 14px
|
|
572
|
+
weight: 400
|
|
573
|
+
|
|
574
|
+
composition:
|
|
575
|
+
filters:
|
|
576
|
+
notes:
|
|
577
|
+
- Keep filter controls directly above UiTable so the relationship between filters and rows is obvious.
|
|
578
|
+
- Use UiTextbox for text search and UiSelect or compact toggle controls for finite filters.
|
|
579
|
+
- Persist filter values in URL query parameters when routing is available.
|
|
580
|
+
sorting:
|
|
581
|
+
notes:
|
|
582
|
+
- Use UiTableSorter inside a UiTableColumn label slot for sortable columns.
|
|
583
|
+
- Reset pagination to the first page when sorting changes.
|
|
584
|
+
- Persist sort key and direction in URL query parameters when routing is available.
|
|
585
|
+
pagination:
|
|
586
|
+
notes:
|
|
587
|
+
- Use footer-summary, footer-page-size, footer-export, and footer-pagination slots for structured footer controls.
|
|
588
|
+
- footer-pagination should use UiTableFooterSection as the root wrapper.
|
|
589
|
+
- Use UiTableFooterButton for page numbers and previous/next arrow controls.
|
|
590
|
+
- Do not use regular UiButton for table footer pagination.
|
|
591
|
+
- Use a local inner flex group for page buttons, dividers, and arrow buttons when recreating the reference-table footer pattern.
|
|
592
|
+
- Use chevron icon assets for previous/next arrows instead of text glyphs such as < or >.
|
|
593
|
+
- Add scoped CSS for footer meta height, control-row background, pagination button size, active page state, arrow icon size, and vertical dividers.
|
|
594
|
+
- Persist page and page size in URL query parameters when routing is available.
|
|
595
|
+
- Reset page to 1 when filters or sorting change.
|
|
596
|
+
|
|
597
|
+
ai_notes:
|
|
598
|
+
do:
|
|
599
|
+
- Read ../../AI.md table-screen rules before generating complete table screens.
|
|
600
|
+
- Provide row-key for stable row identity.
|
|
601
|
+
- Put table filters above the table.
|
|
602
|
+
- Use structured footer slots for summary, page-size controls, export, and pagination.
|
|
603
|
+
- Compose footer controls with UiTableFooterSection and UiTableFooterButton.
|
|
604
|
+
- Copy the Entity list table footer example when building a realistic entity-list footer.
|
|
605
|
+
- Use UiTableSorter for sortable headers.
|
|
606
|
+
avoid:
|
|
607
|
+
- Do not hide table filters in page header actions.
|
|
608
|
+
- Do not use UiButton inside table footer pagination.
|
|
609
|
+
- Do not put pagination only in local state when the screen has routable result sets.
|
|
610
|
+
- Do not import table internals from host or src paths.
|
|
611
|
+
|
|
612
|
+
behavior:
|
|
613
|
+
notes:
|
|
614
|
+
- Read key_props first to identify supported states and variants.
|
|
615
|
+
- Prefer controlled props and documented emits when synchronizing component state with screen logic.
|
|
616
|
+
|
|
617
|
+
accessibility:
|
|
618
|
+
notes:
|
|
619
|
+
- Use meaningful column labels so screen-reader users can understand each cell in context.
|
|
620
|
+
- Use stable row keys so expanded rows and row-level state remain attached to the correct data item.
|
|
621
|
+
- Put interactive controls inside cells as real controls such as UiLink or UiButton, not plain clickable text.
|
|
622
|
+
- When rows are clickable, keep the primary row action visible as a link or button as well.
|
|
@@ -43,5 +43,31 @@ geometry:
|
|
|
43
43
|
ai_notes:
|
|
44
44
|
do:
|
|
45
45
|
- Keep it inside UiTable row composition.
|
|
46
|
+
- Use theme="group" only for group header style cells.
|
|
46
47
|
avoid:
|
|
47
48
|
- Do not use it as a generic box or layout wrapper.
|
|
49
|
+
|
|
50
|
+
composition:
|
|
51
|
+
works_well_with:
|
|
52
|
+
- UiTable
|
|
53
|
+
- UiTableColumn
|
|
54
|
+
patterns:
|
|
55
|
+
- title: Custom row structure
|
|
56
|
+
notes: Prefer UiTableColumn cell slots first; use UiTableBodyCell only for low-level custom rows.
|
|
57
|
+
|
|
58
|
+
behavior:
|
|
59
|
+
notes:
|
|
60
|
+
- Behavior is mostly coordinated by the parent component.
|
|
61
|
+
- Use this child only in the documented parent composition.
|
|
62
|
+
|
|
63
|
+
accessibility:
|
|
64
|
+
notes:
|
|
65
|
+
- This component is normally used inside its parent composition; accessibility behavior is completed by the parent component.
|
|
66
|
+
- Keep labels and visible text meaningful because parent keyboard and screen-reader behavior depends on child content.
|
|
67
|
+
|
|
68
|
+
styling:
|
|
69
|
+
notes:
|
|
70
|
+
- Use documented props and slots as the primary styling API.
|
|
71
|
+
- Internal .ui-v1-* classes are descriptive implementation details for reasoning and debugging unless a profile marks them as public theme hooks.
|
|
72
|
+
root_classes:
|
|
73
|
+
- .ui-v1-table
|