@ajaxjs/ui 1.3.11 → 1.4.0

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 (52) hide show
  1. package/README.md +1 -30
  2. package/dist/ajaxjs-ui.cjs.js +1 -0
  3. package/dist/ajaxjs-ui.es.js +33 -0
  4. package/dist/ajaxjs-ui.umd.js +1 -0
  5. package/dist/types/index.d.ts +1 -0
  6. package/dist/utils.d.ts +18 -0
  7. package/package.json +54 -49
  8. package/.browserslistrc +0 -3
  9. package/.eslintrc.js +0 -26
  10. package/babel.config.js +0 -5
  11. package/deprecated/api-helper.zip +0 -0
  12. package/deprecated/api-helper2.zip +0 -0
  13. package/deprecated/api-selector.zip +0 -0
  14. package/deprecated/common-ui.zip +0 -0
  15. package/deprecated/data-source.zip +0 -0
  16. package/deprecated/table-selector.zip +0 -0
  17. package/deprecated/utils.js +0 -220
  18. package/dist/@ajaxjs/ui.common.js +0 -4321
  19. package/dist/@ajaxjs/ui.common.js.map +0 -1
  20. package/dist/@ajaxjs/ui.css +0 -1
  21. package/dist/@ajaxjs/ui.umd.js +0 -4332
  22. package/dist/@ajaxjs/ui.umd.js.map +0 -1
  23. package/dist/@ajaxjs/ui.umd.min.js +0 -2
  24. package/dist/@ajaxjs/ui.umd.min.js.map +0 -1
  25. package/dist/demo.html +0 -1
  26. package/examples/App.vue +0 -137
  27. package/public/favicon.ico +0 -0
  28. package/public/index.html +0 -17
  29. package/src/data-source/data-source.less +0 -46
  30. package/src/data-source/data-source.ts +0 -97
  31. package/src/data-source/data-source.vue +0 -59
  32. package/src/iam/iam.ts +0 -65
  33. package/src/iam/user.vue +0 -53
  34. package/src/index.js +0 -52
  35. package/src/iview-ext/fast-iview-table.ts +0 -133
  36. package/src/iview-ext/fast-iview-table.vue +0 -67
  37. package/src/iview-ext/list.ts +0 -108
  38. package/src/iview-ext/table-selector.vue +0 -185
  39. package/src/iview-ext/tips.vue +0 -17
  40. package/src/libs/api-helper.d.ts +0 -194
  41. package/src/libs/api-list.d.ts +0 -15
  42. package/src/libs/common.d.ts +0 -201
  43. package/src/libs/entity.ts +0 -31
  44. package/src/libs/iview-widgets.ts +0 -73
  45. package/src/main.ts +0 -7
  46. package/src/shims-tsx.d.ts +0 -11
  47. package/src/shims-vue.d.ts +0 -4
  48. package/src/style/common-functions.less +0 -286
  49. package/src/style/reset.less +0 -19
  50. package/src/style/reset2.less +0 -49
  51. package/tsconfig.json +0 -40
  52. package/vue.config.js +0 -14
