@mptw/skylens-ui 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/AGENTS.md +59 -0
  2. package/CLAUDE.md +36 -0
  3. package/README.md +7 -7
  4. package/app/app.config.ts +11 -2
  5. package/app/app.vue +5 -0
  6. package/app/assets/css/layout.css +134 -0
  7. package/app/assets/css/main.css +189 -0
  8. package/app/components/SLAlertModal.vue +24 -16
  9. package/app/components/SLBreadcrumbs.vue +12 -8
  10. package/app/components/SLButton.vue +196 -163
  11. package/app/components/SLCalendarButton.vue +40 -34
  12. package/app/components/SLCalendarPopup.vue +79 -53
  13. package/app/components/SLCard.vue +57 -41
  14. package/app/components/SLChart.vue +6 -3
  15. package/app/components/SLCheckbox.vue +92 -49
  16. package/app/components/SLCircleButton.vue +25 -16
  17. package/app/components/SLCollapsableBlock.vue +44 -33
  18. package/app/components/SLCollapsableMulitPillSelect.vue +20 -15
  19. package/app/components/SLConfirmModal.vue +9 -6
  20. package/app/components/SLContextMenu.vue +88 -48
  21. package/app/components/SLDateInput.vue +109 -92
  22. package/app/components/SLDatePicker.vue +9 -7
  23. package/app/components/SLDistributor.vue +1 -1
  24. package/app/components/SLDownloadButton.vue +39 -29
  25. package/app/components/SLDraggable.vue +2 -2
  26. package/app/components/SLDropdown.vue +33 -25
  27. package/app/components/SLDropdownItem.vue +9 -5
  28. package/app/components/SLElementWithTitle.vue +12 -7
  29. package/app/components/SLEyeCheckbox.vue +44 -31
  30. package/app/components/SLFileInput.vue +23 -16
  31. package/app/components/SLGenderAgeSelect.vue +52 -36
  32. package/app/components/SLHourRangeInput.vue +45 -32
  33. package/app/components/SLIOSSwitch.vue +81 -60
  34. package/app/components/SLIcon.vue +4 -3
  35. package/app/components/SLIconButton.vue +31 -29
  36. package/app/components/SLInfoTip.vue +51 -40
  37. package/app/components/SLInsightSitePage.vue +12 -7
  38. package/app/components/SLLegend.vue +19 -12
  39. package/app/components/SLLinearProgressBar.vue +7 -20
  40. package/app/components/SLLink.vue +12 -8
  41. package/app/components/SLLoading.vue +34 -31
  42. package/app/components/SLMapChart.vue +5 -4
  43. package/app/components/SLModal.vue +90 -66
  44. package/app/components/SLMonthCalendarButton.vue +91 -45
  45. package/app/components/SLMonthPicker.vue +42 -37
  46. package/app/components/SLMultiEmailInput.vue +163 -113
  47. package/app/components/SLMultiSelect.vue +37 -26
  48. package/app/components/SLNoData.vue +16 -11
  49. package/app/components/SLNotification.vue +133 -129
  50. package/app/components/SLPageModal.vue +14 -9
  51. package/app/components/SLPagination.vue +45 -33
  52. package/app/components/SLPillCheckbox.vue +50 -42
  53. package/app/components/SLPillLabel.vue +43 -28
  54. package/app/components/SLPopupMenuButton.vue +26 -17
  55. package/app/components/SLProfileButton.vue +28 -20
  56. package/app/components/SLProjectShareItem.vue +30 -17
  57. package/app/components/SLRadioButton.vue +41 -33
  58. package/app/components/SLRadioButtonGroup.vue +28 -23
  59. package/app/components/SLRadioGroup.vue +90 -78
  60. package/app/components/SLRangeInput.vue +53 -38
  61. package/app/components/SLRegionsMapChart.vue +5 -4
  62. package/app/components/SLRightSider.vue +50 -40
  63. package/app/components/SLSearchInput.vue +24 -19
  64. package/app/components/SLSelect.vue +114 -87
  65. package/app/components/SLSelectAllToggle.vue +52 -37
  66. package/app/components/SLSidebarNav.vue +253 -193
  67. package/app/components/SLSidebarNavGroupItem.vue +13 -10
  68. package/app/components/SLSidebarNavGroupItemSection.vue +240 -179
  69. package/app/components/SLSidebarNavLinkItem.vue +131 -109
  70. package/app/components/SLSidebarNavSectionItem.vue +21 -18
  71. package/app/components/SLSitePage.vue +35 -24
  72. package/app/components/SLSkyInsightSitePage.vue +13 -8
  73. package/app/components/SLSortByDropdown.vue +35 -22
  74. package/app/components/SLSpinIcon.vue +6 -3
  75. package/app/components/SLStayRangeInput.vue +47 -36
  76. package/app/components/SLTab.vue +7 -2
  77. package/app/components/SLTable.vue +330 -313
  78. package/app/components/SLTableTooltip.vue +44 -30
  79. package/app/components/SLTabs.vue +333 -280
  80. package/app/components/SLTextInput.vue +162 -134
  81. package/app/components/SLTextarea.vue +40 -29
  82. package/app/components/SLToast.vue +19 -11
  83. package/app/components/SLToggleButton.vue +18 -11
  84. package/app/components/SLTwoLayerMultiSelect.vue +180 -85
  85. package/app/components/SLTwoLayerSelect.vue +47 -37
  86. package/app/components/SLTwoLayerSingleSelect.vue +52 -33
  87. package/app/components/SLWarnModal.vue +9 -7
  88. package/app/interface/commons.ts +7 -0
  89. package/app/utils/index.ts +213 -146
  90. package/eslint.config.js +3 -0
  91. package/nuxt.config.ts +17 -14
  92. package/package.json +9 -8
  93. package/skills-lock.json +59 -0
  94. package/tsconfig.json +1 -6
  95. package/.eslintrc.cjs +0 -4
  96. package/app/assets/css/layout.styl +0 -98
  97. package/app/assets/css/tailwind.css +0 -3
  98. package/app/pages/index.vue +0 -15
  99. package/interface/commons.ts +0 -7
  100. package/tailwind.config.js +0 -271
  101. /package/{interface → app/interface}/IDateRange.ts +0 -0
  102. /package/{interface → app/interface}/IHourRange.ts +0 -0
  103. /package/{interface → app/interface}/IInputOption.ts +0 -0
  104. /package/{interface → app/interface}/ILegendItem.ts +0 -0
  105. /package/{interface → app/interface}/IOrganization.ts +0 -0
  106. /package/{interface → app/interface}/IPopupMenuButton.ts +0 -0
  107. /package/{interface → app/interface}/IStayRange.ts +0 -0
  108. /package/{interface → app/interface}/ITableField.ts +0 -0
  109. /package/{interface → app/interface}/IWeb.ts +0 -0
  110. /package/{interface → app/interface}/NavConfigType.ts +0 -0
  111. /package/{models → app/models}/DateRange.ts +0 -0
