@varlet/ui 2.3.1 → 2.4.0-alpha.1670751751241

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 (84) hide show
  1. package/es/app-bar/AppBar.js +1 -1
  2. package/es/app-bar/appBar.css +1 -1
  3. package/es/app-bar/props.js +4 -0
  4. package/es/card/Card.js +1 -1
  5. package/es/index.js +15 -0
  6. package/es/loading-bar/LoadingBar.js +33 -0
  7. package/es/loading-bar/index.js +66 -0
  8. package/es/loading-bar/loadingBar.css +1 -0
  9. package/es/loading-bar/props.js +26 -0
  10. package/es/loading-bar/style/index.js +2 -0
  11. package/es/overlay/Overlay.js +83 -0
  12. package/es/overlay/index.js +8 -0
  13. package/es/overlay/overlay.css +1 -0
  14. package/es/overlay/props.js +19 -0
  15. package/es/overlay/style/index.js +2 -0
  16. package/es/popup/Popup.js +1 -1
  17. package/es/popup/popup.css +1 -1
  18. package/es/popup/props.js +4 -0
  19. package/es/result/Empty.js +23 -0
  20. package/es/result/Error.js +23 -0
  21. package/es/result/Info.js +23 -0
  22. package/es/result/Question.js +23 -0
  23. package/es/result/Result.js +95 -0
  24. package/es/result/ResultSfc.css +0 -0
  25. package/es/result/Success.js +74 -0
  26. package/es/result/Warning.js +23 -0
  27. package/es/result/index.js +8 -0
  28. package/es/result/props.js +24 -0
  29. package/es/result/result.css +1 -0
  30. package/es/result/style/index.js +3 -0
  31. package/es/style.css +1 -1
  32. package/es/style.js +3 -0
  33. package/es/themes/dark/index.js +2 -1
  34. package/es/themes/dark/result.js +9 -0
  35. package/es/umdIndex.js +15 -0
  36. package/es/utils/elements.js +11 -7
  37. package/es/varlet.esm.js +5272 -4795
  38. package/highlight/attributes.json +41 -1
  39. package/highlight/tags.json +22 -1
  40. package/highlight/web-types.json +139 -2
  41. package/lib/app-bar/AppBar.js +1 -1
  42. package/lib/app-bar/appBar.css +1 -1
  43. package/lib/app-bar/props.js +4 -0
  44. package/lib/card/Card.js +1 -1
  45. package/lib/index.js +9 -0
  46. package/lib/loading-bar/LoadingBar.js +49 -0
  47. package/lib/loading-bar/index.js +78 -0
  48. package/lib/loading-bar/loadingBar.css +1 -0
  49. package/lib/loading-bar/props.js +31 -0
  50. package/lib/loading-bar/style/index.js +2 -0
  51. package/lib/overlay/Overlay.js +96 -0
  52. package/lib/overlay/index.js +17 -0
  53. package/lib/overlay/overlay.css +1 -0
  54. package/lib/overlay/props.js +24 -0
  55. package/lib/overlay/style/index.js +2 -0
  56. package/lib/popup/Popup.js +1 -1
  57. package/lib/popup/popup.css +1 -1
  58. package/lib/popup/props.js +4 -0
  59. package/lib/result/Empty.js +32 -0
  60. package/lib/result/Error.js +32 -0
  61. package/lib/result/Info.js +32 -0
  62. package/lib/result/Question.js +32 -0
  63. package/lib/result/Result.js +117 -0
  64. package/lib/result/ResultSfc.css +0 -0
  65. package/lib/result/Success.js +86 -0
  66. package/lib/result/Warning.js +32 -0
  67. package/lib/result/index.js +17 -0
  68. package/lib/result/props.js +30 -0
  69. package/lib/result/result.css +1 -0
  70. package/lib/result/style/index.js +3 -0
  71. package/lib/style.css +1 -1
  72. package/lib/style.js +3 -0
  73. package/lib/themes/dark/index.js +3 -1
  74. package/lib/themes/dark/result.js +14 -0
  75. package/lib/utils/elements.js +18 -8
  76. package/package.json +6 -7
  77. package/types/appBar.d.ts +1 -0
  78. package/types/index.d.ts +6 -0
  79. package/types/loadingBar.d.ts +18 -0
  80. package/types/overlay.d.ts +19 -0
  81. package/types/popup.d.ts +2 -2
  82. package/types/result.d.ts +25 -0
  83. package/umd/varlet.js +7 -7
  84. package/CHANGELOG.md +0 -1885
