@zfqh/uniapp 0.1.1 → 0.1.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/docs/api/apis/index.md +1 -1
  3. package/docs/api/apis/request.md +9 -9
  4. package/docs/api/configs/index.md +1 -2
  5. package/docs/api/hooks/index.md +4 -4
  6. package/docs/api/index.md +8 -3
  7. package/docs/api/mixins/app.md +1 -2
  8. package/docs/api/modules/app.md +0 -2
  9. package/docs/api/modules/index.md +1 -1
  10. package/docs/api/utils/cos.md +1 -2
  11. package/docs/api/utils/index.md +1 -1
  12. package/docs/api/utils/locale.md +68 -32
  13. package/docs/api/utils/navigate.md +3 -3
  14. package/docs/api/utils/pages.md +1 -1
  15. package/docs/api/utils/request.md +1 -1
  16. package/docs/components/index.md +1 -1
  17. package/docs/components/styles/base-styles.md +239 -367
  18. package/docs/components/usage.md +1 -1
  19. package/docs/faq/index.md +5 -6
  20. package/docs/guide/getting-started.md +3 -4
  21. package/docs/guide/project-frame.md +36 -23
  22. package/docs/index.md +3 -3
  23. package/lib/components/g-back-button/g-back-button.vue +2 -2
  24. package/lib/components/g-checkbox-list/g-checkbox-list.vue +1 -1
  25. package/lib/components/g-float/g-float.vue +1 -1
  26. package/lib/components/g-grid-image/g-grid-image.vue +1 -1
  27. package/lib/components/g-grid-swiper/g-grid-swiper.vue +1 -1
  28. package/lib/components/g-more/g-more.vue +2 -2
  29. package/lib/components/g-page-container/g-page-container.vue +1 -1
  30. package/lib/components/g-popup/g-popup.vue +3 -3
  31. package/lib/components/g-refresh-view/g-refresh-view.vue +1 -1
  32. package/lib/components/g-search/g-search.vue +4 -4
  33. package/lib/components/g-share-photo/g-share-photo.vue +1 -1
  34. package/lib/components/g-share-view/g-share-view.vue +2 -2
  35. package/lib/components/g-share-weixin/g-share-weixin.vue +1 -1
  36. package/lib/components/g-tag-editor/g-tag-editor.vue +2 -2
  37. package/lib/components/g-trtc-room/g-trtc-room.vue +1 -1
  38. package/lib/hooks/useI18n.js +1 -7
  39. package/lib/index.d.ts +1 -0
  40. package/lib/index.js +1 -2
  41. package/lib/styles/bg.scss +1 -22
  42. package/lib/styles/border.scss +1 -158
  43. package/lib/styles/{flex-vue.scss → flex.scss} +15 -12
  44. package/lib/styles/index.scss +5 -17
  45. package/lib/styles/layout.scss +17 -75
  46. package/lib/styles/reset-vue.scss +3 -1
  47. package/lib/styles/text-nvue.scss +1 -10
  48. package/lib/styles/text-vue.scss +0 -55
  49. package/lib/styles/text.scss +1 -43
  50. package/lib/styles/var.module.scss +1 -0
  51. package/lib/utils/locale.d.ts +3 -4
  52. package/lib/utils/locale.js +6 -15
  53. package/package.json +3 -3
  54. package/types/index.d.ts +4 -2
  55. package/lib/styles/animate-vue.scss +0 -3
  56. package/lib/styles/animate.scss +0 -27
  57. package/lib/styles/bg-vue.scss +0 -21
  58. package/lib/styles/flex-nvue.scss +0 -64
  59. package/lib/styles/font.scss +0 -59
  60. package/lib/styles/layout-nvue.scss +0 -24
  61. package/lib/styles/layout-vue.scss +0 -30
  62. package/lib/styles/opacity.scss +0 -10
  63. package/lib/styles/shadow.scss +0 -12
  64. package/lib/styles/sizing-vue.scss +0 -21
  65. package/lib/styles/sizing.scss +0 -21
  66. package/lib/styles/spacing.scss +0 -234
@@ -1,25 +1,13 @@
1
1
  @import '@gmcb/uv-ui/index.scss';
2
- @import './font.scss';
3
- @import './spacing.scss';
4
- @import './opacity.scss';
5
- @import './sizing.scss';
6
- @import './layout.scss';
7
- @import './shadow.scss';
8
2
  @import './border.scss';
9
3
  @import './bg.scss';
10
- @import './text.scss';
11
- @import './animate.scss';
4
+ @import './text.scss';
5
+ @import './layout.scss';
6
+ @import './flex.scss';
12
7
  /* #ifndef APP-NVUE */
