@gooddata/sdk-ui-metric-component 11.68.0-alpha.10 → 11.68.0-alpha.12
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/NOTICE +43 -43
- package/esm/MetricComponent/MetricsState.d.ts.map +1 -1
- package/esm/MetricComponent/MetricsState.js +1 -0
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.d.ts.map +1 -1
- package/esm/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.js +25 -4
- package/esm/MetricComponent/MultipleMetricsState.d.ts.map +1 -1
- package/esm/MetricComponent/MultipleMetricsState.js +5 -2
- package/esm/shared/Tabs/Tab.d.ts +5 -1
- package/esm/shared/Tabs/Tab.d.ts.map +1 -1
- package/esm/shared/Tabs/Tab.js +3 -3
- package/esm/shared/Tabs/Tabs.d.ts.map +1 -1
- package/esm/shared/Tabs/Tabs.data.d.ts +8 -0
- package/esm/shared/Tabs/Tabs.data.d.ts.map +1 -1
- package/esm/shared/Tabs/Tabs.js +88 -9
- package/esm/shared/Tabs/hooks/useScrollByButtons.d.ts +2 -0
- package/esm/shared/Tabs/hooks/useScrollByButtons.d.ts.map +1 -1
- package/esm/shared/Tabs/hooks/useScrollByButtons.js +3 -1
- package/esm/shared/Tabs/hooks/useTabsLabels.d.ts +21 -0
- package/esm/shared/Tabs/hooks/useTabsLabels.d.ts.map +1 -0
- package/esm/shared/Tabs/hooks/useTabsLabels.js +29 -0
- package/esm/shared/focusHandoff.d.ts +33 -0
- package/esm/shared/focusHandoff.d.ts.map +1 -0
- package/esm/shared/focusHandoff.js +44 -0
- package/esm/translations/de-DE.json +1 -1
- package/esm/translations/en-US.json +36 -0
- package/package.json +17 -17
package/NOTICE
CHANGED
|
@@ -3,11 +3,11 @@ Copyright (c) 2017-2026 GoodData Corporation
|
|
|
3
3
|
This product includes a number of subcomponents with separate copyright notices and license terms below. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license. This GoodData project does not necessarily use all the open source software referred to below and may also only use portions of a given package. With respect to the open source software listed in this document, if you (i) have any questions, (ii) wish to receive source code for packages under licenses that require their source code to be made available (such as the GNU Lesser Public License), or (iii) discover any errors or omissions in the licensing information provided, please contact us at legal@gooddata.com. Please identify in source code requests: (i) the packages for which you are requesting corresponding source, (ii) the GoodData product (including any available version) with which the package was provided; and (iii) an email address (if available) or postal address at which GoodData may contact you.
|
|
4
4
|
|
|
5
5
|
--------------------------------------------------------------------------------
|
|
6
|
-
Attribution Notice for @gooddata/sdk-ui-metric-component (11.68.0-alpha.
|
|
6
|
+
Attribution Notice for @gooddata/sdk-ui-metric-component (11.68.0-alpha.12)
|
|
7
7
|
Package License: LicenseRef-LICENSE
|
|
8
8
|
Own License File: LICENSE
|
|
9
|
-
Date generated: 2026-11-
|
|
10
|
-
Revision ID:
|
|
9
|
+
Date generated: 2026-11-11
|
|
10
|
+
Revision ID: dcb0869bf079d57a743488c12b4ca59e52b9dc57
|
|
11
11
|
|
|
12
12
|
This notice lists the components that @gooddata/sdk-ui-metric-component depends on, directly or through other
|
|
13
13
|
packages, with the license and copyright information reported for each of them.
|
|
@@ -19,26 +19,26 @@ change those terms.
|
|
|
19
19
|
Dependencies
|
|
20
20
|
|
|
21
21
|
Local GoodData SDK components
|
|
22
|
-
- @gooddata/api-client-tiger (11.68.0-alpha.
|
|
23
|
-
- @gooddata/sdk-backend-base (11.68.0-alpha.
|
|
24
|
-
- @gooddata/sdk-backend-spi (11.68.0-alpha.
|
|
25
|
-
- @gooddata/sdk-backend-tiger (11.68.0-alpha.
|
|
26
|
-
- @gooddata/sdk-code-convertors (11.68.0-alpha.
|
|
27
|
-
- @gooddata/sdk-code-schemas (11.68.0-alpha.
|
|
28
|
-
- @gooddata/sdk-embedding (11.68.0-alpha.
|
|
29
|
-
- @gooddata/sdk-maql-language-server (11.68.0-alpha.
|
|
30
|
-
- @gooddata/sdk-model (11.68.0-alpha.
|
|
31
|
-
- @gooddata/sdk-ui (11.68.0-alpha.
|
|
32
|
-
- @gooddata/sdk-ui-charts (11.68.0-alpha.
|
|
33
|
-
- @gooddata/sdk-ui-ext (11.68.0-alpha.
|
|
34
|
-
- @gooddata/sdk-ui-filters (11.68.0-alpha.
|
|
35
|
-
- @gooddata/sdk-ui-geo (11.68.0-alpha.
|
|
36
|
-
- @gooddata/sdk-ui-kit (11.68.0-alpha.
|
|
37
|
-
- @gooddata/sdk-ui-pivot (11.68.0-alpha.
|
|
38
|
-
- @gooddata/sdk-ui-semantic-search (11.68.0-alpha.
|
|
39
|
-
- @gooddata/sdk-ui-theme-provider (11.68.0-alpha.
|
|
40
|
-
- @gooddata/sdk-ui-vis-commons (11.68.0-alpha.
|
|
41
|
-
- @gooddata/util (11.68.0-alpha.
|
|
22
|
+
- @gooddata/api-client-tiger (11.68.0-alpha.12) [MIT] — Direct
|
|
23
|
+
- @gooddata/sdk-backend-base (11.68.0-alpha.12) [MIT] — Transitive
|
|
24
|
+
- @gooddata/sdk-backend-spi (11.68.0-alpha.12) [MIT] — Direct
|
|
25
|
+
- @gooddata/sdk-backend-tiger (11.68.0-alpha.12) [MIT] — Direct
|
|
26
|
+
- @gooddata/sdk-code-convertors (11.68.0-alpha.12) [MIT] — Transitive
|
|
27
|
+
- @gooddata/sdk-code-schemas (11.68.0-alpha.12) [MIT] — Transitive
|
|
28
|
+
- @gooddata/sdk-embedding (11.68.0-alpha.12) [MIT] — Transitive
|
|
29
|
+
- @gooddata/sdk-maql-language-server (11.68.0-alpha.12) [MIT] — Direct
|
|
30
|
+
- @gooddata/sdk-model (11.68.0-alpha.12) [MIT] — Direct
|
|
31
|
+
- @gooddata/sdk-ui (11.68.0-alpha.12) [MIT] — Direct
|
|
32
|
+
- @gooddata/sdk-ui-charts (11.68.0-alpha.12) [LicenseRef-LICENSE] — Direct
|
|
33
|
+
- @gooddata/sdk-ui-ext (11.68.0-alpha.12) [LicenseRef-LICENSE] — Direct
|
|
34
|
+
- @gooddata/sdk-ui-filters (11.68.0-alpha.12) [MIT] — Transitive
|
|
35
|
+
- @gooddata/sdk-ui-geo (11.68.0-alpha.12) [LicenseRef-LICENSE] — Transitive
|
|
36
|
+
- @gooddata/sdk-ui-kit (11.68.0-alpha.12) [MIT] — Direct
|
|
37
|
+
- @gooddata/sdk-ui-pivot (11.68.0-alpha.12) [LicenseRef-LICENSE] — Direct
|
|
38
|
+
- @gooddata/sdk-ui-semantic-search (11.68.0-alpha.12) [MIT] — Transitive
|
|
39
|
+
- @gooddata/sdk-ui-theme-provider (11.68.0-alpha.12) [MIT] — Transitive
|
|
40
|
+
- @gooddata/sdk-ui-vis-commons (11.68.0-alpha.12) [MIT] — Transitive
|
|
41
|
+
- @gooddata/util (11.68.0-alpha.12) [MIT] — Direct
|
|
42
42
|
|
|
43
43
|
External components
|
|
44
44
|
- @aaronhayes/react-use-hubspot-form (2.1.2) [MIT] — Transitive
|
|
@@ -454,7 +454,7 @@ Local GoodData SDK components
|
|
|
454
454
|
================================================================================
|
|
455
455
|
|
|
456
456
|
--------------------------------------------------------------------------------
|
|
457
|
-
Package Title: @gooddata/api-client-tiger (11.68.0-alpha.
|
|
457
|
+
Package Title: @gooddata/api-client-tiger (11.68.0-alpha.12)
|
|
458
458
|
Package Source: Local workspace
|
|
459
459
|
Package Depth: Direct
|
|
460
460
|
--------------------------------------------------------------------------------
|
|
@@ -472,7 +472,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
472
472
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
473
473
|
|
|
474
474
|
--------------------------------------------------------------------------------
|
|
475
|
-
Package Title: @gooddata/sdk-backend-base (11.68.0-alpha.
|
|
475
|
+
Package Title: @gooddata/sdk-backend-base (11.68.0-alpha.12)
|
|
476
476
|
Package Source: Local workspace
|
|
477
477
|
Package Depth: Transitive
|
|
478
478
|
--------------------------------------------------------------------------------
|
|
@@ -490,7 +490,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
490
490
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
491
491
|
|
|
492
492
|
--------------------------------------------------------------------------------
|
|
493
|
-
Package Title: @gooddata/sdk-backend-spi (11.68.0-alpha.
|
|
493
|
+
Package Title: @gooddata/sdk-backend-spi (11.68.0-alpha.12)
|
|
494
494
|
Package Source: Local workspace
|
|
495
495
|
Package Depth: Direct
|
|
496
496
|
--------------------------------------------------------------------------------
|
|
@@ -508,7 +508,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
508
508
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
509
509
|
|
|
510
510
|
--------------------------------------------------------------------------------
|
|
511
|
-
Package Title: @gooddata/sdk-backend-tiger (11.68.0-alpha.
|
|
511
|
+
Package Title: @gooddata/sdk-backend-tiger (11.68.0-alpha.12)
|
|
512
512
|
Package Source: Local workspace
|
|
513
513
|
Package Depth: Direct
|
|
514
514
|
--------------------------------------------------------------------------------
|
|
@@ -526,7 +526,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
526
526
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
527
527
|
|
|
528
528
|
--------------------------------------------------------------------------------
|
|
529
|
-
Package Title: @gooddata/sdk-code-convertors (11.68.0-alpha.
|
|
529
|
+
Package Title: @gooddata/sdk-code-convertors (11.68.0-alpha.12)
|
|
530
530
|
Package Source: Local workspace
|
|
531
531
|
Package Depth: Transitive
|
|
532
532
|
--------------------------------------------------------------------------------
|
|
@@ -544,7 +544,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
544
544
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
545
545
|
|
|
546
546
|
--------------------------------------------------------------------------------
|
|
547
|
-
Package Title: @gooddata/sdk-code-schemas (11.68.0-alpha.
|
|
547
|
+
Package Title: @gooddata/sdk-code-schemas (11.68.0-alpha.12)
|
|
548
548
|
Package Source: Local workspace
|
|
549
549
|
Package Depth: Transitive
|
|
550
550
|
--------------------------------------------------------------------------------
|
|
@@ -574,7 +574,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
574
574
|
SOFTWARE.
|
|
575
575
|
|
|
576
576
|
--------------------------------------------------------------------------------
|
|
577
|
-
Package Title: @gooddata/sdk-embedding (11.68.0-alpha.
|
|
577
|
+
Package Title: @gooddata/sdk-embedding (11.68.0-alpha.12)
|
|
578
578
|
Package Source: Local workspace
|
|
579
579
|
Package Depth: Transitive
|
|
580
580
|
--------------------------------------------------------------------------------
|
|
@@ -592,7 +592,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
592
592
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
593
593
|
|
|
594
594
|
--------------------------------------------------------------------------------
|
|
595
|
-
Package Title: @gooddata/sdk-maql-language-server (11.68.0-alpha.
|
|
595
|
+
Package Title: @gooddata/sdk-maql-language-server (11.68.0-alpha.12)
|
|
596
596
|
Package Source: Local workspace
|
|
597
597
|
Package Depth: Direct
|
|
598
598
|
--------------------------------------------------------------------------------
|
|
@@ -610,7 +610,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
610
610
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
611
611
|
|
|
612
612
|
--------------------------------------------------------------------------------
|
|
613
|
-
Package Title: @gooddata/sdk-model (11.68.0-alpha.
|
|
613
|
+
Package Title: @gooddata/sdk-model (11.68.0-alpha.12)
|
|
614
614
|
Package Source: Local workspace
|
|
615
615
|
Package Depth: Direct
|
|
616
616
|
--------------------------------------------------------------------------------
|
|
@@ -628,7 +628,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
628
628
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
629
629
|
|
|
630
630
|
--------------------------------------------------------------------------------
|
|
631
|
-
Package Title: @gooddata/sdk-ui (11.68.0-alpha.
|
|
631
|
+
Package Title: @gooddata/sdk-ui (11.68.0-alpha.12)
|
|
632
632
|
Package Source: Local workspace
|
|
633
633
|
Package Depth: Direct
|
|
634
634
|
--------------------------------------------------------------------------------
|
|
@@ -646,7 +646,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
646
646
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
647
647
|
|
|
648
648
|
--------------------------------------------------------------------------------
|
|
649
|
-
Package Title: @gooddata/sdk-ui-charts (11.68.0-alpha.
|
|
649
|
+
Package Title: @gooddata/sdk-ui-charts (11.68.0-alpha.12)
|
|
650
650
|
Package Source: Local workspace
|
|
651
651
|
Package Depth: Direct
|
|
652
652
|
--------------------------------------------------------------------------------
|
|
@@ -686,7 +686,7 @@ THE FOREGOING LIMITATIONS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICA
|
|
|
686
686
|
10. Governing Law These terms are governed by the laws of the State of California and the United States of America without regard to conflict of laws principles. You may not assign any part of this Agreement without the prior written consent of GoodData. Any attempted assignment without consent shall be void. These terms constitute the entire agreement between you and GoodData with respect to the Library and supersede all prior written or oral communications, understandings and agreements. Any waiver of these terms must be in writing to be effective. If any provision of these terms is found to be invalid or unenforceable, the remaining terms will continue to be valid and enforceable to the fullest extent permitted by law.
|
|
687
687
|
|
|
688
688
|
--------------------------------------------------------------------------------
|
|
689
|
-
Package Title: @gooddata/sdk-ui-ext (11.68.0-alpha.
|
|
689
|
+
Package Title: @gooddata/sdk-ui-ext (11.68.0-alpha.12)
|
|
690
690
|
Package Source: Local workspace
|
|
691
691
|
Package Depth: Direct
|
|
692
692
|
--------------------------------------------------------------------------------
|
|
@@ -726,7 +726,7 @@ THE FOREGOING LIMITATIONS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICA
|
|
|
726
726
|
10. Governing Law These terms are governed by the laws of the State of California and the United States of America without regard to conflict of laws principles. You may not assign any part of this Agreement without the prior written consent of GoodData. Any attempted assignment without consent shall be void. These terms constitute the entire agreement between you and GoodData with respect to the Library and supersede all prior written or oral communications, understandings and agreements. Any waiver of these terms must be in writing to be effective. If any provision of these terms is found to be invalid or unenforceable, the remaining terms will continue to be valid and enforceable to the fullest extent permitted by law.
|
|
727
727
|
|
|
728
728
|
--------------------------------------------------------------------------------
|
|
729
|
-
Package Title: @gooddata/sdk-ui-filters (11.68.0-alpha.
|
|
729
|
+
Package Title: @gooddata/sdk-ui-filters (11.68.0-alpha.12)
|
|
730
730
|
Package Source: Local workspace
|
|
731
731
|
Package Depth: Transitive
|
|
732
732
|
--------------------------------------------------------------------------------
|
|
@@ -744,7 +744,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
744
744
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
745
745
|
|
|
746
746
|
--------------------------------------------------------------------------------
|
|
747
|
-
Package Title: @gooddata/sdk-ui-geo (11.68.0-alpha.
|
|
747
|
+
Package Title: @gooddata/sdk-ui-geo (11.68.0-alpha.12)
|
|
748
748
|
Package Source: Local workspace
|
|
749
749
|
Package Depth: Transitive
|
|
750
750
|
--------------------------------------------------------------------------------
|
|
@@ -784,7 +784,7 @@ THE FOREGOING LIMITATIONS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICA
|
|
|
784
784
|
10. Governing Law These terms are governed by the laws of the State of California and the United States of America without regard to conflict of laws principles. You may not assign any part of this Agreement without the prior written consent of GoodData. Any attempted assignment without consent shall be void. These terms constitute the entire agreement between you and GoodData with respect to the Library and supersede all prior written or oral communications, understandings and agreements. Any waiver of these terms must be in writing to be effective. If any provision of these terms is found to be invalid or unenforceable, the remaining terms will continue to be valid and enforceable to the fullest extent permitted by law.
|
|
785
785
|
|
|
786
786
|
--------------------------------------------------------------------------------
|
|
787
|
-
Package Title: @gooddata/sdk-ui-kit (11.68.0-alpha.
|
|
787
|
+
Package Title: @gooddata/sdk-ui-kit (11.68.0-alpha.12)
|
|
788
788
|
Package Source: Local workspace
|
|
789
789
|
Package Depth: Direct
|
|
790
790
|
--------------------------------------------------------------------------------
|
|
@@ -802,7 +802,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
802
802
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
803
803
|
|
|
804
804
|
--------------------------------------------------------------------------------
|
|
805
|
-
Package Title: @gooddata/sdk-ui-pivot (11.68.0-alpha.
|
|
805
|
+
Package Title: @gooddata/sdk-ui-pivot (11.68.0-alpha.12)
|
|
806
806
|
Package Source: Local workspace
|
|
807
807
|
Package Depth: Direct
|
|
808
808
|
--------------------------------------------------------------------------------
|
|
@@ -842,7 +842,7 @@ THE FOREGOING LIMITATIONS SHALL APPLY TO THE MAXIMUM EXTENT PERMITTED BY APPLICA
|
|
|
842
842
|
10. Governing Law These terms are governed by the laws of the State of California and the United States of America without regard to conflict of laws principles. You may not assign any part of this Agreement without the prior written consent of GoodData. Any attempted assignment without consent shall be void. These terms constitute the entire agreement between you and GoodData with respect to the Library and supersede all prior written or oral communications, understandings and agreements. Any waiver of these terms must be in writing to be effective. If any provision of these terms is found to be invalid or unenforceable, the remaining terms will continue to be valid and enforceable to the fullest extent permitted by law.
|
|
843
843
|
|
|
844
844
|
--------------------------------------------------------------------------------
|
|
845
|
-
Package Title: @gooddata/sdk-ui-semantic-search (11.68.0-alpha.
|
|
845
|
+
Package Title: @gooddata/sdk-ui-semantic-search (11.68.0-alpha.12)
|
|
846
846
|
Package Source: Local workspace
|
|
847
847
|
Package Depth: Transitive
|
|
848
848
|
--------------------------------------------------------------------------------
|
|
@@ -860,7 +860,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
860
860
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
861
861
|
|
|
862
862
|
--------------------------------------------------------------------------------
|
|
863
|
-
Package Title: @gooddata/sdk-ui-theme-provider (11.68.0-alpha.
|
|
863
|
+
Package Title: @gooddata/sdk-ui-theme-provider (11.68.0-alpha.12)
|
|
864
864
|
Package Source: Local workspace
|
|
865
865
|
Package Depth: Transitive
|
|
866
866
|
--------------------------------------------------------------------------------
|
|
@@ -878,7 +878,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
878
878
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
879
879
|
|
|
880
880
|
--------------------------------------------------------------------------------
|
|
881
|
-
Package Title: @gooddata/sdk-ui-vis-commons (11.68.0-alpha.
|
|
881
|
+
Package Title: @gooddata/sdk-ui-vis-commons (11.68.0-alpha.12)
|
|
882
882
|
Package Source: Local workspace
|
|
883
883
|
Package Depth: Transitive
|
|
884
884
|
--------------------------------------------------------------------------------
|
|
@@ -896,7 +896,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
896
896
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
897
897
|
|
|
898
898
|
--------------------------------------------------------------------------------
|
|
899
|
-
Package Title: @gooddata/util (11.68.0-alpha.
|
|
899
|
+
Package Title: @gooddata/util (11.68.0-alpha.12)
|
|
900
900
|
Package Source: Local workspace
|
|
901
901
|
Package Depth: Direct
|
|
902
902
|
--------------------------------------------------------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsState.d.ts","sourceRoot":"","sources":["../../src/MetricComponent/MetricsState.tsx"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAOrF,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAwBrE,MAAM,WAAW,iBAAiB;IAC9B,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACnC,QAAQ,CAAC,E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
68
|
titlePlaceholder: intl.formatMessage({
|
|
69
69
|
id: "metricComponent.editMetricForm.namePlaceholder",
|
|
70
70
|
}),
|
|
71
|
+
// the accessible names of the controls are the tabs' own localized defaults
|
|
71
72
|
}), [intl]);
|
|
72
73
|
return (_jsx(_Fragment, { children: tabsProps.tabs.length > 0 && (_jsx(MetricTabs, { ...tabsProps, className: cx(classes.root, maximized && classes.maximized), minimizable: true, maximizable: canMaximize, closeable: true, onTabCreate: createTab, onTabsMinimize: handleMinimize, maximized: maximized, onTabsMaximizable: handleMaximize, onTabsClose: closeAllTabs, render: renderTab, locales: locales })) }));
|
|
73
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimizedMetricComponent.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MinimizedMetricComponent.d.ts","sourceRoot":"","sources":["../../../src/MetricComponent/MinimizedMetricComponent/MinimizedMetricComponent.tsx"],"names":[],"mappings":"AA+GA,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,wBAAwB,CAAC,EACrC,QAAe,EACf,OAAc,EACd,KAAgB,EAChB,MAAU,EACV,QAAQ,EACR,OAAO,EACP,KAAa,EACb,OAAe,GAClB,EAAE,8BAA8B,kDAkFhC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2022-2026 GoodData Corporation
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { FormattedMessage } from "react-intl";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
5
5
|
import { IconClose, IconExpand } from "@gooddata/sdk-ui-kit";
|
|
6
|
+
import { handOffFocusDuring, useFocusHandoff } from "../../shared/focusHandoff.js";
|
|
6
7
|
import { makeStyles } from "../../shared/theme/index.js";
|
|
7
8
|
const useStyles = makeStyles()((theme) => {
|
|
8
9
|
return {
|
|
@@ -102,9 +103,29 @@ const useStyles = makeStyles()((theme) => {
|
|
|
102
103
|
});
|
|
103
104
|
export function MinimizedMetricComponent({ editable = true, visible = true, where = "inline", edited = 0, onExpand, onClose, dirty = false, invalid = false, }) {
|
|
104
105
|
const { classes, cx } = useStyles();
|
|
106
|
+
const intl = useIntl();
|
|
105
107
|
const [over, setOver] = useState(false);
|
|
106
|
-
|
|
108
|
+
const chip = useRef(null);
|
|
109
|
+
const expandButton = useRef(null);
|
|
110
|
+
const isShown = edited > 0 && visible;
|
|
111
|
+
const focusHandoff = useFocusHandoff();
|
|
112
|
+
// Catch the focus only when minimizing this chip's editor dropped it (see focusHandoff). The
|
|
113
|
+
// record is taken in any case, so it cannot move the focus later; and should something have taken
|
|
114
|
+
// the focus in the meantime, it keeps it.
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!isShown) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const isHandedOff = focusHandoff?.take("chip") ?? false;
|
|
120
|
+
const isFocusDropped = !document.activeElement || document.activeElement === document.body;
|
|
121
|
+
if (isHandedOff && isFocusDropped) {
|
|
122
|
+
expandButton.current?.focus();
|
|
123
|
+
}
|
|
124
|
+
}, [isShown, focusHandoff]);
|
|
125
|
+
// restoring unmounts the chip, so the editor catches the focus if the chip held it
|
|
126
|
+
const expandHandler = () => handOffFocusDuring(focusHandoff, "editor", !!chip.current?.contains(document.activeElement), onExpand, () => chip.current !== null);
|
|
127
|
+
if (!isShown) {
|
|
107
128
|
return null;
|
|
108
129
|
}
|
|
109
|
-
return (_jsxs("div", { className: cx(classes.root, where, "s-edit_dialog-minimized"), children: [_jsxs("div", { className: cx(classes.info), onClick:
|
|
130
|
+
return (_jsxs("div", { ref: chip, className: cx(classes.root, where, "s-edit_dialog-minimized"), children: [_jsxs("div", { className: cx(classes.info), onClick: expandHandler, onMouseEnter: () => setOver(true), onMouseLeave: () => setOver(false), children: [_jsx("label", { className: cx(classes.editing), children: editable ? (_jsx(FormattedMessage, { id: "metricComponent.minimize.editing" })) : (_jsx(FormattedMessage, { id: "metricComponent.minimize.viewing" })) }), invalid && _jsx("div", { className: cx(classes.indicator, classes.invalid) }), dirty && !invalid && _jsx("div", { className: cx(classes.indicator, classes.dirty) }), _jsx("div", { className: cx(classes.count, "s-edit_dialog-minimized-counter"), children: _jsx(FormattedMessage, { id: "metricComponent.minimize.metrics", values: { edited } }) })] }), _jsxs("div", { className: cx(classes.controls), children: [_jsx("button", { ref: expandButton, type: "button", className: cx(classes.button, over && "hover", "s-edit_dialog-minimized-expand"), "aria-label": intl.formatMessage({ id: "metricComponent.minimize.restore" }), onClick: expandHandler, children: _jsx(IconExpand, { ariaHidden: true }) }), _jsx("div", { className: cx(classes.divider) }), _jsx("button", { type: "button", className: cx(classes.button, "s-edit_dialog-minimized-close"), "aria-label": intl.formatMessage({ id: "metricComponent.tabs.close" }), onClick: onClose, children: _jsx(IconClose, { ariaHidden: true }) })] })] }));
|
|
110
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultipleMetricsState.d.ts","sourceRoot":"","sources":["../../src/MetricComponent/MultipleMetricsState.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"MultipleMetricsState.d.ts","sourceRoot":"","sources":["../../src/MetricCom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C;CACxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,QAAQ,EACR,MAAM,EACN,OAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,OAAO,EACP,QAAQ,GACX,EAAE,qBAAqB,2CA4BvB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2021-2026 GoodData Corporation
|
|
3
|
-
import { createContext } from "react";
|
|
3
|
+
import { createContext, useState } from "react";
|
|
4
|
+
import { FocusHandoffContext, createFocusHandoff } from "../shared/focusHandoff.js";
|
|
4
5
|
import { CloseAllStatus, } from "./MetricState/metricState.data.js";
|
|
5
6
|
import { useMetricState } from "./MetricState/useMetricState.js";
|
|
6
7
|
export const MultipleMetricsContext = createContext({
|
|
@@ -52,5 +53,7 @@ export function MultipleMetricsState({ children, active, metrics = [], permissio
|
|
|
52
53
|
onClose,
|
|
53
54
|
onCancel,
|
|
54
55
|
});
|
|
55
|
-
|
|
56
|
+
// one per editor instance: it wraps both the editor and its minimized chip
|
|
57
|
+
const [focusHandoff] = useState(createFocusHandoff);
|
|
58
|
+
return (_jsx(MultipleMetricsContext.Provider, { value: metricStateProps, children: _jsx(FocusHandoffContext.Provider, { value: focusHandoff, children: children }) }));
|
|
56
59
|
}
|
package/esm/shared/Tabs/Tab.d.ts
CHANGED
|
@@ -24,8 +24,12 @@ export interface ITabProps<T = undefined> {
|
|
|
24
24
|
beforeActive?: boolean;
|
|
25
25
|
afterActive?: boolean;
|
|
26
26
|
last?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Accessible name of the tab's close button; gets the tab title (or the placeholder) as `title`.
|
|
29
|
+
*/
|
|
30
|
+
closeLabel?: (title: string) => string;
|
|
27
31
|
onActive: (tab: ITab<T>) => void;
|
|
28
32
|
onClose: (tab: ITab<T>) => void;
|
|
29
33
|
}
|
|
30
|
-
export declare function Tab({ tab, placeholder, last, active, afterActive, onActive, onClose }: ITabProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare function Tab({ tab, placeholder, last, active, afterActive, closeLabel, onActive, onClose, }: ITabProps): import("react/jsx-runtime").JSX.Element;
|
|
31
35
|
//# sourceMappingURL=Tab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../src/shared/Tabs/Tab.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,SAAS,CAAC;AACjC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,SAAS,WAAW,CAAC;AAClC,eAAO,MAAM,OAAO,aAAa,CAAC;AAClC,eAAO,MAAM,QAAQ,cAAc,CAAC;AACpC,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAiJhD,oBAAY,QAAQ;IAChB,OAAO,YAAY;IACnB,KAAK,UAAU;CAClB;AAED,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,SAAS;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE;QACN,SAAS,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,IAAI,EAAE,CAAC,CAAC;CACX;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,SAAS;IACpC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,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IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACnC;AAED,wBAAgB,GAAG,CAAC,EAChB,GAAG,EACH,WAAW,EACX,IAAI,EACJ,MAAM,EACN,WAAW,EACX,UAAU,EACV,QAAQ,EACR,OAAO,GACV,EAAE,SAAS,2CA4DX"}
|
package/esm/shared/Tabs/Tab.js
CHANGED
|
@@ -151,13 +151,13 @@ export var TabState;
|
|
|
151
151
|
TabState["Invalid"] = "invalid";
|
|
152
152
|
TabState["Dirty"] = "dirty";
|
|
153
153
|
})(TabState || (TabState = {}));
|
|
154
|
-
export function Tab({ tab, placeholder, last, active, afterActive, onActive, onClose }) {
|
|
154
|
+
export function Tab({ tab, placeholder, last, active, afterActive, closeLabel, onActive, onClose, }) {
|
|
155
155
|
const { states, options, title } = tab;
|
|
156
156
|
const { classes, cx } = useStyles();
|
|
157
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cx(classes.space, active && classes.spaceActive, afterActive && classes.spaceAfterActive, TabSpace) }), _jsxs("div", { role: "tab", className: cx(classes.root, TabRoot, active && classes.active, active && TabActive, TabsClasses.Tab), onClick: () => onActive(tab), children: [_jsx("div", { className: cx(classes.dirty, states?.dirty && classes.dirtyActive, states?.dirty && TabsClasses.TabDirty, states?.invalid && classes.dirtyInvalid, states?.invalid && TabsClasses.TabInvalid) }), _jsx("div", { className: cx(classes.title), children: _jsx("div", { className: cx(classes.inner, TitleText), children: _jsx(Title, { title: title, placeholder: placeholder }) }) }), options && options.closeable && (_jsx("button", { className: cx(classes.close, NameButton, TabsClasses.ButtonCloseTab), onClick: (e) => {
|
|
157
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cx(classes.space, active && classes.spaceActive, afterActive && classes.spaceAfterActive, TabSpace) }), _jsxs("div", { role: "tab", tabIndex: active ? 0 : -1, "aria-selected": active, className: cx(classes.root, TabRoot, active && classes.active, active && TabActive, TabsClasses.Tab), onClick: () => onActive(tab), children: [_jsx("div", { className: cx(classes.dirty, states?.dirty && classes.dirtyActive, states?.dirty && TabsClasses.TabDirty, states?.invalid && classes.dirtyInvalid, states?.invalid && TabsClasses.TabInvalid) }), _jsx("div", { className: cx(classes.title), children: _jsx("div", { className: cx(classes.inner, TitleText), children: _jsx(Title, { title: title, placeholder: placeholder }) }) }), options && options.closeable && (_jsx("button", { type: "button", className: cx(classes.close, NameButton, TabsClasses.ButtonCloseTab), "aria-label": closeLabel?.(title || placeholder || ""), onClick: (e) => {
|
|
158
158
|
e.stopPropagation();
|
|
159
159
|
onClose(tab);
|
|
160
|
-
}, children: _jsx(IconClose, { width: 9, height: 9 }) }))] }), last && _jsx("div", { className: cx(classes.space, active && classes.spaceActive, TabSpace) })] }));
|
|
160
|
+
}, children: _jsx(IconClose, { width: 9, height: 9, ariaHidden: true }) }))] }), last && _jsx("div", { className: cx(classes.space, active && classes.spaceActive, TabSpace) })] }));
|
|
161
161
|
}
|
|
162
162
|
function Title({ title, placeholder }) {
|
|
163
163
|
const { classes, cx } = useStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/shared/Tabs/Tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/shared/Tabs/Tabs.tsx"],"names":[],"mappings":"AAmCA,OAAO,EAAyB,KAAK,UAAU,EAA6B,MAAM,gBAAgB,CAAC;AAEnG,eAAO,MAAM,aAAa,YAAY,CAAC;AAuKvC,wBAAgB,IAAI,CAAC,EACjB,IAAI,EACJ,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,EACT,SAAiB,EACjB,WAAmB,EACnB,WAAmB,EACnB,SAAiB,EACjB,SAAiB,EACjB,WAAsB,EACtB,aAAwB,EACxB,UAAqB,EACrB,cAAyB,EACzB,iBAA4B,EAC5B,WAAsB,EACtB,OAAY,EACZ,OAAY,GACf,EAAE,UAAU,2CA+IZ"}
|
|
@@ -32,6 +32,14 @@ export interface ITabsProps<T = undefined> {
|
|
|
32
32
|
locales?: {
|
|
33
33
|
createTooltip?: string;
|
|
34
34
|
titlePlaceholder?: string;
|
|
35
|
+
minimize?: string;
|
|
36
|
+
maximize?: string;
|
|
37
|
+
exitMaximize?: string;
|
|
38
|
+
close?: string;
|
|
39
|
+
closeTab?: (title: string) => string;
|
|
40
|
+
tabList?: string;
|
|
41
|
+
scrollLeft?: string;
|
|
42
|
+
scrollRight?: string;
|
|
35
43
|
};
|
|
36
44
|
}
|
|
37
45
|
//# sourceMappingURL=Tabs.data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.data.d.ts","sourceRoot":"","sources":["../../../src/shared/Tabs/Tabs.data.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,SAAS;IAC3C,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,SAAS;IACrC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,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B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;QACrC,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACL"}
|
package/esm/shared/Tabs/Tabs.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2022-2026 GoodData Corporation
|
|
3
|
-
import { useState } from "react";
|
|
3
|
+
import { useEffect, useRef, useState, } from "react";
|
|
4
4
|
import { Bubble, BubbleHoverTrigger, Button, IconClose, IconContract, IconExpand, IconMinimize, } from "@gooddata/sdk-ui-kit";
|
|
5
|
+
import { handOffFocusDuring, useFocusHandoff } from "../focusHandoff.js";
|
|
5
6
|
import { makeStyles } from "../theme/index.js";
|
|
6
7
|
import { useChangeScroll } from "./hooks/useChangeScroll.js";
|
|
7
8
|
import { useScrollByButtons } from "./hooks/useScrollByButtons.js";
|
|
8
9
|
import { useScrollToActive } from "./hooks/useScrollToActive.js";
|
|
9
10
|
import { useTabCallbacks } from "./hooks/useTabCallbacks.js";
|
|
10
11
|
import { useTabsCallbacks } from "./hooks/useTabsCallbacks.js";
|
|
11
|
-
import {
|
|
12
|
+
import { useTabsLabels } from "./hooks/useTabsLabels.js";
|
|
13
|
+
import { NameButton, Tab, TabActive, TabRoot, TitleText } from "./Tab.js";
|
|
12
14
|
import { TabsClasses } from "./Tabs.classes.js";
|
|
13
15
|
import { TabMaxWidth, TabsIconSize } from "./Tabs.data.js";
|
|
14
16
|
export const ButtonDivider = "divider";
|
|
@@ -166,25 +168,102 @@ export function Tabs({ tabs, active, render, content, className, closeable = fal
|
|
|
166
168
|
}
|
|
167
169
|
const { classes, cx } = useStyles();
|
|
168
170
|
const { scrollToTabSpace = 3, scrollByArrowsRepeat = 150, scrollByArrowsStep = 100 } = options;
|
|
171
|
+
const labels = useTabsLabels(locales);
|
|
169
172
|
const [tabsElement, setTabsElement] = useState(null);
|
|
170
|
-
const
|
|
173
|
+
const editorRoot = useRef(null);
|
|
174
|
+
const { enabled, canLeft, canRight, onLeft, onRight, stepLeft, stepRight } = useScrollByButtons(tabsElement, scrollByArrowsRepeat, scrollByArrowsStep);
|
|
171
175
|
useChangeScroll(tabsElement);
|
|
172
176
|
useScrollToActive(tabsElement, active, enabled, scrollToTabSpace);
|
|
173
177
|
const { onTabsMinimizeHandler, onTabsCloseHandler, onTabCreateHandler, onTabsMaximizeHandler } = useTabsCallbacks(onTabCreate, onTabsMinimize, onTabsMaximizable, onTabsClose);
|
|
174
178
|
const { onTabActiveHandler, onTabCloseHandler } = useTabCallbacks(tabs, onTabActivate, onTabClose, onTabsClose);
|
|
179
|
+
const onTabListKeyDown = useTabListKeyboard(tabsElement, tabs, active, onTabActiveHandler);
|
|
175
180
|
const Content = content;
|
|
176
|
-
return (_jsxs("div", { className: cx(classes.root, className), children: [_jsxs("div", { className: cx(classes.tabs), children: [enabled && (_jsx("button", { className: cx(classes.leftButton, !canLeft && classes.disabled, TabsClasses.ButtonLeft), onMouseDown: onLeft, children: _jsx("span", { className: "gd-icon-navigateleft" }) })), _jsx("div", { className: cx(classes.tabsList, {
|
|
181
|
+
return (_jsxs("div", { ref: editorRoot, className: cx(classes.root, className), children: [_jsxs("div", { className: cx(classes.tabs), children: [enabled && (_jsx("button", { type: "button", "aria-label": labels.scrollLeft, "aria-disabled": !canLeft, className: cx(classes.leftButton, !canLeft && classes.disabled, TabsClasses.ButtonLeft), onMouseDown: onLeft, onClick: (event) => onScrollButtonClick(event, stepLeft), children: _jsx("span", { className: "gd-icon-navigateleft", "aria-hidden": "true" }) })), _jsx("div", { role: "tablist", "aria-label": labels.tabList, onKeyDown: onTabListKeyDown, className: cx(classes.tabsList, {
|
|
177
182
|
minimizable: minimizable,
|
|
178
183
|
closeable: closeable,
|
|
179
184
|
scrollable: enabled,
|
|
180
|
-
}), style: { width: TabMaxWidth * tabs.length }, ref: setTabsElement, children: tabs.map((tab, i) => (_jsx(Tab, { tab: tab, placeholder: locales.titlePlaceholder, active: active === i, last: i === tabs.length - 1, beforeActive: active - 1 === i, afterActive: active + 1 === i, onActive: onTabActiveHandler, onClose: onTabCloseHandler }, tab.id))) }), enabled && (_jsx("button", { className: cx(classes.rightButton, !canRight && classes.disabled, TabsClasses.ButtonRight), onMouseDown: onRight, children: _jsx("span", { className: "gd-icon-navigateright" }) })), creatable && (_jsxs(BubbleHoverTrigger, { showDelay: 0, hideDelay: 100, eventsOnBubble: true, className: classes.trigger, children: [_jsx("div", { className: cx(classes.controls), children: _jsx(Button, { iconLeft: "gd-icon-add", onClick: onTabCreateHandler, className: cx(classes.create, "gd-button-action", TabsClasses.ButtonNewTab)
|
|
185
|
+
}), style: { width: TabMaxWidth * tabs.length }, ref: setTabsElement, children: tabs.map((tab, i) => (_jsx(Tab, { tab: tab, placeholder: locales.titlePlaceholder, active: active === i, last: i === tabs.length - 1, beforeActive: active - 1 === i, afterActive: active + 1 === i, closeLabel: labels.closeTab, onActive: onTabActiveHandler, onClose: onTabCloseHandler }, tab.id))) }), enabled && (_jsx("button", { type: "button", "aria-label": labels.scrollRight, "aria-disabled": !canRight, className: cx(classes.rightButton, !canRight && classes.disabled, TabsClasses.ButtonRight), onMouseDown: onRight, onClick: (event) => onScrollButtonClick(event, stepRight), children: _jsx("span", { className: "gd-icon-navigateright", "aria-hidden": "true" }) })), creatable && (_jsxs(BubbleHoverTrigger, { showDelay: 0, hideDelay: 100, eventsOnBubble: true, className: classes.trigger, children: [_jsx("div", { className: cx(classes.controls), children: _jsx(Button, { iconLeft: "gd-icon-add", onClick: onTabCreateHandler, className: cx(classes.create, "gd-button-action", TabsClasses.ButtonNewTab),
|
|
186
|
+
// the same text as the hover tooltip, so the name matches what is seen
|
|
187
|
+
accessibilityConfig: { ariaLabel: labels.create } }) }), locales.createTooltip && (_jsx(Bubble, { className: cx("bubble-dark", "s-tabs-create-tooltip"), alignPoints: [{ align: "bc tr", offset: { x: 0, y: -5 } }], children: locales.createTooltip }))] })), _jsx("div", { className: cx(classes.filler) }), _jsx("div", { className: cx(classes.controls), children: _jsx(TabsControls, { maximized: maximized, minimizable: minimizable, maximizable: maximizable, closeable: closeable,
|
|
188
|
+
// closing asks first only when a metric has unsaved changes
|
|
189
|
+
closeOpensDialog: tabs.some((tab) => tab.states?.dirty), labels: labels, onTabsClose: onTabsCloseHandler, onTabsMinimize: onTabsMinimizeHandler, editorRoot: editorRoot, onTabsMaximize: onTabsMaximizeHandler }) })] }), Content && tabs[active] && _jsx(Content, { tab: tabs[active] }), render && tabs[active] && render({ tab: tabs[active] })] }));
|
|
181
190
|
}
|
|
182
|
-
|
|
191
|
+
/**
|
|
192
|
+
* A click with no pointer behind it (`detail` 0) comes from Enter, Space or assistive technology, and
|
|
193
|
+
* scrolls one step. A mouse click (`detail` 1 and up) was already handled by its mousedown, which
|
|
194
|
+
* keeps scrolling while the button is held, so it does not scroll a second time.
|
|
195
|
+
*/
|
|
196
|
+
function onScrollButtonClick(event, step) {
|
|
197
|
+
if (event.detail === 0) {
|
|
198
|
+
step();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* The arrow keys, Home and End of the tab list, the way the ARIA tabs pattern has them: they select
|
|
203
|
+
* the tab (selection follows the focus) and move the focus to it once it is active, and the active
|
|
204
|
+
* tab scrolls into view as it does for a mouse selection.
|
|
205
|
+
*/
|
|
206
|
+
function useTabListKeyboard(tabsElement, tabs, active, onActivate) {
|
|
207
|
+
const isFocusPending = useRef(false);
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
if (!isFocusPending.current) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
isFocusPending.current = false;
|
|
213
|
+
// The key's activation may never have completed (a caller can hold it back), and the change
|
|
214
|
+
// of the active tab then comes from elsewhere; follow it only while the keyboard is still in
|
|
215
|
+
// the tab list, never pull the focus back from a field the user went to in the meantime.
|
|
216
|
+
if (!tabsElement?.contains(document.activeElement)) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
// the scroll to the active tab is smooth, a focus scroll would jump ahead of it
|
|
220
|
+
tabsElement.querySelector(`.${TabRoot}.${TabActive}`)?.focus({ preventScroll: true });
|
|
221
|
+
}, [active, tabsElement]);
|
|
222
|
+
return (event) => {
|
|
223
|
+
// the keys of the close button inside a tab are its own
|
|
224
|
+
if (!(event.target instanceof HTMLElement) || event.target.getAttribute("role") !== "tab") {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const last = tabs.length - 1;
|
|
228
|
+
const targets = {
|
|
229
|
+
ArrowLeft: active > 0 ? active - 1 : last,
|
|
230
|
+
ArrowRight: active < last ? active + 1 : 0,
|
|
231
|
+
Home: 0,
|
|
232
|
+
End: last,
|
|
233
|
+
};
|
|
234
|
+
const target = targets[event.key];
|
|
235
|
+
if (target === undefined) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
event.preventDefault();
|
|
239
|
+
if (target !== active && tabs[target]) {
|
|
240
|
+
isFocusPending.current = true;
|
|
241
|
+
onActivate(tabs[target]);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function TabsControls({ minimizable, maximizable, maximized, closeable, closeOpensDialog, labels, onTabsMinimize, onTabsMaximize, onTabsClose, editorRoot, }) {
|
|
183
246
|
const { classes, cx } = useStyles();
|
|
247
|
+
const minimizeButton = useRef(null);
|
|
248
|
+
const focusHandoff = useFocusHandoff();
|
|
249
|
+
// Restoring from the chip drops the focus to the page (see focusHandoff). Put it back on the
|
|
250
|
+
// minimize button, where it was before minimizing, only when this editor's chip handed it off,
|
|
251
|
+
// and only if nothing inside the editor has taken it in the meantime.
|
|
252
|
+
useEffect(() => {
|
|
253
|
+
const isHandedOff = focusHandoff?.take("editor") ?? false;
|
|
254
|
+
const isFocusDropped = !document.activeElement || document.activeElement === document.body;
|
|
255
|
+
if (isHandedOff && isFocusDropped) {
|
|
256
|
+
minimizeButton.current?.focus();
|
|
257
|
+
}
|
|
258
|
+
// only on mount, which is when the chip has just handed off
|
|
259
|
+
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
260
|
+
}, []);
|
|
261
|
+
// minimizing unmounts the editor, so the chip catches the focus if the editor held it
|
|
262
|
+
const minimizeHandler = () => handOffFocusDuring(focusHandoff, "chip", !!editorRoot.current?.contains(document.activeElement), onTabsMinimize, () => editorRoot.current !== null);
|
|
184
263
|
const controls = [
|
|
185
|
-
minimizable && (_jsx("button", { className: cx(classes.button, TabsClasses.ButtonMinimize), onClick:
|
|
186
|
-
maximizable && (_jsx("button", { className: cx(classes.button, TabsClasses.ButtonMaximize), onClick: () => onTabsMaximize?.(!maximized), children: maximized ? (_jsx(IconContract, { width: TabsIconSize, height: TabsIconSize })) : (_jsx(IconExpand, { width: TabsIconSize, height: TabsIconSize })) }, "maximize")),
|
|
187
|
-
closeable && (_jsx("button", { className: cx(classes.button, TabsClasses.ButtonCloseTabs), onClick: onTabsClose, children: _jsx(IconClose, { width: TabsIconSize, height: TabsIconSize }) }, "close")),
|
|
264
|
+
minimizable && (_jsx("button", { ref: minimizeButton, type: "button", className: cx(classes.button, TabsClasses.ButtonMinimize), "aria-label": labels.minimize, onClick: minimizeHandler, children: _jsx(IconMinimize, { width: TabsIconSize, height: TabsIconSize, ariaHidden: true }) }, "minimize")),
|
|
265
|
+
maximizable && (_jsx("button", { type: "button", className: cx(classes.button, TabsClasses.ButtonMaximize), "aria-label": maximized ? labels.exitMaximize : labels.maximize, onClick: () => onTabsMaximize?.(!maximized), children: maximized ? (_jsx(IconContract, { width: TabsIconSize, height: TabsIconSize, ariaHidden: true })) : (_jsx(IconExpand, { width: TabsIconSize, height: TabsIconSize, ariaHidden: true })) }, "maximize")),
|
|
266
|
+
closeable && (_jsx("button", { type: "button", className: cx(classes.button, TabsClasses.ButtonCloseTabs), "aria-label": labels.close, "aria-haspopup": closeOpensDialog ? "dialog" : undefined, onClick: onTabsClose, children: _jsx(IconClose, { width: TabsIconSize, height: TabsIconSize, ariaHidden: true }) }, "close")),
|
|
188
267
|
];
|
|
189
268
|
return (_jsx(_Fragment, { children: controls.filter(Boolean).reduce((prev, current, i) => {
|
|
190
269
|
if (i !== 0) {
|
|
@@ -5,5 +5,7 @@ export declare function useScrollByButtons(element: HTMLElement | null, timeout?
|
|
|
5
5
|
canRight: boolean;
|
|
6
6
|
onLeft: (e: MouseEvent) => void;
|
|
7
7
|
onRight: (e: MouseEvent) => void;
|
|
8
|
+
stepLeft: () => void;
|
|
9
|
+
stepRight: () => void;
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=useScrollByButtons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollByButtons.d.ts","sourceRoot":"","sources":["../../../../src/shared/Tabs/hooks/useScrollByButtons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAA6C,MAAM,OAAO,CAAC;AAInF,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,OAAO,SAAM,EACb,IAAI,SAAM,GACX;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"useScrollByButtons.d.ts","sourceRoot":"","sources":["../../../../src/shared/Tabs/hooks/useScrollByButtons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAA6C,MAAM,OAAO,CAAC;AAInF,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,OAAO,SAAM,EACb,IAAI,SAAM,GACX;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAEjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB,CAuBA"}
|
|
@@ -14,9 +14,11 @@ export function useScrollByButtons(element, timeout = 150, step = 100) {
|
|
|
14
14
|
canRight,
|
|
15
15
|
onLeft,
|
|
16
16
|
onRight,
|
|
17
|
+
stepLeft: onLeftHandler,
|
|
18
|
+
stepRight: onRightHandler,
|
|
17
19
|
}),
|
|
18
20
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
[enabled, canLeft, canRight, onLeft, onRight, changed]);
|
|
21
|
+
[enabled, canLeft, canRight, onLeft, onRight, onLeftHandler, onRightHandler, changed]);
|
|
20
22
|
}
|
|
21
23
|
function useScroll(element) {
|
|
22
24
|
const [changed, setChanged] = useState("");
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ITabsProps } from "../Tabs.data.js";
|
|
2
|
+
/**
|
|
3
|
+
* The accessible names of the tab strip's controls.
|
|
4
|
+
*/
|
|
5
|
+
export interface ITabsLabels {
|
|
6
|
+
tabList: string;
|
|
7
|
+
create: string;
|
|
8
|
+
minimize: string;
|
|
9
|
+
maximize: string;
|
|
10
|
+
exitMaximize: string;
|
|
11
|
+
close: string;
|
|
12
|
+
closeTab: (title: string) => string;
|
|
13
|
+
scrollLeft: string;
|
|
14
|
+
scrollRight: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Every icon-only control needs an accessible name, so each one has a localized default; a label in
|
|
18
|
+
* `locales` overrides it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useTabsLabels(locales: NonNullable<ITabsProps["locales"]>): ITabsLabels;
|
|
21
|
+
//# sourceMappingURL=useTabsLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabsLabels.d.ts","sourceRoot":"","sources":["../../../../src/shared/Tabs/hooks/useTabsLabels.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACvB;AAUD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,WAAW,CAgBtF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { IntlContext, createIntl } from "react-intl";
|
|
4
|
+
import { DEFAULT_LANGUAGE, DEFAULT_MESSAGES } from "../../../translations/translations.js";
|
|
5
|
+
let fallbackIntl;
|
|
6
|
+
// Outside an IntlProvider (a bare render) the names still come from the default messages.
|
|
7
|
+
function getFallbackIntl() {
|
|
8
|
+
fallbackIntl ??= createIntl({ locale: DEFAULT_LANGUAGE, messages: DEFAULT_MESSAGES[DEFAULT_LANGUAGE] });
|
|
9
|
+
return fallbackIntl;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Every icon-only control needs an accessible name, so each one has a localized default; a label in
|
|
13
|
+
* `locales` overrides it.
|
|
14
|
+
*/
|
|
15
|
+
export function useTabsLabels(locales) {
|
|
16
|
+
const intl = useContext(IntlContext) ?? getFallbackIntl();
|
|
17
|
+
return {
|
|
18
|
+
tabList: locales.tabList ?? intl.formatMessage({ id: "metricComponent.tabs.tabList" }),
|
|
19
|
+
create: locales.createTooltip ?? intl.formatMessage({ id: "metricComponent.createMetric.title" }),
|
|
20
|
+
minimize: locales.minimize ?? intl.formatMessage({ id: "metricComponent.tabs.minimize" }),
|
|
21
|
+
maximize: locales.maximize ?? intl.formatMessage({ id: "metricComponent.tabs.maximize" }),
|
|
22
|
+
exitMaximize: locales.exitMaximize ?? intl.formatMessage({ id: "metricComponent.tabs.exitMaximize" }),
|
|
23
|
+
close: locales.close ?? intl.formatMessage({ id: "metricComponent.tabs.close" }),
|
|
24
|
+
closeTab: locales.closeTab ??
|
|
25
|
+
((title) => intl.formatMessage({ id: "metricComponent.tabs.closeTab" }, { title })),
|
|
26
|
+
scrollLeft: locales.scrollLeft ?? intl.formatMessage({ id: "metricComponent.tabs.scrollLeft" }),
|
|
27
|
+
scrollRight: locales.scrollRight ?? intl.formatMessage({ id: "metricComponent.tabs.scrollRight" }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the focus goes when the metric editor is minimized into the chip, or restored from it.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Minimizing unmounts the editor and mounts the chip, restoring the other way round; the focus is
|
|
6
|
+
* dropped to the page either way. The side that unmounts records that it held the focus, and the
|
|
7
|
+
* side that mounts takes the record and catches the focus. Without a record the mounting side leaves
|
|
8
|
+
* the focus alone, so a chip or an editor that appears for any other reason never takes it.
|
|
9
|
+
*
|
|
10
|
+
* The record belongs to one editor instance (one `MultipleMetricsState`), so the chip of another
|
|
11
|
+
* editor never takes it, and the side that made it cancels it when the transition did not happen.
|
|
12
|
+
*/
|
|
13
|
+
export type FocusHandoffTarget = "chip" | "editor";
|
|
14
|
+
export interface IFocusHandoff {
|
|
15
|
+
handOff(target: FocusHandoffTarget): void;
|
|
16
|
+
/**
|
|
17
|
+
* True once after `handOff(target)`, false otherwise; the record is gone after it.
|
|
18
|
+
*/
|
|
19
|
+
take(target: FocusHandoffTarget): boolean;
|
|
20
|
+
cancel(target: FocusHandoffTarget): void;
|
|
21
|
+
}
|
|
22
|
+
export declare function createFocusHandoff(): IFocusHandoff;
|
|
23
|
+
/**
|
|
24
|
+
* The handoff of the editor instance around; null outside one, where the focus is never moved.
|
|
25
|
+
*/
|
|
26
|
+
export declare const FocusHandoffContext: import("react").Context<IFocusHandoff | null>;
|
|
27
|
+
export declare function useFocusHandoff(): IFocusHandoff | null;
|
|
28
|
+
/**
|
|
29
|
+
* Runs the transition and cancels the record if, a task later, the side that made it is still
|
|
30
|
+
* mounted: the transition did not happen, and nothing is coming to take the record.
|
|
31
|
+
*/
|
|
32
|
+
export declare function handOffFocusDuring(handoff: IFocusHandoff | null, target: FocusHandoffTarget, isFocusHeld: boolean, transition: (() => void) | undefined, isStillMounted: () => boolean): void;
|
|
33
|
+
//# sourceMappingURL=focusHandoff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusHandoff.d.ts","sourceRoot":"","sources":["../../src/shared/focusHandoff.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAC1C,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC5C;AAED,wBAAgB,kBAAkB,IAAI,aAAa,CAoBlD;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,+CAA4C,CAAC;AAE7E,wBAAgB,eAAe,IAAI,aAAa,GAAG,IAAI,CAEtD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,aAAa,GAAG,IAAI,EAC7B,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,OAAO,EACpB,UAAU,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EACpC,cAAc,EAAE,MAAM,OAAO,GAC9B,IAAI,CAUN"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
export function createFocusHandoff() {
|
|
4
|
+
let pending = null;
|
|
5
|
+
return {
|
|
6
|
+
handOff: (target) => {
|
|
7
|
+
pending = target;
|
|
8
|
+
},
|
|
9
|
+
take: (target) => {
|
|
10
|
+
if (pending !== target) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
pending = null;
|
|
14
|
+
return true;
|
|
15
|
+
},
|
|
16
|
+
cancel: (target) => {
|
|
17
|
+
if (pending === target) {
|
|
18
|
+
pending = null;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The handoff of the editor instance around; null outside one, where the focus is never moved.
|
|
25
|
+
*/
|
|
26
|
+
export const FocusHandoffContext = createContext(null);
|
|
27
|
+
export function useFocusHandoff() {
|
|
28
|
+
return useContext(FocusHandoffContext);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Runs the transition and cancels the record if, a task later, the side that made it is still
|
|
32
|
+
* mounted: the transition did not happen, and nothing is coming to take the record.
|
|
33
|
+
*/
|
|
34
|
+
export function handOffFocusDuring(handoff, target, isFocusHeld, transition, isStillMounted) {
|
|
35
|
+
if (handoff && isFocusHeld) {
|
|
36
|
+
handoff.handOff(target);
|
|
37
|
+
window.setTimeout(() => {
|
|
38
|
+
if (isStillMounted()) {
|
|
39
|
+
handoff.cancel(target);
|
|
40
|
+
}
|
|
41
|
+
}, 0);
|
|
42
|
+
}
|
|
43
|
+
transition?.();
|
|
44
|
+
}
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"metricComponent.editMetric.metric.result.context.displayTop": "Oben",
|
|
65
65
|
"metricComponent.editMetric.metric.result.context.displayBottom": "Unten",
|
|
66
66
|
"metricComponent.editMetric.metric.result": "Ergebnis",
|
|
67
|
-
"metricComponent.editMetric.metric.result.tooltip": "Die Metrik gibt eine Zahl zurück und kann wiederverwendet werden, wenn sie mit Attributen und Filtern kombiniert wird, um einen Report zu erstellen. Fügen Sie „Anzeigen nach“ hinzu, um einen
|
|
67
|
+
"metricComponent.editMetric.metric.result.tooltip": "Die Metrik gibt eine Zahl zurück und kann wiederverwendet werden, wenn sie mit Attributen und Filtern kombiniert wird, um einen Report zu erstellen. Fügen Sie „Anzeigen nach“ hinzu, um einen Vorschaureport zu erstellen.",
|
|
68
68
|
"metricComponent.editMetric.metric.result.computing": "Wird berechnet...",
|
|
69
69
|
"metricComponent.editMetric.metric.result.error.title": "Fehler beim Berechnen des Ergebnisses",
|
|
70
70
|
"metricComponent.editMetric.metric.result.error": "Das Ergebnis kann nicht berechnet werden, da die Metrikdefinition unvollständig oder ungültig ist.",
|
|
@@ -495,6 +495,42 @@
|
|
|
495
495
|
"text": "Save all",
|
|
496
496
|
"crowdinContext": "Button to save all unsaved changes"
|
|
497
497
|
},
|
|
498
|
+
"metricComponent.minimize.restore": {
|
|
499
|
+
"text": "Restore editor",
|
|
500
|
+
"crowdinContext": "Accessible name of the icon button that reopens the minimized metric editor"
|
|
501
|
+
},
|
|
502
|
+
"metricComponent.tabs.minimize": {
|
|
503
|
+
"text": "Minimize editor",
|
|
504
|
+
"crowdinContext": "Accessible name of the icon button that minimizes the metric editor into a small bar"
|
|
505
|
+
},
|
|
506
|
+
"metricComponent.tabs.maximize": {
|
|
507
|
+
"text": "Full screen",
|
|
508
|
+
"crowdinContext": "Accessible name of the icon button that expands the metric editor to full screen"
|
|
509
|
+
},
|
|
510
|
+
"metricComponent.tabs.exitMaximize": {
|
|
511
|
+
"text": "Exit full screen",
|
|
512
|
+
"crowdinContext": "Accessible name of the icon button that returns the full-screen metric editor to its normal size"
|
|
513
|
+
},
|
|
514
|
+
"metricComponent.tabs.close": {
|
|
515
|
+
"text": "Close editor",
|
|
516
|
+
"crowdinContext": "Accessible name of the icon button that closes the metric editor with all its open metrics"
|
|
517
|
+
},
|
|
518
|
+
"metricComponent.tabs.tabList": {
|
|
519
|
+
"text": "Open metrics",
|
|
520
|
+
"crowdinContext": "Accessible name of the row of tabs in the metric editor, one tab per metric being edited"
|
|
521
|
+
},
|
|
522
|
+
"metricComponent.tabs.scrollLeft": {
|
|
523
|
+
"text": "Scroll tabs left",
|
|
524
|
+
"crowdinContext": "Accessible name of the arrow button that scrolls the metric editor tabs to the left"
|
|
525
|
+
},
|
|
526
|
+
"metricComponent.tabs.scrollRight": {
|
|
527
|
+
"text": "Scroll tabs right",
|
|
528
|
+
"crowdinContext": "Accessible name of the arrow button that scrolls the metric editor tabs to the right"
|
|
529
|
+
},
|
|
530
|
+
"metricComponent.tabs.closeTab": {
|
|
531
|
+
"text": "Close {title}",
|
|
532
|
+
"crowdinContext": "Accessible name of the icon button that closes one metric tab in the metric editor. {title} is the metric name"
|
|
533
|
+
},
|
|
498
534
|
"metricComponent.minimize.editing": {
|
|
499
535
|
"text": "Editing:",
|
|
500
536
|
"crowdinContext": "Status label when metric is in editing mode"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-metric-component",
|
|
3
|
-
"version": "11.68.0-alpha.
|
|
3
|
+
"version": "11.68.0-alpha.12",
|
|
4
4
|
"license": "LicenseRef-LICENSE",
|
|
5
5
|
"author": "GoodData Corporation",
|
|
6
6
|
"repository": {
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
"vscode-languageserver-textdocument": "1.0.12",
|
|
39
39
|
"vscode-languageserver-types": "3.17.5",
|
|
40
40
|
"yup": "0.32.11",
|
|
41
|
-
"@gooddata/api-client-tiger": "11.68.0-alpha.
|
|
42
|
-
"@gooddata/sdk-backend-spi": "11.68.0-alpha.
|
|
43
|
-
"@gooddata/sdk-backend-tiger": "11.68.0-alpha.
|
|
44
|
-
"@gooddata/sdk-maql-language-server": "11.68.0-alpha.
|
|
45
|
-
"@gooddata/sdk-model": "11.68.0-alpha.
|
|
46
|
-
"@gooddata/sdk-ui": "11.68.0-alpha.
|
|
47
|
-
"@gooddata/sdk-ui-charts": "11.68.0-alpha.
|
|
48
|
-
"@gooddata/sdk-ui-ext": "11.68.0-alpha.
|
|
49
|
-
"@gooddata/sdk-ui-kit": "11.68.0-alpha.
|
|
50
|
-
"@gooddata/
|
|
51
|
-
"@gooddata/
|
|
41
|
+
"@gooddata/api-client-tiger": "11.68.0-alpha.12",
|
|
42
|
+
"@gooddata/sdk-backend-spi": "11.68.0-alpha.12",
|
|
43
|
+
"@gooddata/sdk-backend-tiger": "11.68.0-alpha.12",
|
|
44
|
+
"@gooddata/sdk-maql-language-server": "11.68.0-alpha.12",
|
|
45
|
+
"@gooddata/sdk-model": "11.68.0-alpha.12",
|
|
46
|
+
"@gooddata/sdk-ui": "11.68.0-alpha.12",
|
|
47
|
+
"@gooddata/sdk-ui-charts": "11.68.0-alpha.12",
|
|
48
|
+
"@gooddata/sdk-ui-ext": "11.68.0-alpha.12",
|
|
49
|
+
"@gooddata/sdk-ui-kit": "11.68.0-alpha.12",
|
|
50
|
+
"@gooddata/util": "11.68.0-alpha.12",
|
|
51
|
+
"@gooddata/sdk-ui-pivot": "11.68.0-alpha.12"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@microsoft/api-documenter": "7.30.20",
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
"react-dom": "19.1.1",
|
|
82
82
|
"typescript": "7.0.2",
|
|
83
83
|
"vitest": "5.0.4",
|
|
84
|
-
"@gooddata/eslint-config": "11.68.0-alpha.
|
|
85
|
-
"@gooddata/
|
|
86
|
-
"@gooddata/
|
|
87
|
-
"@gooddata/sdk-
|
|
88
|
-
"@gooddata/sdk-
|
|
84
|
+
"@gooddata/eslint-config": "11.68.0-alpha.12",
|
|
85
|
+
"@gooddata/i18n-toolkit": "11.68.0-alpha.12",
|
|
86
|
+
"@gooddata/oxlint-config": "11.68.0-alpha.12",
|
|
87
|
+
"@gooddata/sdk-ui-theme-provider": "11.68.0-alpha.12",
|
|
88
|
+
"@gooddata/sdk-backend-base": "11.68.0-alpha.12"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "^18.0.0 || ^19.0.0",
|