@univerjs/sheets-sort-ui 1.0.0-alpha.2 → 1.0.0-alpha.3

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 CHANGED
@@ -7,9 +7,9 @@ let _univerjs_design = require("@univerjs/design");
7
7
  let _univerjs_ui = require("@univerjs/ui");
8
8
  let react = require("react");
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
10
+ let _univerjs_sheets_ui = require("@univerjs/sheets-ui");
10
11
  let _univerjs_icons = require("@univerjs/icons");
11
12
  let _univerjs_engine_formula = require("@univerjs/engine-formula");
12
- let _univerjs_sheets_ui = require("@univerjs/sheets-ui");
13
13
 
14
14
  //#region src/views/ExtendConfirm.tsx
15
15
  const ExtendConfirm = (props) => {
@@ -368,10 +368,202 @@ const SortRangeCustomInCtxMenuCommand = {
368
368
  }
369
369
  };
370
370
 
371
+ //#endregion
372
+ //#region src/menu/sheets-sort.menu.ts
373
+ const SHEETS_SORT_MENU_ID = "sheet.menu.sheets-sort";
374
+ const SHEETS_SORT_CTX_MENU_ID = "sheet.menu.sheets-sort-ctx";
375
+ function sortRangeMenuFactory(accessor) {
376
+ return {
377
+ id: SHEETS_SORT_MENU_ID,
378
+ type: _univerjs_ui.MenuItemType.SUBITEMS,
379
+ icon: "AscendingIcon",
380
+ tooltip: "sheets-sort-ui.general.sort",
381
+ hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
382
+ disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
383
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
384
+ worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
385
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
386
+ })
387
+ };
388
+ }
389
+ function sortRangeAscMenuFactory(accessor) {
390
+ return {
391
+ id: SortRangeAscCommand.id,
392
+ icon: "AscendingIcon",
393
+ title: "sheets-sort-ui.general.sort-asc-cur",
394
+ type: _univerjs_ui.MenuItemType.BUTTON,
395
+ hidden$: (0, _univerjs_sheets_ui.getCurrentExclusiveRangeInterest$)(accessor)
396
+ };
397
+ }
398
+ function sortRangeAscExtMenuFactory() {
399
+ return {
400
+ id: SortRangeAscExtCommand.id,
401
+ title: "sheets-sort-ui.general.sort-asc-ext",
402
+ icon: "ExpandAscendingIcon",
403
+ type: _univerjs_ui.MenuItemType.BUTTON
404
+ };
405
+ }
406
+ function sortRangeDescMenuFactory() {
407
+ return {
408
+ id: SortRangeDescCommand.id,
409
+ title: "sheets-sort-ui.general.sort-desc-cur",
410
+ icon: "DescendingIcon",
411
+ type: _univerjs_ui.MenuItemType.BUTTON
412
+ };
413
+ }
414
+ function sortRangeDescExtMenuFactory() {
415
+ return {
416
+ id: SortRangeDescExtCommand.id,
417
+ title: "sheets-sort-ui.general.sort-desc-ext",
418
+ icon: "ExpandDescendingIcon",
419
+ type: _univerjs_ui.MenuItemType.BUTTON
420
+ };
421
+ }
422
+ function sortRangeCustomMenuFactory() {
423
+ return {
424
+ id: SortRangeCustomCommand.id,
425
+ title: "sheets-sort-ui.general.sort-custom",
426
+ type: _univerjs_ui.MenuItemType.BUTTON,
427
+ icon: "CustomSortIcon"
428
+ };
429
+ }
430
+ function sortRangeCtxMenuFactory(accessor) {
431
+ return {
432
+ id: SHEETS_SORT_CTX_MENU_ID,
433
+ title: "sheets-sort-ui.general.sort",
434
+ type: _univerjs_ui.MenuItemType.SUBITEMS,
435
+ icon: "AscendingIcon",
436
+ hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
437
+ disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
438
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
439
+ worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
440
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
441
+ })
442
+ };
443
+ }
444
+ function sortRangeAscCtxMenuFactory(accessor) {
445
+ return {
446
+ id: SortRangeAscInCtxMenuCommand.id,
447
+ title: "sheets-sort-ui.general.sort-asc-cur",
448
+ type: _univerjs_ui.MenuItemType.BUTTON,
449
+ icon: "AscendingIcon",
450
+ disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
451
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
452
+ worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
453
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
454
+ })
455
+ };
456
+ }
457
+ function sortRangeAscExtCtxMenuFactory(accessor) {
458
+ return {
459
+ id: SortRangeAscExtInCtxMenuCommand.id,
460
+ title: "sheets-sort-ui.general.sort-asc-ext",
461
+ type: _univerjs_ui.MenuItemType.BUTTON,
462
+ icon: "ExpandAscendingIcon",
463
+ disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
464
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
465
+ worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
466
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
467
+ })
468
+ };
469
+ }
470
+ function sortRangeDescCtxMenuFactory(accessor) {
471
+ return {
472
+ id: SortRangeDescInCtxMenuCommand.id,
473
+ title: "sheets-sort-ui.general.sort-desc-cur",
474
+ type: _univerjs_ui.MenuItemType.BUTTON,
475
+ icon: "DescendingIcon",
476
+ disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
477
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
478
+ worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
479
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
480
+ })
481
+ };
482
+ }
483
+ function sortRangeDescExtCtxMenuFactory(accessor) {
484
+ return {
485
+ id: SortRangeDescExtInCtxMenuCommand.id,
486
+ title: "sheets-sort-ui.general.sort-desc-ext",
487
+ type: _univerjs_ui.MenuItemType.BUTTON,
488
+ icon: "ExpandDescendingIcon",
489
+ disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
490
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
491
+ worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
492
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
493
+ })
494
+ };
495
+ }
496
+ function sortRangeCustomCtxMenuFactory(accessor) {
497
+ return {
498
+ id: SortRangeCustomInCtxMenuCommand.id,
499
+ title: "sheets-sort-ui.general.sort-custom",
500
+ type: _univerjs_ui.MenuItemType.BUTTON,
501
+ icon: "CustomSortIcon",
502
+ disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
503
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
504
+ worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
505
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
506
+ })
507
+ };
508
+ }
509
+
510
+ //#endregion
511
+ //#region src/menu/schema.ts
512
+ const menuSchema = {
513
+ [_univerjs_ui.RibbonDataGroup.ORGANIZATION]: { [SHEETS_SORT_MENU_ID]: {
514
+ order: 3,
515
+ menuItemFactory: sortRangeMenuFactory,
516
+ [SortRangeAscCommand.id]: {
517
+ order: 0,
518
+ menuItemFactory: sortRangeAscMenuFactory
519
+ },
520
+ [SortRangeAscExtCommand.id]: {
521
+ order: 1,
522
+ menuItemFactory: sortRangeAscExtMenuFactory
523
+ },
524
+ [SortRangeDescCommand.id]: {
525
+ order: 2,
526
+ menuItemFactory: sortRangeDescMenuFactory
527
+ },
528
+ [SortRangeDescExtCommand.id]: {
529
+ order: 3,
530
+ menuItemFactory: sortRangeDescExtMenuFactory
531
+ },
532
+ [SortRangeCustomCommand.id]: {
533
+ order: 4,
534
+ menuItemFactory: sortRangeCustomMenuFactory
535
+ }
536
+ } },
537
+ [_univerjs_ui.ContextMenuPosition.MAIN_AREA]: { [_univerjs_ui.ContextMenuGroup.DATA]: { [SHEETS_SORT_CTX_MENU_ID]: {
538
+ order: 0,
539
+ menuItemFactory: sortRangeCtxMenuFactory,
540
+ [SortRangeAscInCtxMenuCommand.id]: {
541
+ order: 0,
542
+ menuItemFactory: sortRangeAscCtxMenuFactory
543
+ },
544
+ [SortRangeAscExtInCtxMenuCommand.id]: {
545
+ order: 1,
546
+ menuItemFactory: sortRangeAscExtCtxMenuFactory
547
+ },
548
+ [SortRangeDescInCtxMenuCommand.id]: {
549
+ order: 2,
550
+ menuItemFactory: sortRangeDescCtxMenuFactory
551
+ },
552
+ [SortRangeDescExtInCtxMenuCommand.id]: {
553
+ order: 3,
554
+ menuItemFactory: sortRangeDescExtCtxMenuFactory
555
+ },
556
+ [SortRangeCustomInCtxMenuCommand.id]: {
557
+ order: 4,
558
+ menuItemFactory: sortRangeCustomCtxMenuFactory
559
+ }
560
+ } } }
561
+ };
562
+
371
563
  //#endregion
