@sixbell-telco/sdk 2.1.0 → 3.1.0
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/CHANGELOG.md +82 -1
- package/README.md +323 -84
- package/_index.css +17 -3
- package/components/card/card-actions/card-actions.component.d.ts +4 -4
- package/components/card/card-body/card-body.component.d.ts +5 -0
- package/components/card/card-context.d.ts +8 -0
- package/components/card/card-footer/card-footer.component.d.ts +7 -0
- package/components/card/card-header/card-header.component.d.ts +5 -0
- package/components/card/card-header-aside/card-header-aside.component.d.ts +5 -0
- package/components/card/card-section/card-section.component.d.ts +5 -0
- package/components/card/card-section-body/card-section-body.component.d.ts +13 -0
- package/components/card/card-section-footer/card-section-footer.component.d.ts +5 -0
- package/components/card/card-section-group/card-section-group.component.d.ts +16 -0
- package/components/card/card-section-header/card-section-header.component.d.ts +5 -0
- package/components/card/card-section-header-aside/card-section-header-aside.component.d.ts +5 -0
- package/components/card/card-subtitle/card-subtitle.component.d.ts +34 -0
- package/components/card/card-title/card-title.component.d.ts +23 -14
- package/components/card/public-api.d.ts +12 -1
- package/components/card/src/card.component.d.ts +5 -1
- package/components/data-table/actions/actions.component.d.ts +67 -0
- package/components/data-table/actions/actions.types.d.ts +38 -0
- package/components/data-table/public-api.d.ts +2 -0
- package/components/data-table/sortable-header/sortable-header.component.d.ts +2 -0
- package/components/data-table/src/data-table.component.d.ts +14 -5
- package/{directives/typography → components/divider}/index.d.ts +1 -1
- package/components/divider/public-api.d.ts +1 -0
- package/components/divider/src/divider.component.d.ts +13 -0
- package/components/forms/date-picker/src/date-picker.component.d.ts +3 -0
- package/components/forms/form-error/src/form-error.component.d.ts +8 -1
- package/components/forms/input/src/input.component.d.ts +1 -12
- package/components/forms/textarea/src/textarea.component.d.ts +1 -6
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +10 -1
- package/components/paginator/src/paginator.component.d.ts +7 -1
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +37 -4
- package/components/table/table-action/table-action.component.d.ts +2 -6
- package/components/table/table-actions/table-actions.component.d.ts +52 -6
- package/components/table/table-actions/table-actions.types.d.ts +28 -0
- package/components/{toast → text}/index.d.ts +1 -1
- package/components/text/public-api.d.ts +2 -0
- package/components/text/src/text.component.d.ts +38 -0
- package/directives/only-numbers/public-api.d.ts +0 -5
- package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -13
- package/directives/text/index.d.ts +5 -0
- package/directives/text/public-api.d.ts +1 -0
- package/directives/text/src/text.directive.d.ts +87 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +10 -11
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +428 -47
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +202 -51
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +44 -0
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +6 -6
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +21 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +12 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +3 -15
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +5 -11
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +46 -18
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +439 -47
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-text.mjs +308 -0
- package/fesm2022/sixbell-telco-sdk-components-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +12 -12
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +5 -22
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +160 -0
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs +490 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +49 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +100 -92
- package/utils/formatting/README.md +100 -0
- package/utils/formatting/index.d.ts +5 -0
- package/utils/formatting/public-api.d.ts +9 -0
- package/utils/formatting/src/constants/constants.d.ts +18 -0
- package/utils/formatting/src/models/formatting.d.ts +33 -0
- package/utils/formatting/src/pipes/currency/st-currency.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/date/st-date.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/decimal/st-decimal.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/percent/st-percent.pipe.d.ts +9 -0
- package/utils/formatting/src/service/formatting.service.d.ts +13 -0
- package/utils/formatting/src/utils/date-format/date-format.d.ts +9 -0
- package/utils/formatting/src/utils/number-format/number-format.d.ts +12 -0
- package/utils/logger/README.md +8 -19
- package/utils/runtime-config/README.md +1 -1
- package/utils/theme/README.md +21 -2
- package/utils/translation/README.md +40 -10
- package/utils/translation/public-api.d.ts +1 -1
- package/utils/translation/src/constants.d.ts +9 -2
- package/utils/translation/src/models/translation.d.ts +11 -0
- package/utils/translation/src/providers/translation.provider.d.ts +1 -1
- package/utils/translation/src/translation.service.d.ts +6 -1
- package/assets/styles/toast.css +0 -63
- package/components/card/card-content/card-content.component.d.ts +0 -30
- package/components/toast/public-api.d.ts +0 -12
- package/components/toast/services/toast.service.d.ts +0 -35
- package/components/toast/toast-message/toast-message.component.d.ts +0 -70
- package/components/toast/toasts-container/toasts-container.component.d.ts +0 -21
- package/directives/typography/public-api.d.ts +0 -1
- package/directives/typography/src/typography.directive.d.ts +0 -68
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +0 -250
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +0 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +0 -126
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +0 -1
|
@@ -6,7 +6,7 @@ import { heroDocumentText, heroMagnifyingGlass } from '@ng-icons/heroicons/outli
|
|
|
6
6
|
import { SelectComponent } from '@sixbell-telco/sdk/components/forms/select';
|
|
7
7
|
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
8
8
|
import { PaginatorComponent } from '@sixbell-telco/sdk/components/paginator';
|
|
9
|
-
import {
|
|
9
|
+
import { TextDirective } from '@sixbell-telco/sdk/directives/text';
|
|
10
10
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
11
11
|
import { TranslateService, TranslatePipe } from '@sixbell-telco/sdk/utils/translation';
|
|
12
12
|
import { cva } from 'class-variance-authority';
|
|
@@ -14,6 +14,8 @@ import { CheckboxComponent } from '@sixbell-telco/sdk/components/forms/checkbox'
|
|
|
14
14
|
import { TranslatePipe as TranslatePipe$1 } from '@ngx-translate/core';
|
|
15
15
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
16
16
|
import { TooltipComponent } from '@sixbell-telco/sdk/components/tooltip';
|
|
17
|
+
import { DropdownMenuComponent, DropdownMenuTriggerComponent, DropdownMenuContentComponent, DropdownMenuItemComponent } from '@sixbell-telco/sdk/components/dropdown-menu';
|
|
18
|
+
import { matMoreVert } from '@sixbell-telco/sdk/components/icon/material/baseline';
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* Header checkbox component for the table.
|
|
@@ -156,6 +158,336 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImpor
|
|
|
156
158
|
args: [{ selector: 'tr[row-checkbox]', imports: [CheckboxComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<td>\n\t<st-checkbox [(value)]=\"checked\" (valueUpdated)=\"handleSelect($event)\" [variant]=\"checkboxVariant()\" [size]=\"checkboxSize()\"></st-checkbox>\n</td>\n<ng-content></ng-content>\n" }]
|
|
157
159
|
}] });
|
|
158
160
|
|
|
161
|
+
const TABLE_HEADER_TYPOGRAPHY_CLASS_BY_PRESET = {
|
|
162
|
+
'6': [
|
|
163
|
+
'[&_thead_th]:text-[15.75px]',
|
|
164
|
+
'[&_thead_th]:leading-normal',
|
|
165
|
+
'[&_thead_th]:tracking-normal',
|
|
166
|
+
'[&_thead_th]:font-heading',
|
|
167
|
+
'[&_thead_th]:font-semibold',
|
|
168
|
+
'[&_thead_th]:align-middle',
|
|
169
|
+
'[&_thead_td]:text-[15.75px]',
|
|
170
|
+
'[&_thead_td]:leading-normal',
|
|
171
|
+
'[&_thead_td]:tracking-normal',
|
|
172
|
+
'[&_thead_td]:font-heading',
|
|
173
|
+
'[&_thead_td]:font-semibold',
|
|
174
|
+
'[&_thead_td]:align-middle',
|
|
175
|
+
],
|
|
176
|
+
'7': [
|
|
177
|
+
'[&_thead_th]:text-[14px]',
|
|
178
|
+
'[&_thead_th]:leading-normal',
|
|
179
|
+
'[&_thead_th]:tracking-tight',
|
|
180
|
+
'[&_thead_th]:font-heading',
|
|
181
|
+
'[&_thead_th]:font-semibold',
|
|
182
|
+
'[&_thead_th]:align-middle',
|
|
183
|
+
'[&_thead_td]:text-[14px]',
|
|
184
|
+
'[&_thead_td]:leading-normal',
|
|
185
|
+
'[&_thead_td]:tracking-tight',
|
|
186
|
+
'[&_thead_td]:font-heading',
|
|
187
|
+
'[&_thead_td]:font-semibold',
|
|
188
|
+
'[&_thead_td]:align-middle',
|
|
189
|
+
],
|
|
190
|
+
'8': [
|
|
191
|
+
'[&_thead_th]:text-[12.44px]',
|
|
192
|
+
'[&_thead_th]:leading-normal',
|
|
193
|
+
'[&_thead_th]:tracking-tight',
|
|
194
|
+
'[&_thead_th]:font-heading',
|
|
195
|
+
'[&_thead_th]:font-semibold',
|
|
196
|
+
'[&_thead_th]:align-middle',
|
|
197
|
+
'[&_thead_td]:text-[12.44px]',
|
|
198
|
+
'[&_thead_td]:leading-normal',
|
|
199
|
+
'[&_thead_td]:tracking-tight',
|
|
200
|
+
'[&_thead_td]:font-heading',
|
|
201
|
+
'[&_thead_td]:font-semibold',
|
|
202
|
+
'[&_thead_td]:align-middle',
|
|
203
|
+
],
|
|
204
|
+
'9': [
|
|
205
|
+
'[&_thead_th]:text-[11.06px]',
|
|
206
|
+
'[&_thead_th]:leading-normal',
|
|
207
|
+
'[&_thead_th]:tracking-tight',
|
|
208
|
+
'[&_thead_th]:font-heading',
|
|
209
|
+
'[&_thead_th]:font-semibold',
|
|
210
|
+
'[&_thead_th]:align-middle',
|
|
211
|
+
'[&_thead_td]:text-[11.06px]',
|
|
212
|
+
'[&_thead_td]:leading-normal',
|
|
213
|
+
'[&_thead_td]:tracking-tight',
|
|
214
|
+
'[&_thead_td]:font-heading',
|
|
215
|
+
'[&_thead_td]:font-semibold',
|
|
216
|
+
'[&_thead_td]:align-middle',
|
|
217
|
+
],
|
|
218
|
+
'10': [
|
|
219
|
+
'[&_thead_th]:text-[9.83px]',
|
|
220
|
+
'[&_thead_th]:leading-normal',
|
|
221
|
+
'[&_thead_th]:tracking-normal',
|
|
222
|
+
'[&_thead_th]:font-heading',
|
|
223
|
+
'[&_thead_th]:font-semibold',
|
|
224
|
+
'[&_thead_th]:align-middle',
|
|
225
|
+
'[&_thead_td]:text-[9.83px]',
|
|
226
|
+
'[&_thead_td]:leading-normal',
|
|
227
|
+
'[&_thead_td]:tracking-normal',
|
|
228
|
+
'[&_thead_td]:font-heading',
|
|
229
|
+
'[&_thead_td]:font-semibold',
|
|
230
|
+
'[&_thead_td]:align-middle',
|
|
231
|
+
],
|
|
232
|
+
};
|
|
233
|
+
const TABLE_BODY_TYPOGRAPHY_CLASS_BY_PRESET = {
|
|
234
|
+
'6': [
|
|
235
|
+
'[&_tbody_td]:text-[15.75px]',
|
|
236
|
+
'[&_tbody_td]:leading-normal',
|
|
237
|
+
'[&_tbody_td]:tracking-normal',
|
|
238
|
+
'[&_tbody_td]:font-body',
|
|
239
|
+
'[&_tbody_td]:font-normal',
|
|
240
|
+
'[&_tbody_td]:align-middle',
|
|
241
|
+
'[&_tbody_th]:text-[15.75px]',
|
|
242
|
+
'[&_tbody_th]:leading-normal',
|
|
243
|
+
'[&_tbody_th]:tracking-normal',
|
|
244
|
+
'[&_tbody_th]:font-body',
|
|
245
|
+
'[&_tbody_th]:font-normal',
|
|
246
|
+
'[&_tbody_th]:align-middle',
|
|
247
|
+
],
|
|
248
|
+
'7': [
|
|
249
|
+
'[&_tbody_td]:text-[14px]',
|
|
250
|
+
'[&_tbody_td]:leading-normal',
|
|
251
|
+
'[&_tbody_td]:tracking-tight',
|
|
252
|
+
'[&_tbody_td]:font-body',
|
|
253
|
+
'[&_tbody_td]:font-normal',
|
|
254
|
+
'[&_tbody_td]:align-middle',
|
|
255
|
+
'[&_tbody_th]:text-[14px]',
|
|
256
|
+
'[&_tbody_th]:leading-normal',
|
|
257
|
+
'[&_tbody_th]:tracking-tight',
|
|
258
|
+
'[&_tbody_th]:font-body',
|
|
259
|
+
'[&_tbody_th]:font-normal',
|
|
260
|
+
'[&_tbody_th]:align-middle',
|
|
261
|
+
],
|
|
262
|
+
'8': [
|
|
263
|
+
'[&_tbody_td]:text-[12.44px]',
|
|
264
|
+
'[&_tbody_td]:leading-normal',
|
|
265
|
+
'[&_tbody_td]:tracking-tight',
|
|
266
|
+
'[&_tbody_td]:font-body',
|
|
267
|
+
'[&_tbody_td]:font-normal',
|
|
268
|
+
'[&_tbody_td]:align-middle',
|
|
269
|
+
'[&_tbody_th]:text-[12.44px]',
|
|
270
|
+
'[&_tbody_th]:leading-normal',
|
|
271
|
+
'[&_tbody_th]:tracking-tight',
|
|
272
|
+
'[&_tbody_th]:font-body',
|
|
273
|
+
'[&_tbody_th]:font-normal',
|
|
274
|
+
'[&_tbody_th]:align-middle',
|
|
275
|
+
],
|
|
276
|
+
'9': [
|
|
277
|
+
'[&_tbody_td]:text-[11.06px]',
|
|
278
|
+
'[&_tbody_td]:leading-normal',
|
|
279
|
+
'[&_tbody_td]:tracking-tight',
|
|
280
|
+
'[&_tbody_td]:font-body',
|
|
281
|
+
'[&_tbody_td]:font-normal',
|
|
282
|
+
'[&_tbody_td]:align-middle',
|
|
283
|
+
'[&_tbody_th]:text-[11.06px]',
|
|
284
|
+
'[&_tbody_th]:leading-normal',
|
|
285
|
+
'[&_tbody_th]:tracking-tight',
|
|
286
|
+
'[&_tbody_th]:font-body',
|
|
287
|
+
'[&_tbody_th]:font-normal',
|
|
288
|
+
'[&_tbody_th]:align-middle',
|
|
289
|
+
],
|
|
290
|
+
'10': [
|
|
291
|
+
'[&_tbody_td]:text-[9.83px]',
|
|
292
|
+
'[&_tbody_td]:leading-normal',
|
|
293
|
+
'[&_tbody_td]:tracking-normal',
|
|
294
|
+
'[&_tbody_td]:font-body',
|
|
295
|
+
'[&_tbody_td]:font-normal',
|
|
296
|
+
'[&_tbody_td]:align-middle',
|
|
297
|
+
'[&_tbody_th]:text-[9.83px]',
|
|
298
|
+
'[&_tbody_th]:leading-normal',
|
|
299
|
+
'[&_tbody_th]:tracking-normal',
|
|
300
|
+
'[&_tbody_th]:font-body',
|
|
301
|
+
'[&_tbody_th]:font-normal',
|
|
302
|
+
'[&_tbody_th]:align-middle',
|
|
303
|
+
],
|
|
304
|
+
};
|
|
305
|
+
const TABLE_FOOTER_TYPOGRAPHY_CLASS_BY_PRESET = {
|
|
306
|
+
'6': [
|
|
307
|
+
'[&_tfoot_td]:text-[15.75px]',
|
|
308
|
+
'[&_tfoot_td]:leading-normal',
|
|
309
|
+
'[&_tfoot_td]:tracking-normal',
|
|
310
|
+
'[&_tfoot_td]:font-body',
|
|
311
|
+
'[&_tfoot_td]:font-normal',
|
|
312
|
+
'[&_tfoot_td]:align-middle',
|
|
313
|
+
'[&_tfoot_th]:text-[15.75px]',
|
|
314
|
+
'[&_tfoot_th]:leading-normal',
|
|
315
|
+
'[&_tfoot_th]:tracking-normal',
|
|
316
|
+
'[&_tfoot_th]:font-body',
|
|
317
|
+
'[&_tfoot_th]:font-normal',
|
|
318
|
+
'[&_tfoot_th]:align-middle',
|
|
319
|
+
],
|
|
320
|
+
'7': [
|
|
321
|
+
'[&_tfoot_td]:text-[14px]',
|
|
322
|
+
'[&_tfoot_td]:leading-normal',
|
|
323
|
+
'[&_tfoot_td]:tracking-tight',
|
|
324
|
+
'[&_tfoot_td]:font-body',
|
|
325
|
+
'[&_tfoot_td]:font-normal',
|
|
326
|
+
'[&_tfoot_td]:align-middle',
|
|
327
|
+
'[&_tfoot_th]:text-[14px]',
|
|
328
|
+
'[&_tfoot_th]:leading-normal',
|
|
329
|
+
'[&_tfoot_th]:tracking-tight',
|
|
330
|
+
'[&_tfoot_th]:font-body',
|
|
331
|
+
'[&_tfoot_th]:font-normal',
|
|
332
|
+
'[&_tfoot_th]:align-middle',
|
|
333
|
+
],
|
|
334
|
+
'8': [
|
|
335
|
+
'[&_tfoot_td]:text-[12.44px]',
|
|
336
|
+
'[&_tfoot_td]:leading-normal',
|
|
337
|
+
'[&_tfoot_td]:tracking-tight',
|
|
338
|
+
'[&_tfoot_td]:font-body',
|
|
339
|
+
'[&_tfoot_td]:font-normal',
|
|
340
|
+
'[&_tfoot_td]:align-middle',
|
|
341
|
+
'[&_tfoot_th]:text-[12.44px]',
|
|
342
|
+
'[&_tfoot_th]:leading-normal',
|
|
343
|
+
'[&_tfoot_th]:tracking-tight',
|
|
344
|
+
'[&_tfoot_th]:font-body',
|
|
345
|
+
'[&_tfoot_th]:font-normal',
|
|
346
|
+
'[&_tfoot_th]:align-middle',
|
|
347
|
+
],
|
|
348
|
+
'9': [
|
|
349
|
+
'[&_tfoot_td]:text-[11.06px]',
|
|
350
|
+
'[&_tfoot_td]:leading-normal',
|
|
351
|
+
'[&_tfoot_td]:tracking-tight',
|
|
352
|
+
'[&_tfoot_td]:font-body',
|
|
353
|
+
'[&_tfoot_td]:font-normal',
|
|
354
|
+
'[&_tfoot_td]:align-middle',
|
|
355
|
+
'[&_tfoot_th]:text-[11.06px]',
|
|
356
|
+
'[&_tfoot_th]:leading-normal',
|
|
357
|
+
'[&_tfoot_th]:tracking-tight',
|
|
358
|
+
'[&_tfoot_th]:font-body',
|
|
359
|
+
'[&_tfoot_th]:font-normal',
|
|
360
|
+
'[&_tfoot_th]:align-middle',
|
|
361
|
+
],
|
|
362
|
+
'10': [
|
|
363
|
+
'[&_tfoot_td]:text-[9.83px]',
|
|
364
|
+
'[&_tfoot_td]:leading-normal',
|
|
365
|
+
'[&_tfoot_td]:tracking-normal',
|
|
366
|
+
'[&_tfoot_td]:font-body',
|
|
367
|
+
'[&_tfoot_td]:font-normal',
|
|
368
|
+
'[&_tfoot_td]:align-middle',
|
|
369
|
+
'[&_tfoot_th]:text-[9.83px]',
|
|
370
|
+
'[&_tfoot_th]:leading-normal',
|
|
371
|
+
'[&_tfoot_th]:tracking-normal',
|
|
372
|
+
'[&_tfoot_th]:font-body',
|
|
373
|
+
'[&_tfoot_th]:font-normal',
|
|
374
|
+
'[&_tfoot_th]:align-middle',
|
|
375
|
+
],
|
|
376
|
+
};
|
|
377
|
+
const TABLE_SIZE_TOKENS = {
|
|
378
|
+
xs: {
|
|
379
|
+
headerPreset: '9',
|
|
380
|
+
bodyPreset: '9',
|
|
381
|
+
footerPreset: '10',
|
|
382
|
+
selectSize: 'xs',
|
|
383
|
+
paginatorSize: 'xs',
|
|
384
|
+
checkboxSize: 'xs',
|
|
385
|
+
actionSize: 'xs',
|
|
386
|
+
sortableButtonSize: 'xs',
|
|
387
|
+
sortableIconSize: 'xs',
|
|
388
|
+
},
|
|
389
|
+
sm: {
|
|
390
|
+
headerPreset: '8',
|
|
391
|
+
bodyPreset: '8',
|
|
392
|
+
footerPreset: '9',
|
|
393
|
+
selectSize: 'sm',
|
|
394
|
+
paginatorSize: 'sm',
|
|
395
|
+
checkboxSize: 'sm',
|
|
396
|
+
actionSize: 'xs',
|
|
397
|
+
sortableButtonSize: 'xs',
|
|
398
|
+
sortableIconSize: 'xs',
|
|
399
|
+
},
|
|
400
|
+
md: {
|
|
401
|
+
headerPreset: '7',
|
|
402
|
+
bodyPreset: '7',
|
|
403
|
+
footerPreset: '8',
|
|
404
|
+
selectSize: 'sm',
|
|
405
|
+
paginatorSize: 'sm',
|
|
406
|
+
checkboxSize: 'md',
|
|
407
|
+
actionSize: 'sm',
|
|
408
|
+
sortableButtonSize: 'sm',
|
|
409
|
+
sortableIconSize: 'sm',
|
|
410
|
+
},
|
|
411
|
+
lg: {
|
|
412
|
+
headerPreset: '7',
|
|
413
|
+
bodyPreset: '7',
|
|
414
|
+
footerPreset: '8',
|
|
415
|
+
selectSize: 'md',
|
|
416
|
+
paginatorSize: 'md',
|
|
417
|
+
checkboxSize: 'lg',
|
|
418
|
+
actionSize: 'md',
|
|
419
|
+
sortableButtonSize: 'md',
|
|
420
|
+
sortableIconSize: 'sm',
|
|
421
|
+
},
|
|
422
|
+
xl: {
|
|
423
|
+
headerPreset: '6',
|
|
424
|
+
bodyPreset: '6',
|
|
425
|
+
footerPreset: '7',
|
|
426
|
+
selectSize: 'lg',
|
|
427
|
+
paginatorSize: 'lg',
|
|
428
|
+
checkboxSize: 'lg',
|
|
429
|
+
actionSize: 'lg',
|
|
430
|
+
sortableButtonSize: 'lg',
|
|
431
|
+
sortableIconSize: 'md',
|
|
432
|
+
},
|
|
433
|
+
};
|
|
434
|
+
const TABLE_FOOTER_LAYOUT_BY_SIZE = {
|
|
435
|
+
xs: {
|
|
436
|
+
wrapper: ['gap-2', 'pb-1'],
|
|
437
|
+
divider: ['px-3'],
|
|
438
|
+
content: ['gap-2', 'px-3', '@2xl:gap-2'],
|
|
439
|
+
},
|
|
440
|
+
sm: {
|
|
441
|
+
wrapper: ['gap-3', 'pb-2'],
|
|
442
|
+
divider: ['px-3'],
|
|
443
|
+
content: ['gap-2', 'px-3', '@2xl:gap-2'],
|
|
444
|
+
},
|
|
445
|
+
md: {
|
|
446
|
+
wrapper: ['gap-4', 'pb-3'],
|
|
447
|
+
divider: ['px-4'],
|
|
448
|
+
content: ['gap-4', 'px-4', '@2xl:gap-2'],
|
|
449
|
+
},
|
|
450
|
+
lg: {
|
|
451
|
+
wrapper: ['gap-4', 'pb-3'],
|
|
452
|
+
divider: ['px-4'],
|
|
453
|
+
content: ['gap-4', 'px-4', '@2xl:gap-2'],
|
|
454
|
+
},
|
|
455
|
+
xl: {
|
|
456
|
+
wrapper: ['gap-4', 'pb-3'],
|
|
457
|
+
divider: ['px-4'],
|
|
458
|
+
content: ['gap-4', 'px-4', '@2xl:gap-2'],
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
function resolveTableSize(size) {
|
|
462
|
+
switch (size) {
|
|
463
|
+
case 'xs':
|
|
464
|
+
case 'sm':
|
|
465
|
+
case 'md':
|
|
466
|
+
case 'lg':
|
|
467
|
+
case 'xl':
|
|
468
|
+
return size;
|
|
469
|
+
default:
|
|
470
|
+
return 'sm';
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
function getTableSizeTokens(size) {
|
|
474
|
+
return TABLE_SIZE_TOKENS[resolveTableSize(size)];
|
|
475
|
+
}
|
|
476
|
+
function getTableFooterLayoutTokens(size) {
|
|
477
|
+
return TABLE_FOOTER_LAYOUT_BY_SIZE[resolveTableSize(size)];
|
|
478
|
+
}
|
|
479
|
+
function getTableHierarchyTypographyClasses(size) {
|
|
480
|
+
const tokens = TABLE_SIZE_TOKENS[size];
|
|
481
|
+
const headerPreset = tokens.headerPreset;
|
|
482
|
+
const bodyPreset = tokens.bodyPreset;
|
|
483
|
+
const footerPreset = tokens.footerPreset;
|
|
484
|
+
return [
|
|
485
|
+
...TABLE_HEADER_TYPOGRAPHY_CLASS_BY_PRESET[headerPreset],
|
|
486
|
+
...TABLE_BODY_TYPOGRAPHY_CLASS_BY_PRESET[bodyPreset],
|
|
487
|
+
...TABLE_FOOTER_TYPOGRAPHY_CLASS_BY_PRESET[footerPreset],
|
|
488
|
+
'[&_thead_th]:align-middle',
|
|
489
|
+
];
|
|
490
|
+
}
|
|
159
491
|
/** Type definition for pagination display variants */
|
|
160
492
|
/**
|
|
161
493
|
* @internal
|
|
@@ -167,21 +499,17 @@ const tableContent = cva([
|
|
|
167
499
|
'border-separate',
|
|
168
500
|
'border-spacing-0',
|
|
169
501
|
'text-pretty',
|
|
170
|
-
'[&_tbody]:font-body',
|
|
171
|
-
'[&_thead]:font-heading',
|
|
172
|
-
'[&_thead]:leading-normal',
|
|
173
|
-
'[&_tbody]:leading-tight',
|
|
174
502
|
'[&_th]:bg-neutral [&_th]:text-neutral-content',
|
|
175
503
|
'[&_th]:px-4',
|
|
176
504
|
'[&_td]:px-4',
|
|
177
505
|
], {
|
|
178
506
|
variants: {
|
|
179
507
|
size: {
|
|
180
|
-
xs: ['table-xs'],
|
|
181
|
-
sm: ['table-sm'],
|
|
182
|
-
md: ['table-md'],
|
|
183
|
-
lg: ['table-lg'],
|
|
184
|
-
xl: ['table-xl'],
|
|
508
|
+
xs: ['table-xs', ...getTableHierarchyTypographyClasses('xs')],
|
|
509
|
+
sm: ['table-sm', ...getTableHierarchyTypographyClasses('sm')],
|
|
510
|
+
md: ['table-md', ...getTableHierarchyTypographyClasses('md')],
|
|
511
|
+
lg: ['table-lg', ...getTableHierarchyTypographyClasses('lg')],
|
|
512
|
+
xl: ['table-xl', ...getTableHierarchyTypographyClasses('xl')],
|
|
185
513
|
},
|
|
186
514
|
},
|
|
187
515
|
compoundVariants: [],
|
|
@@ -449,26 +777,20 @@ class TableComponent {
|
|
|
449
777
|
'gap-4 pb-4': this.size() === 'lg',
|
|
450
778
|
'gap-5 pb-5': this.size() === 'xl',
|
|
451
779
|
}));
|
|
780
|
+
sizeTokens = computed(() => getTableSizeTokens(this.size()));
|
|
781
|
+
footerLayoutTokens = computed(() => getTableFooterLayoutTokens(this.size()));
|
|
452
782
|
/**
|
|
453
783
|
* @internal
|
|
454
784
|
* Computes typography variant for paginator text based on table size
|
|
455
785
|
*/
|
|
456
786
|
paginatorTextSize = computed(() => {
|
|
457
|
-
|
|
458
|
-
case 'xs':
|
|
459
|
-
return 'body-xxs';
|
|
460
|
-
case 'sm':
|
|
461
|
-
return 'body-xs';
|
|
462
|
-
case 'md':
|
|
463
|
-
return 'body-sm';
|
|
464
|
-
case 'lg':
|
|
465
|
-
return 'body';
|
|
466
|
-
case 'xl':
|
|
467
|
-
return 'body';
|
|
468
|
-
default:
|
|
469
|
-
return 'body-xs';
|
|
470
|
-
}
|
|
787
|
+
return this.size() === 'sm' ? '8' : this.sizeTokens().footerPreset;
|
|
471
788
|
});
|
|
789
|
+
footerSelectSize = computed(() => this.sizeTokens().selectSize);
|
|
790
|
+
footerPaginatorSize = computed(() => this.sizeTokens().paginatorSize);
|
|
791
|
+
footerWrapperClass = computed(() => cn('@container flex w-full flex-col overflow-x-auto', this.footerLayoutTokens().wrapper));
|
|
792
|
+
footerDividerClass = computed(() => cn('divider divider-neutral my-0 h-[0.0625rem] before:h-[0.0625rem] after:h-[0.0625rem]', this.footerLayoutTokens().divider));
|
|
793
|
+
footerContentClass = computed(() => cn('flex flex-col items-center @2xl:flex-row @2xl:justify-between @4xl:grid @4xl:grid-cols-[auto_1fr_auto] @4xl:items-center', this.footerLayoutTokens().content));
|
|
472
794
|
/** @internal Reference to header checkbox component */
|
|
473
795
|
header = contentChild(TableHeaderCheckboxComponent, { descendants: true });
|
|
474
796
|
/** @internal List of row checkbox components */
|
|
@@ -519,11 +841,11 @@ class TableComponent {
|
|
|
519
841
|
this.header()?.checked.set(false);
|
|
520
842
|
}
|
|
521
843
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
522
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: TableComponent, isStandalone: true, selector: "st-table", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, pinRows: { classPropertyName: "pinRows", publicName: "pinRows", isSignal: true, isRequired: false, transformFunction: null }, pinColumns: { classPropertyName: "pinColumns", publicName: "pinColumns", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, paginatorType: { classPropertyName: "paginatorType", publicName: "paginatorType", isSignal: true, isRequired: false, transformFunction: null }, noDataIcon: { classPropertyName: "noDataIcon", publicName: "noDataIcon", isSignal: true, isRequired: false, transformFunction: null }, noResultsIcon: { classPropertyName: "noResultsIcon", publicName: "noResultsIcon", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, showItemsPerPage: { classPropertyName: "showItemsPerPage", publicName: "showItemsPerPage", isSignal: true, isRequired: false, transformFunction: null }, showEntries: { classPropertyName: "showEntries", publicName: "showEntries", isSignal: true, isRequired: false, transformFunction: null }, showPagination: { classPropertyName: "showPagination", publicName: "showPagination", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, hasActiveFiltersCallback: { classPropertyName: "hasActiveFiltersCallback", publicName: "hasActiveFiltersCallback", isSignal: true, isRequired: false, transformFunction: null }, allowHeaderOverflow: { classPropertyName: "allowHeaderOverflow", publicName: "allowHeaderOverflow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", checkedItems: "checkedItems" }, queries: [{ propertyName: "header", first: true, predicate: TableHeaderCheckboxComponent, descendants: true, isSignal: true }, { propertyName: "rows", predicate: TableRowCheckboxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let total = totalItems();\n@let containerClassVar = containerClass();\n@let tableContainerClassVar = tableContainerClass();\n@let tableClassVar = tableClass();\n@let paginatorTextSizeVar = paginatorTextSize();\n@let showItemsPerPageVar = showItemsPerPage();\n@let paginationVar = pagination();\n@let showPaginationVar = showPagination();\n@let paginatorTypeVar = paginatorType();\n@let maxSizeVar = maxSize();\n@let showEntriesVar = showEntries();\n@let showFooterVar = showFooter();\n@let totalPagesVar = totalPages();\n\n<div [class]=\"containerClassVar\">\n\t<div [class]=\"tableContainerClassVar\">\n\t\t<div class=\"w-full flex-grow overflow-x-auto\">\n\t\t\t@if (hasNoData()) {\n\t\t\t\t<div class=\"flex flex-col items-center justify-center py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40
|
|
844
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: TableComponent, isStandalone: true, selector: "st-table", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, pinRows: { classPropertyName: "pinRows", publicName: "pinRows", isSignal: true, isRequired: false, transformFunction: null }, pinColumns: { classPropertyName: "pinColumns", publicName: "pinColumns", isSignal: true, isRequired: false, transformFunction: null }, zebra: { classPropertyName: "zebra", publicName: "zebra", isSignal: true, isRequired: false, transformFunction: null }, paginatorType: { classPropertyName: "paginatorType", publicName: "paginatorType", isSignal: true, isRequired: false, transformFunction: null }, noDataIcon: { classPropertyName: "noDataIcon", publicName: "noDataIcon", isSignal: true, isRequired: false, transformFunction: null }, noResultsIcon: { classPropertyName: "noResultsIcon", publicName: "noResultsIcon", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, showItemsPerPage: { classPropertyName: "showItemsPerPage", publicName: "showItemsPerPage", isSignal: true, isRequired: false, transformFunction: null }, showEntries: { classPropertyName: "showEntries", publicName: "showEntries", isSignal: true, isRequired: false, transformFunction: null }, showPagination: { classPropertyName: "showPagination", publicName: "showPagination", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, hasActiveFiltersCallback: { classPropertyName: "hasActiveFiltersCallback", publicName: "hasActiveFiltersCallback", isSignal: true, isRequired: false, transformFunction: null }, allowHeaderOverflow: { classPropertyName: "allowHeaderOverflow", publicName: "allowHeaderOverflow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", checkedItems: "checkedItems" }, queries: [{ propertyName: "header", first: true, predicate: TableHeaderCheckboxComponent, descendants: true, isSignal: true }, { propertyName: "rows", predicate: TableRowCheckboxComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@let total = totalItems();\n@let containerClassVar = containerClass();\n@let tableContainerClassVar = tableContainerClass();\n@let tableClassVar = tableClass();\n@let paginatorTextSizeVar = paginatorTextSize();\n@let footerSelectSizeVar = footerSelectSize();\n@let footerPaginatorSizeVar = footerPaginatorSize();\n@let footerWrapperClassVar = footerWrapperClass();\n@let footerDividerClassVar = footerDividerClass();\n@let footerContentClassVar = footerContentClass();\n@let showItemsPerPageVar = showItemsPerPage();\n@let paginationVar = pagination();\n@let showPaginationVar = showPagination();\n@let paginatorTypeVar = paginatorType();\n@let maxSizeVar = maxSize();\n@let showEntriesVar = showEntries();\n@let showFooterVar = showFooter();\n@let totalPagesVar = totalPages();\n\n<div [class]=\"containerClassVar\">\n\t<div [class]=\"tableContainerClassVar\">\n\t\t<div class=\"w-full flex-grow overflow-x-auto\">\n\t\t\t@if (hasNoData()) {\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noDataIcon()\" size=\"lg\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.table.noData.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.table.noData.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (hasNoResults()) {\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noResultsIcon()\" size=\"xl\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.table.noResults.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.table.noResults.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"mt-3\">\n\t\t\t\t\t\t<ng-content select=\"st-table-empty-actions\"></ng-content>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else {\n\t\t\t\t<table [class]=\"tableClassVar\">\n\t\t\t\t\t<ng-content select=\"thead\"></ng-content>\n\t\t\t\t\t<ng-content select=\"tbody\"></ng-content>\n\t\t\t\t\t<ng-content select=\"tfoot\"></ng-content>\n\t\t\t\t</table>\n\t\t\t}\n\t\t</div>\n\t</div>\n\t@if (total > 0) {\n\t\t@if (showFooterVar) {\n\t\t\t<div [class]=\"footerWrapperClassVar\">\n\t\t\t\t<div [class]=\"footerDividerClassVar\"></div>\n\t\t\t\t<div [class]=\"footerContentClassVar\">\n\t\t\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t\t\t@if (showEntriesVar) {\n\t\t\t\t\t\t\t@if (!showItemsPerPageVar && !showPaginationVar) {\n\t\t\t\t\t\t\t\t<span [stText]=\"paginatorTextSizeVar\">\n\t\t\t\t\t\t\t\t\t{{ 'sdk.table.totalEntries' | translate: { total: total } }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t\t<span [stText]=\"paginatorTextSizeVar\">\n\t\t\t\t\t\t\t\t\t{{ 'sdk.table.entriesRange' | translate: { range: paginationRange(), total: total } }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex justify-center\">\n\t\t\t\t\t\t@if (showPaginationVar) {\n\t\t\t\t\t\t\t@if (paginatorTypeVar === 'default') {\n\t\t\t\t\t\t\t\t<st-paginator\n\t\t\t\t\t\t\t\t\t[paginatorId]=\"paginationVar.id\"\n\t\t\t\t\t\t\t\t\t[pages]=\"totalPagesVar\"\n\t\t\t\t\t\t\t\t\t[currentPage]=\"paginationVar.currentPage\"\n\t\t\t\t\t\t\t\t\t[size]=\"footerPaginatorSizeVar\"\n\t\t\t\t\t\t\t\t\t[maxSize]=\"maxSizeVar\"\n\t\t\t\t\t\t\t\t\t(pageChanged)=\"handlePageChange($event)\"\n\t\t\t\t\t\t\t\t></st-paginator>\n\t\t\t\t\t\t\t} @else if (paginatorTypeVar === 'dots') {\n\t\t\t\t\t\t\t\t<st-paginator\n\t\t\t\t\t\t\t\t\t[paginatorId]=\"paginationVar.id\"\n\t\t\t\t\t\t\t\t\t[pages]=\"totalPagesVar\"\n\t\t\t\t\t\t\t\t\t[currentPage]=\"paginationVar.currentPage\"\n\t\t\t\t\t\t\t\t\t[size]=\"footerPaginatorSizeVar\"\n\t\t\t\t\t\t\t\t\t(pageChanged)=\"handlePageChange($event)\"\n\t\t\t\t\t\t\t\t\ttype=\"dots\"\n\t\t\t\t\t\t\t\t></st-paginator>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t\t\t@if (showItemsPerPageVar) {\n\t\t\t\t\t\t\t<span class=\"sr-only\">{{ 'sdk.table.entriesByPage' | translate }}</span>\n\t\t\t\t\t\t\t<st-select\n\t\t\t\t\t\t\t\t[options]=\"entriesPerPageOptions()\"\n\t\t\t\t\t\t\t\t[value]=\"paginationVar.itemsPerPage\"\n\t\t\t\t\t\t\t\tvalueKey=\"value\"\n\t\t\t\t\t\t\t\tdisplayKey=\"text\"\n\t\t\t\t\t\t\t\t[size]=\"footerSelectSizeVar\"\n\t\t\t\t\t\t\t\t(valueUpdated)=\"handlePageSizeChange($event)\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t[allowClear]=\"false\"\n\t\t\t\t\t\t\t></st-select>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t}\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: PaginatorComponent, selector: "st-paginator", inputs: ["paginatorId", "maxSize", "type", "pages", "size", "currentPage"], outputs: ["pageChanged", "currentPageChange"] }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "component", type: SelectComponent, selector: "st-select", inputs: ["variant", "size", "showOptional", "optionalText", "ghost", "name", "placeholder", "label", "value", "options", "displayKey", "valueKey", "allowClear", "parentForm", "formControlName", "disabled", "stopPropagation"], outputs: ["valueChange", "disabledChange", "blurred", "valueUpdated", "clicked", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
523
845
|
}
|
|
524
846
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TableComponent, decorators: [{
|
|
525
847
|
type: Component,
|
|
526
|
-
args: [{ selector: 'st-table', imports: [CommonModule, PaginatorComponent,
|
|
848
|
+
args: [{ selector: 'st-table', imports: [CommonModule, PaginatorComponent, TextDirective, SelectComponent, IconComponent, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let total = totalItems();\n@let containerClassVar = containerClass();\n@let tableContainerClassVar = tableContainerClass();\n@let tableClassVar = tableClass();\n@let paginatorTextSizeVar = paginatorTextSize();\n@let footerSelectSizeVar = footerSelectSize();\n@let footerPaginatorSizeVar = footerPaginatorSize();\n@let footerWrapperClassVar = footerWrapperClass();\n@let footerDividerClassVar = footerDividerClass();\n@let footerContentClassVar = footerContentClass();\n@let showItemsPerPageVar = showItemsPerPage();\n@let paginationVar = pagination();\n@let showPaginationVar = showPagination();\n@let paginatorTypeVar = paginatorType();\n@let maxSizeVar = maxSize();\n@let showEntriesVar = showEntries();\n@let showFooterVar = showFooter();\n@let totalPagesVar = totalPages();\n\n<div [class]=\"containerClassVar\">\n\t<div [class]=\"tableContainerClassVar\">\n\t\t<div class=\"w-full flex-grow overflow-x-auto\">\n\t\t\t@if (hasNoData()) {\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noDataIcon()\" size=\"lg\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.table.noData.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.table.noData.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else if (hasNoResults()) {\n\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-1.5 py-12 text-center\">\n\t\t\t\t\t<div class=\"text-base-content/40\">\n\t\t\t\t\t\t<st-icon [icon]=\"noResultsIcon()\" size=\"xl\" color=\"base-content\" class=\"mx-auto opacity-40\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex flex-col items-center justify-center gap-0.5\">\n\t\t\t\t\t\t<h3 stText=\"6\" class=\"text-base-content/60\">{{ 'sdk.table.noResults.title' | translate }}</h3>\n\t\t\t\t\t\t<p stText=\"8\" class=\"text-base-content/40\">{{ 'sdk.table.noResults.message' | translate }}</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"mt-3\">\n\t\t\t\t\t\t<ng-content select=\"st-table-empty-actions\"></ng-content>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t} @else {\n\t\t\t\t<table [class]=\"tableClassVar\">\n\t\t\t\t\t<ng-content select=\"thead\"></ng-content>\n\t\t\t\t\t<ng-content select=\"tbody\"></ng-content>\n\t\t\t\t\t<ng-content select=\"tfoot\"></ng-content>\n\t\t\t\t</table>\n\t\t\t}\n\t\t</div>\n\t</div>\n\t@if (total > 0) {\n\t\t@if (showFooterVar) {\n\t\t\t<div [class]=\"footerWrapperClassVar\">\n\t\t\t\t<div [class]=\"footerDividerClassVar\"></div>\n\t\t\t\t<div [class]=\"footerContentClassVar\">\n\t\t\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t\t\t@if (showEntriesVar) {\n\t\t\t\t\t\t\t@if (!showItemsPerPageVar && !showPaginationVar) {\n\t\t\t\t\t\t\t\t<span [stText]=\"paginatorTextSizeVar\">\n\t\t\t\t\t\t\t\t\t{{ 'sdk.table.totalEntries' | translate: { total: total } }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t\t<span [stText]=\"paginatorTextSizeVar\">\n\t\t\t\t\t\t\t\t\t{{ 'sdk.table.entriesRange' | translate: { range: paginationRange(), total: total } }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex justify-center\">\n\t\t\t\t\t\t@if (showPaginationVar) {\n\t\t\t\t\t\t\t@if (paginatorTypeVar === 'default') {\n\t\t\t\t\t\t\t\t<st-paginator\n\t\t\t\t\t\t\t\t\t[paginatorId]=\"paginationVar.id\"\n\t\t\t\t\t\t\t\t\t[pages]=\"totalPagesVar\"\n\t\t\t\t\t\t\t\t\t[currentPage]=\"paginationVar.currentPage\"\n\t\t\t\t\t\t\t\t\t[size]=\"footerPaginatorSizeVar\"\n\t\t\t\t\t\t\t\t\t[maxSize]=\"maxSizeVar\"\n\t\t\t\t\t\t\t\t\t(pageChanged)=\"handlePageChange($event)\"\n\t\t\t\t\t\t\t\t></st-paginator>\n\t\t\t\t\t\t\t} @else if (paginatorTypeVar === 'dots') {\n\t\t\t\t\t\t\t\t<st-paginator\n\t\t\t\t\t\t\t\t\t[paginatorId]=\"paginationVar.id\"\n\t\t\t\t\t\t\t\t\t[pages]=\"totalPagesVar\"\n\t\t\t\t\t\t\t\t\t[currentPage]=\"paginationVar.currentPage\"\n\t\t\t\t\t\t\t\t\t[size]=\"footerPaginatorSizeVar\"\n\t\t\t\t\t\t\t\t\t(pageChanged)=\"handlePageChange($event)\"\n\t\t\t\t\t\t\t\t\ttype=\"dots\"\n\t\t\t\t\t\t\t\t></st-paginator>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"flex items-center justify-end\">\n\t\t\t\t\t\t@if (showItemsPerPageVar) {\n\t\t\t\t\t\t\t<span class=\"sr-only\">{{ 'sdk.table.entriesByPage' | translate }}</span>\n\t\t\t\t\t\t\t<st-select\n\t\t\t\t\t\t\t\t[options]=\"entriesPerPageOptions()\"\n\t\t\t\t\t\t\t\t[value]=\"paginationVar.itemsPerPage\"\n\t\t\t\t\t\t\t\tvalueKey=\"value\"\n\t\t\t\t\t\t\t\tdisplayKey=\"text\"\n\t\t\t\t\t\t\t\t[size]=\"footerSelectSizeVar\"\n\t\t\t\t\t\t\t\t(valueUpdated)=\"handlePageSizeChange($event)\"\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t[allowClear]=\"false\"\n\t\t\t\t\t\t\t></st-select>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t}\n</div>\n" }]
|
|
527
849
|
}] });
|
|
528
850
|
|
|
529
851
|
/**
|
|
@@ -561,56 +883,126 @@ class TableActionComponent {
|
|
|
561
883
|
size = input('md');
|
|
562
884
|
/**
|
|
563
885
|
* Computes CSS classes for the table action text size based on the current size setting.
|
|
564
|
-
*
|
|
565
|
-
* @returns A string of CSS classes determined by the component's size:
|
|
566
|
-
* - 'xs' size: applies 'text-[0.6875rem]' class
|
|
567
|
-
* - 'sm' size: applies 'text-xs' class
|
|
568
|
-
* - 'md' size: applies 'text-sm' class
|
|
569
|
-
* - 'lg' or 'xl' size: applies 'text-lg' class
|
|
570
886
|
*/
|
|
571
887
|
tableActionClass = computed(() => {
|
|
572
888
|
return cn({
|
|
573
|
-
'text-[
|
|
574
|
-
'text-
|
|
575
|
-
'text-
|
|
576
|
-
'text-
|
|
889
|
+
'text-[9.83px] leading-normal tracking-normal': this.size() === 'xs',
|
|
890
|
+
'text-[11.06px] leading-normal tracking-tight': this.size() === 'sm',
|
|
891
|
+
'text-[12.44px] leading-normal tracking-tight': this.size() === 'md',
|
|
892
|
+
'text-[14px] leading-normal tracking-tight': this.size() === 'lg',
|
|
893
|
+
'text-[15.75px] leading-normal tracking-normal': this.size() === 'xl',
|
|
577
894
|
});
|
|
578
895
|
});
|
|
896
|
+
textPreset = computed(() => {
|
|
897
|
+
switch (this.size()) {
|
|
898
|
+
case 'xs':
|
|
899
|
+
return '10';
|
|
900
|
+
case 'sm':
|
|
901
|
+
return '9';
|
|
902
|
+
case 'md':
|
|
903
|
+
return '8';
|
|
904
|
+
case 'lg':
|
|
905
|
+
return '7';
|
|
906
|
+
case 'xl':
|
|
907
|
+
return '6';
|
|
908
|
+
default:
|
|
909
|
+
return '8';
|
|
910
|
+
}
|
|
911
|
+
});
|
|
579
912
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TableActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
580
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: TableActionComponent, isStandalone: true, selector: "st-table-action", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let tooltipVar = tooltip();\n@let variantVar = variant();\n@let iconVar = icon();\n@let sizeVar = size();\n\n<!-- Define the button template with content projection -->\n<ng-template #buttonTemplate>\n\t<st-button [class]=\"tableActionClass()\" [variant]=\"variantVar\" [icon]=\"iconVar\" [link]=\"true\" [size]=\"sizeVar\">\n\t\t<ng-content></ng-content>\n\t</st-button>\n</ng-template>\n\n<!-- Conditional rendering -->\n@if (tooltipVar) {\n\t<st-tooltip variant=\"secondary\" [label]=\"tooltipVar | translate\" position=\"top\">\n\t\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n\t</st-tooltip>\n} @else {\n\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TooltipComponent, selector: "st-tooltip", inputs: ["variant", "position", "label", "icon", "iconPosition"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe$1, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
913
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: TableActionComponent, isStandalone: true, selector: "st-table-action", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@let tooltipVar = tooltip();\n@let variantVar = variant();\n@let iconVar = icon();\n@let sizeVar = size();\n@let textPresetVar = textPreset();\n\n<!-- Define the button template with content projection -->\n<ng-template #buttonTemplate>\n\t<st-button [class]=\"tableActionClass()\" [variant]=\"variantVar\" [icon]=\"iconVar\" [link]=\"true\" [size]=\"sizeVar\">\n\t\t<span [stText]=\"textPresetVar\">\n\t\t\t<ng-content></ng-content>\n\t\t</span>\n\t</st-button>\n</ng-template>\n\n<!-- Conditional rendering -->\n@if (tooltipVar) {\n\t<st-tooltip variant=\"secondary\" [label]=\"tooltipVar | translate\" position=\"top\">\n\t\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n\t</st-tooltip>\n} @else {\n\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TooltipComponent, selector: "st-tooltip", inputs: ["variant", "position", "label", "icon", "iconPosition"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "pipe", type: TranslatePipe$1, name: "translate" }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
581
914
|
}
|
|
582
915
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TableActionComponent, decorators: [{
|
|
583
916
|
type: Component,
|
|
584
|
-
args: [{ selector: 'st-table-action', imports: [CommonModule, TooltipComponent, ButtonComponent, TranslatePipe$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let tooltipVar = tooltip();\n@let variantVar = variant();\n@let iconVar = icon();\n@let sizeVar = size();\n\n<!-- Define the button template with content projection -->\n<ng-template #buttonTemplate>\n\t<st-button [class]=\"tableActionClass()\" [variant]=\"variantVar\" [icon]=\"iconVar\" [link]=\"true\" [size]=\"sizeVar\">\n\t\t<ng-content></ng-content>\n\t</st-button>\n</ng-template>\n\n<!-- Conditional rendering -->\n@if (tooltipVar) {\n\t<st-tooltip variant=\"secondary\" [label]=\"tooltipVar | translate\" position=\"top\">\n\t\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n\t</st-tooltip>\n} @else {\n\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n}\n" }]
|
|
917
|
+
args: [{ selector: 'st-table-action', imports: [CommonModule, TooltipComponent, ButtonComponent, TranslatePipe$1, TextDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let tooltipVar = tooltip();\n@let variantVar = variant();\n@let iconVar = icon();\n@let sizeVar = size();\n@let textPresetVar = textPreset();\n\n<!-- Define the button template with content projection -->\n<ng-template #buttonTemplate>\n\t<st-button [class]=\"tableActionClass()\" [variant]=\"variantVar\" [icon]=\"iconVar\" [link]=\"true\" [size]=\"sizeVar\">\n\t\t<span [stText]=\"textPresetVar\">\n\t\t\t<ng-content></ng-content>\n\t\t</span>\n\t</st-button>\n</ng-template>\n\n<!-- Conditional rendering -->\n@if (tooltipVar) {\n\t<st-tooltip variant=\"secondary\" [label]=\"tooltipVar | translate\" position=\"top\">\n\t\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n\t</st-tooltip>\n} @else {\n\t<ng-container *ngTemplateOutlet=\"buttonTemplate\"></ng-container>\n}\n" }]
|
|
585
918
|
}] });
|
|
586
919
|
|
|
587
920
|
/**
|
|
588
921
|
* Component to render a container for table actions.
|
|
589
922
|
*
|
|
590
923
|
* @remarks
|
|
591
|
-
*
|
|
592
|
-
*
|
|
924
|
+
* Supports three modes of operation:
|
|
925
|
+
* 1. **ng-content (backward compatible)**: When no `actions` input is provided, renders projected content.
|
|
926
|
+
* 2. **Inline mode**: When `actions` is provided and `mode` is `'inline'`, renders action buttons in a row.
|
|
927
|
+
* 3. **Dropdown mode**: When `actions` is provided and `mode` is `'dropdown'`, renders a kebab menu.
|
|
593
928
|
*
|
|
594
929
|
* @example
|
|
595
930
|
* ```html
|
|
931
|
+
* <!-- ng-content mode (backward compatible) -->
|
|
596
932
|
* <st-table-actions>
|
|
597
|
-
* <
|
|
598
|
-
* <button>Action 2</button>
|
|
933
|
+
* <st-table-action [icon]="editIcon" tooltip="Edit" />
|
|
599
934
|
* </st-table-actions>
|
|
935
|
+
*
|
|
936
|
+
* <!-- Data-driven inline mode -->
|
|
937
|
+
* <st-table-actions [actions]="myActions" (actionTriggered)="onAction($event)" />
|
|
938
|
+
*
|
|
939
|
+
* <!-- Data-driven dropdown mode -->
|
|
940
|
+
* <st-table-actions [actions]="myActions" mode="dropdown" (actionTriggered)="onAction($event)" />
|
|
600
941
|
* ```
|
|
601
942
|
*/
|
|
602
943
|
class TableActionsComponent {
|
|
944
|
+
/**
|
|
945
|
+
* Array of action configurations. When provided, renders actions data-driven.
|
|
946
|
+
* When empty or not provided, falls back to ng-content projection.
|
|
947
|
+
*/
|
|
948
|
+
actions = input([]);
|
|
949
|
+
/**
|
|
950
|
+
* Rendering mode for the actions.
|
|
951
|
+
* - `'inline'`: Renders action buttons in a row (default).
|
|
952
|
+
* - `'dropdown'`: Renders a kebab menu that opens a dropdown with action items.
|
|
953
|
+
* @defaultValue 'inline'
|
|
954
|
+
*/
|
|
955
|
+
mode = input('inline');
|
|
956
|
+
/**
|
|
957
|
+
* Size for action buttons and the dropdown trigger.
|
|
958
|
+
* @defaultValue 'md'
|
|
959
|
+
*/
|
|
960
|
+
size = input('md');
|
|
961
|
+
/**
|
|
962
|
+
* Icon for the dropdown trigger button.
|
|
963
|
+
* @defaultValue matMoreVert (Material vertical dots icon)
|
|
964
|
+
*/
|
|
965
|
+
triggerIcon = input(matMoreVert);
|
|
966
|
+
/**
|
|
967
|
+
* Emitted when a data-driven action is triggered/clicked.
|
|
968
|
+
* Emits the full `TableActionConfig` of the triggered action.
|
|
969
|
+
*/
|
|
970
|
+
actionTriggered = output();
|
|
603
971
|
/**
|
|
604
972
|
* @internal
|
|
605
|
-
* Computed class string for the table actions container.
|
|
973
|
+
* Computed class string for the table actions container (inline mode and ng-content fallback).
|
|
606
974
|
*/
|
|
607
|
-
componentClass = computed(() => cn('inline-flex items-center gap-2
|
|
975
|
+
componentClass = computed(() => cn('inline-flex grow-0 items-center justify-center gap-2 align-top'));
|
|
976
|
+
/**
|
|
977
|
+
* @internal
|
|
978
|
+
* Whether the component should use data-driven rendering.
|
|
979
|
+
*/
|
|
980
|
+
hasActions = computed(() => (this.actions()?.length ?? 0) > 0);
|
|
981
|
+
/**
|
|
982
|
+
* @internal
|
|
983
|
+
* Handle action click for data-driven mode.
|
|
984
|
+
*/
|
|
985
|
+
onActionClick(action) {
|
|
986
|
+
if (!action.disabled) {
|
|
987
|
+
this.actionTriggered.emit(action);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
608
990
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TableActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
609
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
991
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: TableActionsComponent, isStandalone: true, selector: "st-table-actions", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, triggerIcon: { classPropertyName: "triggerIcon", publicName: "triggerIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionTriggered: "actionTriggered" }, ngImport: i0, template: "@if (hasActions()) {\n\t@if (mode() === 'inline') {\n\t\t<div [class]=\"componentClass()\">\n\t\t\t@for (action of actions(); track action.id) {\n\t\t\t\t<st-table-action\n\t\t\t\t\t[variant]=\"action.variant ?? 'primary'\"\n\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t[tooltip]=\"action.tooltip\"\n\t\t\t\t\t[size]=\"size()\"\n\t\t\t\t\t(click)=\"onActionClick(action)\"\n\t\t\t\t/>\n\t\t\t}\n\t\t</div>\n\t} @else {\n\t\t<st-dropdown-menu>\n\t\t\t<st-dropdown-menu-trigger [menuTriggerFor]=\"content.template\">\n\t\t\t\t<st-button [icon]=\"triggerIcon()\" [ghost]=\"true\" [size]=\"size()\" variant=\"base\" />\n\t\t\t</st-dropdown-menu-trigger>\n\t\t\t<st-dropdown-menu-content #content [size]=\"size()\">\n\t\t\t\t@for (action of actions(); track action.id) {\n\t\t\t\t\t<st-dropdown-menu-item [disabled]=\"action.disabled ?? false\" (triggered)=\"onActionClick(action)\">\n\t\t\t\t\t\t<span class=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t@if (action.icon) {\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"action.icon\" size=\"auto\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@if (action.label) {\n\t\t\t\t\t\t\t\t{{ action.label | translate }}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</st-dropdown-menu-item>\n\t\t\t\t}\n\t\t\t</st-dropdown-menu-content>\n\t\t</st-dropdown-menu>\n\t}\n} @else {\n\t<div [class]=\"componentClass()\">\n\t\t<ng-content></ng-content>\n\t</div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: TranslatePipe$1, name: "translate" }, { kind: "component", type: TableActionComponent, selector: "st-table-action", inputs: ["variant", "tooltip", "icon", "size"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "component", type: DropdownMenuComponent, selector: "st-dropdown-menu" }, { kind: "component", type: DropdownMenuTriggerComponent, selector: "st-dropdown-menu-trigger" }, { kind: "component", type: DropdownMenuContentComponent, selector: "st-dropdown-menu-content", inputs: ["class", "size"], outputs: ["closed"], exportAs: ["menuContent"] }, { kind: "component", type: DropdownMenuItemComponent, selector: "st-dropdown-menu-item", inputs: ["disabled", "active", "shortcut", "class", "stopPropagation"], outputs: ["triggered", "clicked", "keyDownEnter", "keyDownSpace"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
610
992
|
}
|
|
611
993
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TableActionsComponent, decorators: [{
|
|
612
994
|
type: Component,
|
|
613
|
-
args: [{ selector: 'st-table-actions', imports: [
|
|
995
|
+
args: [{ selector: 'st-table-actions', imports: [
|
|
996
|
+
CommonModule,
|
|
997
|
+
TranslatePipe$1,
|
|
998
|
+
TableActionComponent,
|
|
999
|
+
ButtonComponent,
|
|
1000
|
+
IconComponent,
|
|
1001
|
+
DropdownMenuComponent,
|
|
1002
|
+
DropdownMenuTriggerComponent,
|
|
1003
|
+
DropdownMenuContentComponent,
|
|
1004
|
+
DropdownMenuItemComponent,
|
|
1005
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (hasActions()) {\n\t@if (mode() === 'inline') {\n\t\t<div [class]=\"componentClass()\">\n\t\t\t@for (action of actions(); track action.id) {\n\t\t\t\t<st-table-action\n\t\t\t\t\t[variant]=\"action.variant ?? 'primary'\"\n\t\t\t\t\t[icon]=\"action.icon\"\n\t\t\t\t\t[tooltip]=\"action.tooltip\"\n\t\t\t\t\t[size]=\"size()\"\n\t\t\t\t\t(click)=\"onActionClick(action)\"\n\t\t\t\t/>\n\t\t\t}\n\t\t</div>\n\t} @else {\n\t\t<st-dropdown-menu>\n\t\t\t<st-dropdown-menu-trigger [menuTriggerFor]=\"content.template\">\n\t\t\t\t<st-button [icon]=\"triggerIcon()\" [ghost]=\"true\" [size]=\"size()\" variant=\"base\" />\n\t\t\t</st-dropdown-menu-trigger>\n\t\t\t<st-dropdown-menu-content #content [size]=\"size()\">\n\t\t\t\t@for (action of actions(); track action.id) {\n\t\t\t\t\t<st-dropdown-menu-item [disabled]=\"action.disabled ?? false\" (triggered)=\"onActionClick(action)\">\n\t\t\t\t\t\t<span class=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t@if (action.icon) {\n\t\t\t\t\t\t\t\t<st-icon [icon]=\"action.icon\" size=\"auto\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@if (action.label) {\n\t\t\t\t\t\t\t\t{{ action.label | translate }}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</st-dropdown-menu-item>\n\t\t\t\t}\n\t\t\t</st-dropdown-menu-content>\n\t\t</st-dropdown-menu>\n\t}\n} @else {\n\t<div [class]=\"componentClass()\">\n\t\t<ng-content></ng-content>\n\t</div>\n}\n" }]
|
|
614
1006
|
}] });
|
|
615
1007
|
|
|
616
1008
|
class TableEmptyActionsComponent {
|
|
@@ -626,5 +1018,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImpor
|
|
|
626
1018
|
* Generated bundle index. Do not edit.
|
|
627
1019
|
*/
|
|
628
1020
|
|
|
629
|
-
export { TableActionComponent, TableActionsComponent, TableComponent, TableEmptyActionsComponent, TableHeaderCheckboxComponent, TableRowCheckboxComponent, tableComponent, tableContainer, tableContent };
|
|
1021
|
+
export { TableActionComponent, TableActionsComponent, TableComponent, TableEmptyActionsComponent, TableHeaderCheckboxComponent, TableRowCheckboxComponent, getTableFooterLayoutTokens, getTableHierarchyTypographyClasses, getTableSizeTokens, resolveTableSize, tableComponent, tableContainer, tableContent };
|
|
630
1022
|
//# sourceMappingURL=sixbell-telco-sdk-components-table.mjs.map
|