13
- @import './reset-vue.scss';
14
- @import './flex-vue.scss';
15
- @import './layout-vue.scss';
16
- @import './sizing-vue.scss';
8
+ @import './reset-vue.scss';
17
9
  @import './text-vue.scss';
18
- @import './bg-vue.scss';
19
- @import './animate-vue.scss';
20
10
  /* #endif */
21
11
  /* #ifdef APP-NVUE */
22
- @import './flex-nvue.scss';
23
- @import './layout-nvue.scss';
24
- @import './text-nvue.scss';
12
+ @import './text-nvue.scss';
25
13
  /* #endif */
@@ -1,76 +1,18 @@
1
- .overflow-hidden {
2
- overflow: hidden;
3
- }
4
- .inset-0 {
5
- top: 0;
6
- right: 0;
7
- bottom: 0;
8
- left: 0;
9
- }
10
- .inset-x-0 {
11
- left: 0;
12
- right: 0;
13
- }
14
- .inset-y-0 {
15
- top: 0;
16
- bottom: 0;
17
- }
18
- @for $i from 0 through 50 {
19
- $s: $i * 2;
20
- .top-#{$s}px {
21
- top: #{$s}px;
22
- }
23
- .right-#{$s}px {
24
- right: #{$s}px;
25
- }
26
- .bottom-#{$s}px {
27
- bottom: #{$s}px;
28
- }
29
- .left-#{$s}px {
30
- left: #{$s}px;
31
- }
32
- .top-#{$s}rpx {
33
- top: #{$s}rpx;
34
- }
35
- .right-#{$s}rpx {
36
- right: #{$s}rpx;
37
- }
38
- .bottom-#{$s}rpx {
39
- bottom: #{$s}rpx;
40
- }
41
- .left-#{$s}rpx {
42
- left: #{$s}rpx;
43
- }
44
- }
45
- @for $i from 1 through 50 {
46
- $s: $i * 2;
47
- .-top-#{$s}px {
48
- top: -#{$s}px;
49
- }
50
- .-right-#{$s}px {
51
- right: -#{$s}px;
52
- }
53
- .-bottom-#{$s}px {
54
- bottom: -#{$s}px;
55
- }
56
- .-left-#{$s}px {
57
- left: -#{$s}px;
58
- }
59
- .-top-#{$s}rpx {
60
- top: -#{$s}rpx;
61
- }
62
- .-right-#{$s}rpx {
63
- right: -#{$s}rpx;
64
- }
65
- .-bottom-#{$s}rpx {
66
- bottom: -#{$s}rpx;
67
- }
68
- .-left-#{$s}rpx {
69
- left: -#{$s}rpx;
70
- }
71
- }
72
- @for $n from 0 through 10 {
73
- .z-#{$n} {
74
- z-index: $n;
75
- }
1
+ /* #ifdef H5 */
2
+ page {
3
+ /* #endif */
4
+ .relative {
5
+ position: relative;
6
+ }
7
+ .absolute {
8
+ position: absolute;
9
+ }
10
+ .fixed {
11
+ position: fixed;
12
+ }
13
+ .sticky {
14
+ position: sticky;
15
+ }
16
+ /* #ifdef H5 */
76
17
  }
18
+ /* #endif */
@@ -11,7 +11,9 @@ page {
11
11
  width: 100%;
12
12
  height: 100%;
13
13
  font-family: Microsoft YaHei;
14
- color: $uv-main-color;
14
+ color: $uv-main-color;
15
+ display: flex;
16
+ flex-direction: column;
15
17
  }
16
18
 
17
19
  view,
@@ -9,13 +9,4 @@
9
9
  text-overflow: ellipsis;
10
10
  lines: $n;
11
11
  }
12
- }
13
- @for $i from 8 through 11 {
14
- $s: $i * 2;
15
- .text-#{$i}px {
16
- font-size: #{$i}px;
17
- }
18
- .text-#{$s}rpx {
19
- font-size: #{$s}rpx;
20
- }
21
- }
12
+ }
@@ -1,17 +1,3 @@
1
- @each $size, $base, $zoom in
2
- (8px, 12px, 0.67),
3
- (9px, 12px, 0.75),
4
- (10px, 12px, 0.83),
5
- (11px, 12px, 0.92),
6
- (16rpx, 24rpx, 0.67),
7
- (18rpx, 24rpx, 0.75),
8
- (20rpx, 24rpx, 0.83),
9
- (22rpx, 24rpx, 0.92) {
10
- .text-#{$size} {
11
- font-size: $base;
12
- zoom: $zoom;
13
- }
14
- }
15
1
  .truncate {
16
2
  overflow: hidden;
17
3
  text-overflow: ellipsis;
@@ -27,44 +13,3 @@
27
13
  word-break: break-all;
28
14
  }
