hy-app 0.6.9 → 0.7.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 (106) hide show
  1. package/attributes.json +1 -1
  2. package/components/hy-avatar/hy-avatar.vue +12 -5
  3. package/components/hy-avatar/props.ts +4 -2
  4. package/components/hy-avatar/typing.d.ts +8 -1
  5. package/components/hy-calendar/hy-calendar.vue +3 -2
  6. package/components/hy-calendar/month.vue +25 -5
  7. package/components/hy-calendar/props.ts +1 -1
  8. package/components/hy-calendar/typing.d.ts +9 -0
  9. package/components/hy-cascader/hy-cascader.vue +503 -0
  10. package/components/hy-cascader/index.scss +84 -0
  11. package/components/hy-cascader/props.ts +88 -0
  12. package/components/hy-cascader/typing.d.ts +34 -0
  13. package/components/hy-check-button/typing.d.ts +12 -7
  14. package/components/hy-code-input/hy-code-input.vue +33 -11
  15. package/components/hy-code-input/typing.d.ts +4 -0
  16. package/components/hy-config-provider/hy-config-provider.vue +58 -53
  17. package/components/hy-count-down/hy-count-down.vue +8 -8
  18. package/components/hy-count-down/typing.d.ts +16 -0
  19. package/components/hy-count-to/hy-count-to.vue +7 -7
  20. package/components/hy-count-to/typing.d.ts +24 -0
  21. package/components/hy-datetime-picker/props.ts +1 -1
  22. package/components/hy-datetime-picker/typing.d.ts +1 -1
  23. package/components/hy-dropdown/typing.d.ts +5 -0
  24. package/components/hy-dropdown-item/hy-dropdown-item.vue +1 -1
  25. package/components/hy-folding-panel/hy-folding-panel.vue +3 -3
  26. package/components/hy-folding-panel/typing.d.ts +23 -0
  27. package/components/hy-folding-panel-item/hy-folding-panel-item.vue +2 -2
  28. package/components/hy-folding-panel-item/typing.d.ts +21 -0
  29. package/components/hy-form/hy-form.vue +2 -2
  30. package/components/hy-form/typing.d.ts +37 -0
  31. package/components/hy-form-item/typing.d.ts +1 -1
  32. package/components/hy-grid/hy-grid.vue +12 -12
  33. package/components/hy-grid/index.scss +1 -2
  34. package/components/hy-grid/props.ts +7 -2
  35. package/components/hy-grid/typing.d.ts +1 -1
  36. package/components/hy-icon/typing.d.ts +52 -9
  37. package/components/hy-keyboard/constants.ts +83 -0
  38. package/components/hy-keyboard/hy-keyboard.vue +375 -0
  39. package/components/hy-keyboard/index.scss +73 -0
  40. package/components/hy-keyboard/key/index.scss +79 -0
  41. package/components/hy-keyboard/key/index.vue +91 -0
  42. package/components/hy-keyboard/key/types.ts +1 -0
  43. package/components/hy-keyboard/props.ts +108 -0
  44. package/components/hy-keyboard/typing.d.ts +18 -0
  45. package/components/hy-list/hy-list.vue +15 -13
  46. package/components/hy-list/props.ts +1 -1
  47. package/components/hy-modal/typing.d.ts +2 -2
  48. package/components/hy-notice-bar/hy-column-notice.vue +54 -94
  49. package/components/hy-notice-bar/hy-notice-bar.vue +128 -96
  50. package/components/hy-notice-bar/hy-row-notice.vue +89 -121
  51. package/components/hy-notice-bar/props.ts +86 -85
  52. package/components/hy-notify/hy-notify.vue +10 -10
  53. package/components/hy-notify/typing.d.ts +35 -0
  54. package/components/hy-number-step/hy-number-step.vue +370 -367
  55. package/components/hy-number-step/index.scss +1 -0
  56. package/components/hy-number-step/props.ts +1 -1
  57. package/components/hy-picker/hy-picker.vue +126 -149
  58. package/components/hy-picker/props.ts +4 -1
  59. package/components/hy-picker/typing.d.ts +22 -0
  60. package/components/hy-popover/hy-popover.vue +2 -2
  61. package/components/hy-popover/typing.d.ts +1 -1
  62. package/components/hy-popup/hy-popup.vue +1 -1
  63. package/components/hy-popup/index.scss +1 -0
  64. package/components/hy-price/hy-price.vue +52 -23
  65. package/components/hy-price/props.ts +54 -54
  66. package/components/hy-radio/props.ts +1 -1
  67. package/components/hy-radio/typing.d.ts +5 -1
  68. package/components/hy-rolling-num/typing.d.ts +1 -0
  69. package/components/hy-signature/hy-signature.vue +17 -17
  70. package/components/hy-signature/typing.d.ts +1 -1
  71. package/components/hy-skeleton/index.scss +17 -0
  72. package/components/hy-steps/hy-steps.vue +1 -1
  73. package/components/hy-submit-bar/typing.d.ts +3 -3
  74. package/components/hy-swipe-action/hy-swipe-action.vue +34 -15
  75. package/components/hy-swipe-action/index.scss +0 -1
  76. package/components/hy-switch/typing.d.ts +4 -0
  77. package/components/hy-tabbar/props.ts +2 -1
  78. package/components/hy-tabbar/typing.d.ts +5 -4
  79. package/components/hy-tabs/hy-tabs.vue +338 -336
  80. package/components/hy-tabs/index.scss +6 -6
  81. package/components/hy-tabs/typing.d.ts +41 -33
  82. package/components/hy-textarea/hy-textarea.vue +2 -2
  83. package/components/hy-textarea/typing.d.ts +4 -0
  84. package/components/hy-toast/hy-toast.vue +17 -9
  85. package/components/hy-toast/index.scss +1 -1
  86. package/components/hy-toast/typing.d.ts +56 -37
  87. package/components/hy-tooltip/hy-tooltip.vue +1 -1
  88. package/components/hy-tooltip/index.scss +1 -0
  89. package/components/hy-tooltip/props.ts +1 -1
  90. package/components/hy-upload/hy-upload.vue +16 -1
  91. package/components/hy-upload/index.scss +149 -144
  92. package/components/index.ts +6 -0
  93. package/global.d.ts +2 -0
  94. package/libs/api/http.ts +122 -119
  95. package/libs/config/icon.ts +442 -430
  96. package/libs/css/_function.scss +7 -13
  97. package/libs/css/iconfont.css +445 -441
  98. package/libs/css/theme.scss +3 -1
  99. package/libs/locale/lang/en-US.ts +4 -0
  100. package/libs/locale/lang/zh-CN.ts +4 -0
  101. package/libs/typing/index.ts +80 -0
  102. package/package.json +5 -2
  103. package/tags.json +1 -1
  104. package/web-types.json +1 -1
  105. package/components/hy-folding-panel/hy-folding-panel-group.vue +0 -163
  106. package/components/hy-qrcode/qrcode.js.bak +0 -1434
