@table-bro/native 0.0.0-stage → 1.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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -2
  3. package/THIRD_PARTY_NOTICES.md +69 -0
  4. package/dist/table-bro.native.d.ts +185 -0
  5. package/dist/table-bro.native.esm.js +113 -0
  6. package/dist/table-bro.native.esm.js.map +1 -0
  7. package/dist/table-bro.native.min.css +1 -0
  8. package/dist/table-bro.native.umd.js +113 -0
  9. package/dist/table-bro.native.umd.js.map +1 -0
  10. package/package.json +62 -4
  11. package/styles/_table-bro.api.scss +3 -0
  12. package/styles/_table-bro.native.api.scss +5 -0
  13. package/styles/mixins/_text-ellipsis.scss +5 -0
  14. package/styles/skin/shared/_variables.scss +94 -0
  15. package/styles/skin/shared/mixins/_custom-properties.scss +39 -0
  16. package/styles/skin/shared/mixins/_progress-bar.scss +27 -0
  17. package/styles/skin/shared/mixins/_shared.scss +87 -0
  18. package/styles/skin/shared/mixins/_skin-colors.scss +64 -0
  19. package/styles/skin/shared/mixins/_slide-toggle.scss +5 -0
  20. package/styles/skin/shared/mixins/_sort-header.scss +11 -0
  21. package/styles/skin/shared/mixins/_toolbar.scss +61 -0
  22. package/styles/skin/shared/table-bro/_details.scss +11 -0
  23. package/styles/skin/shared/table-bro/_filter-drawer.scss +62 -0
  24. package/styles/skin/shared/table-bro/_shadows.scss +19 -0
  25. package/styles/skin/shared/table-bro/_state.scss +38 -0
  26. package/styles/skin/shared/table-bro/_table.scss +70 -0
  27. package/styles/skin/shared/table-bro/_text-ellipsis.scss +14 -0
  28. package/styles/skin/vanilla-js/native/_themes.scss +45 -0
  29. package/styles/skin/vanilla-js/native/_variables.scss +54 -0
  30. package/styles/skin/vanilla-js/native/components/bootstrap-based/_paginator.scss +50 -0
  31. package/styles/skin/vanilla-js/native/components/bootstrap-based/_toolbar.scss +99 -0
  32. package/styles/skin/vanilla-js/native/table-bro/_button.scss +16 -0
  33. package/styles/skin/vanilla-js/native/table-bro/_filter-drawer.scss +10 -0
  34. package/styles/skin/vanilla-js/native/table-bro/_progress-bar.scss +24 -0
  35. package/styles/skin/vanilla-js/native/table-bro/_table.scss +16 -0
  36. package/styles/skin/vanilla-js/native/table-bro/_toolbar-search.scss +17 -0
  37. package/styles/skin/vanilla-js/native/table-bro/_toolbar.scss +19 -0
  38. package/styles/skin/vanilla-js/shared/_bootstrap-adapter.scss +9 -0
  39. package/styles/skin/vanilla-js/shared/_skin.scss +70 -0
  40. package/styles/skin/vanilla-js/shared/components/bootstrap-based/_button.scss +9 -0
  41. package/styles/skin/vanilla-js/shared/components/material-based/_paginator.scss +62 -0
  42. package/styles/skin/vanilla-js/shared/components/material-based/_sort-header.scss +134 -0
  43. package/styles/skin/vanilla-js/shared/components/material-based/_table.scss +11 -0
  44. package/styles/skin/vanilla-js/shared/table-bro/_filter-drawer.scss +13 -0
  45. package/styles/skin/vanilla-js/shared/table-bro/_paginator.scss +5 -0
  46. package/styles/skin/vanilla-js/shared/table-bro/_toolbar-search.scss +31 -0
  47. package/styles/skin/vanilla-js/shared/table-bro/_toolbar.scss +39 -0
  48. package/styles/skin/vanilla-js/shared/vendor-extensions/material-based/_paginator.scss +12 -0
  49. package/styles/table-bro.native.scss +43 -0