@@ -1,201 +0,0 @@
1
- /**
2
- * 后端响应的消息
3
- */
4
- declare interface RepsonseResult {
5
- /**
6
- * 操作代码
7
- */
8
- code?: number;
9
-
10
- /**
11
- * 操作是否成功
12
- */
13
- status: boolean;
14
-
15
- /**
16
- * 操作说明
17
- */
18
- message: string;
19
-
20
- /**
21
- * 结果,实体,
22
- */
23
- data: any;
24
-
25
- /**
26
- * 进行新建的时候返回的实体 id
27
- */
28
- newlyId?: number;
29
-
30
- /**
31
- * 分页列表的总数
32
- */
33
- total?: number;
34
- }
35
-
36
- /**
37
- * JSON 接口返回的通用
38
- */
39
- type JsonResponse = {
40
- /**
41
- * 1 = 成功,0 = 失败
42
- */
43
- status: number;
44
-
45
- /**
46
- * 信息
47
- */
48
- message: string;
49
-
50
- /**
51
- * 分页的总数
52
- */
53
- total?: number;
54
-
55
- /**
56
- * 返回数据
57
- */
58
- data: any;
59
- };
60
-
61
- // 官方 API 还没提供,自己写一个
62
- interface FileReaderEventTarget extends EventTarget {
63
- result: string
64
- }
65
-
66
- interface FileReaderEvent extends Event {
67
- target: FileReaderEventTarget;
68
- getMessage(): string;
69
- }
70
-
71
- /**
72
- * JSON 实体
73
- */
74
- declare type JsonParam = { [key: string]: string | number | boolean | JsonParam | any[] };
75
-
76
- /**
77
- * key 和 value 都是 string 类型的 JSON 实体
78
- */
79
- declare type StringJsonParam = { [key: string]: string };
80
-
81
- /*
82
- * 公共类型
83
- */
84
-
85
- declare type ManagedWidget = {
86
- };
87
-
88
- /**
89
- * 按钮事件
90
- */
91
- declare type ButtonEvent = {
92
- /**
93
- * 按钮文本
94
- */
95
- name: string;
96
-
97
- /**
98
- * JS 事件代码
99
- */
100
- event: string;
101
- }
102
-
103
- /**
104
- * 数据绑定配置
105
- */
106
- declare type DataBinding = {
107
- /**
108
- * 请求方法
109
- */
110
- httpMethod?: string;
111
-
112
- /**
113
- * 请求地址
114
- */
115
- url: string,
116
-
117
- /**
118
- * 固定参数
119
- */
120
- baseParams: string,
121
-
122
- /**
123
- * 动态获取参数的函数
124
- */
125
- beforeRequest: string;
126
- };
127
-
128
- /**
129
- * 解析过后的请求对象
130
- */
131
- type ManagedRequest = {
132
- /**
133
- * 请求地址
134
- */
135
- url: string;
136
-
137
- /**
138
- * 请求参数
139
- */
140
- params: any;
141
- };
142
-
143
- /**
144
- * 模型与表单共有的字段
145
- */
146
- declare type BaseModel = {
147
- /**
148
- * 字段名、Key
149
- */
150
- name: string;
151
-
152
- /**
153
- * 名称,UI 外显名称
154
- */
155
- label: string;
156
-
157
- /**
158
- * 说明
159
- */
160
- comment?: string;
161
-
162
- /**
163
- * 是否必填
164
- */
165
- isNull?: boolean;
166
-
167
- /**
168
- * 数据长度/最大长度
169
- */
170
- length?: number;
171
-
172
- /**
173
- * 其他扩展属性
174
- */
175
- ext_attribs?: any;
176
- };
177
-
178
- /**
179
- * 模型
180
- */
181
- declare type Model = BaseModel & {
182
- /**
183
- * 数据类型
184
- */
185
- dataType?: string;
186
-
187
- /**
188
- * 是否主键
189
- */
190
- isKey?: boolean;
191
-
192
- /**
193
- *默认值
194
- */
195
- defaultValue?: string | number | boolean | null;
196
-
197
- /**
198
- * 是否跨表字段
199
- */
200
- isCrossTable?: boolean;
201
- };
@@ -1,31 +0,0 @@
1
- type Entity = {
2
- /**
3
- * 类型
4
- */
5
- type: string;
6
-
7
- /**
8
- * 数据长度
9
- */
10
- width: number;
11
-
12
- /**
13
- * 是否允许为空
14
- */
15
- isNotNull: boolean;
16
-
17
- /**
18
- * 默认值
19
- */
20
- defaultValue: any;
21
-
22
- /**
23
- * 校验规则
24
- */
25
- regexp: RegExp;
26
-
27
- /**
28
- * 注释说明
29
- */
30
- comment: string;
31
- };
@@ -1,73 +0,0 @@
1
- // iView 组件的配置定义
2
-
3
- // cfg: any;
4
-
5
- /**
6
- * iView Table 配置字段, data 字段
7
- */
8
- type TableListConfig = {
9
- /**
10
- * 列定义
11
- */
12
- columns: any[];
13
-
14
- /**
15
- * 表格数据
16
- */
17
- data: any[];
18
-
19
- /**
20
- * 记录总数
21
- */
22
- total: number;
23
-
24
- /**
25
- * MySQL 分页方式 start
26
- */
27
- start?: number;
28
-
29
- /**
30
- * MySQL 分页方式 limit
31
- */
32
- limit?: number;
33
-
34
- /**
35
- * 页码,表示第几页
36
- */
37
- pageNo?: number;
38
-
39
- /**
40
- * 每页记录数,等同于 MySQL 分页方式 limit
41
- */
42
- pageSize?: number;
43
-
44
- /**
45
- * 表格处于加载中状态
46
- */
47
- loading?: boolean;
48
- };
49
-
50
- /**
51
- * iView Table 配置方法
52
- */
53
- type TableListMethod = {
54
- /**
55
- * 异步加载列表数据
56
- */
57
- getData(): void;
58
-
59
- /**
60
- * 打开详情 UI
61
- *
62
- * @param id
63
- */
64
- openInfo?(id: number): void;
65
-
66
- /**
67
- * 删除
68
- *
69
- * @param id
70
- * @param index 行号
71
- */
72
- deleteInfo?(id: number, index: number): void;
73
- };
package/src/main.ts DELETED
@@ -1,7 +0,0 @@
1
- import Vue from 'vue';
2
- import App from '../examples/App.vue';
3
- import 'view-design/dist/styles/iview.css';
4
-
5
- Vue.config.productionTip = false;
6
-
7
- new Vue({ render: h => h(App) }).$mount('#app');
@@ -1,11 +0,0 @@
1
- import Vue, { VNode } from 'vue'
2
-
3
- declare global {
4
- namespace JSX {
5
- interface Element extends VNode {}
6
- interface ElementClass extends Vue {}
7
- interface IntrinsicElements {
8
- [elem: string]: any
9
- }
10
- }
11
- }
@@ -1,4 +0,0 @@
1
- declare module '*.vue' {
2
- import Vue from 'vue'
3
- export default Vue
4
- }
@@ -1,286 +0,0 @@
1
- :root {
2
- --admin-main-color: #1e6bb8;
3
- }
4
-
5
- .aj-center-title () {
6
- text-align : center;
7
- font-size : 1.3rem;
8
- font-weight : bold;
9
- letter-spacing: 5px;
10
- padding : 20px 0;
11
- }
12
-
13
- .aj-text-function() {
14
- color : #333;
15
- line-height : 160%;
16
- margin : 15px 0;
17
- font-size : .95rem;
18
- letter-spacing: 1px;
19
- text-align : justify;
20
- }
21
-
22
- .centerBody (@defaultWidth: 1300px) {
23
- max-width: @defaultWidth;
24
- margin : 0 auto;
25
- width : 100%;
26
- height : 100%;
27
- }
28
-
29
- .transition (@t) {
30
- -webkit-transition: @t;
31
- -moz-transition : @t;
32
- -ms-transition : @t;
33
- -o-transition : @t;
34
- transition : @t;
35
- }
36
-
37
- .transition_withTransform (@t) {
38
- -webkit-transition: -webkit-transform @t;
39
- -moz-transition : -moz-transform @t;
40
- -ms-transition : -moz-transform @t;
41
- -o-transition : -o-transform @t;
42
- transition : transform @t;
43
- }
44
-
45
- .transform (@t) {
46
- -webkit-transform: @t;
47
- -moz-transform : @t;
48
- -ms-transform : @t;
49
- -o-transform : @t;
50
- -transform : @t;
51
- }
52
-
53
- .heightFx () {
54
- .transition (300ms height ease-out);
55
- }
56
-
57
- .widthFx () {
58
- .transition (200ms width ease-out);
59
- }
60
-
61
- .leftFx () {
62
- .transition (200ms left linear);
63
- }
64
-
65
- // 解决使用CSS动画时闪烁的问题
66
- // http://ued.taobao.com/blog/2012/01/chrome%E6%B8%B2%E6%9F%93transition%E6%97%B6%E9%A1%B5%E9%9D%A2%E9%97%AA%E5%8A%A8bug/
67
- .fixTransitionFlash () {
68
- backface-visibility : hidden;
69
- -webkit-backface-visibility: hidden;
70
- -moz-backface-visibility : hidden;
71
- }
72
-
73
- // 解决高度塌陷的问题 – 清除浮动 或叫 闭合浮动
74
- // http://www.iyunlu.com/view/css-xhtml/55.html
75
- // http://www.zhangxinxu.com/wordpress/2010/01/css-float%E6%B5%AE%E5%8A%A8%E7%9A%84%E6%B7%B1%E5%85%A5%E7%A0%94%E7%A9%B6%E3%80%81%E8%AF%A6%E8%A7%A3%E5%8F%8A%E6%8B%93%E5%B1%95%E4%BA%8C/
76
- // 强制换行
77
- .forceBreak () {
78
- word-wrap : break-word;
79
- word-break: break-all;
80
- }
81
-
82
- .giveHeight () {
83
- overflow: hidden;
84
- zoom : 1;
85
- }
86
-
87
- // 透明度
88
- .imgOpacityShow (@time: 300ms) {
89
- .transition (opacity @time ease-in);
90
- }
91
-
92
- // 旋转角度
93
- .rotate (@ro: 30deg) {
94
- .transform (rotate(@ro));
95
- }
96
-
97
- // 渐变
98
- .gradient (@direction , @startColor , @endColor) {
99
- background-image: -webkit-linear-gradient(@direction, @startColor, @endColor);
100
- background-image: -moz-linear-gradient(@direction, @startColor, @endColor);
101
- background-image: -ms-linear-gradient(@direction, @startColor, @endColor);
102
- background-image: -o-linear-gradient(@direction, @startColor, @endColor);
103
- background-image: linear-gradient(@direction, @startColor, @endColor);
104
- }
105
-
106
- // 渐变
107
- .gradient (@direction , @startColor , @midColor , @endColor) {
108
- background-image: -webkit-linear-gradient(@direction, @startColor, @midColor, @endColor);
109
- background-image: -moz-linear-gradient(@direction, @startColor, @midColor, @endColor);
110
- background-image: -ms-linear-gradient(@direction, @startColor, @midColor, @endColor);
111
- background-image: -o-linear-gradient(@direction, @startColor, @midColor, @endColor);
112
- background-image: linear-gradient(@direction, @startColor, @midColor, @endColor);
113
- }
114
-
115
- .fadeIn (@duration) {
116
- animation : fade-in;
117
- animation-duration: @duration;
118
- -webkit-animation : fade-in @duration;
119
- }
120
-
121
- .fadeOut (@duration) {
122
- animation : fade-out-hide;
123
- animation-duration: @duration;
124
- -webkit-animation : fade-out-hide @duration;
125
- }
126
- .aj-text-title {
127
- letter-spacing: 2px;
128
- margin: 10px;
129
- }
130
-
131
- // 快速制作1px 表格边框,为需要设置的 table 元素加上 border 的class即可
132
- .aj-table {
133
- border : 1px lightgray solid;
134
- border-collapse: collapse;
135
- border-spacing : 0;
136
-
137
- th {
138
- background-color: #efefef;
139
- letter-spacing : 3px;
140
- }
141
-
142
- td,
143
- th {
144
- border : 1px lightgray solid;
145
- line-height: 160%;
146
- height : 120%;
147
- padding : 6px;
148
- }
149
-
150
- tr {
151
- .transition (background-color 400ms ease-out);
152
-
153
- &:nth-child(odd) {
154
- background: #f5f5f5;
155
- box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
156
- }
157
-
158
- &:hover {
159
- background-color: #fbf8e9;
160
- }
161
- }
162
-
163
- }
164
-
165
- .aj-form-table {
166
- border-collapse: collapse;
167
- border-spacing : 0;
168
-
169
- th {
170
- background-color: #efefef;
171
- letter-spacing : 3px;
172
- }
173
-
174
- td,
175
- th {
176
- line-height: 160%;
177
- height : 120%;
178
- padding : 10px 15px;
179
- }
180
-
181
- tr {
182
- .transition (background-color 400ms ease-out);
183
-
184
- &:nth-child(odd) {
185
- background: #f5f5f5;
186
- box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
187
- }
188
-
189
- &:hover {
190
- background-color: #fbf8e9;
191
- }
192
- }
193
- }
194
-
195
- .aj-btn-base() {
196
- min-height : 26px;
197
- font-size : .8rem;
198
- //line-height: 100%;
199
- padding : .3em 2.3em;
200
- margin : 10px auto;
201
- color : #333;
202
- letter-spacing : .3em;
203
- border-radius : 4px;
204
- border : 1px solid #ccc;
205
- border-bottom-color: #B4B4B4;
206
- box-shadow : 0 1px 3px rgba(0, 0, 0, 0.12);
207
- text-shadow : 0 1px 0 rgba(255, 255, 255, 0.8);
208
- background-color : lightgray;
209
- background-repeat : repeat-x;
210
- transition : background-image 0.5s linear 1s;
211
- cursor : pointer;
212
- outline : 0;
213
- .gradient (to bottom, rgba(255, 255, 255, 1) 0%, rgba(239, 239, 239, 1) 60%, rgba(225, 223, 226, 1) 100%);
214
-
215
- img {
216
- vertical-align: middle;
217
- }
218
-
219
- &:hover {
220
- color : black;
221
- border-color: lighten(black, 65%);
222
- }
223
-
224
- &:active {
225
- box-shadow : inset 0 3px 5px rgba(0, 0, 0, .2);
226
- border-color: lighten(black, 55%);
227
- }
228
-
229
- &:focus {
230
- border-color: lighten(black, 60%);
231
- }
232
-
233
- &:hover {
234
- background-position: 0px -10px;
235
- }
236
- }
237
-
238
- .aj-btnsHolder {
239
- text-align: center;
240
- padding : 2% 0;
241
-
242
- button {
243
- margin-right: 3% !important;
244
- }
245
- }
246
-
247
- .aj-input-base() {
248
- min-height : 25px;
249
- font-size : .9rem;
250
- border : 1px solid #abadb3;
251
- // border-radius : 3px;
252
- box-sizing : border-box;
253
- background-color: white;
254
- transition : border-color ease-in-out 200ms;
255
- outline : 0;
256
- padding : 2px;
257
- vertical-align : middle;
258
- color : #333;
259
- // letter-spacing : 1px;
260
-
261
- &:hover,
262
- &:focus {
263
- // box-shadow : 1px 2px 3px #e5e5e5 inset;
264
- border-color: lighten(black, 45);
265
- }
266
- }
267
-
268
- form.aj-form {
269
- input[type=text], .form input[type=password], .form textarea{
270
- .aj-input-base();
271
- }
272
- button {
273
- .aj-btn-base();
274
- }
275
-
276
- select {
277
- color: gray;
278
- height: 25px;
279
- border: 1px solid gray;
280
- }
281
-
282
- select:hover {
283
- border-color: black;
284
- }
285
-
286
- }
@@ -1,19 +0,0 @@
1
- /* AJAXJS Base CSS */
2
- body,dl,dt,dd,ul,li,pre,form,fieldset,input,p,blockquote,th,td,h1,h2,h3,h4,h5{margin:0;padding:0;}
3
- h1,h2,h3,h4,h5{font-weight: normal;}img{border:0;}ul li{list-style-type:none}.hide{display:none}
4
- body {-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing: grayscale;
5
- font-family: "Lantinghei SC", "Open Sans", Arial, "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "STHeiti", "WenQuanYi Micro Hei", SimSun, sans-serif;}
6
-
7
- /* a{text-decoration:none;color:#666;transition:color .4s ease-in-out;}
8
- a:hover{color:#000;}
9
- button{border:none;outline:0;cursor:pointer;letter-spacing:2px;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}
10
- input[type=password],input[type=text],select,textarea{outline:0;-moz-appearance:none;} */
11
-
12
- /* 手机端浏览器所显示的网页 CSS */
13
- @media screen and (max-width:480px) {
14
- * {
15
- -webkit-tap-highlight-color: transparent; /* 很多 Android 浏览器的 a 链接有边框,这里取消它 */
16
- -webkit-touch-callout: none; /* 在 iOS 浏览器里面,假如用户长按 a 标签,都会出现默认的弹出菜单事件 */
17
- /* -webkit-user-select:none; */
18
- }
19
- }
@@ -1,49 +0,0 @@
1
- /* AJAXJS Base CSS */
2
- body,dl,dt,dd,ul,li,pre,form,fieldset,input,p,blockquote,th,td,h1,h2,h3,h4,h5{margin:0;padding:0;}
3
- h1,h2,h3,h4,h5{font-weight: normal;}img{border:0;}ul li{list-style-type:none}.hide{display:none}
4
- body {-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing: grayscale;
5
- font-family: "Lantinghei SC", "Open Sans", Arial, "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "STHeiti", "WenQuanYi Micro Hei", SimSun, sans-serif;}
6
-
7
- /* a{text-decoration:none;color:#666;transition:color .4s ease-in-out;}
8
- a:hover{color:#000;}
9
- button{border:none;outline:0;cursor:pointer;letter-spacing:2px;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}
10
- input[type=password],input[type=text],select,textarea{outline:0;-moz-appearance:none;} */
11
-
12
- /* 手机端浏览器所显示的网页 CSS */
13
- @media screen and (max-width:480px) {
14
- * {
15
- -webkit-tap-highlight-color: transparent; /* 很多 Android 浏览器的 a 链接有边框,这里取消它 */
16
- -webkit-touch-callout: none; /* 在 iOS 浏览器里面,假如用户长按 a 标签,都会出现默认的弹出菜单事件 */
17
- /* -webkit-user-select:none; */
18
- }
19
- }
20
-
21
- ::-webkit-scrollbar {
22
- width: 8px;
23
- height: 8px;
24
- }
25
-
26
- ::-webkit-scrollbar-track {
27
- background-color: #fff;
28
- border-radius: 10px;
29
- }
30
-
31
- ::-webkit-scrollbar-thumb {
32
- background-color: lightgray;
33
- border-radius: 10px;
34
- }
35
-
36
- /* 修改 firefox 滚动条的样式 */
37
- * {
38
- /* 宽度 */
39
- scrollbar-width: thin;
40
- /* "auto" 或 "thin" 或 "none" */
41
- /* 轨道颜色 */
42
- scrollbar-track-color: #f1f1f1;
43
- /* 滑块颜色 */
44
- scrollbar-thumb-color: #888;
45
- /* 滑块圆角 */
46
- scrollbar-thumb-border-radius: 10px;
47
- /* 滑块悬停时的样式 */
48
- scrollbar-thumb-hover-color: #555;
49
- }