@@ -6,6 +6,7 @@ import HyBackTop from './hy-back-top/hy-back-top.vue'
6
6
  import HyBadge from './hy-badge/hy-badge.vue'
7
7
  import HyButton from './hy-button/hy-button.vue'
8
8
  import HyCard from './hy-card/hy-card.vue'
9
+ import HyCascader from './hy-cascader/hy-cascader.vue'
9
10
  import HyCell from './hy-cell/hy-cell.vue'
10
11
  import HyCheckButton from './hy-check-button/hy-check-button.vue'
11
12
  import HyCheckbox from './hy-checkbox/hy-checkbox.vue'
@@ -52,6 +53,7 @@ import HySubsection from './hy-subsection/hy-subsection.vue'
52
53
  import HySwiper from './hy-swiper/hy-swiper.vue'
53
54
  import HySwitch from './hy-switch/hy-switch.vue'
54
55
  import HyTabs from './hy-tabs/hy-tabs.vue'
56
+ import HyKeyboard from './hy-keyboard/hy-keyboard.vue'
55
57
  import HyTag from './hy-tag/hy-tag.vue'
56
58
  import HyTextarea from './hy-textarea/hy-textarea.vue'
57
59
  import HyTooltip from './hy-tooltip/hy-tooltip.vue'
@@ -68,6 +70,7 @@ const install = (Vue: any) => {
68
70
  Vue.component('HyBadge', HyBadge)
69
71
  Vue.component('HyButton', HyButton)
70
72
  Vue.component('HyCard', HyCard)
73
+ Vue.component('HyCascader', HyCascader)
71
74
  Vue.component('HyCell', HyCell)
72
75
  Vue.component('HyCheckButton', HyCheckButton)
73
76
  Vue.component('HyCheckbox', HyCheckbox)
@@ -113,6 +116,7 @@ const install = (Vue: any) => {
113
116
  Vue.component('HySwiper', HySwiper)
114
117
  Vue.component('HySwitch', HySwitch)
115
118
  Vue.component('HyTabs', HyTabs)
119
+ Vue.component('HyKeyboard', HyKeyboard)
116
120
  Vue.component('HyTag', HyTag)
117
121
  Vue.component('HyTextarea', HyTextarea)
118
122
  Vue.component('HyTooltip', HyTooltip)
@@ -129,6 +133,7 @@ export {
129
133
  HyBadge,
130
134
  HyButton,
131
135
  HyCard,
136
+ HyCascader,
132
137
  HyCell,
133
138
  HyCheckButton,
134
139
  HyCheckbox,
@@ -174,6 +179,7 @@ export {
174
179
  HySwiper,
175
180
  HySwitch,
176
181
  HyTabs,
182
+ HyKeyboard,
177
183
  HyTag,
178
184
  HyTextarea,
179
185
  HyTooltip,
package/global.d.ts CHANGED
@@ -9,6 +9,7 @@ declare module 'vue' {
9
9
  HyButton: (typeof import('./components/hy-button/hy-button.vue'))['default']
10
10
  HyCalendar: (typeof import('./components/hy-calendar/hy-calendar.vue'))['default']
11
11
  HyCard: (typeof import('./components/hy-card/hy-card.vue'))['default']
12
+ HyCascader: (typeof import('./components/hy-cascader/hy-cascader.vue'))['default']
12
13
  HyCell: (typeof import('./components/hy-cell/hy-cell.vue'))['default']
13
14
  HyCellItem: (typeof import('./components/hy-cell-item/hy-cell-item.vue'))['default']
14
15
  HyCheckButton: (typeof import('./components/hy-check-button/hy-check-button.vue'))['default']
@@ -38,6 +39,7 @@ declare module 'vue' {
38
39
  HyImage: (typeof import('./components/hy-image/hy-image.vue'))['default']
39
40
  HyIndexBar: (typeof import('./components/hy-index-bar/hy-index-bar.vue'))['default']
40
41
  HyInput: (typeof import('./components/hy-input/hy-input.vue'))['default']
42
+ HyKeyboard: (typeof import('./components/hy-keyboard/hy-keyboard.vue'))['default']
41
43
  HyLine: (typeof import('./components/hy-line/hy-line.vue'))['default']
42
44
  HyLineProgress: (typeof import('./components/hy-line-progress/hy-line-progress.vue'))['default']
43
45
  HyList: (typeof import('./components/hy-list/hy-list.vue'))['default']
package/libs/api/http.ts CHANGED
@@ -1,119 +1,122 @@
1
- import { objectToUrlParams } from '../../libs'
2
-
3
- export class Http {
4
- /**
5
- * 默认请求配置
6
- */
7
- config: HyHttps.HttpRequestConfig = {
8
- baseURL: '',
9
- url: '',
10
- data: {},
11
- dataType: 'json',
12
- header: {},
13
- method: 'POST',
14
- responseType: 'text',
15
- timeout: 10000
16
- }
17
-
18
- /* 私有回调槽 */
19
- private _requestHook?: (conf: UniNamespace.RequestOptions) => UniNamespace.RequestOptions
20
- private _responseSuccessHook?: (res: UniNamespace.RequestSuccessCallbackResult) => any
21
- private _responseFailHook?: (err: UniNamespace.GeneralCallbackResult) => any
22
-
23
- /**
24
- * @description 拦截器
25
- */
26
- interceptor = {
27
- /**
28
- * @description 请求拦截 请求配置
29
- * @param hook
30
- */
31
- request: (hook: (conf: UniNamespace.RequestOptions) => UniNamespace.RequestOptions) => {
32
- this._requestHook = hook
33
- },
34
- /**
35
- * @description 响应拦截
36
- * @param success 成功响应
37
- * @param fail 失败响应
38
- */
39
- response: (
40
- success?: (response: UniNamespace.RequestSuccessCallbackResult) => any,
41
- fail?: (error: UniNamespace.GeneralCallbackResult) => any
42
- ) => {
43
- if (success) {
44
- this._responseSuccessHook = success
45
- }
46
- if (fail) {
47
- this._responseFailHook = fail
48
- }
49
- }
50
- }
51
-
52
- /**
53
- * @description 请求拦截
54
- * @param conf 请求配置
55
- */
56
- private requestBefore(conf: UniNamespace.RequestOptions): UniNamespace.RequestOptions {
57
- return this._requestHook ? this._requestHook(conf) : conf
58
- }
59
-
60
- /**
61
- * @description uni异步请求
62
- * @param options 请求配置
63
- */
64
- async request<T = any>(options: UniNamespace.RequestOptions): Promise<T> {
65
- options.url = this.config.baseURL + options.url || this.config.url
66
- options.data = options.data || this.config.data
67
- options.header = options.header || this.config.header
68
- options.method = options.method || this.config.method
69
- options.responseType = options.responseType || this.config.responseType
70
- options.timeout = options.timeout || this.config.timeout
71
- /* 合并默认配置 ... */
72
- return new Promise((resolve, reject) => {
73
- options = this.requestBefore(options) // ⭐这里会调用钩子
74
- uni.request({
75
- ...options,
76
- success: (res: UniNamespace.RequestSuccessCallbackResult) => {
77
- const after = this._responseSuccessHook ? this._responseSuccessHook(res) : res
78
- resolve(after)
79
- },
80
- fail: (err: UniNamespace.GeneralCallbackResult) => {
81
- const after = this._responseFailHook ? this._responseFailHook(err) : err
82
- reject(after)
83
- }
84
- })
85
- })
86
- }
87
-
88
- /**
89
- * post请求
90
- * @param url 请求地址
91
- * @param params 请求JSON参数
92
- * @param options 请求配置
93
- */
94
- post<T = any>(url: string, params?: any, options?: HyHttps.HttpRequestConfig): Promise<T> {
95
- return this.request({
96
- url: url,
97
- method: 'POST',
98
- data: params,
99
- ...options
100
- })
101
- }
102
-
103
- /**
104
- * get请求
105
- * @param url 请求地址
106
- * @param params URL查询参数
107
- * @param options 请求配置
108
- */
109
- get<T = any>(url: string, params?: any, options?: HyHttps.HttpRequestConfig): Promise<T> {
110
- if (params) {
111
- url += '?' + objectToUrlParams(params)
112
- }
113
- return this.request({
114
- url: url,
115
- method: 'GET',
116
- ...options
117
- })
118
- }
119
- }
1
+ import { objectToUrlParams } from '../../libs'
2
+
3
+ export class Http {
4
+ /**
5
+ * 默认请求配置
6
+ */
7
+ config: HyHttps.HttpRequestConfig = {
8
+ baseURL: '',
9
+ url: '',
10
+ data: {},
11
+ dataType: 'json',
12
+ header: {},
13
+ method: 'POST',
14
+ responseType: 'text',
15
+ timeout: 10000
16
+ }
17
+
18
+ /* 私有回调槽 */
19
+ private _requestHook?: (conf: UniNamespace.RequestOptions) => UniNamespace.RequestOptions
20
+ private _responseSuccessHook?: (res: UniNamespace.RequestSuccessCallbackResult) => any
21
+ private _responseFailHook?: (err: UniNamespace.GeneralCallbackResult) => any
22
+
23
+ /**
24
+ * @description 拦截器
25
+ */
26
+ interceptor = {
27
+ /**
28
+ * @description 请求拦截 请求配置
29
+ * @param hook
30
+ */
31
+ request: (hook: (conf: UniNamespace.RequestOptions) => UniNamespace.RequestOptions) => {
32
+ this._requestHook = hook
33
+ },
34
+ /**
35
+ * @description 响应拦截
36
+ * @param success 成功响应
37
+ * @param fail 失败响应
38
+ */
39
+ response: (
40
+ success?: (response: UniNamespace.RequestSuccessCallbackResult) => any,
41
+ fail?: (error: UniNamespace.GeneralCallbackResult) => any
42
+ ) => {
43
+ if (success) {
44
+ this._responseSuccessHook = success
45
+ }
46
+ if (fail) {
47
+ this._responseFailHook = fail
48
+ }
49
+ }
50
+ }
51
+
52
+ /**
53
+ * @description 请求拦截
54
+ * @param conf 请求配置
55
+ */
56
+ private requestBefore(conf: UniNamespace.RequestOptions): UniNamespace.RequestOptions {
57
+ return this._requestHook ? this._requestHook(conf) : conf
58
+ }
59
+
60
+ /**
61
+ * @description uni异步请求
62
+ * @param options 请求配置
63
+ */
64
+ async request<T = any>(options: UniNamespace.RequestOptions): Promise<T> {
65
+ options.url =
66
+ options.url && /^https?:\/\//.test(options.url)
67
+ ? options.url
68
+ : this.config.baseURL + options.url
69
+ options.data = options.data || this.config.data
70
+ options.header = options.header || this.config.header
71
+ options.method = options.method || this.config.method
72
+ options.responseType = options.responseType || this.config.responseType
73
+ options.timeout = options.timeout || this.config.timeout
74
+ /* 合并默认配置 ... */
75
+ return new Promise((resolve, reject) => {
76
+ options = this.requestBefore(options) // ⭐这里会调用钩子
77
+ uni.request({
78
+ ...options,
79
+ success: (res: UniNamespace.RequestSuccessCallbackResult) => {
80
+ const after = this._responseSuccessHook ? this._responseSuccessHook(res) : res
81
+ resolve(after)
82
+ },
83
+ fail: (err: UniNamespace.GeneralCallbackResult) => {
84
+ const after = this._responseFailHook ? this._responseFailHook(err) : err
85
+ reject(after)
86
+ }
87
+ })
88
+ })
89
+ }
90
+
91
+ /**
92
+ * post请求
93
+ * @param url 请求地址
94
+ * @param params 请求JSON参数
95
+ * @param options 请求配置
96
+ */
97
+ post<T = any>(url: string, params?: any, options?: HyHttps.HttpRequestConfig): Promise<T> {
98
+ return this.request({
99
+ url: url,
100
+ method: 'POST',
101
+ data: params,
102
+ ...options
103
+ })
104
+ }
105
+
106
+ /**
107
+ * get请求
108
+ * @param url 请求地址
109
+ * @param params URL查询参数
110
+ * @param options 请求配置
111
+ */
112
+ get<T = any>(url: string, params?: any, options?: HyHttps.HttpRequestConfig): Promise<T> {
113
+ if (params) {
114
+ url += '?' + objectToUrlParams(params)
115
+ }
116
+ return this.request({
117
+ url: url,
118
+ method: 'GET',
119
+ ...options
120
+ })
121
+ }
122
+ }