29
15
  }
30
- .break-normal {
31
- word-break: normal;
32
- white-space: normal;
33
- }
34
- .break-all {
35
- word-break: break-all;
36
- }
37
- .break-word {
38
- word-wrap: break-word;
39
- word-break: break-word;
40
- }
41
- .break-keep {
42
- word-break: keep-all;
43
- }
44
- .whitespace-normal {
45
- white-space: normal;
46
- }
47
- .whitespace-nowrap {
48
- white-space: nowrap;
49
- }
50
- .whitespace-pre {
51
- white-space: pre;
52
- }
53
- .whitespace-pre-line {
54
- white-space: pre-line;
55
- }
56
- .whitespace-pre-wrap {
57
- white-space: pre-wrap;
58
- }
59
- .align-baseline {
60
- vertical-align: baseline;
61
- }
62
- .align-top {
63
- vertical-align: top;
64
- }
65
- .align-middle {
66
- vertical-align: middle;
67
- }
68
- .align-bottom {
69
- vertical-align: bottom;
70
- }
@@ -1,12 +1,3 @@
1
- .text-transparent {
2
- color: transparent;
3
- }
4
- .text-white {
5
- color: #ffffff;
6
- }
7
- .text-black {
8
- color: #000000;
9
- }
10
1
  .text-primary {
11
2
  color: $uv-primary;
12
3
  }
@@ -84,39 +75,6 @@
84
75
  }
85
76
  .text-disabled {
86
77
  color: $uv-disabled-color;
87
- }
88
- @for $i from 6 through 50 {
89
- $s: $i * 2;
90
- .text-#{$s}px {
91
- font-size: #{$s}px;
92
- }
93
- .text-#{$s}rpx {
94
- font-size: #{$s}rpx;
95
- }
96
- }
97
- .text-left {
98
- text-align: left;
99
- }
100
- .text-center {
101
- text-align: center;
102
- }
103
- .text-right {
104
- text-align: right;
105
- }
106
- .text-ellipsis {
107
- text-overflow: ellipsis;
108
- }
109
- .text-clip {
110
- text-overflow: clip;
111
- }
112
- .underline {
113
- text-decoration: underline;
114
- }
115
- .line-through {
116
- text-decoration: line-through;
117
- }
118
- .no-underline {
119
- text-decoration: none;
120
- }
78
+ }
121
79
 
122
80
 
@@ -20,6 +20,7 @@
20
20
  infoDisabled: $uv-info-disabled;
21
21
  infoLight: $uv-info-light;
22
22
  bgColor: $uv-bg-color;
23
+ bgLightColor: $uv-bg-light-color;
23
24
  mainColor: $uv-main-color;
24
25
  contentColor: $uv-content-color;
25
26
  tipsColor: $uv-tips-color;
@@ -1,6 +1,5 @@
1
+ import { I18nOptions } from 'vue-i18n';
1
2
  export declare const defaultLocale: string;
2
3
  export declare const fallbackLocale = "zh-Hans";
3
- /**
4
- * nvue inject 未提供 t 时的回退;第二参数为命名占位 {n} 等
5
- */
6
- export declare function showLocale(key: any, values: any): any;
4
+ export declare function createI18n(opts: I18nOptions): import("vue-i18n").I18n<import("vue-i18n").LocaleMessages<import("vue-i18n").VueMessageType>, import("vue-i18n").IntlDateTimeFormats, import("vue-i18n").IntlNumberFormats, boolean>;
5
+ export declare function getLocaleMessage(key: string): string;
@@ -1,19 +1,10 @@
1
+ import { createI18n as _createI18n } from 'vue-i18n';
1
2
  export const defaultLocale = uni.getLocale();
2
3
  export const fallbackLocale = 'zh-Hans';
