@thinkpixellab-public/px-vue 4.0.12 → 4.0.13
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/bases/PxBaseItems.vue
CHANGED
|
@@ -94,11 +94,11 @@ export default {
|
|
|
94
94
|
},
|
|
95
95
|
|
|
96
96
|
isValidItem(item) {
|
|
97
|
-
return !!this.items
|
|
97
|
+
return !!this.items?.includes(item);
|
|
98
98
|
},
|
|
99
99
|
|
|
100
100
|
isValidItemKey(key) {
|
|
101
|
-
return !!this.itemKeys
|
|
101
|
+
return !!this.itemKeys?.includes(key);
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
-->
|
|
4
4
|
<template>
|
|
5
5
|
<component
|
|
6
|
-
:is="
|
|
6
|
+
:is="calcTag"
|
|
7
7
|
class="px-balanced-text"
|
|
8
8
|
:style="{ opacity: elementOpacity, color: debugColor, textAlign }"
|
|
9
9
|
>
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
<component
|
|
12
12
|
v-if="hasHtml"
|
|
13
13
|
:class="[bem('inner', { html: true }), innerClass]"
|
|
14
|
-
:is="
|
|
14
|
+
:is="calcInnerTag"
|
|
15
15
|
ref="text"
|
|
16
16
|
v-html="html"
|
|
17
17
|
/>
|
|
18
18
|
|
|
19
19
|
<!-- slot -->
|
|
20
|
-
<component v-else :class="[bem('inner'), innerClass]" :is="
|
|
20
|
+
<component v-else :class="[bem('inner'), innerClass]" :is="calcInnerTag" ref="text">
|
|
21
21
|
<slot>
|
|
22
22
|
{{ text }}
|
|
23
23
|
</slot>
|
|
@@ -37,12 +37,12 @@ export default {
|
|
|
37
37
|
/**
|
|
38
38
|
* The outer tag element
|
|
39
39
|
*/
|
|
40
|
-
tag: { type: String, default:
|
|
40
|
+
tag: { type: String, default: null },
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* The inner tag element
|
|
44
44
|
*/
|
|
45
|
-
innerTag: { type: String, default:
|
|
45
|
+
innerTag: { type: String, default: null },
|
|
46
46
|
|
|
47
47
|
// the inner tag element
|
|
48
48
|
innerClass: { type: String, default: null },
|
|
@@ -83,6 +83,14 @@ export default {
|
|
|
83
83
|
};
|
|
84
84
|
},
|
|
85
85
|
computed: {
|
|
86
|
+
calcTag() {
|
|
87
|
+
const defaultTag = this.hasHtml ? 'div' : 'p';
|
|
88
|
+
return this.tag || defaultTag;
|
|
89
|
+
},
|
|
90
|
+
calcInnerTag() {
|
|
91
|
+
const defaultTag = this.hasHtml ? 'div' : 'span';
|
|
92
|
+
return this.innerTag || defaultTag;
|
|
93
|
+
},
|
|
86
94
|
hasHtml() {
|
|
87
95
|
return !!this.htmlValue && !this.text;
|
|
88
96
|
},
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<div :class="bem()">
|
|
3
3
|
<pre
|
|
4
4
|
v-if="loaded"
|
|
5
|
-
ref="code"
|
|
6
5
|
class="px-code-sample"
|
|
7
6
|
:class="lang"
|
|
8
7
|
><code v-html="highlightedCode"></code></pre>
|
|
@@ -71,10 +70,14 @@ export default {
|
|
|
71
70
|
@use '@thinkpixellab-public/px-styles/src/modules/highlightjs.scss' as *;
|
|
72
71
|
.px-code-sample {
|
|
73
72
|
position: relative;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
padding: 1em;
|
|
74
|
+
border-radius: 0.5em;
|
|
75
|
+
|
|
76
|
+
@include highlightjs();
|
|
77
|
+
pre,
|
|
78
|
+
code {
|
|
79
|
+
padding: 0;
|
|
80
|
+
margin: 0;
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
&__copy-button {
|
package/components/PxTable.vue
CHANGED
|
@@ -471,64 +471,64 @@ export default {
|
|
|
471
471
|
@use '../styles/px.scss' as *;
|
|
472
472
|
@use '@thinkpixellab-public/px-styles/src/modules/controls' as *;
|
|
473
473
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
--px-table-bg: #{clr(page-bg)};
|
|
474
|
+
@at-root {
|
|
475
|
+
:root {
|
|
476
|
+
// background for the entire table
|
|
477
|
+
--px-table-bg: #{clr(page-bg)};
|
|
479
478
|
|
|
480
|
-
|
|
481
|
-
|
|
479
|
+
// background for the entire table
|
|
480
|
+
--px-table-fg: #{clr(page-fg)};
|
|
482
481
|
|
|
483
|
-
|
|
484
|
-
|
|
482
|
+
// outer border for the entire table
|
|
483
|
+
--px-table-border: 1px solid #{gray(2, 0.5)};
|
|
485
484
|
|
|
486
|
-
|
|
487
|
-
|
|
485
|
+
// outer border radius for the entire table
|
|
486
|
+
--px-table-radius: 0.5em;
|
|
488
487
|
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
// inner border radius (may need to be less than outer in some cases)
|
|
489
|
+
--px-table-inner-radius: initial;
|
|
491
490
|
|
|
492
|
-
|
|
493
|
-
|
|
491
|
+
// background for the header row
|
|
492
|
+
--px-table-header-bg: #{gray(8)};
|
|
494
493
|
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
// background for the header row
|
|
495
|
+
--px-table-header-fg: unset;
|
|
497
496
|
|
|
498
|
-
|
|
499
|
-
|
|
497
|
+
// separator border below the header row
|
|
498
|
+
--px-table-header-border: 1px solid #{gray(2, 0.5)};
|
|
500
499
|
|
|
501
|
-
|
|
502
|
-
|
|
500
|
+
// background for all non-header rows
|
|
501
|
+
--px-table-row-bg: unset;
|
|
503
502
|
|
|
504
|
-
|
|
505
|
-
|
|
503
|
+
// background for all non-header rows
|
|
504
|
+
--px-table-row-fg: unset;
|
|
506
505
|
|
|
507
|
-
|
|
508
|
-
|
|
506
|
+
// background for odd non-header rows
|
|
507
|
+
--px-table-row-odd-bg: unset;
|
|
509
508
|
|
|
510
|
-
|
|
511
|
-
|
|
509
|
+
// background for odd non-header rows
|
|
510
|
+
--px-table-row-odd-fg: unset;
|
|
512
511
|
|
|
513
|
-
|
|
514
|
-
|
|
512
|
+
// separator border below each row
|
|
513
|
+
--px-table-row-border: 1px solid #{gray(2, 0.5)};
|
|
515
514
|
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
// cell padding
|
|
516
|
+
--px-table-cell-padding: 1em;
|
|
518
517
|
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
// header cell padding
|
|
519
|
+
--px-table-header-cell-padding: 1em;
|
|
521
520
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
521
|
+
// header cell hover (when clickable)
|
|
522
|
+
--px-table-header-cell-hover-bg: #{gray(5)};
|
|
523
|
+
--px-table-header-cell-hover-fg: unset;
|
|
525
524
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
525
|
+
// header cell selected (e.g. sorted)
|
|
526
|
+
--px-table-header-cell-selected-bg: #{accent(0)};
|
|
527
|
+
--px-table-header-cell-selected-fg: #{contrast-color(accent(0))};
|
|
530
528
|
}
|
|
529
|
+
}
|
|
531
530
|
|
|
531
|
+
.px-table {
|
|
532
532
|
// row states that can be used when defining config for cell and header
|
|
533
533
|
|
|
534
534
|
$cell-state-aliases: (
|
|
@@ -635,6 +635,7 @@ export default {
|
|
|
635
635
|
overflow: hidden;
|
|
636
636
|
white-space: nowrap;
|
|
637
637
|
text-overflow: ellipsis;
|
|
638
|
+
line-height: 1.33;
|
|
638
639
|
|
|
639
640
|
&--action {
|
|
640
641
|
padding: 0.5em;
|