vueless 0.0.522 → 0.0.524
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/package.json +1 -1
- package/ui.button/UButton.vue +3 -2
- package/ui.button/config.ts +5 -2
- package/ui.button/useAttrs.ts +1 -0
- package/ui.data-table/UTable.vue +95 -57
- package/web-types.json +12 -12
package/package.json
CHANGED
package/ui.button/UButton.vue
CHANGED
|
@@ -116,8 +116,6 @@ defineExpose({
|
|
|
116
116
|
:data-test="dataTest"
|
|
117
117
|
>
|
|
118
118
|
<template v-if="loading">
|
|
119
|
-
<!-- Label is needed to prevent changing button height -->
|
|
120
|
-
<div tabindex="-1" class="invisible w-0" v-text="label" />
|
|
121
119
|
<ULoader :loading="loading" :size="loaderSize" :color="iconColor" v-bind="loaderAttrs" />
|
|
122
120
|
</template>
|
|
123
121
|
|
|
@@ -183,5 +181,8 @@ defineExpose({
|
|
|
183
181
|
/>
|
|
184
182
|
</slot>
|
|
185
183
|
</template>
|
|
184
|
+
|
|
185
|
+
<!-- This is needed to prevent changing button height -->
|
|
186
|
+
<div v-if="!label || loading" tabindex="-1" class="invisible w-0" v-text="'invisible'" />
|
|
186
187
|
</component>
|
|
187
188
|
</template>
|
package/ui.button/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
button: {
|
|
3
3
|
base: `
|
|
4
|
-
flex items-center justify-center font-medium whitespace-nowrap
|
|
4
|
+
flex items-center justify-center font-medium !leading-snug whitespace-nowrap
|
|
5
5
|
border border-transparent outline-none transition
|
|
6
6
|
disabled:cursor-not-allowed cursor-pointer
|
|
7
7
|
disabled:ring-0 disabled:ring-offset-0
|
|
@@ -51,7 +51,10 @@ export default /*tw*/ {
|
|
|
51
51
|
true: "!ring-0 !ring-offset-0",
|
|
52
52
|
},
|
|
53
53
|
loading: {
|
|
54
|
-
true: "pointer-events-none
|
|
54
|
+
true: "gap-0 pointer-events-none",
|
|
55
|
+
},
|
|
56
|
+
label: {
|
|
57
|
+
false: "gap-0",
|
|
55
58
|
},
|
|
56
59
|
block: {
|
|
57
60
|
true: "w-full",
|
package/ui.button/useAttrs.ts
CHANGED
|
@@ -13,6 +13,7 @@ export default function useAttrs(props: UButtonProps): UseAttrs<Config> {
|
|
|
13
13
|
const mutatedProps = computed(() => ({
|
|
14
14
|
leftIcon: Boolean(props.leftIcon) || hasSlotContent(slots["left"]),
|
|
15
15
|
rightIcon: Boolean(props.rightIcon) || hasSlotContent(slots["right"]),
|
|
16
|
+
label: Boolean(props.label),
|
|
16
17
|
}));
|
|
17
18
|
|
|
18
19
|
const keysAttrs = getKeysAttrs(mutatedProps);
|
package/ui.data-table/UTable.vue
CHANGED
|
@@ -422,82 +422,120 @@ defineExpose({
|
|
|
422
422
|
<template>
|
|
423
423
|
<div v-bind="wrapperAttrs" :data-test="dataTest">
|
|
424
424
|
<div
|
|
425
|
-
v-show="isHeaderSticky
|
|
425
|
+
v-show="isHeaderSticky && !isShownActionsHeader"
|
|
426
426
|
ref="sticky-header-row"
|
|
427
427
|
:style="tableRowWidthStyle"
|
|
428
428
|
v-bind="stickyHeaderAttrs"
|
|
429
429
|
>
|
|
430
|
-
<
|
|
431
|
-
<
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
/>
|
|
440
|
-
</div>
|
|
430
|
+
<div v-bind="stickyHeaderCellAttrs">
|
|
431
|
+
<UCheckbox
|
|
432
|
+
v-if="selectable"
|
|
433
|
+
v-model="selectAll"
|
|
434
|
+
size="md"
|
|
435
|
+
:partial="!isSelectedAllRows"
|
|
436
|
+
v-bind="stickyHeaderCheckboxAttrs"
|
|
437
|
+
:data-test="`${dataTest}-select-all`"
|
|
438
|
+
/>
|
|
441
439
|
|
|
442
440
|
<div
|
|
443
441
|
v-if="selectedRows.length"
|
|
444
|
-
v-bind="
|
|
442
|
+
v-bind="stickyHeaderCounterAttrs"
|
|
445
443
|
v-text="selectedRows.length"
|
|
446
444
|
/>
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
v-if="selectable"
|
|
459
|
-
v-model="selectAll"
|
|
460
|
-
size="md"
|
|
461
|
-
:partial="!isSelectedAllRows"
|
|
462
|
-
v-bind="stickyHeaderCheckboxAttrs"
|
|
463
|
-
:data-test="`${dataTest}-select-all`"
|
|
464
|
-
/>
|
|
465
|
-
|
|
466
|
-
<div
|
|
467
|
-
v-if="selectedRows.length"
|
|
468
|
-
v-bind="stickyHeaderCounterAttrs"
|
|
469
|
-
v-text="selectedRows.length"
|
|
470
|
-
/>
|
|
471
|
-
</div>
|
|
472
|
-
|
|
473
|
-
<!-- TODO: Remove any when key attrs are typed-->
|
|
474
|
-
<div
|
|
475
|
-
v-for="(column, index) in normalizedColumns"
|
|
476
|
-
:key="index"
|
|
477
|
-
v-bind="stickyHeaderCellAttrs"
|
|
478
|
-
:class="cx([(stickyHeaderCellAttrs as any).class, column.thClass])"
|
|
479
|
-
>
|
|
480
|
-
<template v-if="hasSlotContent($slots[`header-${column.key}`])">
|
|
481
|
-
<!--
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
<!-- TODO: Remove any when key attrs are typed-->
|
|
448
|
+
<div
|
|
449
|
+
v-for="(column, index) in normalizedColumns"
|
|
450
|
+
:key="index"
|
|
451
|
+
v-bind="stickyHeaderCellAttrs"
|
|
452
|
+
:class="cx([(stickyHeaderCellAttrs as any).class, column.thClass])"
|
|
453
|
+
>
|
|
454
|
+
<template v-if="hasSlotContent($slots[`header-${column.key}`])">
|
|
455
|
+
<!--
|
|
482
456
|
@slot Use it to customise needed header cell.
|
|
483
457
|
@binding {object} column
|
|
484
458
|
@binding {number} index
|
|
485
459
|
-->
|
|
486
|
-
|
|
487
|
-
|
|
460
|
+
<slot :name="`header-${column.key}`" :column="column" :index="index" />
|
|
461
|
+
</template>
|
|
488
462
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
463
|
+
<template v-else>
|
|
464
|
+
{{ column.label }}
|
|
465
|
+
</template>
|
|
492
466
|
|
|
493
|
-
|
|
467
|
+
<!--
|
|
494
468
|
@slot Use it to add something after the needed header cell.
|
|
495
469
|
@binding {object} column
|
|
496
470
|
@binding {number} index
|
|
497
471
|
-->
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
472
|
+
<slot :name="`header-${column.key}-after`" :column="column" :index="index" />
|
|
473
|
+
</div>
|
|
474
|
+
|
|
475
|
+
<ULoaderProgress v-if="isHeaderSticky" :loading="loading" v-bind="stickyHeaderLoaderAttrs" />
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
<div
|
|
479
|
+
v-show="isShownActionsHeader && isHeaderSticky"
|
|
480
|
+
ref="sticky-header-row"
|
|
481
|
+
:style="tableRowWidthStyle"
|
|
482
|
+
v-bind="stickyHeaderAttrs"
|
|
483
|
+
>
|
|
484
|
+
<div v-bind="stickyHeaderCellAttrs">
|
|
485
|
+
<UCheckbox
|
|
486
|
+
v-if="selectable"
|
|
487
|
+
v-model="selectAll"
|
|
488
|
+
size="md"
|
|
489
|
+
:partial="!isSelectedAllRows"
|
|
490
|
+
v-bind="stickyHeaderActionsCheckboxAttrs"
|
|
491
|
+
:data-test="`${dataTest}-select-all`"
|
|
492
|
+
/>
|
|
493
|
+
</div>
|
|
494
|
+
|
|
495
|
+
<div
|
|
496
|
+
v-if="selectedRows.length"
|
|
497
|
+
v-bind="stickyHeaderActionsCounterAttrs"
|
|
498
|
+
v-text="selectedRows.length"
|
|
499
|
+
/>
|
|
500
|
+
|
|
501
|
+
<!--
|
|
502
|
+
@slot Use it to add action buttons within the actions header, which appear when rows are selected.
|
|
503
|
+
@binding {array} selected-rows
|
|
504
|
+
-->
|
|
505
|
+
<slot name="header-actions" :selected-rows="selectedRows" />
|
|
506
|
+
|
|
507
|
+
<ULoaderProgress v-if="isHeaderSticky" :loading="loading" v-bind="stickyHeaderLoaderAttrs" />
|
|
508
|
+
</div>
|
|
509
|
+
|
|
510
|
+
<div
|
|
511
|
+
v-show="isShownActionsHeader && !isHeaderSticky"
|
|
512
|
+
ref="sticky-header-row"
|
|
513
|
+
:style="tableRowWidthStyle"
|
|
514
|
+
v-bind="stickyHeaderAttrs"
|
|
515
|
+
class="absolute"
|
|
516
|
+
>
|
|
517
|
+
<div v-bind="stickyHeaderCellAttrs">
|
|
518
|
+
<UCheckbox
|
|
519
|
+
v-if="selectable"
|
|
520
|
+
v-model="selectAll"
|
|
521
|
+
size="md"
|
|
522
|
+
:partial="!isSelectedAllRows"
|
|
523
|
+
v-bind="stickyHeaderActionsCheckboxAttrs"
|
|
524
|
+
:data-test="`${dataTest}-select-all`"
|
|
525
|
+
/>
|
|
526
|
+
</div>
|
|
527
|
+
|
|
528
|
+
<div
|
|
529
|
+
v-if="selectedRows.length"
|
|
530
|
+
v-bind="stickyHeaderActionsCounterAttrs"
|
|
531
|
+
v-text="selectedRows.length"
|
|
532
|
+
/>
|
|
533
|
+
|
|
534
|
+
<!--
|
|
535
|
+
@slot Use it to add action buttons within the actions header, which appear when rows are selected.
|
|
536
|
+
@binding {array} selected-rows
|
|
537
|
+
-->
|
|
538
|
+
<slot name="header-actions" :selected-rows="selectedRows" />
|
|
501
539
|
|
|
502
540
|
<ULoaderProgress v-if="isHeaderSticky" :loading="loading" v-bind="stickyHeaderLoaderAttrs" />
|
|
503
541
|
</div>
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.524",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -10373,17 +10373,6 @@
|
|
|
10373
10373
|
}
|
|
10374
10374
|
],
|
|
10375
10375
|
"slots": [
|
|
10376
|
-
{
|
|
10377
|
-
"name": "header-actions",
|
|
10378
|
-
"scoped": true,
|
|
10379
|
-
"description": "Use it to add action buttons within the actions header, which appear when rows are selected.",
|
|
10380
|
-
"bindings": [
|
|
10381
|
-
{
|
|
10382
|
-
"type": "array",
|
|
10383
|
-
"name": "selected-rows"
|
|
10384
|
-
}
|
|
10385
|
-
]
|
|
10386
|
-
},
|
|
10387
10376
|
{
|
|
10388
10377
|
"name": "`header-${column.key}`",
|
|
10389
10378
|
"scoped": true,
|
|
@@ -10420,6 +10409,17 @@
|
|
|
10420
10409
|
}
|
|
10421
10410
|
]
|
|
10422
10411
|
},
|
|
10412
|
+
{
|
|
10413
|
+
"name": "header-actions",
|
|
10414
|
+
"scoped": true,
|
|
10415
|
+
"description": "Use it to add action buttons within the actions header, which appear when rows are selected.",
|
|
10416
|
+
"bindings": [
|
|
10417
|
+
{
|
|
10418
|
+
"type": "array",
|
|
10419
|
+
"name": "selected-rows"
|
|
10420
|
+
}
|
|
10421
|
+
]
|
|
10422
|
+
},
|
|
10423
10423
|
{
|
|
10424
10424
|
"name": "before-header",
|
|
10425
10425
|
"scoped": true,
|