372
564
  //#region package.json
373
565
  var name = "@univerjs/sheets-sort-ui";
374
- var version = "1.0.0-alpha.2";
566
+ var version = "1.0.0-alpha.3";
375
567
 
376
568
  //#endregion
377
569
  //#region src/config/config.ts
@@ -643,198 +835,6 @@ let ComponentsController = class ComponentsController extends _univerjs_core.Dis
643
835
  };
644
836
  ComponentsController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.IconManager))], ComponentsController);
645
837
 
646
- //#endregion
647
- //#region src/menu/sheets-sort.menu.ts
648
- const SHEETS_SORT_MENU_ID = "sheet.menu.sheets-sort";
649
- const SHEETS_SORT_CTX_MENU_ID = "sheet.menu.sheets-sort-ctx";
650
- function sortRangeMenuFactory(accessor) {
651
- return {
652
- id: SHEETS_SORT_MENU_ID,
653
- type: _univerjs_ui.MenuItemType.SUBITEMS,
654
- icon: "AscendingIcon",
655
- tooltip: "sheets-sort-ui.general.sort",
656
- hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
657
- disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
658
- workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
659
- worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
660
- rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
661
- })
662
- };
663
- }
664
- function sortRangeAscMenuFactory(accessor) {
665
- return {
666
- id: SortRangeAscCommand.id,
667
- icon: "AscendingIcon",
668
- title: "sheets-sort-ui.general.sort-asc-cur",
669
- type: _univerjs_ui.MenuItemType.BUTTON,
670
- hidden$: (0, _univerjs_sheets_ui.getCurrentExclusiveRangeInterest$)(accessor)
671
- };
672
- }
673
- function sortRangeAscExtMenuFactory() {
674
- return {
675
- id: SortRangeAscExtCommand.id,
676
- title: "sheets-sort-ui.general.sort-asc-ext",
677
- icon: "ExpandAscendingIcon",
678
- type: _univerjs_ui.MenuItemType.BUTTON
679
- };
680
- }
681
- function sortRangeDescMenuFactory() {
682
- return {
683
- id: SortRangeDescCommand.id,
684
- title: "sheets-sort-ui.general.sort-desc-cur",
685
- icon: "DescendingIcon",
686
- type: _univerjs_ui.MenuItemType.BUTTON
687
- };
688
- }
689
- function sortRangeDescExtMenuFactory() {
690
- return {
691
- id: SortRangeDescExtCommand.id,
692
- title: "sheets-sort-ui.general.sort-desc-ext",
693
- icon: "ExpandDescendingIcon",
694
- type: _univerjs_ui.MenuItemType.BUTTON
695
- };
696
- }
697
- function sortRangeCustomMenuFactory() {
698
- return {
699
- id: SortRangeCustomCommand.id,
700
- title: "sheets-sort-ui.general.sort-custom",
701
- type: _univerjs_ui.MenuItemType.BUTTON,
702
- icon: "CustomSortIcon"
703
- };
704
- }
705
- function sortRangeCtxMenuFactory(accessor) {
706
- return {
707
- id: SHEETS_SORT_CTX_MENU_ID,
708
- title: "sheets-sort-ui.general.sort",
709
- type: _univerjs_ui.MenuItemType.SUBITEMS,
710
- icon: "AscendingIcon",
711
- hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
712
- disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
713
- workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
714
- worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
715
- rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
716
- })
717
- };
718
- }
719
- function sortRangeAscCtxMenuFactory(accessor) {
720
- return {
721
- id: SortRangeAscInCtxMenuCommand.id,
722
- title: "sheets-sort-ui.general.sort-asc-cur",
723
- type: _univerjs_ui.MenuItemType.BUTTON,
724
- icon: "AscendingIcon",
725
- disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
726
- workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
727
- worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
728
- rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
729
- })
730
- };
731
- }
732
- function sortRangeAscExtCtxMenuFactory(accessor) {
733
- return {
734
- id: SortRangeAscExtInCtxMenuCommand.id,
735
- title: "sheets-sort-ui.general.sort-asc-ext",
736
- type: _univerjs_ui.MenuItemType.BUTTON,
737
- icon: "ExpandAscendingIcon",
738
- disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
739
- workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
740
- worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
741
- rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
742
- })
743
- };
744
- }
745
- function sortRangeDescCtxMenuFactory(accessor) {
746
- return {
747
- id: SortRangeDescInCtxMenuCommand.id,
748
- title: "sheets-sort-ui.general.sort-desc-cur",
749
- type: _univerjs_ui.MenuItemType.BUTTON,
750
- icon: "DescendingIcon",
751
- disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
752
- workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
753
- worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
754
- rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
755
- })
756
- };
757
- }
758
- function sortRangeDescExtCtxMenuFactory(accessor) {
759
- return {
760
- id: SortRangeDescExtInCtxMenuCommand.id,
761
- title: "sheets-sort-ui.general.sort-desc-ext",
762
- type: _univerjs_ui.MenuItemType.BUTTON,
763
- icon: "ExpandDescendingIcon",
764
- disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
765
- workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
766
- worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
767
- rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
768
- })
769
- };
770
- }
771
- function sortRangeCustomCtxMenuFactory(accessor) {
772
- return {
773
- id: SortRangeCustomInCtxMenuCommand.id,
774
- title: "sheets-sort-ui.general.sort-custom",
775
- type: _univerjs_ui.MenuItemType.BUTTON,
776
- icon: "CustomSortIcon",
777
- disabled$: (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
778
- workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
779
- worksheetTypes: [_univerjs_sheets.WorksheetSortPermission, _univerjs_sheets.WorksheetEditPermission],
780
- rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
781
- })
782
- };
783
- }
784
-
785
- //#endregion
786
- //#region src/menu/schema.ts
787
- const menuSchema = {
788
- [_univerjs_ui.RibbonDataGroup.ORGANIZATION]: { [SHEETS_SORT_MENU_ID]: {
789
- order: 3,
790
- menuItemFactory: sortRangeMenuFactory,
791
- [SortRangeAscCommand.id]: {
792
- order: 0,
793
- menuItemFactory: sortRangeAscMenuFactory
794
- },
795
- [SortRangeAscExtCommand.id]: {
796
- order: 1,
797
- menuItemFactory: sortRangeAscExtMenuFactory
798
- },
799
- [SortRangeDescCommand.id]: {
800
- order: 2,
801
- menuItemFactory: sortRangeDescMenuFactory
802
- },
803
- [SortRangeDescExtCommand.id]: {
804
- order: 3,
805
- menuItemFactory: sortRangeDescExtMenuFactory
806
- },
807
- [SortRangeCustomCommand.id]: {
808
- order: 4,
809
- menuItemFactory: sortRangeCustomMenuFactory
810
- }
811
- } },
812
- [_univerjs_ui.ContextMenuPosition.MAIN_AREA]: { [_univerjs_ui.ContextMenuGroup.DATA]: { [SHEETS_SORT_CTX_MENU_ID]: {
813
- order: 0,
814
- menuItemFactory: sortRangeCtxMenuFactory,
815
- [SortRangeAscInCtxMenuCommand.id]: {
816
- order: 0,
817
- menuItemFactory: sortRangeAscCtxMenuFactory
818
- },
819
- [SortRangeAscExtInCtxMenuCommand.id]: {
820
- order: 1,
821
- menuItemFactory: sortRangeAscExtCtxMenuFactory
822
- },
823
- [SortRangeDescInCtxMenuCommand.id]: {
824
- order: 2,
825
- menuItemFactory: sortRangeDescCtxMenuFactory
826
- },
827
- [SortRangeDescExtInCtxMenuCommand.id]: {
828
- order: 3,
829
- menuItemFactory: sortRangeDescExtCtxMenuFactory
830
- },
831
- [SortRangeCustomInCtxMenuCommand.id]: {
832
- order: 4,
833
- menuItemFactory: sortRangeCustomCtxMenuFactory
834
- }
835
- } } }
836
- };
837
-
838
838
  //#endregion
839
839
  //#region src/views/EmbedSortBtn.tsx
840
840
  function EmbedSortBtn(props) {
@@ -990,6 +990,7 @@ UniverSheetsSortUIPlugin = __decorate([
990
990
  ], UniverSheetsSortUIPlugin);
991
991
 
992
992
  //#endregion
993
+ exports.SheetsSortUIMenuSchema = menuSchema;
993
994
  exports.SortRangeAscCommand = SortRangeAscCommand;
994
995
  exports.SortRangeAscExtCommand = SortRangeAscExtCommand;
995
996
  exports.SortRangeAscExtInCtxMenuCommand = SortRangeAscExtInCtxMenuCommand;