@@ -57,7 +57,11 @@
57
57
  },
58
58
  "var-app-bar/elevation": {
59
59
  "type": "boolean",
60
- "description": "是否给导航栏设置海拔 默认值:true"
60
+ "description": "是否使用海拔 默认值:true"
61
+ },
62
+ "var-app-bar/round": {
63
+ "type": "boolean",
64
+ "description": "是否使用圆角 默认值:false"
61
65
  },
62
66
  "var-back-top/target": {
63
67
  "type": "string | HTMLElement",
@@ -1063,6 +1067,18 @@
1063
1067
  "type": "any",
1064
1068
  "description": "选项绑定的值 默认值:-"
1065
1069
  },
1070
+ "var-overlay/v-model:show": {
1071
+ "type": "boolean",
1072
+ "description": "是否显示遮罩层 默认值:false"
1073
+ },
1074
+ "var-overlay/lock-scroll": {
1075
+ "type": "boolean",
1076
+ "description": "是否禁止滚动穿透,禁止时滚动遮罩层不会引发 body 的滚动 默认值:true"
1077
+ },
1078
+ "var-overlay/teleport": {
1079
+ "type": "TeleportProps['to']",
1080
+ "description": "遮罩层挂载的位置 默认值:-"
1081
+ },
1066
1082
  "var-pagination/v-model: current": {
1067
1083
  "type": "string | number",
1068
1084
  "description": "当前页数 默认值:1"
@@ -1175,6 +1191,10 @@
1175
1191
  "type": "object",
1176
1192
  "description": "自定义遮罩层的 style 默认值:-"
1177
1193
  },
1194
+ "var-popup/default-style": {
1195
+ "type": "boolean",
1196
+ "description": "是否启用默认样式 默认值:true"
1197
+ },
1178
1198
  "var-popup/transition": {
1179
1199
  "type": "string",
1180
1200
  "description": "过度动画的名称 默认值:-"
@@ -1383,6 +1403,26 @@
1383
1403
  "type": "Array<(v: string | number) => any>",
1384
1404
  "description": "验证规则,返回 `true` 表示验证通过,其余的值则转换为文本作为用户提示 默认值:-"
1385
1405
  },
1406
+ "var-result/type": {
1407
+ "type": "string",
1408
+ "description": "结果状态,可选值为 `info` `success` `warning` `error` `question` `empty` 默认值:success"
1409
+ },
1410
+ "var-result/title": {
1411
+ "type": "string",
1412
+ "description": "标题 默认值:-"
1413
+ },
1414
+ "var-result/description": {
1415
+ "type": "string",
1416
+ "description": "描述 默认值:-"
1417
+ },
1418
+ "var-result/image-size": {
1419
+ "type": "string | number",
1420
+ "description": "图片尺寸 默认值:-"
1421
+ },
1422
+ "var-result/animation": {
1423
+ "type": "boolean",
1424
+ "description": "是否开启动画,仅对 `success` 状态有效 默认值:true"
1425
+ },
1386
1426
  "var-row/gutter": {
1387
1427
  "type": "string | number",
1388
1428
  "description": "列间距 默认值:0"
@@ -19,7 +19,8 @@
19
19
  "text-color",
20
20
  "title",
21
21
  "title-position",
22
- "elevation"
22
+ "elevation",
23
+ "round"
23
24
  ]
24
25
  },
25
26
  "var-back-top": {
@@ -381,6 +382,9 @@
381
382
  "radius"
382
383
  ]
383
384
  },
385
+ "var-loading-bar": {
386
+ "attributes": []
387
+ },
384
388
  "var-locale": {
385
389
  "attributes": []
386
390
  },
