@univerjs/design 1.0.0-alpha.6 → 1.0.0-alpha.8
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/lib/cjs/index.js +111 -80
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +3 -3
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fr-FR.js +3 -3
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +3 -3
- package/lib/cjs/locale/pl-PL.js +3 -3
- package/lib/cjs/locale/pt-BR.js +3 -3
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +3 -3
- package/lib/es/index.js +105 -81
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +3 -3
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fr-FR.js +3 -3
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +3 -3
- package/lib/es/locale/pl-PL.js +3 -3
- package/lib/es/locale/pt-BR.js +3 -3
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +3 -3
- package/lib/index.css +85 -80
- package/lib/index.js +105 -81
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +3 -3
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fr-FR.js +3 -3
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +3 -3
- package/lib/locale/pl-PL.js +3 -3
- package/lib/locale/pt-BR.js +3 -3
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +3 -3
- package/lib/types/components/command/Command.d.ts +25 -0
- package/lib/types/components/dialog/Dialog.d.ts +0 -6
- package/lib/types/components/input-number/InputNumber.d.ts +1 -0
- package/lib/types/components/input-number/InputNumber.stories.d.ts +3 -0
- package/lib/types/components/popup/Popup.d.ts +0 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/umd/index.js +14 -14
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/package.json +12 -13
- package/lib/types/helper/resize-observer.d.ts +0 -19
package/lib/index.css
CHANGED
|
@@ -191,6 +191,10 @@
|
|
|
191
191
|
z-index: 10;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
.univer-z-\[1070\] {
|
|
195
|
+
z-index: 1070;
|
|
196
|
+
}
|
|
197
|
+
|
|
194
198
|
.univer-z-\[1080\] {
|
|
195
199
|
z-index: 1080;
|
|
196
200
|
}
|
|
@@ -456,6 +460,10 @@
|
|
|
456
460
|
max-height: 1000px;
|
|
457
461
|
}
|
|
458
462
|
|
|
463
|
+
.univer-max-h-\[300px\] {
|
|
464
|
+
max-height: 300px;
|
|
465
|
+
}
|
|
466
|
+
|
|
459
467
|
.univer-max-h-full {
|
|
460
468
|
max-height: 100%;
|
|
461
469
|
}
|
|
@@ -604,6 +612,10 @@
|
|
|
604
612
|
transform-origin: var(--radix-hover-card-content-transform-origin);
|
|
605
613
|
}
|
|
606
614
|
|
|
615
|
+
.univer-origin-top-left {
|
|
616
|
+
transform-origin: 0 0;
|
|
617
|
+
}
|
|
618
|
+
|
|
607
619
|
.-univer-translate-x-1\/2 {
|
|
608
620
|
--univer-tw-translate-x: -50%;
|
|
609
621
|
transform: translate(-50%, var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));
|
|
@@ -652,6 +664,18 @@
|
|
|
652
664
|
transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));
|
|
653
665
|
}
|
|
654
666
|
|
|
667
|
+
.univer-scale-y-0 {
|
|
668
|
+
--univer-tw-scale-y: 0;
|
|
669
|
+
transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(0);
|
|
670
|
+
transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.univer-scale-y-100 {
|
|
674
|
+
--univer-tw-scale-y: 1;
|
|
675
|
+
transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(1);
|
|
676
|
+
transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));
|
|
677
|
+
}
|
|
678
|
+
|
|
655
679
|
.\!univer-animate-none {
|
|
656
680
|
animation: none !important;
|
|
657
681
|
}
|
|
@@ -867,6 +891,10 @@
|
|
|
867
891
|
overflow-y: auto;
|
|
868
892
|
}
|
|
869
893
|
|
|
894
|
+
.univer-overflow-x-hidden {
|
|
895
|
+
overflow-x: hidden;
|
|
896
|
+
}
|
|
897
|
+
|
|
870
898
|
.univer-truncate {
|
|
871
899
|
text-overflow: ellipsis;
|
|
872
900
|
white-space: nowrap;
|
|
@@ -1280,6 +1308,11 @@
|
|
|
1280
1308
|
padding-bottom: .75rem;
|
|
1281
1309
|
}
|
|
1282
1310
|
|
|
1311
|
+
.univer-py-6 {
|
|
1312
|
+
padding-top: 1.5rem;
|
|
1313
|
+
padding-bottom: 1.5rem;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1283
1316
|
.\!univer-pl-4 {
|
|
1284
1317
|
padding-left: 1rem !important;
|
|
1285
1318
|
}
|
|
@@ -1685,6 +1718,12 @@
|
|
|
1685
1718
|
transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
1686
1719
|
}
|
|
1687
1720
|
|
|
1721
|
+
.univer-transition-\[transform\,opacity\] {
|
|
1722
|
+
transition-property: transform, opacity;
|
|
1723
|
+
transition-duration: .15s;
|
|
1724
|
+
transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1688
1727
|
.univer-transition-all {
|
|
1689
1728
|
transition-property: all;
|
|
1690
1729
|
transition-duration: .15s;
|
|
@@ -1884,6 +1923,10 @@
|
|
|
1884
1923
|
animation-timing-function: cubic-bezier(0, 0, .2, 1);
|
|
1885
1924
|
}
|
|
1886
1925
|
|
|
1926
|
+
.\[scroll-padding-block\:4px\] {
|
|
1927
|
+
scroll-padding-block: 4px;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1887
1930
|
.placeholder\:univer-text-gray-200::placeholder {
|
|
1888
1931
|
color: var(--univer-gray-200);
|
|
1889
1932
|
}
|
|
@@ -1939,7 +1982,7 @@
|
|
|
1939
1982
|
margin-bottom: 0;
|
|
1940
1983
|
}
|
|
1941
1984
|
|
|
1942
|
-
.data-\[disabled\]\:univer-pointer-events-none[data-disabled] {
|
|
1985
|
+
.data-\[disabled\=true\]\:univer-pointer-events-none[data-disabled="true"], .data-\[disabled\]\:univer-pointer-events-none[data-disabled] {
|
|
1943
1986
|
pointer-events: none;
|
|
1944
1987
|
}
|
|
1945
1988
|
|
|
@@ -1959,7 +2002,7 @@
|
|
|
1959
2002
|
width: 1px;
|
|
1960
2003
|
}
|
|
1961
2004
|
|
|
1962
|
-
.data-\[state\=open\]\:univer-bg-gray-100[data-state="open"] {
|
|
2005
|
+
.data-\[selected\=true\]\:univer-bg-gray-100[data-selected="true"], .data-\[state\=open\]\:univer-bg-gray-100[data-state="open"] {
|
|
1963
2006
|
background-color: var(--univer-gray-100);
|
|
1964
2007
|
}
|
|
1965
2008
|
|
|
@@ -1967,7 +2010,7 @@
|
|
|
1967
2010
|
color: var(--univer-red-600);
|
|
1968
2011
|
}
|
|
1969
2012
|
|
|
1970
|
-
.data-\[disabled\]\:univer-opacity-50[data-disabled] {
|
|
2013
|
+
.data-\[disabled\=true\]\:univer-opacity-50[data-disabled="true"], .data-\[disabled\]\:univer-opacity-50[data-disabled] {
|
|
1971
2014
|
opacity: .5;
|
|
1972
2015
|
}
|
|
1973
2016
|
|
|
@@ -2221,6 +2264,14 @@
|
|
|
2221
2264
|
right: auto;
|
|
2222
2265
|
}
|
|
2223
2266
|
|
|
2267
|
+
.rtl\:univer-ml-0:where([dir="rtl"], [dir="rtl"] *) {
|
|
2268
|
+
margin-left: 0;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
.rtl\:univer-mr-auto:where([dir="rtl"], [dir="rtl"] *) {
|
|
2272
|
+
margin-right: auto;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2224
2275
|
.rtl\:\!univer-rotate-0:where([dir="rtl"], [dir="rtl"] *) {
|
|
2225
2276
|
--univer-tw-rotate: 0deg !important;
|
|
2226
2277
|
transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(0deg) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y)) !important;
|
|
@@ -2395,6 +2446,10 @@
|
|
|
2395
2446
|
background-color: var(--univer-gray-600) !important;
|
|
2396
2447
|
}
|
|
2397
2448
|
|
|
2449
|
+
.dark\:data-\[selected\=true\]\:\!univer-bg-gray-600[data-selected="true"]:where(.univer-dark, .univer-dark *) {
|
|
2450
|
+
background-color: var(--univer-gray-600) !important;
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2398
2453
|
.dark\:data-\[state\=open\]\:\!univer-bg-gray-600[data-state="open"]:where(.univer-dark, .univer-dark *) {
|
|
2399
2454
|
background-color: var(--univer-gray-600) !important;
|
|
2400
2455
|
}
|
|
@@ -2485,6 +2540,10 @@
|
|
|
2485
2540
|
flex-shrink: 0;
|
|
2486
2541
|
}
|
|
2487
2542
|
|
|
2543
|
+
.\[\&\>svg\]\:univer-text-gray-400 > svg {
|
|
2544
|
+
color: var(--univer-gray-400);
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2488
2547
|
.\[\&\>ul\:not\(\:last-child\)\]\:univer-border-0 > ul:not(:last-child) {
|
|
2489
2548
|
border-width: 0;
|
|
2490
2549
|
}
|
|
@@ -2501,6 +2560,29 @@
|
|
|
2501
2560
|
border-right-color: var(--univer-gray-200);
|
|
2502
2561
|
}
|
|
2503
2562
|
|
|
2563
|
+
.\[\&_\[cmdk-group-heading\]\]\:univer-px-2 [cmdk-group-heading] {
|
|
2564
|
+
padding-left: .5rem;
|
|
2565
|
+
padding-right: .5rem;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
.\[\&_\[cmdk-group-heading\]\]\:univer-py-1\.5 [cmdk-group-heading] {
|
|
2569
|
+
padding-top: .375rem;
|
|
2570
|
+
padding-bottom: .375rem;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
.\[\&_\[cmdk-group-heading\]\]\:univer-text-xs [cmdk-group-heading] {
|
|
2574
|
+
font-size: .75rem;
|
|
2575
|
+
line-height: 1rem;
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
.\[\&_\[cmdk-group-heading\]\]\:univer-font-medium [cmdk-group-heading] {
|
|
2579
|
+
font-weight: 500;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
.\[\&_\[cmdk-group-heading\]\]\:univer-text-gray-500 [cmdk-group-heading] {
|
|
2583
|
+
color: var(--univer-gray-500);
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2504
2586
|
.\[\&_\[data-description\]\]\:univer-text-sm [data-description] {
|
|
2505
2587
|
font-size: .875rem;
|
|
2506
2588
|
line-height: 1.25rem;
|
|
@@ -2712,80 +2794,3 @@
|
|
|
2712
2794
|
.\[\&_svg\]\:univer-shrink-0 svg {
|
|
2713
2795
|
flex-shrink: 0;
|
|
2714
2796
|
}
|
|
2715
|
-
.univer-popup {
|
|
2716
|
-
z-index: 1070;
|
|
2717
|
-
--univer-tw-shadow: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
|
|
2718
|
-
--univer-tw-shadow-colored: 0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);
|
|
2719
|
-
box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 3px #0000001a, 0 1px 2px -1px #0000001a;
|
|
2720
|
-
box-shadow: var(--univer-tw-ring-offset-shadow, 0 0 #0000), var(--univer-tw-ring-shadow, 0 0 #0000), var(--univer-tw-shadow);
|
|
2721
|
-
border-radius: 6px;
|
|
2722
|
-
position: fixed;
|
|
2723
|
-
top: -9999px;
|
|
2724
|
-
left: -9999px;
|
|
2725
|
-
overflow: hidden;
|
|
2726
|
-
}
|
|
2727
|
-
|
|
2728
|
-
.univer-popup-enter {
|
|
2729
|
-
transform-origin: 0 0;
|
|
2730
|
-
opacity: 0;
|
|
2731
|
-
animation-duration: .15s;
|
|
2732
|
-
animation-timing-function: cubic-bezier(.08, .82, .17, 1);
|
|
2733
|
-
animation-play-state: paused;
|
|
2734
|
-
animation-fill-mode: both;
|
|
2735
|
-
}
|
|
2736
|
-
|
|
2737
|
-
.univer-popup-enter-active {
|
|
2738
|
-
animation-name: popup-slide-up-in;
|
|
2739
|
-
animation-play-state: running;
|
|
2740
|
-
}
|
|
2741
|
-
|
|
2742
|
-
.univer-popup-exit {
|
|
2743
|
-
transform-origin: 0 0;
|
|
2744
|
-
opacity: 1;
|
|
2745
|
-
animation-name: popup-slide-up-out;
|
|
2746
|
-
animation-duration: .15s;
|
|
2747
|
-
animation-timing-function: cubic-bezier(.6, .04, .98, .34);
|
|
2748
|
-
animation-play-state: running;
|
|
2749
|
-
animation-fill-mode: both;
|
|
2750
|
-
}
|
|
2751
|
-
|
|
2752
|
-
.univer-popup-exit-active {
|
|
2753
|
-
display: none;
|
|
2754
|
-
}
|
|
2755
|
-
|
|
2756
|
-
@keyframes popup-slide-up-in {
|
|
2757
|
-
0% {
|
|
2758
|
-
transform-origin: 0 0;
|
|
2759
|
-
opacity: 0;
|
|
2760
|
-
transform: scaleY(0);
|
|
2761
|
-
}
|
|
2762
|
-
|
|
2763
|
-
100% {
|
|
2764
|
-
transform-origin: 0 0;
|
|
2765
|
-
opacity: 1;
|
|
2766
|
-
transform: scaleY(1);
|
|
2767
|
-
}
|
|
2768
|
-
}
|
|
2769
|
-
|
|
2770
|
-
@keyframes popup-slide-up-out {
|
|
2771
|
-
0% {
|
|
2772
|
-
transform-origin: 0 0;
|
|
2773
|
-
opacity: 1;
|
|
2774
|
-
transform: scaleY(1);
|
|
2775
|
-
}
|
|
2776
|
-
|
|
2777
|
-
100% {
|
|
2778
|
-
transform-origin: 0 0;
|
|
2779
|
-
opacity: 0;
|
|
2780
|
-
transform: scaleY(0);
|
|
2781
|
-
}
|
|
2782
|
-
}
|
|
2783
|
-
|
|
2784
|
-
.univer-popup-mask {
|
|
2785
|
-
z-index: 1060;
|
|
2786
|
-
position: fixed;
|
|
2787
|
-
top: 0;
|
|
2788
|
-
bottom: 0;
|
|
2789
|
-
left: 0;
|
|
2790
|
-
right: 0;
|
|
2791
|
-
}
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalendarIcon, CheckMarkIcon, ClockIcon, CloseIcon, DeleteIcon, DownIcon, ErrorIcon, InfoIcon, LoadingMultiIcon, MoreDownIcon, MoreLeftIcon, MoreRightIcon, MoreUpIcon, OneToOneIcon, SuccessIcon, WarningIcon, ZoomInIcon, ZoomOutIcon } from "@univerjs/icons";
|
|
1
|
+
import { CalendarIcon, CheckMarkIcon, ClockIcon, CloseIcon, DeleteIcon, DownIcon, ErrorIcon, InfoIcon, LoadingMultiIcon, MoreDownIcon, MoreLeftIcon, MoreRightIcon, MoreUpIcon, OneToOneIcon, SearchIcon, SuccessIcon, WarningIcon, ZoomInIcon, ZoomOutIcon } from "@univerjs/icons";
|
|
2
2
|
import { Children, cloneElement, createContext, forwardRef, isValidElement, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { clsx as clsx$1 } from "clsx";
|
|
4
4
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
@@ -9,10 +9,10 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
9
9
|
import { CheckboxItem, Content, Item, ItemIndicator, Portal, RadioGroup as RadioGroup$1, RadioItem, Root, Separator as Separator$1, Sub, SubContent, SubTrigger, Trigger } from "@radix-ui/react-dropdown-menu";
|
|
10
10
|
import { Content as Content$1, Portal as Portal$1, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-popover";
|
|
11
11
|
import { Close, Content as Content$2, Description, Overlay, Portal as Portal$2, Root as Root$2, Title } from "@radix-ui/react-dialog";
|
|
12
|
+
import { Command as Command$1 } from "cmdk";
|
|
12
13
|
import { createPortal } from "react-dom";
|
|
13
14
|
import { Content as Content$3, Portal as Portal$3, Root as Root$3, Trigger as Trigger$2 } from "@radix-ui/react-hover-card";
|
|
14
15
|
import { Toaster as Toaster$1, toast, toast as toast$1 } from "sonner";
|
|
15
|
-
import { CSSTransition } from "react-transition-group";
|
|
16
16
|
import { Root as Root$4 } from "@radix-ui/react-separator";
|
|
17
17
|
import { createRoot } from "react-dom/client";
|
|
18
18
|
|
|
@@ -1107,7 +1107,8 @@ function useDraggable(options = {}) {
|
|
|
1107
1107
|
if (!isDragging) return;
|
|
1108
1108
|
e.preventDefault();
|
|
1109
1109
|
e.stopPropagation();
|
|
1110
|
-
|
|
1110
|
+
const newPosition = calculateBounds(e.clientX, e.clientY);
|
|
1111
|
+
setPosition(newPosition);
|
|
1111
1112
|
}, [isDragging, calculateBounds]);
|
|
1112
1113
|
const endDrag = useCallback(() => {
|
|
1113
1114
|
setIsDragging(false);
|
|
@@ -1504,10 +1505,11 @@ function RgbInput({ hsv, alpha, format, onChange }) {
|
|
|
1504
1505
|
if (value !== "" && !/^\d*\.?\d*$/.test(value)) return;
|
|
1505
1506
|
const numValue = value === "" ? 0 : Number.parseFloat(value);
|
|
1506
1507
|
if (numValue > 1) return;
|
|
1507
|
-
|
|
1508
|
+
const newValues = {
|
|
1508
1509
|
...localValues,
|
|
1509
1510
|
a: numValue
|
|
1510
|
-
}
|
|
1511
|
+
};
|
|
1512
|
+
setLocalValues(newValues);
|
|
1511
1513
|
if (onChange) onChange(hsv[0], hsv[1], hsv[2], numValue);
|
|
1512
1514
|
return;
|
|
1513
1515
|
}
|
|
@@ -2061,6 +2063,69 @@ function ColorPicker({ format = "hex", value, onChange }) {
|
|
|
2061
2063
|
});
|
|
2062
2064
|
}
|
|
2063
2065
|
|
|
2066
|
+
//#endregion
|
|
2067
|
+
//#region src/components/command/Command.tsx
|
|
2068
|
+
function Command({ className, ...props }) {
|
|
2069
|
+
return /* @__PURE__ */ jsx(Command$1, {
|
|
2070
|
+
"data-slot": "command",
|
|
2071
|
+
className: clsx("univer-flex univer-h-full univer-w-full univer-flex-col univer-overflow-hidden univer-rounded-md univer-bg-white univer-text-gray-900 dark:!univer-bg-gray-700 dark:!univer-text-white", className),
|
|
2072
|
+
...props
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
function CommandInput({ className, ...props }) {
|
|
2076
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2077
|
+
"data-slot": "command-input-wrapper",
|
|
2078
|
+
className: "univer-flex univer-h-10 univer-items-center univer-gap-2 univer-border-0 univer-border-b univer-border-solid univer-border-gray-200 univer-px-3 dark:!univer-border-gray-600 [&>svg]:univer-size-4 [&>svg]:univer-shrink-0 [&>svg]:univer-text-gray-400",
|
|
2079
|
+
children: [/* @__PURE__ */ jsx(SearchIcon, {}), /* @__PURE__ */ jsx(Command$1.Input, {
|
|
2080
|
+
"data-slot": "command-input",
|
|
2081
|
+
className: clsx("univer-h-10 univer-w-full univer-border-none univer-bg-transparent univer-text-sm univer-outline-none placeholder:univer-text-gray-400", className),
|
|
2082
|
+
...props
|
|
2083
|
+
})]
|
|
2084
|
+
});
|
|
2085
|
+
}
|
|
2086
|
+
function CommandList({ className, ...props }) {
|
|
2087
|
+
return /* @__PURE__ */ jsx(Command$1.List, {
|
|
2088
|
+
"data-slot": "command-list",
|
|
2089
|
+
className: clsx("univer-max-h-[300px] univer-overflow-y-auto univer-overflow-x-hidden univer-p-1 [scroll-padding-block:4px]", className),
|
|
2090
|
+
...props
|
|
2091
|
+
});
|
|
2092
|
+
}
|
|
2093
|
+
function CommandEmpty({ className, ...props }) {
|
|
2094
|
+
return /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
2095
|
+
"data-slot": "command-empty",
|
|
2096
|
+
className: clsx("univer-py-6 univer-text-center univer-text-sm univer-text-gray-500", className),
|
|
2097
|
+
...props
|
|
2098
|
+
});
|
|
2099
|
+
}
|
|
2100
|
+
function CommandGroup({ className, ...props }) {
|
|
2101
|
+
return /* @__PURE__ */ jsx(Command$1.Group, {
|
|
2102
|
+
"data-slot": "command-group",
|
|
2103
|
+
className: clsx("univer-overflow-hidden univer-p-1 [&_[cmdk-group-heading]]:univer-px-2 [&_[cmdk-group-heading]]:univer-py-1.5 [&_[cmdk-group-heading]]:univer-text-xs [&_[cmdk-group-heading]]:univer-font-medium [&_[cmdk-group-heading]]:univer-text-gray-500", className),
|
|
2104
|
+
...props
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2107
|
+
function CommandItem({ className, ...props }) {
|
|
2108
|
+
return /* @__PURE__ */ jsx(Command$1.Item, {
|
|
2109
|
+
"data-slot": "command-item",
|
|
2110
|
+
className: clsx("univer-relative univer-flex univer-cursor-default univer-select-none univer-items-center univer-gap-2 univer-rounded univer-px-2 univer-py-1.5 univer-text-sm univer-outline-none data-[disabled=true]:univer-pointer-events-none data-[selected=true]:univer-bg-gray-100 data-[disabled=true]:univer-opacity-50 dark:data-[selected=true]:!univer-bg-gray-600", className),
|
|
2111
|
+
...props
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
function CommandSeparator({ className, ...props }) {
|
|
2115
|
+
return /* @__PURE__ */ jsx(Command$1.Separator, {
|
|
2116
|
+
"data-slot": "command-separator",
|
|
2117
|
+
className: clsx("univer-my-1 univer-h-px univer-bg-gray-200 dark:!univer-bg-gray-600", className),
|
|
2118
|
+
...props
|
|
2119
|
+
});
|
|
2120
|
+
}
|
|
2121
|
+
function CommandShortcut({ className, ...props }) {
|
|
2122
|
+
return /* @__PURE__ */ jsx("span", {
|
|
2123
|
+
"data-slot": "command-shortcut",
|
|
2124
|
+
className: clsx("univer-ml-auto univer-text-xs univer-tracking-widest univer-text-gray-400 rtl:univer-ml-0 rtl:univer-mr-auto", className),
|
|
2125
|
+
...props
|
|
2126
|
+
});
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2064
2129
|
//#endregion
|
|
2065
2130
|
//#region src/components/confirm/Confirm.tsx
|
|
2066
2131
|
function Footer(props) {
|
|
@@ -2329,7 +2394,10 @@ function DraggableList(props) {
|
|
|
2329
2394
|
onPointerDownCapture: (e) => {
|
|
2330
2395
|
if (pointerIdRef.current !== null) return;
|
|
2331
2396
|
if (!draggableHandle) pressedHandleIdRef.current = itemId;
|
|
2332
|
-
else
|
|
2397
|
+
else {
|
|
2398
|
+
const isMatched = !!e.target.closest(draggableHandle);
|
|
2399
|
+
pressedHandleIdRef.current = isMatched ? itemId : null;
|
|
2400
|
+
}
|
|
2333
2401
|
if (pressedHandleIdRef.current !== itemId) return;
|
|
2334
2402
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
2335
2403
|
dragPointerOffsetRef.current = {
|
|
@@ -2708,7 +2776,7 @@ const Input = forwardRef(({ autoFocus = false, className, style, type = "text",
|
|
|
2708
2776
|
|
|
2709
2777
|
//#endregion
|
|
2710
2778
|
//#region src/components/input-number/InputNumber.tsx
|
|
2711
|
-
const InputNumber = forwardRef(({ value, defaultValue, size = "small", min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, step = 1, precision, formatter, parser, controls = true, className, inputClassName, controlsClassName, disabled, onChange, onKeyDown, onPressEnter, onFocus, onBlur, allowEmpty = false }, ref) => {
|
|
2779
|
+
const InputNumber = forwardRef(({ value, defaultValue, size = "small", min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, step = 1, precision, formatter, parser, controls = true, className, inputClassName, controlsClassName, disabled, onChange, onKeyDown, onPressEnter, onFocus, onBlur, allowEmpty = false, allowClear = false }, ref) => {
|
|
2712
2780
|
const { locale } = useContext(ConfigContext);
|
|
2713
2781
|
const [internalValue, setInternalValue] = useState(value !== void 0 ? value : defaultValue !== void 0 ? defaultValue : null);
|
|
2714
2782
|
const lastValidValueRef = useRef(internalValue);
|
|
@@ -2854,6 +2922,7 @@ const InputNumber = forwardRef(({ value, defaultValue, size = "small", min = Num
|
|
|
2854
2922
|
className: clsx("univer-box-border", inputClassName),
|
|
2855
2923
|
size,
|
|
2856
2924
|
value: inputValue,
|
|
2925
|
+
allowClear,
|
|
2857
2926
|
disabled,
|
|
2858
2927
|
onChange: handleInputChange,
|
|
2859
2928
|
onFocus,
|
|
@@ -2910,14 +2979,16 @@ function Segmented({ items, value, defaultValue, onChange, className = "" }) {
|
|
|
2910
2979
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
2911
2980
|
const newRect = newItemElement.getBoundingClientRect();
|
|
2912
2981
|
const newLeft = newRect.left - containerRect.left - SEGMENTED_PADDING;
|
|
2913
|
-
if (oldItemElement)
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2982
|
+
if (oldItemElement) {
|
|
2983
|
+
const oldLeft = oldItemElement.getBoundingClientRect().left - containerRect.left - SEGMENTED_PADDING;
|
|
2984
|
+
setSlideStyle({
|
|
2985
|
+
"--slide-from": `${oldLeft}px`,
|
|
2986
|
+
"--slide-to": `${newLeft}px`,
|
|
2987
|
+
left: `${SEGMENTED_PADDING}px`,
|
|
2988
|
+
width: `${newRect.width}px`,
|
|
2989
|
+
transform: `translateX(${newLeft}px)`
|
|
2990
|
+
});
|
|
2991
|
+
} else setSlideStyle({
|
|
2921
2992
|
left: `${SEGMENTED_PADDING}px`,
|
|
2922
2993
|
width: `${newRect.width}px`,
|
|
2923
2994
|
transform: `translateX(${newLeft}px)`
|
|
@@ -3773,9 +3844,10 @@ function PanelField(props) {
|
|
|
3773
3844
|
//#endregion
|
|
3774
3845
|
//#region src/components/popup/Popup.tsx
|
|
3775
3846
|
const POPUP_POINTER_OFFSET = 2;
|
|
3847
|
+
const DEFAULT_POPUP_OFFSET = [0, 0];
|
|
3776
3848
|
const HIDDEN_POPUP_OFFSET = [-9999, -9999];
|
|
3777
3849
|
function Popup(props) {
|
|
3778
|
-
const { children, visible = false, offset =
|
|
3850
|
+
const { children, visible = false, offset = DEFAULT_POPUP_OFFSET, overflowVisible = false, placementY = "below" } = props;
|
|
3779
3851
|
const nodeRef = useRef(null);
|
|
3780
3852
|
const [realOffset, setRealOffset] = useState(HIDDEN_POPUP_OFFSET);
|
|
3781
3853
|
const { mountContainer, direction } = useContext(ConfigContext);
|
|
@@ -3821,29 +3893,17 @@ function Popup(props) {
|
|
|
3821
3893
|
function preventDefault(event) {
|
|
3822
3894
|
event.preventDefault();
|
|
3823
3895
|
}
|
|
3824
|
-
return createPortal(/* @__PURE__ */ jsx(
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
exitActive: "univer-popup-exit",
|
|
3833
|
-
exitDone: "univer-popup-exit-active"
|
|
3896
|
+
return createPortal(/* @__PURE__ */ jsx("section", {
|
|
3897
|
+
ref: nodeRef,
|
|
3898
|
+
dir: direction,
|
|
3899
|
+
className: clsx("univer-popup univer-fixed univer-z-[1070] univer-origin-top-left univer-overflow-hidden univer-rounded-md univer-shadow univer-transition-[transform,opacity] univer-duration-150", visible ? "univer-[transition-timing-function:cubic-bezier(0.08,0.82,0.17,1)] univer-scale-y-100 univer-opacity-100" : "univer-[transition-timing-function:cubic-bezier(0.6,0.04,0.98,0.34)] univer-scale-y-0 univer-opacity-0"),
|
|
3900
|
+
style: {
|
|
3901
|
+
left: realOffset[0] + POPUP_POINTER_OFFSET,
|
|
3902
|
+
top: realOffset[1] + POPUP_POINTER_OFFSET,
|
|
3903
|
+
overflow: overflowVisible ? "visible" : void 0
|
|
3834
3904
|
},
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
dir: direction,
|
|
3838
|
-
className: "univer-popup",
|
|
3839
|
-
style: {
|
|
3840
|
-
left: realOffset[0] + POPUP_POINTER_OFFSET,
|
|
3841
|
-
top: realOffset[1] + POPUP_POINTER_OFFSET,
|
|
3842
|
-
overflow: overflowVisible ? "visible" : void 0
|
|
3843
|
-
},
|
|
3844
|
-
onContextMenu: preventDefault,
|
|
3845
|
-
children
|
|
3846
|
-
})
|
|
3905
|
+
onContextMenu: preventDefault,
|
|
3906
|
+
children
|
|
3847
3907
|
}), mountContainer);
|
|
3848
3908
|
}
|
|
3849
3909
|
|
|
@@ -4050,13 +4110,15 @@ function MultipleSelect(props) {
|
|
|
4050
4110
|
disabled: option.disabled,
|
|
4051
4111
|
checked: value.includes(option.value),
|
|
4052
4112
|
onSelect: (item) => {
|
|
4053
|
-
|
|
4113
|
+
const newValue = value.includes(item) ? value.filter((v) => v !== item) : [...value, item];
|
|
4114
|
+
onChange(newValue);
|
|
4054
4115
|
}
|
|
4055
4116
|
};
|
|
4056
4117
|
});
|
|
4057
4118
|
}, [options]);
|
|
4058
4119
|
function handleClose(item) {
|
|
4059
|
-
|
|
4120
|
+
const newValue = value.filter((v) => v !== item);
|
|
4121
|
+
onChange(newValue);
|
|
4060
4122
|
}
|
|
4061
4123
|
const displayValue = useMemo(() => {
|
|
4062
4124
|
return options.filter((option) => value.includes(option.value)).map((option, index) => /* @__PURE__ */ jsx(Badge, {
|
|
@@ -4314,7 +4376,8 @@ const filterLeafNode = (tree, keyList) => {
|
|
|
4314
4376
|
const result = [];
|
|
4315
4377
|
const find = createCacheWithFindNodePathFromTree(tree);
|
|
4316
4378
|
keyList.forEach((key) => {
|
|
4317
|
-
const
|
|
4379
|
+
const path = find.findNodePathFromTreeWithCache(key);
|
|
4380
|
+
const node = findNodeFromPath(tree, path);
|
|
4318
4381
|
if (node) {
|
|
4319
4382
|
var _node$children3;
|
|
4320
4383
|
if (!((_node$children3 = node.children) === null || _node$children3 === void 0 ? void 0 : _node$children3.length)) result.push(node);
|
|
@@ -4469,43 +4532,4 @@ function unmount(container) {
|
|
|
4469
4532
|
}
|
|
4470
4533
|
|
|
4471
4534
|
//#endregion
|
|
4472
|
-
|
|
4473
|
-
/**
|
|
4474
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4475
|
-
*
|
|
4476
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4477
|
-
* you may not use this file except in compliance with the License.
|
|
4478
|
-
* You may obtain a copy of the License at
|
|
4479
|
-
*
|
|
4480
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4481
|
-
*
|
|
4482
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
4483
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4484
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4485
|
-
* See the License for the specific language governing permissions and
|
|
4486
|
-
* limitations under the License.
|
|
4487
|
-
*/
|
|
4488
|
-
/**
|
|
4489
|
-
* All elements are observed by a single ResizeObserver is got greater performance than each element observed by separate ResizeObserver
|
|
4490
|
-
* See issue https://github.com/WICG/resize-observer/issues/59#issuecomment-408098151
|
|
4491
|
-
*/
|
|
4492
|
-
const _resizeObserverCallbacks = /* @__PURE__ */ new Set();
|
|
4493
|
-
let _resizeObserver;
|
|
4494
|
-
function resizeObserverCtor(callback) {
|
|
4495
|
-
if (!_resizeObserver) _resizeObserver = new ResizeObserver((...args) => {
|
|
4496
|
-
_resizeObserverCallbacks.forEach((callback) => callback(...args));
|
|
4497
|
-
});
|
|
4498
|
-
return {
|
|
4499
|
-
observe(target, options) {
|
|
4500
|
-
_resizeObserverCallbacks.add(callback);
|
|
4501
|
-
_resizeObserver.observe(target, options);
|
|
4502
|
-
},
|
|
4503
|
-
unobserve(target) {
|
|
4504
|
-
_resizeObserverCallbacks.delete(callback);
|
|
4505
|
-
_resizeObserver.unobserve(target);
|
|
4506
|
-
}
|
|
4507
|
-
};
|
|
4508
|
-
}
|
|
4509
|
-
|
|
4510
|
-
//#endregion
|
|
4511
|
-
export { Accordion, Avatar, Badge, Button, ButtonGroup, Calendar, CascaderList, Checkbox, CheckboxGroup, ColorPicker, ColorPresets, ConfigContext, ConfigProvider, Confirm, DatePicker, DateRangePicker, Dialog, DraggableList, Dropdown, DropdownMenu, FormDualColumnLayout, FormLayout, Gallery, GradientColorPicker, HoverCard, Input, InputNumber, KBD, MessageType, Messager, MultipleSelect, Pager, Panel, PanelField, PanelSection, Popup, Radio, RadioGroup, Segmented, Select, SelectList, Separator, Switch, Textarea, TimeInput, Toaster, Tooltip, Tree, TreeSelectionMode, borderBottomClassName, borderClassName, borderLeftBottomClassName, borderLeftClassName, borderRightClassName, borderTopClassName, clsx, cva, divideXClassName, divideYClassName, filterLeafNode, findNodePathFromTree, findSubTreeFromPath, isBrowser, mergeTreeSelected, message, removeMessage, render, resetButtonClassName, resizeObserverCtor, scrollbarClassName, selectClassName, toast, unmount };
|
|
4535
|
+
export { Accordion, Avatar, Badge, Button, ButtonGroup, Calendar, CascaderList, Checkbox, CheckboxGroup, ColorPicker, ColorPresets, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfigContext, ConfigProvider, Confirm, DatePicker, DateRangePicker, Dialog, DraggableList, Dropdown, DropdownMenu, FormDualColumnLayout, FormLayout, Gallery, GradientColorPicker, HoverCard, Input, InputNumber, KBD, MessageType, Messager, MultipleSelect, Pager, Panel, PanelField, PanelSection, Popup, Radio, RadioGroup, Segmented, Select, SelectList, Separator, Switch, Textarea, TimeInput, Toaster, Tooltip, Tree, TreeSelectionMode, borderBottomClassName, borderClassName, borderLeftBottomClassName, borderLeftClassName, borderRightClassName, borderTopClassName, clsx, cva, divideXClassName, divideYClassName, filterLeafNode, findNodePathFromTree, findSubTreeFromPath, isBrowser, mergeTreeSelected, message, removeMessage, render, resetButtonClassName, scrollbarClassName, selectClassName, toast, unmount };
|
package/lib/locale/ar-SA.js
CHANGED
package/lib/locale/ca-ES.js
CHANGED
|
@@ -12,11 +12,11 @@ const locale = { design: {
|
|
|
12
12
|
},
|
|
13
13
|
Confirm: {
|
|
14
14
|
cancel: "cancel·la",
|
|
15
|
-
confirm: "
|
|
15
|
+
confirm: "D'acord"
|
|
16
16
|
},
|
|
17
17
|
CascaderList: { empty: "Cap" },
|
|
18
18
|
Calendar: {
|
|
19
|
-
year: "",
|
|
19
|
+
year: "Any",
|
|
20
20
|
weekDays: [
|
|
21
21
|
"dg",
|
|
22
22
|
"dl",
|
|
@@ -51,7 +51,7 @@ const locale = { design: {
|
|
|
51
51
|
ColorPicker: {
|
|
52
52
|
more: "Més colors",
|
|
53
53
|
cancel: "cancel·la",
|
|
54
|
-
confirm: "
|
|
54
|
+
confirm: "D'acord"
|
|
55
55
|
},
|
|
56
56
|
GradientColorPicker: {
|
|
57
57
|
linear: "Lineal",
|
package/lib/locale/de-DE.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
package/lib/locale/fr-FR.js
CHANGED
|
@@ -12,11 +12,11 @@ const locale = { design: {
|
|
|
12
12
|
},
|
|
13
13
|
Confirm: {
|
|
14
14
|
cancel: "annuler",
|
|
15
|
-
confirm: "
|
|
15
|
+
confirm: "OK"
|
|
16
16
|
},
|
|
17
17
|
CascaderList: { empty: "Aucun" },
|
|
18
18
|
Calendar: {
|
|
19
|
-
year: "",
|
|
19
|
+
year: "Année",
|
|
20
20
|
weekDays: [
|
|
21
21
|
"Dim",
|
|
22
22
|
"Lun",
|
|
@@ -51,7 +51,7 @@ const locale = { design: {
|
|
|
51
51
|
ColorPicker: {
|
|
52
52
|
more: "Plus de couleurs",
|
|
53
53
|
cancel: "annuler",
|
|
54
|
-
confirm: "
|
|
54
|
+
confirm: "OK"
|
|
55
55
|
},
|
|
56
56
|
GradientColorPicker: {
|
|
57
57
|
linear: "Linéaire",
|
package/lib/locale/id-ID.js
CHANGED
package/lib/locale/it-IT.js
CHANGED
|
@@ -12,11 +12,11 @@ const locale = { design: {
|
|
|
12
12
|
},
|
|
13
13
|
Confirm: {
|
|
14
14
|
cancel: "annulla",
|
|
15
|
-
confirm: "
|
|
15
|
+
confirm: "OK"
|
|
16
16
|
},
|
|
17
17
|
CascaderList: { empty: "Nessuno" },
|
|
18
18
|
Calendar: {
|
|
19
|
-
year: "",
|
|
19
|
+
year: "Anno",
|
|
20
20
|
weekDays: [
|
|
21
21
|
"Dom",
|
|
22
22
|
"Lun",
|
|
@@ -51,7 +51,7 @@ const locale = { design: {
|
|
|
51
51
|
ColorPicker: {
|
|
52
52
|
more: "Altri Colori",
|
|
53
53
|
cancel: "annulla",
|
|
54
|
-
confirm: "
|
|
54
|
+
confirm: "OK"
|
|
55
55
|
},
|
|
56
56
|
GradientColorPicker: {
|
|
57
57
|
linear: "Lineare",
|