@@ -112,7 +112,7 @@ import Swiper from "swiper";
112
112
  import { FreeMode, Scrollbar, Mousewheel } from "swiper/modules";
113
113
  import "swiper/css";
114
114
  import "swiper/css/scrollbar";
115
- import { OrgUserRole } from "~ui/interface/IOrganization";
115
+ import { OrgUserRole } from "~ui/app/interface/IOrganization";
116
116
 
117
117
  export default defineComponent({
118
118
  name: "SLMultiEmailInput",
@@ -445,13 +445,13 @@ export default defineComponent({
445
445
  case "ArrowDown":
446
446
  focusedAutoCompleteIndex.value = Math.min(
447
447
  autoCompletedMembers.value.length - 1,
448
- focusedAutoCompleteIndex.value + 1
448
+ focusedAutoCompleteIndex.value + 1,
449
449
  );
450
450
  break;
451
451
  case "ArrowUp":
452
452
  focusedAutoCompleteIndex.value = Math.max(
453
453
  -1,
454
- focusedAutoCompleteIndex.value - 1
454
+ focusedAutoCompleteIndex.value - 1,
455
455
  );
456
456
  break;
457
457
  default:
@@ -526,7 +526,7 @@ export default defineComponent({
526
526
  itemBottom - scrollBotttom + scrollTop,
527
527
  300,
528
528
  false,
529
- false
529
+ false,
530
530
  );
531
531
  }
532
532
  });
@@ -564,7 +564,7 @@ export default defineComponent({
564
564
  setupPopper();
565
565
 
566
566
  keydownSubscription = fromEvent(window, "keydown").subscribe(
567
- onWindowKeydown
567
+ onWindowKeydown,
568
568
  );
569
569
  });
570
570
 
@@ -605,115 +605,165 @@ export default defineComponent({
605
605
  });
606
606
  </script>
607
607
 
608
- <style lang="stylus" scoped>
609
- .multi-email-input
610
- @apply flex flex-col
611
-
612
- &.collapsable
613
- .multi-email-input-header
614
- @apply cursor-pointer
615
-
616
- .right-block
617
- @apply flex
618
-
619
- &.collapsed
620
- .multi-email-input-header
621
- .right-block
622
- .icon
623
- @apply rotate-0
624
-
625
- &-header
626
- @apply flex items-center justify-between mb-2 cursor-default
627
-
628
- .left-block
629
- @apply flex-grow-0 flex-shrink-0 flex items-center text-base text-pgray-2
630
-
631
- .right-block
632
- @apply flex-grow-0 flex-shrink-0 text-xs hidden
633
- .icon
634
- @apply transition-transform rotate-180
635
-
636
- &-body
637
-
638
- &-wrapper
639
- @apply flex items-start space-x-4
640
-
641
- .emails-input
642
- @apply flex-grow flex items-center s('p-1.75') space-x-4 bg-white border border-primary-500 rounded overflow-hidden
643
-
644
- &-wrapper
645
- @apply flex-grow space-y-2 overflow-hidden
646
-
647
- .emails-list
648
- @apply s('max-h-[97px]')
649
-
650
- &-wrapper
651
- @apply flex flex-col items-start space-y-2 overflow-hidden
652
-
653
- .email-item
654
- @apply inline-flex items-center justify-start max-w-full s('px-1.75') s('py-0.5') space-x-2 bg-white border border-primary-300 rounded-full text-base text-pgray-2
655
-
656
- &-email
657
- @apply flex-grow truncate
608
+ <style scoped>
609
+ @reference '~ui/app/assets/css/main.css';
610
+
611
+ .multi-email-input {
612
+ @apply flex flex-col;
613
+ }
614
+
615
+ .multi-email-input.collapsable .multi-email-input-header {
616
+ @apply cursor-pointer;
617
+ }
618
+
619
+ .multi-email-input.collapsable .multi-email-input-header .right-block {
620
+ @apply flex;
621
+ }
622
+
623
+ .multi-email-input.collapsed .multi-email-input-header .right-block .icon {
624
+ @apply rotate-0;
625
+ }
626
+
627
+ .multi-email-input-header {
628
+ @apply flex items-center justify-between mb-2 cursor-default;
629
+ }
630
+
631
+ .multi-email-input-header .left-block {
632
+ @apply grow-0 shrink-0 flex items-center text-base text-pgray-2;
633
+ }
634
+
635
+ .multi-email-input-header .right-block {
636
+ @apply grow-0 shrink-0 text-xs hidden;
637
+ }
638
+
639
+ .multi-email-input-header .right-block .icon {
640
+ @apply transition-transform rotate-180;
641
+ }
642
+
643
+ .multi-email-input-body-wrapper {
644
+ @apply flex items-start space-x-4;
645
+ }
646
+
647
+ .multi-email-input-body .emails-input {
648
+ @apply grow flex items-center p-1.75 space-x-4 bg-white border border-primary-500 rounded overflow-hidden;
649
+ }
650
+
651
+ .multi-email-input-body .emails-input-wrapper {
652
+ @apply grow space-y-2 overflow-hidden;
653
+ }
654
+
655
+ .multi-email-input-body .emails-input .emails-list {
656
+ @apply max-h-[97px];
657
+ }
658
+
659
+ .multi-email-input-body .emails-input .emails-list-wrapper {
660
+ @apply flex flex-col items-start space-y-2 overflow-hidden;
661
+ }
662
+
663
+ .multi-email-input-body .emails-input .emails-list-wrapper .email-item {
664
+ @apply inline-flex items-center justify-start max-w-full px-1.75 py-0.5 space-x-2 bg-white border border-primary-300 rounded-full text-base text-pgray-2;
665
+ }
666
+
667
+ .multi-email-input-body .emails-input .emails-list-wrapper .email-item-email {
668
+ @apply grow truncate;
669
+ }
670
+
671
+ .multi-email-input-body .emails-input .emails-list-wrapper .email-item-status {
672
+ @apply grow-0 shrink-0;
673
+ }
674
+
675
+ .multi-email-input-body
676
+ .emails-input
677
+ .emails-list-wrapper
678
+ .email-item-status
679
+ .icon-loading {
680
+ @apply text-third-500;
681
+ }
682
+
683
+ .multi-email-input-body
684
+ .emails-input
685
+ .emails-list-wrapper
686
+ .email-item-status
687
+ .icon-success {
688
+ @apply text-highlight-500;
689
+ }
690
+
691
+ .multi-email-input-body
692
+ .emails-input
693
+ .emails-list-wrapper
694
+ .email-item-status
695
+ .icon-warn {
696
+ @apply text-danger;
697
+ }
698
+
699
+ .multi-email-input-body
700
+ .emails-input
701
+ .emails-list-wrapper
702
+ .email-item-delete-button {
703
+ @apply text-xs;
704
+ }
705
+
706
+ .multi-email-input-body .emails-input textarea {
707
+ @apply grow-0 shrink-0 block w-full p-0 border-0 bg-white text-sm text-pgray-2 resize-none focus:outline-none;
708
+ }
709
+
710
+ .multi-email-input-body .multi-email-input-role {
711
+ @apply grow-0 shrink-0 flex;
712
+ }
713
+
714
+ .multi-email-input-body .multi-email-input-role :deep(.dropdown-toggle) {
715
+ @apply text-sm;
716
+ }
717
+
718
+ .multi-email-input .multi-email-input-actions {
719
+ @apply grow-0 shrink-0;
720
+ }
721
+
722
+ .multi-email-input .multi-email-input-actions .btn {
723
+ @apply text-sm;
724
+ }
725
+
726
+ .multi-email-input-autocomplete {
727
+ @apply z-50 max-h-[116px] p-1 bg-white rounded shadow-default hidden;
728
+ }
729
+
730
+ .multi-email-input-autocomplete[data-show] {
731
+ @apply flex;
732
+ }
733
+
734
+ .multi-email-input-autocomplete .swiper {
735
+ @apply w-full;
736
+ }
737
+
738
+ .multi-email-input-autocomplete .swiper-slide {
739
+ @apply h-auto;
740
+ }
741
+
742
+ .multi-email-input-autocomplete .swiper-scrollbar {
743
+ @apply top-0 right-0 h-full bg-transparent;
744
+ }
745
+
746
+ .multi-email-input-autocomplete :deep(.swiper-scrollbar-drag) {
747
+ @apply bg-primary-300;
748
+ }
749
+
750
+ .multi-email-input-autocomplete .autotcomplete-item {
751
+ @apply block w-full py-1 px-2 bg-white text-sm text-pgray-2;
752
+ }
753
+
754
+ .multi-email-input-autocomplete .autotcomplete-item:hover,
755
+ .multi-email-input-autocomplete .autotcomplete-item.focused {
756
+ @apply bg-primary-100;
757
+ }
758
+
759
+ .dropdown-menu.multi-email-input-role-dropdown-menu {
760
+ @apply border-primary;
761
+ }
658
762
 
659
- &-status
660
- @apply flex-grow-0 flex-shrink-0
661
-
662
- .icon-loading
663
- @apply text-third-500
664
-
665
- .icon-success
666
- @apply text-highlight-500
667
-
668
- .icon-warn
669
- @apply text-danger
670
-
671
- &-delete-button
672
- @apply text-xs
673
-
674
- textarea
675
- @apply flex-grow-0 flex-shrink-0 block w-full p-0 border-0 bg-white text-sm text-pgray-2 resize-none s('focus:outline-none')
676
-
677
- .multi-email-input-role
678
- @apply flex-grow-0 flex-shrink-0 flex
679
-
680
- :deep(.dropdown-toggle)
681
- @apply text-sm
682
-
683
- .multi-email-input-actions
684
- @apply flex-grow-0 flex-shrink-0
685
-
686
- .btn
687
- @apply text-sm
688
-
689
- .multi-email-input-autocomplete
690
- @apply z-50 s('max-h-[116px]') p-1 bg-white rounded shadow hidden
691
-
692
- &[data-show]
693
- @apply flex
694
-
695
- .swiper
696
- @apply w-full
697
-
698
- .swiper-slide
699
- @apply h-auto
700
- .swiper-scrollbar
701
- @apply top-0 right-0 h-full bg-transparent
702
-
703
- :deep(.swiper-scrollbar-drag)
704
- @apply bg-primary-300
705
- .autotcomplete-item
706
- @apply block w-full py-1 px-2 bg-white text-sm text-pgray-2
707
- &:hover, &.focused
708
- @apply bg-primary-100
709
- </style>
710
-
711
- <style lang="stylus">
712
763
  .dropdown-menu.multi-email-input-role-dropdown-menu
713
- @apply border-primary
714
-
715
764
  .dropdown-list-wrapper
716
- .dropdown-list
717
- .dropdown-item
718
- @apply text-center
765
+ .dropdown-list
766
+ .dropdown-item {
767
+ @apply text-center;
768
+ }
719
769
  </style>
@@ -16,7 +16,7 @@
16
16
  <script lang="ts">
17
17
  import type { PropType } from "vue";
18
18
  import { isEqual } from "lodash-es";
19
- import type IInputOption from "~ui/interface/IInputOption";
19
+ import type IInputOption from "~ui/app/interface/IInputOption";
20
20
 
21
21
  export default defineComponent({
22
22
  name: "SLMultiSelect",
@@ -62,7 +62,7 @@ export default defineComponent({
62
62
  if (found) {
63
63
  emit(
64
64
  "update:modelValue",
65
- modelValue.value.filter((v) => !isEqual(v, optionValue))
65
+ modelValue.value.filter((v) => !isEqual(v, optionValue)),
66
66
  );
67
67
  return;
68
68
  }
@@ -85,37 +85,48 @@ export default defineComponent({
85
85
  });
86
86
  </script>
87
87
 
88
- <style lang="stylus">
89
- .custom-multi-select
90
- @apply px-3 py-1 border border-primary-500 rounded
88
+ <style>
89
+ @reference '~ui/app/assets/css/main.css';
90
+
91
+ .custom-multi-select {
92
+ @apply px-3 py-1 border border-primary-500 rounded;
93
+ }
91
94
 
92
- .options-wrapper
93
- @apply relative overflow-auto
95
+ .custom-multi-select .options-wrapper {
96
+ @apply relative overflow-auto;
97
+ }
94
98
 
95
- .options
96
- @apply flex flex-col
99
+ .custom-multi-select .options {
100
+ @apply flex flex-col;
101
+ }
97
102
 
98
- .option-button
99
- @apply flex justify-between items-center px-2 py-1 bg-white shadow-inline s("hover:bg-primary-25")
103
+ .custom-multi-select .options .option-button {
104
+ @apply flex justify-between items-center px-2 py-1 bg-white shadow-inline hover:bg-primary-25;
105
+ }
100
106
 
101
- &:hover
102
- .btn
103
- @apply opacity-100
107
+ .custom-multi-select .options .option-button:hover .btn {
108
+ @apply opacity-100;
109
+ }
104
110
 
105
- &.selected
106
- .option-label
107
- @apply text-primary font-bold
111
+ .custom-multi-select .options .option-button.selected .option-label {
112
+ @apply text-primary font-bold;
113
+ }
108
114
 
109
- .btn
110
- @apply bg-primary-600 opacity-100
115
+ .custom-multi-select .options .option-button.selected .btn {
116
+ @apply bg-primary-600 opacity-100;
117
+ }
111
118
 
112
- &:hover, &:active, &:focus
113
- .btn
114
- @apply bg-primary
119
+ .custom-multi-select .options .option-button.selected:hover .btn,
120
+ .custom-multi-select .options .option-button.selected:active .btn,
121
+ .custom-multi-select .options .option-button.selected:focus .btn {
122
+ @apply bg-primary;
123
+ }
115
124
 
116
- .option-label
117
- @apply flex-grow inline-block text-base leading-normal text-pgray-2 truncate
125
+ .custom-multi-select .options .option-button .option-label {
126
+ @apply grow inline-block text-base leading-[1.3125] text-pgray-2 truncate;
127
+ }
118
128
 
119
- .btn
120
- @apply flex-grow-0 flex-shrink-0 inline-block px-2 py-1 bg-primary rounded text-base leading-normal text-white opacity-0
129
+ .custom-multi-select .options .option-button .btn {
130
+ @apply grow-0 shrink-0 inline-block px-2 py-1 bg-primary rounded text-base leading-[1.3125] text-white opacity-0;
131
+ }
121
132
  </style>
@@ -1,6 +1,6 @@
1
1
  <template lang="pug">
2
2
  .no-data(:class='{ "no-data--sm": size === "sm" }')
3
- img(src="images/commons/empty-box.png")
3
+ img(src="~ui/app/assets/images/commons/empty-box.png")
4
4
  .no-data-title {{ title }}
5
5
  .no-data-reason(v-if='reason') 可能的原因:{{ reason }}
6
6
  </template>
@@ -27,17 +27,22 @@ export default defineComponent({
27
27
  });
28
28
  </script>
29
29
 
30
- <style lang="stylus" scoped>
31
- .no-data
32
- @apply flex flex-col items-center w-full py-8 px-4 space-y-3 bg-white rounded-lg
30
+ <style scoped>
31
+ @reference '~ui/app/assets/css/main.css';
33
32
 
34
- &--sm
35
- .no-data-title
36
- @apply text-sm
33
+ .no-data {
34
+ @apply flex flex-col items-center w-full py-8 px-4 space-y-3 bg-white rounded-lg;
35
+ }
37
36
 
38
- &-title
39
- @apply text-lg text-primary-500
37
+ .no-data--sm .no-data-title {
38
+ @apply text-sm;
39
+ }
40
40
 
41
- &-reason
42
- @apply text-sm text-pgray-3
41
+ .no-data-title {
42
+ @apply text-lg text-primary-500;
43
+ }
44
+
45
+ .no-data-reason {
46
+ @apply text-sm text-pgray-3;
47
+ }
43
48
  </style>