@@ -402,6 +406,13 @@
402
406
  "value"
403
407
  ]
404
408
  },
409
+ "var-overlay": {
410
+ "attributes": [
411
+ "v-model:show",
412
+ "lock-scroll",
413
+ "teleport"
414
+ ]
415
+ },
405
416
  "var-pagination": {
406
417
  "attributes": [
407
418
  "v-model: current",
@@ -440,6 +451,7 @@
440
451
  "overlay",
441
452
  "overlay-class",
442
453
  "overlay-style",
454
+ "default-style",
443
455
  "transition",
444
456
  "lock-scroll",
445
457
  "close-on-click-overlay",
@@ -514,6 +526,15 @@
514
526
  "rules"
515
527
  ]
516
528
  },
529
+ "var-result": {
530
+ "attributes": [
531
+ "type",
532
+ "title",
533
+ "description",
534
+ "image-size",
535
+ "animation"
536
+ ]
537
+ },
517
538
  "var-ripple": {
518
539
  "attributes": []
519
540
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "2.3.0",
4
+ "version": "2.3.1",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -178,12 +178,21 @@
178
178
  },
179
179
  {
180
180
  "name": "elevation",
181
- "description": "是否给导航栏设置海拔",
181
+ "description": "是否使用海拔",
182
182
  "default": "true",
183
183
  "value": {
184
184
  "type": "boolean",
185
185
  "kind": "expression"
186
186
  }
187
+ },
188
+ {
189
+ "name": "round",
190
+ "description": "是否使用圆角",
191
+ "default": "false",
192
+ "value": {
193
+ "type": "boolean",
194
+ "kind": "expression"
195
+ }
187
196
  }
188
197
  ],
189
198
  "events": [],
@@ -3037,6 +3046,12 @@
3037
3046
  }
3038
3047
  ]
3039
3048
  },
3049
+ {
3050
+ "name": "var-loading-bar",
3051
+ "attributes": [],
3052
+ "events": [],
3053
+ "slots": []
3054
+ },
3040
3055
  {
3041
3056
  "name": "var-locale",
3042
3057
  "attributes": [],
@@ -3178,6 +3193,50 @@
3178
3193
  }
3179
3194
  ]
3180
3195
  },
3196
+ {
3197
+ "name": "var-overlay",
3198
+ "attributes": [
3199
+ {
3200
+ "name": "v-model:show",
3201
+ "description": "是否显示遮罩层",
3202
+ "default": "false",
3203
+ "value": {
3204
+ "type": "boolean",
3205
+ "kind": "expression"
3206
+ }
3207
+ },
3208
+ {
3209
+ "name": "lock-scroll",
3210
+ "description": "是否禁止滚动穿透,禁止时滚动遮罩层不会引发 body 的滚动",
3211
+ "default": "true",
3212
+ "value": {
3213
+ "type": "boolean",
3214
+ "kind": "expression"
3215
+ }
3216
+ },
3217
+ {
3218
+ "name": "teleport",
3219
+ "description": "遮罩层挂载的位置",
3220
+ "default": "-",
3221
+ "value": {
3222
+ "type": "TeleportProps['to']",
3223
+ "kind": "expression"
3224
+ }
3225
+ }
3226
+ ],
3227
+ "events": [
3228
+ {
3229
+ "name": "click",
3230
+ "description": "点击遮罩层时触发"
3231
+ }
3232
+ ],
3233
+ "slots": [
3234
+ {
3235
+ "name": "default",
3236
+ "description": "遮罩层内容"
3237
+ }
3238
+ ]
3239
+ },
3181
3240
  {
3182
3241
  "name": "var-pagination",
3183
3242
  "attributes": [
@@ -3487,6 +3546,15 @@
3487
3546
  "kind": "expression"
3488
3547
  }
3489
3548
  },