3
- function applyNamedPlaceholders(str, values) {
4
- if (!values || typeof str !== 'string') {
5
- return str;
6
- }
7
- let out = str;
8
- for (const k of Object.keys(values)) {
9
- out = out.split(`{${k}}`).join(String(values[k]));
10
- }
11
- return out;
4
+ export function createI18n(opts) {
5
+ const i18n = _createI18n(opts);
6
+ return (uni.$i18n = i18n);
12
7
  }
13
- /**
14
- * nvue 下 inject 未提供 t 时的回退;第二参数为命名占位 {n} 等
15
- */
16
- export function showLocale(key, values) {
17
- const raw = uni.$messages[uni.getLocale()]?.[key] || uni.$messages[fallbackLocale]?.[key] || key;
18
- return applyNamedPlaceholders(raw, values);
8
+ export function getLocaleMessage(key) {
9
+ return uni.$i18n?.global?.t(key) || key;
19
10
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@zfqh/uniapp",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "uniapp公共模块",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "MIT",
7
7
  "main": "lib/index.js",
8
8
  "types": "lib/index.d.ts",
9
- "homepage": "https://git.keeprisk.cn/zfqh/front-end/tree/master/packages/uniapp-zfqh",
9
+ "homepage": "https://git.keeprisk.cn/zfqh/front-end/tree/master/packages/zfqh-uniapp",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -45,5 +45,5 @@
45
45
  "@types/qs": "^6.9.16",
46
46
  "@types/url-parse": "^1.4.11"
47
47
  },
48
- "gitHead": "29f2e4284d8c7e3585410f8800f2b89a39a37cf1"
48
+ "gitHead": "51d155379d352d8507622d2ccb89a6442892b2b2"
49
49
  }
package/types/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  /// <reference path="./virtual.d.ts" />
2
2
 
3
3
  import type { Uni as UniTypes } from '@dcloudio/types';
4
+ import type { Store } from 'vuex';
5
+ import type { I18n } from 'vue-i18n';
4
6
  import color from '../lib/configs/color';
5
7
 
6
8
  declare global {
7
9
  interface Uni extends UniTypes {
8
- $store: any;
9
- $messages: any;
10
+ $store: Store;
11
+ $i18n: I18n;
10
12
  $uv: any;
11
13
  webView: any;
12
14
  showAppFromBackground: boolean;
@@ -1,3 +0,0 @@
1
- .transition-all-300 {
2
- transition: all 300ms;
3
- }
@@ -1,27 +0,0 @@
1
- .origin-center {
2
- transform-origin: center center;
3
- }
4
- .origin-top {
5
- transform-origin: top;
6
- }
7
- .origin-top-right {
8
- transform-origin: top right;
9
- }
10
- .origin-right {
11
- transform-origin: right;
12
- }
13
- .origin-bottom-right {
14
- transform-origin: bottom right;
15
- }
16
- .origin-bottom {
17
- transform-origin: bottom;
18
- }
19
- .origin-bottom-left {
20
- transform-origin: bottom left;
21
- }
22
- .origin-left {
23
- transform-origin: left;
24
- }
25
- .origin-top-left {
26
- transform-origin: top left;
27
- }
@@ -1,21 +0,0 @@
1
- .backdrop-blur-0 {
2
- backdrop-filter: blur(0);
3
- }
4
- .backdrop-blur-10px {
5
- backdrop-filter: blur(10px);
6
- }
7
- .backdrop-blur-10rpx {
8
- backdrop-filter: blur(10rpx);
9
- }
10
- .backdrop-blur-20px {
11
- backdrop-filter: blur(20px);
12
- }
13
- .backdrop-blur-20rpx {
14
- backdrop-filter: blur(20rpx);
15
- }
16
- .backdrop-blur-30px {
17
- backdrop-filter: blur(30px);
18
- }
19
- .backdrop-blur-30rpx {
20
- backdrop-filter: blur(30rpx);
21
- }
@@ -1,64 +0,0 @@
1
- .flex {
2
- flex-direction: row;
3
- align-items: center;
4
- }
5
- .flex-row {
6
- flex-direction: row;
7
- }
8
- .flex-row-reverse {
9
- flex-direction: row-reverse;
10
- }
11
- .flex-col {
12
- flex-direction: column;
13
- }
14
- .flex-col-reverse {
15
- flex-direction: column-reverse;
16
- }
17
- .flex-wrap {
18
- flex-wrap: wrap;
19
- }
20
- .flex-nowrap {
21
- flex-wrap: nowrap;
22
- }
23
- .flex-wrap-reverse {
24
- flex-wrap: wrap-reverse;
25
- }
26
- @for $n from 0 through 5 {
27
- .flex-#{$n} {
28
- flex: $n;
29
- }
30
- }
31
- .flex-none {
32
- flex: 0;
33
- }
34
- .items-start {
35
- align-items: flex-start;
36
- }
37
- .items-end {
38
- align-items: flex-end;
39
- }
40
- .items-center {
41
- align-items: center;
42
- }
43
- .items-stretch {
44
- align-items: stretch;
45
- }
46
- .items-baseline {
47
- align-items: flex-end;
48
- }
49
- .justify-start {
50
- justify-content: flex-start;
51
- }
52
- .justify-end {
53
- justify-content: flex-end;
54
- }
55
- .justify-center {
56
- justify-content: center;
57
- }
58
- .justify-between {
59
- justify-content: space-between;
60
- }
61
- .justify-around {
62
- justify-content: space-around;
63
- }
64
-
@@ -1,59 +0,0 @@
1
- .font-sans {
2
- font-family: system-ui, sans-serif;
3
- }
4
- .font-thin {
5
- font-weight: 100;
6
- }
7
- .font-extralight {
8
- font-weight: 200;
9
- }
10
- .font-light {
11
- font-weight: 300;
12
- }
13
- .font-normal {
14
- font-weight: 400;
15
- }
16
- .font-medium {
17
- font-weight: 500;
18
- }
19
- .font-semibold {
20
- font-weight: 600;
21
- }
22
- .font-bold {
23
- font-weight: 700;
24
- }
25
- .font-extrabold {
26
- font-weight: 800;
27
- }
28
- .font-black {
29
- font-weight: 900;
30
- }
31
- @each $w in (100, 200, 300, 400, 500, 600, 700, 800, 900) {
32
- .font-#{$w} {
33
- font-weight: $w;
34
- }
35
- }
36
- .italic {
37
- font-style: italic;
38
- }
39
- .not-italic {
40
- font-style: normal;
41
- }
42
- .leading-none {
43
- line-height: 1;
44
- }
45
- .leading-tight {
46
- line-height: 1.25;
47
- }
48
- .leading-snug {
49
- line-height: 1.375;
50
- }
51
- .leading-normal {
52
- line-height: 1.5;
53
- }
54
- .leading-relaxed {
55
- line-height: 1.625;
56
- }
57
- .leading-loose {
58
- line-height: 2;
59
- }
@@ -1,24 +0,0 @@
1
- .relative {
2
- position: relative;
3
- }
4
- .absolute {
5
- position: absolute;
6
- }
7
- .fixed {
8
- position: fixed;
9
- }
10
- .sticky {
11
- position: sticky;
12
- }
13
- .sticky-top {
14
- position: sticky;
15
- top: 0;
16
- z-index: 9;
17
- }
18
- .sticky-bottom {
19
- position: sticky;
20
- bottom: 0;
21
- z-index: 9;
22
- }
23
-
24
-
@@ -1,30 +0,0 @@
1
- page {
2
- .relative {
3
- position: relative;
4
- }
5
- .absolute {
6
- position: absolute;
7
- }
8
- .fixed {
9
- position: fixed;
10
- }
11
- .sticky {
12
- position: sticky;
13
- }
14
- .sticky-top {
15
- position: sticky;
16
- top: var(--window-top);
17
- z-index: 9;
18
- }
19
- .sticky-bottom {
20
- position: sticky;
21
- bottom: var(--window-bottom);
22
- z-index: 9;
23
- }
24
- }
25
- .overflow-auto {
26
- overflow: auto;
27
- }
28
- .overflow-scroll {
29
- overflow: scroll;
30
- }
@@ -1,10 +0,0 @@
1
- .opacity-0 {
2
- opacity: 0;
3
- }
4
- @for $i from 1 through 10 {
5
- $o: $i * 10;
6
- .opacity-#{$o} {
7
- opacity: $o * 0.01;
8
- }
9
- }
10
-
@@ -1,12 +0,0 @@
1
- .shadow {
2
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
3
- }
4
- .shadow-sm {
5
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
6
- }
7
- .shadow-md {
8
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
9
- }
10
- .shadow-lg {
11
- box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
12
- }
@@ -1,21 +0,0 @@
1
- .w-full {
2
- width: 100%;
3
- }
4
- .h-full {
5
- height: 100%;
6
- }
7
- @for $i from 1 through 10 {
8
- $s: $i * 10;
9
- .w-#{$s}vw {
10
- width: #{$s}vw;
11
- }
12
- .h-#{$s}vh {
13
- height: #{$s}vh;
14
- }
15
- }
16
- .box-border {
17
- box-sizing: border-box;
18
- }
19
- .box-content {
20
- box-sizing: content-box;
21
- }
@@ -1,21 +0,0 @@
1
- .w-0 {
2
- width: 0;
3
- }
4
- .h-0 {
5
- height: 0;
6
- }
7
- @for $i from 1 through 80 {
8
- $s: $i * 2;
9
- .w-#{$s}px {
10
- width: #{$s}px;
11
- }
12
- .h-#{$s}px {
13
- height: #{$s}px;
14
- }
15
- .w-#{$s}rpx {
16
- width: #{$s}rpx;
17
- }
18
- .h-#{$s}rpx {
19
- height: #{$s}rpx;
20
- }
21
- }