tianheng-ui 0.1.10 → 0.1.12
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/lib/theme-chalk/styles/reset.scss +0 -2
- package/lib/tianheng-ui.js +13 -14
- package/package.json +1 -1
- package/packages/FormMaking/GenerateForm.vue +16 -11
- package/packages/FormMaking/GenerateFormItem.vue +73 -581
- package/packages/FormMaking/GenerateFormItemH5.vue +6 -6
- package/packages/FormMaking/Upload/index.vue +0 -1
- package/packages/FormMaking/WidgetConfig.vue +100 -77
- package/packages/FormMaking/WidgetForm.vue +7 -48
- package/packages/FormMaking/WidgetFormItem.vue +41 -65
- package/packages/FormMaking/WidgetSelect.vue +160 -0
- package/packages/FormMaking/WidgetTools.vue +538 -0
- package/packages/FormMaking/config/index.js +6 -0
- package/packages/FormMaking/custom/config.js +119 -87
- package/packages/FormMaking/custom/configs/button.vue +24 -25
- package/packages/FormMaking/custom/configs/cascader.vue +7 -7
- package/packages/FormMaking/custom/configs/checkbox.vue +23 -22
- package/packages/FormMaking/custom/configs/color.vue +3 -3
- package/packages/FormMaking/custom/configs/date.vue +3 -3
- package/packages/FormMaking/custom/configs/grid.vue +4 -4
- package/packages/FormMaking/custom/configs/input.vue +138 -31
- package/packages/FormMaking/custom/configs/number.vue +5 -5
- package/packages/FormMaking/custom/configs/radio.vue +23 -19
- package/packages/FormMaking/custom/configs/rate.vue +3 -3
- package/packages/FormMaking/custom/configs/select.vue +25 -20
- package/packages/FormMaking/custom/configs/slider.vue +3 -3
- package/packages/FormMaking/custom/configs/switch.vue +3 -3
- package/packages/FormMaking/custom/configs/table.vue +2 -2
- package/packages/FormMaking/custom/configs/{table_h5.vue → tableH5.vue} +2 -2
- package/packages/FormMaking/custom/configs/tabs.vue +18 -23
- package/packages/FormMaking/custom/configs/textarea.vue +124 -22
- package/packages/FormMaking/custom/configs/time.vue +3 -3
- package/packages/FormMaking/custom/configs/upload.vue +5 -5
- package/packages/FormMaking/custom/index.js +2 -4
- package/packages/FormMaking/custom/items/alliance.vue +30 -29
- package/packages/FormMaking/custom/items/blank_pro.vue +14 -0
- package/packages/FormMaking/custom/items/button.vue +36 -1
- package/packages/FormMaking/custom/items/cascader.vue +6 -2
- package/packages/FormMaking/custom/items/cell.vue +0 -2
- package/packages/FormMaking/custom/items/checkbox.vue +18 -8
- package/packages/FormMaking/custom/items/color.vue +1 -1
- package/packages/FormMaking/custom/items/date.vue +1 -1
- package/packages/FormMaking/custom/items/editor.vue +1 -1
- package/packages/FormMaking/custom/items/{grid.vue → grid_dev.vue} +16 -47
- package/packages/FormMaking/custom/items/grid_pro.vue +45 -0
- package/packages/FormMaking/custom/items/image.vue +0 -28
- package/packages/FormMaking/custom/items/input.vue +15 -9
- package/packages/FormMaking/custom/items/number.vue +4 -4
- package/packages/FormMaking/custom/items/radio.vue +17 -7
- package/packages/FormMaking/custom/items/rate.vue +1 -1
- package/packages/FormMaking/custom/items/select.vue +12 -6
- package/packages/FormMaking/custom/items/slider.vue +1 -1
- package/packages/FormMaking/custom/items/switch.vue +1 -1
- package/packages/FormMaking/custom/items/{table_h5.vue → tableH5_dev.vue} +44 -49
- package/packages/FormMaking/custom/items/tableH5_pro.vue +113 -0
- package/packages/FormMaking/custom/items/{table.vue → table_dev.vue} +21 -41
- package/packages/FormMaking/custom/items/table_pro.vue +114 -0
- package/packages/FormMaking/custom/items/tabs_dev.vue +101 -0
- package/packages/FormMaking/custom/items/tabs_pro.vue +50 -0
- package/packages/FormMaking/custom/items/text.vue +1 -1
- package/packages/FormMaking/custom/items/textarea.vue +4 -13
- package/packages/FormMaking/custom/items/time.vue +3 -3
- package/packages/FormMaking/custom/items/upload.vue +15 -14
- package/packages/FormMaking/custom/mixins/index.js +28 -6
- package/packages/FormMaking/custom/register.js +22 -11
- package/packages/FormMaking/index.vue +95 -468
- package/packages/FormMaking/styles/index.scss +235 -242
- package/packages/FormMaking/util/generateCode.js +3 -3
- package/packages/FormMaking/util/index.js +33 -23
- package/packages/FormMaking/util/request.js +9 -12
- package/packages/FormMaking/custom/items/tabs.vue +0 -145
- /package/packages/FormMaking/custom/items/{blank.vue → blank_dev.vue} +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
$primary-color: #409eff;
|
2
2
|
$primary-background-color: #ecf5ff;
|
3
3
|
|
4
|
-
.
|
4
|
+
.formMaking {
|
5
5
|
height: 100%;
|
6
6
|
|
7
7
|
*,
|
@@ -32,7 +32,7 @@ $primary-background-color: #ecf5ff;
|
|
32
32
|
vertical-align: middle;
|
33
33
|
}
|
34
34
|
|
35
|
-
.
|
35
|
+
.isHideFormLabel {
|
36
36
|
.el-form-item__label {
|
37
37
|
display: none;
|
38
38
|
}
|
@@ -100,32 +100,11 @@ $primary-background-color: #ecf5ff;
|
|
100
100
|
border-left: 1px solid #e0e0e0;
|
101
101
|
border-right: 1px solid #e0e0e0;
|
102
102
|
|
103
|
-
.el-header {
|
104
|
-
display: flex;
|
105
|
-
align-items: center;
|
106
|
-
height: 45px !important;
|
107
|
-
line-height: 45px !important;
|
108
|
-
// font-size: 18px;
|
109
|
-
border-bottom: solid 2px #e4e7ed;
|
110
|
-
text-align: right;
|
111
|
-
}
|
112
|
-
|
113
103
|
.el-main {
|
114
104
|
padding: 0;
|
115
105
|
position: relative;
|
116
106
|
background: #fafafa;
|
117
107
|
}
|
118
|
-
|
119
|
-
.client {
|
120
|
-
flex: 1;
|
121
|
-
text-align: left;
|
122
|
-
.el-button {
|
123
|
-
color: #333;
|
124
|
-
}
|
125
|
-
.active {
|
126
|
-
color: #409eff;
|
127
|
-
}
|
128
|
-
}
|
129
108
|
}
|
130
109
|
|
131
110
|
// 左侧字段区
|
@@ -160,17 +139,24 @@ $primary-background-color: #ecf5ff;
|
|
160
139
|
margin: 1%;
|
161
140
|
color: #333;
|
162
141
|
border: 1px solid #f4f6fc;
|
142
|
+
transition: 0.25s;
|
163
143
|
|
164
144
|
&:hover {
|
165
|
-
color: $primary-color;
|
145
|
+
color: $primary-color !important;
|
166
146
|
border: 1px dashed $primary-color;
|
147
|
+
|
148
|
+
a {
|
149
|
+
color: $primary-color !important;
|
150
|
+
}
|
167
151
|
}
|
168
152
|
|
169
153
|
& > a {
|
154
|
+
color: #333;
|
170
155
|
display: block;
|
171
156
|
cursor: move;
|
172
157
|
background: #f4f6fc;
|
173
158
|
border: 1px solid #f4f6fc;
|
159
|
+
transition: 0.25s;
|
174
160
|
|
175
161
|
.icon {
|
176
162
|
margin-right: 6px;
|
@@ -209,12 +195,18 @@ $primary-background-color: #ecf5ff;
|
|
209
195
|
}
|
210
196
|
}
|
211
197
|
|
212
|
-
.
|
213
|
-
|
198
|
+
.draggable {
|
199
|
+
height: 100%;
|
200
|
+
}
|
201
|
+
.draggable-list {
|
214
202
|
min-height: 100%;
|
215
203
|
background: #fff;
|
216
204
|
border: 1px dashed #999;
|
217
205
|
|
206
|
+
.widget-form-list-item {
|
207
|
+
position: relative;
|
208
|
+
}
|
209
|
+
|
218
210
|
.widget-col-list {
|
219
211
|
min-height: 50px;
|
220
212
|
border: 1px dashed #ccc;
|
@@ -260,7 +252,7 @@ $primary-background-color: #ecf5ff;
|
|
260
252
|
}
|
261
253
|
}
|
262
254
|
|
263
|
-
.
|
255
|
+
.widgetFormItem {
|
264
256
|
padding-bottom: 18px;
|
265
257
|
position: relative;
|
266
258
|
border: 1px dashed rgba(170, 170, 170, 0.7);
|
@@ -271,7 +263,7 @@ $primary-background-color: #ecf5ff;
|
|
271
263
|
position: unset;
|
272
264
|
}
|
273
265
|
|
274
|
-
&.
|
266
|
+
&.isRequired {
|
275
267
|
.el-form-item__label::before {
|
276
268
|
content: "*";
|
277
269
|
color: #f56c6c;
|
@@ -309,7 +301,7 @@ $primary-background-color: #ecf5ff;
|
|
309
301
|
}
|
310
302
|
}
|
311
303
|
|
312
|
-
.
|
304
|
+
.isLayout {
|
313
305
|
padding-bottom: 0;
|
314
306
|
padding: 5px;
|
315
307
|
margin-left: 2px !important;
|
@@ -333,10 +325,6 @@ $primary-background-color: #ecf5ff;
|
|
333
325
|
}
|
334
326
|
}
|
335
327
|
|
336
|
-
.el-col {
|
337
|
-
// min-height: 50px;
|
338
|
-
}
|
339
|
-
|
340
328
|
&.ghost {
|
341
329
|
background: #f56c6c;
|
342
330
|
border: 2px solid #f56c6c;
|
@@ -354,215 +342,215 @@ $primary-background-color: #ecf5ff;
|
|
354
342
|
}
|
355
343
|
}
|
356
344
|
|
357
|
-
.widget-table {
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
}
|
345
|
+
// .widget-table {
|
346
|
+
// padding-bottom: 0;
|
347
|
+
// padding: 5px;
|
348
|
+
// background-color: rgba(253, 246, 236, 0.3);
|
349
|
+
|
350
|
+
// .widget-table-wrapper {
|
351
|
+
// min-height: 50px;
|
352
|
+
// background: #fff;
|
353
|
+
// display: flex;
|
354
|
+
// justify-content: flex-start;
|
355
|
+
|
356
|
+
// .widget-table-row {
|
357
|
+
// td {
|
358
|
+
// border-bottom: 0;
|
359
|
+
// }
|
360
|
+
// }
|
361
|
+
|
362
|
+
// .widget-table-left {
|
363
|
+
// width: 51px;
|
364
|
+
// border-left: 1px solid #ebeef5;
|
365
|
+
// border-right: 1px solid #ebeef5;
|
366
|
+
// border-top: 1px solid #ebeef5;
|
367
|
+
// flex: none;
|
368
|
+
// }
|
369
|
+
|
370
|
+
// .widget-table-view {
|
371
|
+
// border: 1px solid #ebeef5;
|
372
|
+
// width: 200px;
|
373
|
+
// float: left;
|
374
|
+
// height: 100%;
|
375
|
+
// position: relative;
|
376
|
+
// display: block;
|
377
|
+
|
378
|
+
// .el-table {
|
379
|
+
// height: 100%;
|
380
|
+
// }
|
381
|
+
|
382
|
+
// &.is_req {
|
383
|
+
// .el-form-item__label::before {
|
384
|
+
// content: "*";
|
385
|
+
// color: #f56c6c;
|
386
|
+
// margin-right: 4px;
|
387
|
+
// }
|
388
|
+
// }
|
389
|
+
|
390
|
+
// &::after {
|
391
|
+
// position: absolute;
|
392
|
+
// left: 0;
|
393
|
+
// right: 0;
|
394
|
+
// top: 0;
|
395
|
+
// bottom: 0;
|
396
|
+
// display: block;
|
397
|
+
// content: "";
|
398
|
+
// }
|
399
|
+
|
400
|
+
// &::before {
|
401
|
+
// display: none;
|
402
|
+
// }
|
403
|
+
|
404
|
+
// &:hover {
|
405
|
+
// background: $primary-background-color;
|
406
|
+
// outline: 1px solid $primary-color;
|
407
|
+
// outline-offset: -1px;
|
408
|
+
|
409
|
+
// &.active {
|
410
|
+
// // outline: 1px solid $primary-color;
|
411
|
+
// border: 1px solid $primary-color;
|
412
|
+
// outline: 1px solid $primary-color;
|
413
|
+
// outline-offset: -1px;
|
414
|
+
// }
|
415
|
+
|
416
|
+
// .widget-view-drag {
|
417
|
+
// display: block;
|
418
|
+
// }
|
419
|
+
// }
|
420
|
+
|
421
|
+
// &.active {
|
422
|
+
// outline: 1px solid $primary-color;
|
423
|
+
// border: 1px solid $primary-color;
|
424
|
+
// outline-offset: -1px;
|
425
|
+
// }
|
426
|
+
|
427
|
+
// &.ghost {
|
428
|
+
// background: #f56c6c;
|
429
|
+
// outline-width: 0;
|
430
|
+
// width: 5px !important;
|
431
|
+
// box-sizing: border-box;
|
432
|
+
// font-size: 0;
|
433
|
+
// content: "";
|
434
|
+
// overflow: hidden;
|
435
|
+
// padding: 0;
|
436
|
+
// position: relative;
|
437
|
+
// outline: none !important;
|
438
|
+
// border: 0 !important;
|
439
|
+
|
440
|
+
// &::after {
|
441
|
+
// background: #f56c6c;
|
442
|
+
// position: absolute;
|
443
|
+
// top: 0;
|
444
|
+
// left: 0;
|
445
|
+
// bottom: 0;
|
446
|
+
// right: 0;
|
447
|
+
// z-index: 9999;
|
448
|
+
// content: "";
|
449
|
+
// outline: none;
|
450
|
+
// }
|
451
|
+
// }
|
452
|
+
// }
|
453
|
+
|
454
|
+
// .widget-table-content {
|
455
|
+
// width: 100%;
|
456
|
+
// // border: 1px dashed #ccc;
|
457
|
+
// outline: 1px dashed #ccc;
|
458
|
+
// background: #fff;
|
459
|
+
// flex: 1;
|
460
|
+
// margin: 0 1px;
|
461
|
+
// overflow: auto;
|
462
|
+
|
463
|
+
// & > div {
|
464
|
+
// height: 100%;
|
465
|
+
// }
|
466
|
+
|
467
|
+
// .widget-table-col {
|
468
|
+
// height: 100%;
|
469
|
+
|
470
|
+
// .ghost {
|
471
|
+
// background: #f56c6c;
|
472
|
+
// // border: 2px solid #F56C6C;
|
473
|
+
// position: relative;
|
474
|
+
// content: "";
|
475
|
+
// float: left;
|
476
|
+
// height: 100%;
|
477
|
+
// width: 5px !important;
|
478
|
+
// list-style: none;
|
479
|
+
// font-size: 0;
|
480
|
+
// overflow: hidden;
|
481
|
+
// outline: none;
|
482
|
+
|
483
|
+
// &::after {
|
484
|
+
// background: #f56c6c;
|
485
|
+
// position: absolute;
|
486
|
+
// top: 0;
|
487
|
+
// left: 0;
|
488
|
+
// bottom: 0;
|
489
|
+
// right: 0;
|
490
|
+
// z-index: 9999;
|
491
|
+
// content: "";
|
492
|
+
// outline: none;
|
493
|
+
// }
|
494
|
+
// }
|
495
|
+
// }
|
496
|
+
// }
|
497
|
+
// }
|
498
|
+
|
499
|
+
// &.active {
|
500
|
+
// outline: 2px solid #e6a23c;
|
501
|
+
// border: 1px solid #e6a23c;
|
502
|
+
// }
|
503
|
+
|
504
|
+
// &:hover {
|
505
|
+
// background: #fdf6ec;
|
506
|
+
// outline: 1px solid #e6a23c;
|
507
|
+
// outline-offset: 0px;
|
508
|
+
|
509
|
+
// &.active {
|
510
|
+
// outline: 2px solid #e6a23c;
|
511
|
+
// border: 1px solid #e6a23c;
|
512
|
+
// outline-offset: 0;
|
513
|
+
// }
|
514
|
+
// }
|
515
|
+
|
516
|
+
// .widget-view-action.widget-col-action {
|
517
|
+
// background: #e6a23c;
|
518
|
+
// }
|
519
|
+
|
520
|
+
// .widget-view-drag.widget-col-drag {
|
521
|
+
// background: #e6a23c;
|
522
|
+
// }
|
523
|
+
|
524
|
+
// &::after {
|
525
|
+
// display: none;
|
526
|
+
// }
|
527
|
+
|
528
|
+
// &.ghost {
|
529
|
+
// background: #f56c6c;
|
530
|
+
// outline-width: 0;
|
531
|
+
// height: 5px;
|
532
|
+
// box-sizing: border-box;
|
533
|
+
// font-size: 0;
|
534
|
+
// content: "";
|
535
|
+
// overflow: hidden;
|
536
|
+
// padding: 0;
|
537
|
+
// position: relative;
|
538
|
+
// outline: none;
|
539
|
+
// border: 0;
|
540
|
+
|
541
|
+
// &::after {
|
542
|
+
// background: #f56c6c;
|
543
|
+
// position: absolute;
|
544
|
+
// top: 0;
|
545
|
+
// left: 0;
|
546
|
+
// right: 0;
|
547
|
+
// bottom: 0;
|
548
|
+
// content: "";
|
549
|
+
// display: block;
|
550
|
+
// z-index: 999;
|
551
|
+
// }
|
552
|
+
// }
|
553
|
+
// }
|
566
554
|
|
567
555
|
.ghost {
|
568
556
|
background: #f56c6c;
|
@@ -734,6 +722,11 @@ $primary-background-color: #ecf5ff;
|
|
734
722
|
.el-form-item__label {
|
735
723
|
width: 100%;
|
736
724
|
}
|
725
|
+
|
726
|
+
.flexView {
|
727
|
+
display: flex;
|
728
|
+
margin-bottom: 5px;
|
729
|
+
}
|
737
730
|
}
|
738
731
|
|
739
732
|
.widget-actions {
|
@@ -1,15 +1,15 @@
|
|
1
1
|
function findRemoteFunc(list, funcList, tokenFuncList, blankList) {
|
2
2
|
for (let i = 0; i < list.length; i++) {
|
3
3
|
if (list[i].type == "grid") {
|
4
|
-
list[i].columns.forEach(item => {
|
4
|
+
list[i].options.columns.forEach(item => {
|
5
5
|
findRemoteFunc(item.list, funcList, tokenFuncList, blankList);
|
6
6
|
});
|
7
7
|
} else if (list[i].type == "tabs") {
|
8
|
-
list[i].
|
8
|
+
list[i].options.columns.forEach(item => {
|
9
9
|
findRemoteFunc(item.list, funcList, tokenFuncList, blankList);
|
10
10
|
});
|
11
11
|
} else if (list[i].type == "table") {
|
12
|
-
// list[i].
|
12
|
+
// list[i].options.columns.forEach(item => {
|
13
13
|
findRemoteFunc(list[i].list, funcList, tokenFuncList, blankList);
|
14
14
|
// })
|
15
15
|
} else {
|
@@ -1,33 +1,43 @@
|
|
1
|
-
export const loadJs =
|
1
|
+
export const loadJs = url => {
|
2
2
|
return new Promise((resolve, reject) => {
|
3
|
-
const script = document.createElement(
|
4
|
-
script.src = url
|
5
|
-
script.type =
|
6
|
-
document.body.appendChild(script)
|
3
|
+
const script = document.createElement("script");
|
4
|
+
script.src = url;
|
5
|
+
script.type = "text/javascript";
|
6
|
+
document.body.appendChild(script);
|
7
7
|
script.onload = () => {
|
8
|
-
resolve()
|
9
|
-
}
|
10
|
-
})
|
11
|
-
}
|
8
|
+
resolve();
|
9
|
+
};
|
10
|
+
});
|
11
|
+
};
|
12
12
|
|
13
|
-
export const loadCss =
|
13
|
+
export const loadCss = url => {
|
14
14
|
return new Promise((resolve, reject) => {
|
15
|
-
const link = document.createElement(
|
16
|
-
link.rel =
|
17
|
-
link.href = url
|
18
|
-
document.head.appendChild(link)
|
15
|
+
const link = document.createElement("link");
|
16
|
+
link.rel = "stylesheet";
|
17
|
+
link.href = url;
|
18
|
+
document.head.appendChild(link);
|
19
19
|
link.onload = () => {
|
20
|
-
resolve()
|
21
|
-
}
|
22
|
-
})
|
23
|
-
}
|
20
|
+
resolve();
|
21
|
+
};
|
22
|
+
});
|
23
|
+
};
|
24
24
|
|
25
25
|
export const generateUUID = () => {
|
26
26
|
var d = new Date().getTime();
|
27
|
-
var uuid =
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
28
|
+
c
|
29
|
+
) {
|
30
|
+
var r = (d + Math.random() * 16) % 16 | 0;
|
31
|
+
d = Math.floor(d / 16);
|
32
|
+
return (c == "x" ? r : (r & 0x7) | 0x8).toString(16);
|
31
33
|
});
|
32
34
|
return uuid;
|
33
|
-
}
|
35
|
+
};
|
36
|
+
|
37
|
+
export const inputTypeDict = val => {
|
38
|
+
const dict = {
|
39
|
+
email: "email",
|
40
|
+
url: "url"
|
41
|
+
};
|
42
|
+
return dict[val] || "text";
|
43
|
+
};
|