3549
+ {
3550
+ "name": "default-style",
3551
+ "description": "是否启用默认样式",
3552
+ "default": "true",
3553
+ "value": {
3554
+ "type": "boolean",
3555
+ "kind": "expression"
3556
+ }
3557
+ },
3490
3558
  {
3491
3559
  "name": "transition",
3492
3560
  "description": "过度动画的名称",
@@ -4072,6 +4140,75 @@
4072
4140
  ],
4073
4141
  "slots": []
4074
4142
  },
4143
+ {
4144
+ "name": "var-result",
4145
+ "attributes": [
4146
+ {
4147
+ "name": "type",
4148
+ "description": "结果状态,可选值为 `info` `success` `warning` `error` `question` `empty`",
4149
+ "default": "success",
4150
+ "value": {
4151
+ "type": "string",
4152
+ "kind": "expression"
4153
+ }
4154
+ },
4155
+ {
4156
+ "name": "title",
4157
+ "description": "标题",
4158
+ "default": "-",
4159
+ "value": {
4160
+ "type": "string",
4161
+ "kind": "expression"
4162
+ }
4163
+ },
4164
+ {
4165
+ "name": "description",
4166
+ "description": "描述",
4167
+ "default": "-",
4168
+ "value": {
4169
+ "type": "string",
4170
+ "kind": "expression"
4171
+ }
4172
+ },
4173
+ {
4174
+ "name": "image-size",
4175
+ "description": "图片尺寸",
4176
+ "default": "-",
4177
+ "value": {
4178
+ "type": "string | number",
4179
+ "kind": "expression"
4180
+ }
4181
+ },
4182
+ {
4183
+ "name": "animation",
4184
+ "description": "是否开启动画,仅对 `success` 状态有效",
4185
+ "default": "true",
4186
+ "value": {
4187
+ "type": "boolean",
4188
+ "kind": "expression"
4189
+ }
4190
+ }
4191
+ ],
4192
+ "events": [],
4193
+ "slots": [
4194
+ {
4195
+ "name": "image",
4196
+ "description": "自定义图标"
4197
+ },
4198
+ {
4199
+ "name": "title",
4200
+ "description": "自定义标题"
4201
+ },
4202
+ {
4203
+ "name": "description",
4204
+ "description": "自定义描述"
4205
+ },
4206
+ {
4207
+ "name": "footer",
4208
+ "description": "自定义底部内容"
4209
+ }
4210
+ ]
4211
+ },
4075
4212
  {
4076
4213
  "name": "var-ripple",
4077
4214
  "attributes": [],
@@ -17,7 +17,7 @@ var {
17
17
 
18
18
  function render(_ctx, _cache) {
19
19
  return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
20
- class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.elevation, _ctx.n('$-elevation--3')])),
20
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.round, _ctx.n('--round')], [_ctx.elevation, _ctx.n('$-elevation--3')])),
21
21
  style: (0, _vue.normalizeStyle)({
22
22
  background: _ctx.color,
23
23
  color: _ctx.textColor
@@ -1 +1 @@
1
- :root { --app-bar-color: var(--color-primary); --app-bar-title-padding: 0 12px; --app-bar-text-color: #fff; --app-bar-height: 54px; --app-bar-left-gap: 6px; --app-bar-right-gap: 6px;}.var-app-bar { position: relative; display: flex; width: 100%; justify-content: center; align-items: center; height: var(--app-bar-height); background: var(--app-bar-color); color: var(--app-bar-text-color); transition: background-color 0.25s;}.var-app-bar__title { flex: 1; display: flex; justify-content: center; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; padding: var(--app-bar-title-padding);}.var-app-bar__left,.var-app-bar__right { display: flex; align-items: center; height: 100%; z-index: 2;}.var-app-bar__left { position: absolute; top: 0; left: var(--app-bar-left-gap);}.var-app-bar__right { position: absolute; top: 0; right: var(--app-bar-right-gap);}
1
+ :root { --app-bar-color: var(--color-primary); --app-bar-title-padding: 0 12px; --app-bar-text-color: #fff; --app-bar-height: 54px; --app-bar-left-gap: 6px; --app-bar-right-gap: 6px; --app-bar-border-radius: 4px;}.var-app-bar { position: relative; display: flex; width: 100%; justify-content: center; align-items: center; height: var(--app-bar-height); background: var(--app-bar-color); color: var(--app-bar-text-color); transition: background-color 0.25s;}.var-app-bar__title { flex: 1; display: flex; justify-content: center; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; padding: var(--app-bar-title-padding);}.var-app-bar__left,.var-app-bar__right { display: flex; align-items: center; height: 100%; z-index: 2;}.var-app-bar__left { position: absolute; top: 0; left: var(--app-bar-left-gap);}.var-app-bar__right { position: absolute; top: 0; right: var(--app-bar-right-gap);}.var-app-bar--round { border-radius: var(--app-bar-border-radius);}
@@ -27,6 +27,10 @@ var props = {
27
27
  elevation: {
28
28
  type: Boolean,
29
29
  default: true
30
+ },
31
+ round: {
32
+ type: Boolean,
33
+ default: false
30
34
  }
31
35
  };
32
36
  exports.props = props;
package/lib/card/Card.js CHANGED
@@ -56,7 +56,7 @@ function render(_ctx, _cache) {
56
56
  })
57
57
  }, [(0, _vue.createElementVNode)("div", {
58
58
  ref: "cardFloater",
59
- class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('floater'))),
59
+ class: (0, _vue.normalizeClass)(_ctx.n('floater')),
60
60
  style: (0, _vue.normalizeStyle)({
61
61
  width: _ctx.floaterWidth,
62
62
  height: _ctx.floaterHeight,
package/lib/index.js CHANGED
@@ -31,9 +31,11 @@ var Lazy = require('./lazy')['default']
31
31
  var Link = require('./link')['default']
32
32
  var List = require('./list')['default']
33
33
  var Loading = require('./loading')['default']
34
+ var LoadingBar = require('./loading-bar')['default']
34
35
  var Locale = require('./locale')['default']
35
36
  var Menu = require('./menu')['default']
36
37
  var Option = require('./option')['default']
38
+ var Overlay = require('./overlay')['default']
37
39
  var Pagination = require('./pagination')['default']
38
40
  var Picker = require('./picker')['default']
39
41
  var Popup = require('./popup')['default']
@@ -42,6 +44,7 @@ var PullRefresh = require('./pull-refresh')['default']
42
44
  var Radio = require('./radio')['default']
43
45
  var RadioGroup = require('./radio-group')['default']
44
46
  var Rate = require('./rate')['default']
47
+ var Result = require('./result')['default']
45
48
  var Ripple = require('./ripple')['default']
46
49
  var Row = require('./row')['default']
47
50
  var Select = require('./select')['default']
@@ -100,9 +103,11 @@ function install(app) {
100
103
  Link.install && app.use(Link)
101
104
  List.install && app.use(List)
102
105
  Loading.install && app.use(Loading)
106
+ LoadingBar.install && app.use(LoadingBar)
103
107
  Locale.install && app.use(Locale)
104
108
  Menu.install && app.use(Menu)
105
109
  Option.install && app.use(Option)
110
+ Overlay.install && app.use(Overlay)
106
111
  Pagination.install && app.use(Pagination)
107
112
  Picker.install && app.use(Picker)
108
113
  Popup.install && app.use(Popup)
@@ -111,6 +116,7 @@ function install(app) {
111
116
  Radio.install && app.use(Radio)
112
117
  RadioGroup.install && app.use(RadioGroup)
113
118
  Rate.install && app.use(Rate)
119
+ Result.install && app.use(Result)
114
120
  Ripple.install && app.use(Ripple)
115
121
  Row.install && app.use(Row)
116
122
  Select.install && app.use(Select)
@@ -171,9 +177,11 @@ module.exports = {
171
177
  Link,
172
178
  List,
173
179
  Loading,
180
+ LoadingBar,
174
181
  Locale,
175
182
  Menu,
176
183
  Option,
184
+ Overlay,
177
185
  Pagination,
178
186
  Picker,
179
187
  Popup,
@@ -182,6 +190,7 @@ module.exports = {
182
190
  Radio,
183
191
  RadioGroup,
184
192
  Rate,
193
+ Result,
185
194
  Ripple,
186
195
  Row,
187
196
  Select,
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _vue = require("vue");
7
+
8
+ var _context = _interopRequireDefault(require("../context"));
9
+
10
+ var _components = require("../utils/components");
11
+
12
+ var _elements = require("../utils/elements");
13
+
14
+ var _props = require("./props");
15
+
16
+
17
+
18
+
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ var {
23
+ classes,
24
+ n
25
+ } = (0, _components.createNamespace)('loading-bar');
26
+
27
+ var _default = (0, _vue.defineComponent)({
28
+ name: 'VarLoadingBar',
29
+ props: _props.props,
30
+
31
+ setup(props) {
32
+ return () => {
33
+ return (0, _vue.createVNode)("div", {
34
+ "class": classes(n(), [props.error, n('--error')]),
35
+ "style": {
36
+ zIndex: _context.default.zIndex + 10,
37
+ width: props.value + "%",
38
+ opacity: props.opacity,
39
+ height: (0, _elements.toSizeUnit)(props.height),
40
+ backgroundColor: props.error ? props.errorColor : props.color,
41
+ top: (0, _elements.toSizeUnit)(props.top)
42
+ }
43
+ }, null);
44
+ };
45
+ }
46
+
47
+ });
48
+
49
+ exports.default = _default;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports._LoadingBarComponent = void 0;
5
+
6
+ var _LoadingBar = _interopRequireDefault(require("./LoadingBar"));
7
+
8
+ var _vue = require("vue");
9
+
10
+ var _components = require("../utils/components");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var timer;
15
+ var isMount;
16
+ var props = (0, _vue.reactive)({
17
+ value: 0,
18
+ opacity: 0,
19
+ error: false
20
+ });
21
+
22
+ var mergeConfig = options => {
23
+ Object.assign(props, options);
24
+ };
25
+
26
+ var changeValue = () => {
27
+ timer = window.setTimeout(() => {
28
+ if (props.value >= 95) return;
29
+ var num = Math.random();
30
+ if (props.value < 70) num = Math.round(5 * Math.random());
31
+ props.value += num;
32
+ changeValue();
33
+ }, 200);
34
+ };
35
+
36
+ var start = () => {
37
+ if (!isMount) {
38
+ isMount = true;
39
+ (0, _components.mountInstance)(_LoadingBar.default, props);
40
+ }
41
+
42
+ if (!props.error || props.value === 100) {
43
+ props.value = 0;
44
+ }
45
+
46
+ setTimeout(() => {
47
+ props.opacity = 1;
48
+ }, 200);
49
+ changeValue();
50
+ };
51
+
52
+ var finish = () => {
53
+ props.value = 100;
54
+ setTimeout(() => {
55
+ props.opacity = 0;
56
+ setTimeout(() => {
57
+ props.error = false;
58
+ }, 250);
59
+ }, 300);
60
+ window.clearTimeout(timer);
61
+ };
62
+
63
+ var error = () => {
64
+ props.error = true;
65
+ LoadingBar.start();
66
+ setTimeout(LoadingBar.finish, 300);
67
+ };
68
+
69
+ var LoadingBar = {
70
+ start,
71
+ finish,
72
+ error,
73
+ mergeConfig
74
+ };
75
+ var _LoadingBarComponent = LoadingBar;
76
+ exports._LoadingBarComponent = _LoadingBarComponent;
77
+ var _default = LoadingBar;
78
+ exports.default = _default;
@@ -0,0 +1 @@
1
+ :root { --loading-bar-color: var(--color-primary); --loading-bar-error-color: var(--color-danger); --loading-bar-height: 3px;}.var-loading-bar { position: fixed; left: 0; top: 0; transition: all 0.25s; height: var(--loading-bar-height); background-color: var(--loading-bar-color);}.var-loading-bar--error { background-color: var(--loading-bar-error-color);}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.props = void 0;
5
+ var props = {
6
+ value: {
7
+ type: Number,
8
+ default: 0
9
+ },
10
+ opacity: {
11
+ type: Number,
12
+ default: 0
13
+ },
14
+ error: {
15
+ type: Boolean,
16
+ default: false
17
+ },
18
+ color: {
19
+ type: String
20
+ },
21
+ errorColor: {
22
+ type: String
23
+ },
24
+ height: {
25
+ type: [Number, String]
26
+ },
27
+ top: {
28
+ type: [Number, String]
29
+ }
30
+ };
31
+ exports.props = props;
@@ -0,0 +1,2 @@
1
+ require('../../styles/common.css')
2
+ require('../loadingBar.css')
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _vue = require("vue");
7
+
8
+ var _props = require("./props");
9
+
10
+ var _lock = require("../context/lock");
11
+
12
+ var _zIndex = require("../context/zIndex");
13
+
14
+ var _components = require("../utils/components");
15
+
16
+
17
+
18
+
19
+
20
+ function _isSlot(s) {
21
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0, _vue.isVNode)(s);
22
+ }
23
+
24
+ var {
25
+ n
26
+ } = (0, _components.createNamespace)('overlay');
27
+
28
+ var _default = (0, _vue.defineComponent)({
29
+ name: 'VarOverlay',
30
+ inheritAttrs: false,
31
+ props: _props.props,
32
+
33
+ setup(props, _ref) {
34
+ var {
35
+ slots,
36
+ attrs
37
+ } = _ref;
38
+ var {
39
+ zIndex
40
+ } = (0, _zIndex.useZIndex)(() => props.show, 1);
41
+ var {
42
+ disabled
43
+ } = (0, _components.useTeleport)();
44
+
45
+ var handleClickOverlay = () => {
46
+ (0, _components.call)(props.onClick);
47
+ (0, _components.call)(props['onUpdate:show'], false);
48
+ };
49
+
50
+ (0, _lock.useLock)(() => props.show, () => props.lockScroll);
51
+
52
+ var renderOverlay = () => {
53
+ return (0, _vue.createVNode)("div", (0, _vue.mergeProps)({
54
+ "class": n(),
55
+ "style": {
56
+ zIndex: zIndex.value - 1
57
+ }
58
+ }, attrs, {
59
+ "onClick": handleClickOverlay
60
+ }), [(0, _components.call)(slots.default)]);
61
+ };
62
+
63
+ var renderTransitionOverlay = () => {
64
+ var {
65
+ show
66
+ } = props;
67
+ return (0, _vue.createVNode)(_vue.Transition, {
68
+ "name": n('--fade')
69
+ }, {
70
+ default: () => [show && renderOverlay()]
71
+ });
72
+ };
73
+
74
+ return () => {
75
+ var {
76
+ teleport
77
+ } = props;
78
+
79
+ if (teleport) {
80
+ var _slot;
81
+
82
+ return (0, _vue.createVNode)(_vue.Teleport, {
83
+ "to": teleport,
84
+ "disabled": disabled.value
85
+ }, _isSlot(_slot = renderTransitionOverlay()) ? _slot : {
86
+ default: () => [_slot]
87
+ });
88
+ }
89
+
90
+ return renderTransitionOverlay();
91
+ };
92
+ }
93
+
94
+ });
95
+
96
+ exports.default = _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports._PopupComponent = void 0;
5
+
6
+ var _Overlay = _interopRequireDefault(require("./Overlay"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ _Overlay.default.install = function (app) {
11
+ app.component(_Overlay.default.name, _Overlay.default);
12
+ };
13
+
14
+ var _PopupComponent = _Overlay.default;
15
+ exports._PopupComponent = _PopupComponent;
16
+ var _default = _Overlay.default;
17
+ exports.default = _default;
@@ -0,0 +1 @@
1
+ :root { --overlay-background-color: rgba(0, 0, 0, 0.6);}.var-overlay { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: var(--overlay-background-color); transition: all 0.25s;}.var-overlay--fade-enter-from,.var-overlay--fade-leave-to { opacity: 0;}.var-overlay--fade-enter-active,.var-overlay--fade-leave-active { transition: opacity 0.25s;}