@hlw-uni/mp-vue 1.1.2 → 1.1.4

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/dist/style.css CHANGED
@@ -297,7 +297,7 @@ to {
297
297
  font-size: var(--font-base, 28rpx);
298
298
  color: #bbb;
299
299
  }
300
- .hlw-header[data-v-b85e90ac] {
300
+ .hlw-header[data-v-8497ffe5] {
301
301
  position: sticky;
302
302
  top: 0;
303
303
  z-index: 999;
@@ -305,18 +305,18 @@ to {
305
305
  flex-direction: column;
306
306
  overflow: hidden;
307
307
  }
308
- .header-bg-layer[data-v-b85e90ac] {
308
+ .header-bg-layer[data-v-8497ffe5] {
309
309
  position: absolute;
310
310
  inset: 0;
311
311
  z-index: 0;
312
312
  }
313
- .status-bar-spacer[data-v-b85e90ac] {
313
+ .status-bar-spacer[data-v-8497ffe5] {
314
314
  flex-shrink: 0;
315
315
  width: 100%;
316
316
  position: relative;
317
317
  z-index: 1;
318
318
  }
319
- .header-content-area[data-v-b85e90ac] {
319
+ .header-content-area[data-v-8497ffe5] {
320
320
  flex-shrink: 0;
321
321
  width: 100%;
322
322
  display: flex;
@@ -324,29 +324,34 @@ to {
324
324
  position: relative;
325
325
  z-index: 1;
326
326
  }
327
- .header-back[data-v-b85e90ac] {
327
+ .header-back[data-v-8497ffe5] {
328
328
  width: 88rpx;
329
329
  height: 100%;
330
330
  display: flex;
331
331
  align-items: center;
332
332
  justify-content: center;
333
333
  flex-shrink: 0;
334
+ color: #475569;
335
+ }
336
+ .header-back[data-v-8497ffe5]:active {
337
+ opacity: 0.8;
334
338
  }
335
- .header-back-icon[data-v-b85e90ac] {
336
- font-size: 36rpx;
339
+ .header-back-icon[data-v-8497ffe5] {
340
+ font-size: var(--font-md, 32rpx);
341
+ color: inherit;
337
342
  }
338
- .header-title[data-v-b85e90ac] {
343
+ .header-title[data-v-8497ffe5] {
339
344
  flex: 1;
340
345
  overflow: hidden;
341
346
  }
342
- .header-title--center[data-v-b85e90ac] {
347
+ .header-title--center[data-v-8497ffe5] {
343
348
  text-align: center;
344
349
  }
345
- .header-title--left[data-v-b85e90ac] {
350
+ .header-title--left[data-v-8497ffe5] {
346
351
  text-align: left;
347
352
  padding-left: 4rpx;
348
353
  }
349
- .header-title-text[data-v-b85e90ac] {
354
+ .header-title-text[data-v-8497ffe5] {
350
355
  display: block;
351
356
  overflow: hidden;
352
357
  text-overflow: ellipsis;
@@ -356,7 +361,7 @@ to {
356
361
  font-weight: 500;
357
362
  color: #14181f;
358
363
  }
359
- .header-placeholder[data-v-b85e90ac] {
364
+ .header-placeholder[data-v-8497ffe5] {
360
365
  width: 88rpx;
361
366
  flex-shrink: 0;
362
367
  }
@@ -709,97 +714,112 @@ to {
709
714
  100% {
710
715
  transform: translateX(-100%);
711
716
  }
712
- }.hlw-page[data-v-0cf37585] {
717
+ }.hlw-page[data-v-01bb7796] {
713
718
  width: 100%;
714
719
  height: 100vh;
715
720
  display: flex;
716
721
  flex-direction: column;
717
722
  overflow: hidden;
718
723
  }
719
- .hlw-page-header[data-v-0cf37585] {
724
+ .hlw-page-header[data-v-01bb7796] {
720
725
  flex-shrink: 0;
721
726
  }
722
- .hlw-page-content[data-v-0cf37585] {
727
+ .hlw-page-content[data-v-01bb7796] {
723
728
  flex: 1;
724
729
  height: 0;
725
730
  width: 100%;
726
731
  }
727
- .hlw-page-footer[data-v-0cf37585] {
732
+ .hlw-page-footer[data-v-01bb7796] {
728
733
  flex-shrink: 0;
729
- }.hlw-popup-mask[data-v-2d71ef9b] {
734
+ }.hlw-popup-mask[data-v-be12aee0] {
730
735
  position: fixed;
731
736
  inset: 0;
732
737
  background: rgba(0, 0, 0, 0.5);
733
738
  z-index: 1000;
734
- animation: hlw-fade-in-2d71ef9b 0.25s;
739
+ animation: hlw-fade-in-be12aee0 0.25s;
735
740
  }
736
- .hlw-popup[data-v-2d71ef9b] {
741
+ .hlw-popup[data-v-be12aee0] {
737
742
  position: fixed;
738
743
  z-index: 1001;
739
744
  background: #fff;
740
- transition: transform 0.3s ease, opacity 0.3s ease;
741
745
  }
742
- .hlw-popup--bottom[data-v-2d71ef9b] {
746
+ .hlw-popup--bottom[data-v-be12aee0] {
743
747
  left: 0;
744
748
  right: 0;
745
749
  bottom: 0;
746
750
  max-height: 80vh;
747
- transform: translateY(100%);
751
+ animation: hlw-popup-slide-up-be12aee0 0.25s ease;
748
752
  }
749
- .hlw-popup--bottom.hlw-popup--show[data-v-2d71ef9b] {
750
- transform: translateY(0);
751
- }
752
- .hlw-popup--bottom.hlw-popup--round[data-v-2d71ef9b] {
753
+ .hlw-popup--bottom.hlw-popup--round[data-v-be12aee0] {
753
754
  border-radius: var(--radius-xl, 32rpx) var(--radius-xl, 32rpx) 0 0;
754
755
  }
755
- .hlw-popup--top[data-v-2d71ef9b] {
756
+ .hlw-popup--top[data-v-be12aee0] {
756
757
  left: 0;
757
758
  right: 0;
758
759
  top: 0;
759
760
  max-height: 80vh;
760
- transform: translateY(-100%);
761
- }
762
- .hlw-popup--top.hlw-popup--show[data-v-2d71ef9b] {
763
- transform: translateY(0);
761
+ animation: hlw-popup-slide-down-be12aee0 0.25s ease;
764
762
  }
765
- .hlw-popup--top.hlw-popup--round[data-v-2d71ef9b] {
763
+ .hlw-popup--top.hlw-popup--round[data-v-be12aee0] {
766
764
  border-radius: 0 0 var(--radius-xl, 32rpx) var(--radius-xl, 32rpx);
767
765
  }
768
- .hlw-popup--center[data-v-2d71ef9b] {
766
+ .hlw-popup--center[data-v-be12aee0] {
769
767
  left: 50%;
770
768
  top: 50%;
771
769
  width: 80%;
772
- transform: translate(-50%, -50%) scale(0.9);
773
- opacity: 0;
770
+ transform: translate(-50%, -50%);
774
771
  border-radius: var(--radius-xl, 32rpx);
772
+ animation: hlw-popup-scale-in-be12aee0 0.22s ease;
775
773
  }
776
- .hlw-popup--center.hlw-popup--show[data-v-2d71ef9b] {
777
- transform: translate(-50%, -50%) scale(1);
778
- opacity: 1;
779
- }
780
- .hlw-popup-header[data-v-2d71ef9b] {
774
+ .hlw-popup-header[data-v-be12aee0] {
781
775
  display: flex;
782
776
  align-items: center;
783
777
  justify-content: space-between;
784
778
  padding: 28rpx 32rpx;
785
779
  border-bottom: 1rpx solid var(--border-color-light, #f1f5f9);
786
780
  }
787
- .hlw-popup-title[data-v-2d71ef9b] {
781
+ .hlw-popup-title[data-v-be12aee0] {
788
782
  font-size: var(--font-md, 32rpx);
789
783
  font-weight: 600;
790
784
  color: #1e293b;
791
785
  }
792
- .hlw-popup-close[data-v-2d71ef9b] {
786
+ .hlw-popup-close[data-v-be12aee0] {
793
787
  font-size: 32rpx;
794
788
  color: #94a3b8;
795
789
  line-height: 1;
796
790
  padding: 4rpx;
797
791
  }
798
- @keyframes hlw-fade-in-2d71ef9b {
792
+ @keyframes hlw-fade-in-be12aee0 {
793
+ from {
794
+ opacity: 0;
795
+ }
796
+ to {
797
+ opacity: 1;
798
+ }
799
+ }
800
+ @keyframes hlw-popup-slide-up-be12aee0 {
801
+ from {
802
+ transform: translateY(100%);
803
+ }
804
+ to {
805
+ transform: translateY(0);
806
+ }
807
+ }
808
+ @keyframes hlw-popup-slide-down-be12aee0 {
799
809
  from {
810
+ transform: translateY(-100%);
811
+ }
812
+ to {
813
+ transform: translateY(0);
814
+ }
815
+ }
816
+ @keyframes hlw-popup-scale-in-be12aee0 {
817
+ from {
818
+ transform: translate(-50%, -50%) scale(0.92);
800
819
  opacity: 0;
801
820
  }
802
821
  to {
822
+ transform: translate(-50%, -50%) scale(1);
803
823
  opacity: 1;
804
824
  }
805
825
  }.hlw-search[data-v-4fe1bfab] {
@@ -933,74 +953,90 @@ to {
933
953
  border-radius: 6rpx;
934
954
  background: var(--primary-color, #3b82f6);
935
955
  transition: width 0.2s;
936
- }.hlw-tag[data-v-fd774288] {
956
+ }.hlw-tag[data-v-e4ea56ad] {
937
957
  display: inline-flex;
938
958
  align-items: center;
959
+ justify-content: center;
960
+ vertical-align: middle;
939
961
  gap: 4rpx;
940
962
  font-weight: 500;
963
+ line-height: 1.2;
941
964
  border: 2rpx solid transparent;
965
+ box-sizing: border-box;
942
966
  }
943
- .hlw-tag--medium[data-v-fd774288] {
967
+ .hlw-tag--medium[data-v-e4ea56ad] {
968
+ min-height: 36rpx;
944
969
  padding: 4rpx 16rpx;
945
970
  font-size: var(--font-xs, 20rpx);
946
971
  border-radius: var(--radius-sm, 8rpx);
947
972
  }
948
- .hlw-tag--small[data-v-fd774288] {
973
+ .hlw-tag--small[data-v-e4ea56ad] {
974
+ min-height: 28rpx;
949
975
  padding: 2rpx 10rpx;
950
976
  font-size: 18rpx;
951
977
  border-radius: 6rpx;
952
978
  }
953
- .hlw-tag--round[data-v-fd774288] {
979
+ .hlw-tag--round[data-v-e4ea56ad] {
954
980
  border-radius: 999rpx;
955
981
  }
956
- .hlw-tag--primary[data-v-fd774288] {
982
+ .hlw-tag--primary[data-v-e4ea56ad] {
957
983
  background: var(--primary-color, #3b82f6);
958
984
  color: #fff;
959
985
  border-color: var(--primary-color, #3b82f6);
960
986
  }
961
- .hlw-tag--primary.hlw-tag--plain[data-v-fd774288] {
987
+ .hlw-tag--primary.hlw-tag--plain[data-v-e4ea56ad] {
962
988
  background: transparent;
963
989
  color: var(--primary-color, #3b82f6);
964
990
  }
965
- .hlw-tag--success[data-v-fd774288] {
991
+ .hlw-tag--success[data-v-e4ea56ad] {
966
992
  background: #10b981;
967
993
  color: #fff;
968
994
  border-color: #10b981;
969
995
  }
970
- .hlw-tag--success.hlw-tag--plain[data-v-fd774288] {
996
+ .hlw-tag--success.hlw-tag--plain[data-v-e4ea56ad] {
971
997
  background: transparent;
972
998
  color: #10b981;
973
999
  }
974
- .hlw-tag--warning[data-v-fd774288] {
1000
+ .hlw-tag--warning[data-v-e4ea56ad] {
975
1001
  background: #f59e0b;
976
1002
  color: #fff;
977
1003
  border-color: #f59e0b;
978
1004
  }
979
- .hlw-tag--warning.hlw-tag--plain[data-v-fd774288] {
1005
+ .hlw-tag--warning.hlw-tag--plain[data-v-e4ea56ad] {
980
1006
  background: transparent;
981
1007
  color: #f59e0b;
982
1008
  }
983
- .hlw-tag--danger[data-v-fd774288] {
1009
+ .hlw-tag--danger[data-v-e4ea56ad] {
984
1010
  background: #ef4444;
985
1011
  color: #fff;
986
1012
  border-color: #ef4444;
987
1013
  }
988
- .hlw-tag--danger.hlw-tag--plain[data-v-fd774288] {
1014
+ .hlw-tag--danger.hlw-tag--plain[data-v-e4ea56ad] {
989
1015
  background: transparent;
990
1016
  color: #ef4444;
991
1017
  }
992
- .hlw-tag--info[data-v-fd774288] {
1018
+ .hlw-tag--info[data-v-e4ea56ad] {
993
1019
  background: #64748b;
994
1020
  color: #fff;
995
1021
  border-color: #64748b;
996
1022
  }
997
- .hlw-tag--info.hlw-tag--plain[data-v-fd774288] {
1023
+ .hlw-tag--info.hlw-tag--plain[data-v-e4ea56ad] {
998
1024
  background: transparent;
999
1025
  color: #64748b;
1000
1026
  }
1001
- .hlw-tag-close[data-v-fd774288] {
1027
+ .hlw-tag-text[data-v-e4ea56ad] {
1028
+ display: block;
1029
+ font-size: inherit;
1030
+ font-weight: inherit;
1031
+ color: inherit;
1032
+ line-height: 1.2;
1033
+ }
1034
+ .hlw-tag-close[data-v-e4ea56ad] {
1002
1035
  font-size: 1em;
1003
1036
  line-height: 1;
1037
+ display: inline-flex;
1038
+ align-items: center;
1039
+ justify-content: center;
1004
1040
  margin-left: 2rpx;
1005
1041
  opacity: 0.8;
1006
1042
  }
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@hlw-uni/mp-vue",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "hlw-uni Vue 组件库 — 供小程序业务方使用的 UI 组件集合",
5
- "main": "src/index.ts",
6
- "module": "src/index.ts",
7
- "types": "src/index.ts",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./src/index.ts",
11
- "require": "./src/index.ts",
12
- "types": "./src/index.ts"
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
13
  },
14
+ "./dist/*": "./dist/*",
14
15
  "./src/*": "./src/*"
15
16
  },
16
17
  "files": [
@@ -172,10 +172,16 @@ const totalNavBarHeight = computed(() => statusBarHeight.value + NAV_BAR_CONTENT
172
172
  align-items: center;
173
173
  justify-content: center;
174
174
  flex-shrink: 0;
175
+ color: #475569;
176
+
177
+ &:active {
178
+ opacity: 0.8;
179
+ }
175
180
  }
176
181
 
177
182
  .header-back-icon {
178
- font-size: 36rpx;
183
+ font-size: var(--font-md, 32rpx);
184
+ color: inherit;
179
185
  }
180
186
 
181
187
  .header-title {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="hlw-page">
2
+ <view class="hlw-page" :style="themePageStyle">
3
3
  <view class="hlw-page-header">
4
4
  <slot name="header">
5
5
  <hlw-header
@@ -16,6 +16,7 @@
16
16
  :enable-flex="true"
17
17
  :enhanced="true"
18
18
  :show-scrollbar="false"
19
+ :style="themePageStyle"
19
20
  >
20
21
  <slot></slot>
21
22
  </scroll-view>
@@ -26,6 +27,7 @@
26
27
  </template>
27
28
 
28
29
  <script setup lang="ts">
30
+ import { useThemePageStyle } from "../../composables/theme";
29
31
  /**
30
32
  * HlwPage — 页面布局容器
31
33
  *
@@ -61,6 +63,8 @@ const props = withDefaults(defineProps<Props>(), {
61
63
  isBack: false,
62
64
  bgClass: "",
63
65
  });
66
+
67
+ const { themePageStyle } = useThemePageStyle();
64
68
  </script>
65
69
 
66
70
  <style lang="scss" scoped>
@@ -1,12 +1,18 @@
1
1
  <template>
2
- <view v-if="show" class="hlw-popup-mask" @tap.self="onClose" />
3
- <view class="hlw-popup" :class="[`hlw-popup--${position}`, { 'hlw-popup--show': show, 'hlw-popup--round': round }]">
4
- <view v-if="title || closable" class="hlw-popup-header">
5
- <text class="hlw-popup-title">{{ title }}</text>
6
- <view v-if="closable" class="hlw-popup-close i-fa6-solid-xmark" @tap="onClose" />
2
+ <template v-if="show">
3
+ <view class="hlw-popup-mask" @tap.self="onClose" />
4
+ <view
5
+ class="hlw-popup"
6
+ :class="[`hlw-popup--${position}`, { 'hlw-popup--round': round }]"
7
+ @tap.stop
8
+ >
9
+ <view v-if="title || closable" class="hlw-popup-header">
10
+ <text class="hlw-popup-title">{{ title }}</text>
11
+ <view v-if="closable" class="hlw-popup-close i-fa6-solid-xmark" @tap="onClose" />
12
+ </view>
13
+ <slot />
7
14
  </view>
8
- <slot />
9
- </view>
15
+ </template>
10
16
  </template>
11
17
 
12
18
  <script setup lang="ts">
@@ -47,16 +53,17 @@ function onClose() {
47
53
  position: fixed;
48
54
  z-index: 1001;
49
55
  background: #fff;
50
- transition: transform 0.3s ease, opacity 0.3s ease;
51
56
 
52
57
  &--bottom {
53
58
  left: 0;
54
59
  right: 0;
55
60
  bottom: 0;
56
61
  max-height: 80vh;
57
- transform: translateY(100%);
58
- &.hlw-popup--show { transform: translateY(0); }
59
- &.hlw-popup--round { border-radius: var(--radius-xl, 32rpx) var(--radius-xl, 32rpx) 0 0; }
62
+ animation: hlw-popup-slide-up 0.25s ease;
63
+
64
+ &.hlw-popup--round {
65
+ border-radius: var(--radius-xl, 32rpx) var(--radius-xl, 32rpx) 0 0;
66
+ }
60
67
  }
61
68
 
62
69
  &--top {
@@ -64,19 +71,20 @@ function onClose() {
64
71
  right: 0;
65
72
  top: 0;
66
73
  max-height: 80vh;
67
- transform: translateY(-100%);
68
- &.hlw-popup--show { transform: translateY(0); }
69
- &.hlw-popup--round { border-radius: 0 0 var(--radius-xl, 32rpx) var(--radius-xl, 32rpx); }
74
+ animation: hlw-popup-slide-down 0.25s ease;
75
+
76
+ &.hlw-popup--round {
77
+ border-radius: 0 0 var(--radius-xl, 32rpx) var(--radius-xl, 32rpx);
78
+ }
70
79
  }
71
80
 
72
81
  &--center {
73
82
  left: 50%;
74
83
  top: 50%;
75
84
  width: 80%;
76
- transform: translate(-50%, -50%) scale(0.9);
77
- opacity: 0;
85
+ transform: translate(-50%, -50%);
78
86
  border-radius: var(--radius-xl, 32rpx);
79
- &.hlw-popup--show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
87
+ animation: hlw-popup-scale-in 0.22s ease;
80
88
  }
81
89
  }
82
90
 
@@ -105,4 +113,19 @@ function onClose() {
105
113
  from { opacity: 0; }
106
114
  to { opacity: 1; }
107
115
  }
116
+
117
+ @keyframes hlw-popup-slide-up {
118
+ from { transform: translateY(100%); }
119
+ to { transform: translateY(0); }
120
+ }
121
+
122
+ @keyframes hlw-popup-slide-down {
123
+ from { transform: translateY(-100%); }
124
+ to { transform: translateY(0); }
125
+ }
126
+
127
+ @keyframes hlw-popup-scale-in {
128
+ from { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
129
+ to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
130
+ }
108
131
  </style>
@@ -5,7 +5,7 @@
5
5
  :style="customStyle"
6
6
  @tap="$emit('click')"
7
7
  >
8
- <slot />
8
+ <text class="hlw-tag-text"><slot /></text>
9
9
  <view v-if="closable" class="hlw-tag-close i-fa6-solid-xmark" @tap.stop="$emit('close')" />
10
10
  </view>
11
11
  </template>
@@ -53,12 +53,28 @@ $colors: (
53
53
  .hlw-tag {
54
54
  display: inline-flex;
55
55
  align-items: center;
56
+ justify-content: center;
57
+ vertical-align: middle;
56
58
  gap: 4rpx;
57
59
  font-weight: 500;
60
+ line-height: 1.2;
58
61
  border: 2rpx solid transparent;
62
+ box-sizing: border-box;
63
+
64
+ &--medium {
65
+ min-height: 36rpx;
66
+ padding: 4rpx 16rpx;
67
+ font-size: var(--font-xs, 20rpx);
68
+ border-radius: var(--radius-sm, 8rpx);
69
+ }
70
+
71
+ &--small {
72
+ min-height: 28rpx;
73
+ padding: 2rpx 10rpx;
74
+ font-size: 18rpx;
75
+ border-radius: 6rpx;
76
+ }
59
77
 
60
- &--medium { padding: 4rpx 16rpx; font-size: var(--font-xs, 20rpx); border-radius: var(--radius-sm, 8rpx); }
61
- &--small { padding: 2rpx 10rpx; font-size: 18rpx; border-radius: 6rpx; }
62
78
  &--round { border-radius: 999rpx; }
63
79
 
64
80
  @each $name, $c in $colors {
@@ -67,9 +83,20 @@ $colors: (
67
83
  }
68
84
  }
69
85
 
86
+ .hlw-tag-text {
87
+ display: block;
88
+ font-size: inherit;
89
+ font-weight: inherit;
90
+ color: inherit;
91
+ line-height: 1.2;
92
+ }
93
+
70
94
  .hlw-tag-close {
71
95
  font-size: 1em;
72
96
  line-height: 1;
97
+ display: inline-flex;
98
+ align-items: center;
99
+ justify-content: center;
73
100
  margin-left: 2rpx;
74
101
  opacity: 0.8;
75
102
  }