@@ -0,0 +1,134 @@
1
+ @use "../../../../shared/mixins/shared" as *;
2
+ @use "../../../../shared/mixins/sort-header" as *;
3
+
4
+ /**
5
+ * @license
6
+ * Copyright Google LLC All Rights Reserved.
7
+ *
8
+ * Use of this source code is governed by an MIT-style license that can be
9
+ * found in the LICENSE file at https://angular.dev/license
10
+ */
11
+
12
+ .bro-sort-header-container {
13
+ display: flex;
14
+
15
+ align-items: center;
16
+
17
+ // Needs to be reset since we don't want an outline around the inner
18
+ // div which is focusable. We have our own alternate focus styling.
19
+ outline: 0;
20
+
21
+ letter-spacing: normal;
22
+
23
+ cursor: pointer;
24
+
25
+ // The focus from the keyboard shows a ring in the color of the title, inside the header: the cell component clips
26
+ // what is outside it. A click shows no ring
27
+ &:focus-visible {
28
+ outline: 2px solid currentColor;
29
+
30
+ outline-offset: -2px;
31
+ }
32
+ }
33
+
34
+ // The icon that the configs of the bs and nv skins give the arrow (icon-html): a class, not a style attribute, which a
35
+ // strict Content Security Policy blocks
36
+ .bro-sort-header-arrow .bro-button-icon {
37
+ display: inline-block;
38
+
39
+ line-height: 1;
40
+ vertical-align: top;
41
+ }
42
+
43
+ .bro-sort-header-content {
44
+ @include sort-header-content();
45
+
46
+ @include table-width-transition();
47
+ }
48
+
49
+ .bro-sort-header-position-before {
50
+ flex-direction: row-reverse;
51
+ }
52
+
53
+ @keyframes _bro-sort-header-recently-cleared-ascending {
54
+ from {
55
+ opacity: 1;
56
+ transform: translateY(0);
57
+ }
58
+
59
+ to {
60
+ opacity: 0;
61
+ transform: translateY(-25%);
62
+ }
63
+ }
64
+
65
+ .bro-sort-header-arrow {
66
+ $timing: 225ms cubic-bezier(0.4, 0, 0.2, 1);
67
+ position: relative;
68
+
69
+ overflow: visible;
70
+
71
+ width: 16px;
72
+ height: 16px;
73
+
74
+ opacity: 0;
75
+
76
+ transition: transform $timing, opacity $timing;
77
+
78
+ // A header without a title sorts nothing and is no control: no arrow
79
+ .bro-sort-header-container:not([role="button"]) & {
80
+ visibility: hidden;
81
+ }
82
+
83
+ .bro-sort-header:hover & {
84
+ opacity: 0.54;
85
+ }
86
+
87
+ .bro-sort-header .bro-sort-header-sorted & {
88
+ opacity: 1;
89
+ }
90
+
91
+ .bro-sort-header-descending & {
92
+ transform: rotate(180deg);
93
+ }
94
+
95
+ .bro-sort-header-recently-cleared-ascending & {
96
+ transform: translateY(-25%);
97
+
98
+ transition: none; // Without this the animation looks glitchy on Safari.
99
+ animation: _bro-sort-header-recently-cleared-ascending $timing forwards;
100
+ }
101
+
102
+ // Without motion the arrow takes its end state at once
103
+ @media (prefers-reduced-motion: reduce) {
104
+ .bro-sort-header & {
105
+ transition-duration: 0ms;
106
+ animation-duration: 0ms;
107
+ }
108
+ }
109
+
110
+ svg {
111
+ position: absolute;
112
+ top: 50%;
113
+ left: 50%;
114
+
115
+ width: 16px;
116
+ height: 16px;
117
+ margin: -8px 0 0 -8px;
118
+
119
+ // Without this transform the element twitches at the end of the transition on Safari.
120
+ transform: translateZ(0);
121
+
122
+ fill: currentColor;
123
+ }
124
+
125
+ &,
126
+ [dir='rtl'] .bro-sort-header-position-before & {
127
+ margin: 0 0 0 6px;
128
+ }
129
+
130
+ .bro-sort-header-position-before &,
131
+ [dir='rtl'] & {
132
+ margin: 0 6px 0 0;
133
+ }
134
+ }
@@ -0,0 +1,11 @@
1
+ @mixin styles {
2
+ @at-root table-bro#{&} table {
3
+ tr.bro-header-row {
4
+ height: var(--bro-header-height);
5
+ }
6
+
7
+ tr.bro-row {
8
+ height: var(--bro-row-height);
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,13 @@
1
+ @use "toolbar-search" as *;
2
+
3
+ // The header of the filter drawer of the vanilla skins: its close button looks as the buttons of the toolbar search
4
+ @mixin filter-drawer-header-content($nav-link-padding) {
5
+ .bro-filter-drawer-header .bro-toolbar-content {
6
+ @include toolbar-content-buttons($nav-link-padding);
7
+ }
8
+
9
+ // The title of the filter drawer keeps from the left edge the space that the close button keeps from the right one
10
+ .bro-filter-drawer-header .bro-filter-drawer-title {
11
+ padding-left: $nav-link-padding;
12
+ }
13
+ }
@@ -0,0 +1,5 @@
1
+ @use "../../../shared/mixins/toolbar" as *;
2
+
3
+ @mixin styles {
4
+ @include skin_paginator('.bro-paginator');
5
+ }
@@ -0,0 +1,31 @@
1
+ // The buttons of a toolbar content: the toolbar search and the header of the filter drawer (filter-drawer.scss) look the same
2
+ @mixin toolbar-content-buttons($nav-link-padding) {
3
+ > bro-button {
4
+ display: flex;
5
+
6
+ a {
7
+ box-sizing: content-box;
8
+ width: 1rem;
9
+ padding: 0.75rem;
10
+ }
11
+
12
+ &:first-child a {
13
+ padding-left: $nav-link-padding;
14
+ }
15
+
16
+ // The icon of the last button keeps to the right edge, as the icon of the first one keeps to the left edge:
17
+ // a text icon of the nv skin is narrower than its box
18
+ &:last-child a {
19
+ padding-right: $nav-link-padding;
20
+
21
+ text-align: right;
22
+ }
23
+ }
24
+ }
25
+
26
+ // The buttons of the toolbar search
27
+ @mixin toolbar-search-content($nav-link-padding) {
28
+ .bro-toolbar-search .bro-toolbar-content {
29
+ @include toolbar-content-buttons($nav-link-padding);
30
+ }
31
+ }
@@ -0,0 +1,39 @@
1
+ @use "../../../shared/variables" as *;
2
+ @use "../../../shared/mixins/toolbar" as *;
3
+
4
+ @mixin toolbar-links($toolbar-link-selector, $link-color) {
5
+ #{$toolbar-link-selector} {
6
+ color: $link-color;
7
+
8
+ &:hover,
9
+ &:focus {
10
+ color: $link-color;
11
+ }
12
+ }
13
+ }
14
+
15
+ @mixin toolbar-main-content($nav-link-padding) {
16
+ .bro-toolbar-content {
17
+ .bro-toolbar-title-space {
18
+ display: inline-block;
19
+
20
+ width: calc($nav-link-padding + 1rem + 0.75rem);
21
+ }
22
+ }
23
+
24
+ // The space between the title and the buttons, which keep their width: classes, not a style attribute, which a strict
25
+ // Content Security Policy blocks
26
+ .bro-toolbar-space {
27
+ flex: 1 1 auto;
28
+ }
29
+
30
+ .bro-toolbar-buttons {
31
+ flex-grow: 0;
32
+ }
33
+ }
34
+
35
+ @mixin styles {
36
+ #{$bro-skin} {
37
+ @include skin_toolbar('.bro-toolbar');
38
+ }
39
+ }
@@ -0,0 +1,12 @@
1
+ @use "../../../../shared/variables" as *;
2
+
3
+ @mixin styles {
4
+ // The background of the paginator lies on this element, so it takes the corners of the paginator
5
+ .bro-paginator-outer-container {
6
+ border-radius: inherit;
7
+ }
8
+
9
+ .bro-paginator-inner-container {
10
+ height: $bro-paginator-height;
11
+ }
12
+ }
@@ -0,0 +1,43 @@
1
+ // The native skin: @use prints its CSS. The variables and mixins of the skin without the CSS: table-bro.native.api
2
+ @forward "./table-bro.native.api";
3
+ @use "./skin/vanilla-js/native/variables" as *;
4
+ @use "sass:meta";
5
+
6
+ @use "./skin/vanilla-js/shared/skin" as shared-skin;
7
+ @use "./skin/vanilla-js/native/themes" as native-themes;
8
+ @use "./skin/vanilla-js/native/components/bootstrap-based/paginator" as native-bootstrap-based-paginator;
9
+ @use "./skin/vanilla-js/native/table-bro/filter-drawer" as native-filter-drawer;
10
+ @use "./skin/vanilla-js/native/table-bro/button" as native-button;
11
+ @use "./skin/vanilla-js/native/table-bro/progress-bar" as native-progress-bar;
12
+ @use "./skin/vanilla-js/native/table-bro/table" as native-table;
13
+ @use "./skin/vanilla-js/native/table-bro/toolbar" as native-toolbar;
14
+ @use "./skin/vanilla-js/native/table-bro/toolbar-search" as native-toolbar-search;
15
+
16
+
17
+ /* Shared */
18
+ @include shared-skin.styles('bro-nv-tags', 'mark') {
19
+ // The space after each tag of the skin
20
+ #{$bro-skin} bro-nv-tags > mark {
21
+ margin-right: 0.375rem;
22
+ }
23
+
24
+
25
+ /* Native components */
26
+ @include native-themes.styles;
27
+
28
+ @include native-bootstrap-based-paginator.styles;
29
+ @include meta.load-css("./skin/vanilla-js/native/components/bootstrap-based/toolbar");
30
+
31
+
32
+ /* Table-bro extensions */
33
+ #{$bro-skin} {
34
+ @include native-button.styles;
35
+ @include native-progress-bar.styles;
36
+ @include native-table.styles;
37
+ @include native-toolbar.styles;
38
+ @include native-toolbar-search.styles;
39
+
40
+ // The header of the filter drawer looks as the toolbar search, its rules follow it
41
+ @include native-filter-drawer.styles;
42
+ }
43
+ }