@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
@@ -8,7 +8,7 @@ var {
8
8
  import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode } from "vue";
9
9
  export function render(_ctx, _cache) {
10
10
  return _openBlock(), _createElementBlock("div", {
11
- class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.elevation, _ctx.n('$-elevation--3')])),
11
+ class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.round, _ctx.n('--round')], [_ctx.elevation, _ctx.n('$-elevation--3')])),
12
12
  style: _normalizeStyle({
13
13
  background: _ctx.color,
14
14
  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);}
@@ -20,5 +20,9 @@ export var props = {
20
20
  elevation: {
21
21
  type: Boolean,
22
22
  default: true
23
+ },
24
+ round: {
25
+ type: Boolean,
26
+ default: false
23
27
  }
24
28
  };
package/es/card/Card.js CHANGED
@@ -39,7 +39,7 @@ export function render(_ctx, _cache) {
39
39
  })
40
40
  }, [_createElementVNode("div", {
41
41
  ref: "cardFloater",
42
- class: _normalizeClass(_ctx.classes(_ctx.n('floater'))),
42
+ class: _normalizeClass(_ctx.n('floater')),
43
43
  style: _normalizeStyle({
44
44
  width: _ctx.floaterWidth,
45
45
  height: _ctx.floaterHeight,
package/es/index.js CHANGED
@@ -31,9 +31,11 @@ import Lazy, * as LazyModule from './lazy'
31
31
  import Link, * as LinkModule from './link'
32
32
  import List, * as ListModule from './list'
33
33
  import Loading, * as LoadingModule from './loading'
34
+ import LoadingBar, * as LoadingBarModule from './loading-bar'
34
35
  import Locale, * as LocaleModule from './locale'
35
36
  import Menu, * as MenuModule from './menu'
36
37
  import Option, * as OptionModule from './option'
38
+ import Overlay, * as OverlayModule from './overlay'
37
39
  import Pagination, * as PaginationModule from './pagination'
38
40
  import Picker, * as PickerModule from './picker'
39
41
  import Popup, * as PopupModule from './popup'
@@ -42,6 +44,7 @@ import PullRefresh, * as PullRefreshModule from './pull-refresh'
42
44
  import Radio, * as RadioModule from './radio'
43
45
  import RadioGroup, * as RadioGroupModule from './radio-group'
44
46
  import Rate, * as RateModule from './rate'
47
+ import Result, * as ResultModule from './result'
45
48
  import Ripple, * as RippleModule from './ripple'
46
49
  import Row, * as RowModule from './row'
47
50
  import Select, * as SelectModule from './select'
@@ -98,9 +101,11 @@ export const _LazyComponent = LazyModule._LazyComponent || {}
98
101
  export const _LinkComponent = LinkModule._LinkComponent || {}
99
102
  export const _ListComponent = ListModule._ListComponent || {}
100
103
  export const _LoadingComponent = LoadingModule._LoadingComponent || {}
104
+ export const _LoadingBarComponent = LoadingBarModule._LoadingBarComponent || {}
101
105
  export const _LocaleComponent = LocaleModule._LocaleComponent || {}
102
106
  export const _MenuComponent = MenuModule._MenuComponent || {}
103
107
  export const _OptionComponent = OptionModule._OptionComponent || {}
108
+ export const _OverlayComponent = OverlayModule._OverlayComponent || {}
104
109
  export const _PaginationComponent = PaginationModule._PaginationComponent || {}
105
110
  export const _PickerComponent = PickerModule._PickerComponent || {}
106
111
  export const _PopupComponent = PopupModule._PopupComponent || {}
@@ -109,6 +114,7 @@ export const _PullRefreshComponent = PullRefreshModule._PullRefreshComponent ||
109
114
  export const _RadioComponent = RadioModule._RadioComponent || {}
110
115
  export const _RadioGroupComponent = RadioGroupModule._RadioGroupComponent || {}
111
116
  export const _RateComponent = RateModule._RateComponent || {}
117
+ export const _ResultComponent = ResultModule._ResultComponent || {}
112
118
  export const _RippleComponent = RippleModule._RippleComponent || {}
113
119
  export const _RowComponent = RowModule._RowComponent || {}
114
120
  export const _SelectComponent = SelectModule._SelectComponent || {}
@@ -167,9 +173,11 @@ function install(app) {
167
173
  Link.install && app.use(Link)
168
174
  List.install && app.use(List)
169
175
  Loading.install && app.use(Loading)
176
+ LoadingBar.install && app.use(LoadingBar)
170
177
  Locale.install && app.use(Locale)
171
178
  Menu.install && app.use(Menu)
172
179
  Option.install && app.use(Option)
180
+ Overlay.install && app.use(Overlay)
173
181
  Pagination.install && app.use(Pagination)
174
182
  Picker.install && app.use(Picker)
175
183
  Popup.install && app.use(Popup)
@@ -178,6 +186,7 @@ function install(app) {
178
186
  Radio.install && app.use(Radio)
179
187
  RadioGroup.install && app.use(RadioGroup)
180
188
  Rate.install && app.use(Rate)
189
+ Result.install && app.use(Result)
181
190
  Ripple.install && app.use(Ripple)
182
191
  Row.install && app.use(Row)
183
192
  Select.install && app.use(Select)
@@ -237,9 +246,11 @@ export {
237
246
  Link,
238
247
  List,
239
248
  Loading,
249
+ LoadingBar,
240
250
  Locale,
241
251
  Menu,
242
252
  Option,
253
+ Overlay,
243
254
  Pagination,
244
255
  Picker,
245
256
  Popup,
@@ -248,6 +259,7 @@ export {
248
259
  Radio,
249
260
  RadioGroup,
250
261
  Rate,
262
+ Result,
251
263
  Ripple,
252
264
  Row,
253
265
  Select,
@@ -307,9 +319,11 @@ export default {
307
319
  Link,
308
320
  List,
309
321
  Loading,
322
+ LoadingBar,
310
323
  Locale,
311
324
  Menu,
312
325
  Option,
326
+ Overlay,
313
327
  Pagination,
314
328
  Picker,
315
329
  Popup,
@@ -318,6 +332,7 @@ export default {
318
332
  Radio,
319
333
  RadioGroup,
320
334
  Rate,
335
+ Result,
321
336
  Ripple,
322
337
  Row,
323
338
  Select,
@@ -0,0 +1,33 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import { defineComponent } from 'vue';
3
+ import context from '../context';
4
+ import { createNamespace } from '../utils/components';
5
+ import { toSizeUnit } from '../utils/elements';
6
+ import { props } from './props';
7
+
8
+
9
+ var {
10
+ classes,
11
+ n
12
+ } = createNamespace('loading-bar');
13
+ export default defineComponent({
14
+ name: 'VarLoadingBar',
15
+ props,
16
+
17
+ setup(props) {
18
+ return () => {
19
+ return _createVNode("div", {
20
+ "class": classes(n(), [props.error, n('--error')]),
21
+ "style": {
22
+ zIndex: context.zIndex + 10,
23
+ width: props.value + "%",
24
+ opacity: props.opacity,
25
+ height: toSizeUnit(props.height),
26
+ backgroundColor: props.error ? props.errorColor : props.color,
27
+ top: toSizeUnit(props.top)
28
+ }
29
+ }, null);
30
+ };
31
+ }
32
+
33
+ });
@@ -0,0 +1,66 @@
1
+ import LoadingBarComponent from './LoadingBar';
2
+ import { reactive } from 'vue';
3
+ import { mountInstance } from '../utils/components';
4
+ var timer;
5
+ var isMount;
6
+ var props = reactive({
7
+ value: 0,
8
+ opacity: 0,
9
+ error: false
10
+ });
11
+
12
+ var mergeConfig = options => {
13
+ Object.assign(props, options);
14
+ };
15
+
16
+ var changeValue = () => {
17
+ timer = window.setTimeout(() => {
18
+ if (props.value >= 95) return;
19
+ var num = Math.random();
20
+ if (props.value < 70) num = Math.round(5 * Math.random());
21
+ props.value += num;
22
+ changeValue();
23
+ }, 200);
24
+ };
25
+
26
+ var start = () => {
27
+ if (!isMount) {
28
+ isMount = true;
29
+ mountInstance(LoadingBarComponent, props);
30
+ }
31
+
32
+ if (!props.error || props.value === 100) {
33
+ props.value = 0;
34
+ }
35
+
36
+ setTimeout(() => {
37
+ props.opacity = 1;
38
+ }, 200);
39
+ changeValue();
40
+ };
41
+
42
+ var finish = () => {
43
+ props.value = 100;
44
+ setTimeout(() => {
45
+ props.opacity = 0;
46
+ setTimeout(() => {
47
+ props.error = false;
48
+ }, 250);
49
+ }, 300);
50
+ window.clearTimeout(timer);
51
+ };
52
+
53
+ var error = () => {
54
+ props.error = true;
55
+ LoadingBar.start();
56
+ setTimeout(LoadingBar.finish, 300);
57
+ };
58
+
59
+ var LoadingBar = {
60
+ start,
61
+ finish,
62
+ error,
63
+ mergeConfig
64
+ };
65
+ export var _LoadingBarComponent = LoadingBar;
66
+ export default LoadingBar;
@@ -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,26 @@
1
+ export var props = {
2
+ value: {
3
+ type: Number,
4
+ default: 0
5
+ },
6
+ opacity: {
7
+ type: Number,
8
+ default: 0
9
+ },
10
+ error: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ color: {
15
+ type: String
16
+ },
17
+ errorColor: {
18
+ type: String
19
+ },
20
+ height: {
21
+ type: [Number, String]
22
+ },
23
+ top: {
24
+ type: [Number, String]
25
+ }
26
+ };
@@ -0,0 +1,2 @@
1
+ import '../../styles/common.css'
2
+ import '../loadingBar.css'
@@ -0,0 +1,83 @@
1
+ import { isVNode as _isVNode, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
2
+ import { defineComponent, Teleport, Transition } from 'vue';
3
+ import { props } from './props';
4
+ import { useLock } from '../context/lock';
5
+ import { useZIndex } from '../context/zIndex';
6
+ import { createNamespace, useTeleport, call } from '../utils/components';
7
+
8
+
9
+
10
+ function _isSlot(s) {
11
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
12
+ }
13
+
14
+ var {
15
+ n
16
+ } = createNamespace('overlay');
17
+ export default defineComponent({
18
+ name: 'VarOverlay',
19
+ inheritAttrs: false,
20
+ props,
21
+
22
+ setup(props, _ref) {
23
+ var {
24
+ slots,
25
+ attrs
26
+ } = _ref;
27
+ var {
28
+ zIndex
29
+ } = useZIndex(() => props.show, 1);
30
+ var {
31
+ disabled
32
+ } = useTeleport();
33
+
34
+ var handleClickOverlay = () => {
35
+ call(props.onClick);
36
+ call(props['onUpdate:show'], false);
37
+ };
38
+
39
+ useLock(() => props.show, () => props.lockScroll);
40
+
41
+ var renderOverlay = () => {
42
+ return _createVNode("div", _mergeProps({
43
+ "class": n(),
44
+ "style": {
45
+ zIndex: zIndex.value - 1
46
+ }
47
+ }, attrs, {
48
+ "onClick": handleClickOverlay
49
+ }), [call(slots.default)]);
50
+ };
51
+
52
+ var renderTransitionOverlay = () => {
53
+ var {
54
+ show
55
+ } = props;
56
+ return _createVNode(Transition, {
57
+ "name": n('--fade')
58
+ }, {
59
+ default: () => [show && renderOverlay()]
60
+ });
61
+ };
62
+
63
+ return () => {
64
+ var {
65
+ teleport
66
+ } = props;
67
+
68
+ if (teleport) {
69
+ var _slot;
70
+
71
+ return _createVNode(Teleport, {
72
+ "to": teleport,
73
+ "disabled": disabled.value
74
+ }, _isSlot(_slot = renderTransitionOverlay()) ? _slot : {
75
+ default: () => [_slot]
76
+ });
77
+ }
78
+
79
+ return renderTransitionOverlay();
80
+ };
81
+ }
82
+
83
+ });
@@ -0,0 +1,8 @@
1
+ import Overlay from './Overlay';
2
+
3
+ Overlay.install = function (app) {
4
+ app.component(Overlay.name, Overlay);
5
+ };
6
+
7
+ export var _PopupComponent = Overlay;
8
+ export default Overlay;
@@ -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;}
@@ -0,0 +1,19 @@
1
+ export var props = {
2
+ show: {
3
+ type: Boolean,
4
+ default: false
5
+ },
6
+ lockScroll: {
7
+ type: Boolean,
8
+ default: true
9
+ },
10
+ onClick: {
11
+ type: Function
12
+ },
13
+ teleport: {
14
+ type: String
15
+ },
16
+ 'onUpdate:show': {
17
+ type: Function
18
+ }
19
+ };
@@ -0,0 +1,2 @@
1
+ import '../../styles/common.css'
2
+ import '../overlay.css'
package/es/popup/Popup.js CHANGED
@@ -78,7 +78,7 @@ export default defineComponent({
78
78
 
79
79
  var renderContent = () => {
80
80
  return _createVNode("div", _mergeProps({
81
- "class": classes(n('content'), n('$-elevation--3'), n("--" + props.position)),
81
+ "class": classes(n('content'), n("--" + props.position), [props.defaultStyle, n('--content-background-color')], [props.defaultStyle, n('$-elevation--3')]),
82
82
  "style": {
83
83
  zIndex: zIndex.value
84
84
  }
@@ -1 +1 @@
1
- :root { --popup-overlay-background-color: rgba(0, 0, 0, 0.6); --popup-content-background-color: #fff;}.var-fade-enter-from,.var-fade-leave-to { opacity: 0;}.var-fade-enter-active,.var-fade-leave-active { transition: opacity 0.25s;}.var-pop-center-enter-from,.var-pop-center-leave-to { transform: scale(0.3);}.var-pop-center-enter-active,.var-pop-center-leave-active { transition: all 0.25s;}.var-pop-bottom-enter-from,.var-pop-bottom-leave-to { transform: translateY(100%);}.var-pop-bottom-enter-active,.var-pop-bottom-leave-active { transition: all 0.25s;}.var-pop-top-enter-from,.var-pop-top-leave-to { transform: translateY(-100%);}.var-pop-top-enter-active,.var-pop-top-leave-active { transition: all 0.25s;}.var-pop-left-enter-from,.var-pop-left-leave-to { transform: translateX(-100%);}.var-pop-left-enter-active,.var-pop-left-leave-active { transition: all 0.25s;}.var-pop-right-enter-from,.var-pop-right-leave-to { transform: translateX(100%);}.var-pop-right-enter-active,.var-pop-right-leave-active { transition: all 0.25s;}.var-popup { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0;}.var-popup__overlay { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: var(--popup-overlay-background-color); transition: all 0.25s;}.var-popup__content { overflow: auto; background-color: var(--popup-content-background-color); transition: all 0.25s;}.var-popup--center { position: relative;}.var-popup--bottom { min-width: 100%; position: absolute; left: 0; bottom: 0;}.var-popup--top { min-width: 100%; position: absolute; left: 0; top: 0;}.var-popup--left { min-height: 100%; position: absolute; left: 0; top: 0;}.var-popup--right { min-height: 100%; position: absolute; right: 0; top: 0;}
1
+ :root { --popup-content-background-color: #fff; --popup-overlay-background-color: rgba(0, 0, 0, 0.6);}.var-fade-enter-from,.var-fade-leave-to { opacity: 0;}.var-fade-enter-active,.var-fade-leave-active { transition: opacity 0.25s;}.var-pop-center-enter-from,.var-pop-center-leave-to { transform: scale(0.3);}.var-pop-center-enter-active,.var-pop-center-leave-active { transition: all 0.25s;}.var-pop-bottom-enter-from,.var-pop-bottom-leave-to { transform: translateY(100%);}.var-pop-bottom-enter-active,.var-pop-bottom-leave-active { transition: all 0.25s;}.var-pop-top-enter-from,.var-pop-top-leave-to { transform: translateY(-100%);}.var-pop-top-enter-active,.var-pop-top-leave-active { transition: all 0.25s;}.var-pop-left-enter-from,.var-pop-left-leave-to { transform: translateX(-100%);}.var-pop-left-enter-active,.var-pop-left-leave-active { transition: all 0.25s;}.var-pop-right-enter-from,.var-pop-right-leave-to { transform: translateX(100%);}.var-pop-right-enter-active,.var-pop-right-leave-active { transition: all 0.25s;}.var-popup { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0;}.var-popup__overlay { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: var(--popup-overlay-background-color); transition: all 0.25s;}.var-popup__content { overflow: auto; transition: all 0.25s;}.var-popup--content-background-color { background-color: var(--popup-content-background-color);}.var-popup--center { position: relative;}.var-popup--bottom { min-width: 100%; position: absolute; left: 0; bottom: 0;}.var-popup--top { min-width: 100%; position: absolute; left: 0; top: 0;}.var-popup--left { min-height: 100%; position: absolute; left: 0; top: 0;}.var-popup--right { min-height: 100%; position: absolute; right: 0; top: 0;}
package/es/popup/props.js CHANGED
@@ -33,6 +33,10 @@ export var props = {
33
33
  type: Boolean,
34
34
  default: true
35
35
  },
36
+ defaultStyle: {
37
+ type: Boolean,
38
+ default: true
39
+ },
36
40
  teleport: {
37
41
  type: String
38
42
  },
@@ -0,0 +1,23 @@
1
+ import { defineComponent } from 'vue';
2
+ import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
3
+
4
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
5
+
6
+ var _hoisted_1 = {
7
+ viewBox: "-4 -4 32 32"
8
+ };
9
+
10
+ var _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("path", {
11
+ fill: "currentColor",
12
+ d: "M2,10.96C1.5,10.68 1.35,10.07 1.63,9.59L3.13,7C3.24,6.8 3.41,6.66 3.6,6.58L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.66,6.72 20.82,6.88 20.91,7.08L22.36,9.6C22.64,10.08 22.47,10.69 22,10.96L21,11.54V16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V10.96C2.7,11.13 2.32,11.14 2,10.96M12,4.15V4.15L12,10.85V10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V12.69L14,15.59C13.67,15.77 13.3,15.76 13,15.6V19.29L19,15.91M13.85,13.36L20.13,9.73L19.55,8.72L13.27,12.35L13.85,13.36Z"
13
+ }, null, -1
14
+ /* HOISTED */
15
+ ));
16
+
17
+ var _hoisted_3 = [_hoisted_2];
18
+ export function render(_ctx, _cache) {
19
+ return _openBlock(), _createElementBlock("svg", _hoisted_1, _hoisted_3);
20
+ }
21
+ export default defineComponent({
22
+ render
23
+ });
@@ -0,0 +1,23 @@
1
+ import { defineComponent } from 'vue';
2
+ import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
3
+
4
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
5
+
6
+ var _hoisted_1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "2 2 20 20"
9
+ };
10
+
11
+ var _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("path", {
12
+ d: "M19,3V5H19V19M17,8.4L13.4,12L17,15.6L15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4Z"
13
+ }, null, -1
14
+ /* HOISTED */
15
+ ));
16
+
17
+ var _hoisted_3 = [_hoisted_2];
18
+ export function render(_ctx, _cache) {
19
+ return _openBlock(), _createElementBlock("svg", _hoisted_1, _hoisted_3);
20
+ }
21
+ export default defineComponent({
22
+ render
23
+ });
@@ -0,0 +1,23 @@
1
+ import { defineComponent } from 'vue';
2
+ import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
3
+
4
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
5
+
6
+ var _hoisted_1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "2 3.6 20 20"
9
+ };
10
+
11
+ var _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("path", {
12
+ d: "M11,9H13V7H11M11,20H13V11H11V20Z"
13
+ }, null, -1
14
+ /* HOISTED */
15
+ ));
16
+
17
+ var _hoisted_3 = [_hoisted_2];
18
+ export function render(_ctx, _cache) {
19
+ return _openBlock(), _createElementBlock("svg", _hoisted_1, _hoisted_3);
20
+ }
21
+ export default defineComponent({
22
+ render
23
+ });
@@ -0,0 +1,23 @@
1
+ import { defineComponent } from 'vue';
2
+ import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
3
+
4
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
5
+
6
+ var _hoisted_1 = {
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "-3 -3 30 30"
9
+ };
10
+
11
+ var _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("path", {
12
+ d: "M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z"
13
+ }, null, -1
14
+ /* HOISTED */
15
+ ));
16
+
17
+ var _hoisted_3 = [_hoisted_2];
18
+ export function render(_ctx, _cache) {
19
+ return _openBlock(), _createElementBlock("svg", _hoisted_1, _hoisted_3);
20
+ }
21
+ export default defineComponent({
22
+ render
23
+ });
@@ -0,0 +1,95 @@
1
+ import { computed, defineComponent } from 'vue';
2
+ import { toNumber } from '@varlet/shared';
3
+ import { props } from './props';
4
+ import { createNamespace } from '../utils/components';
5
+ import { toPxNum, toSizeUnit } from '../utils/elements';
6
+ import Info from './Info.js'
7
+ import Error from './Error.js'
8
+ import Warning from './Warning.js'
9
+ import Success from './Success.js'
10
+ import Question from './Question.js'
11
+ import Empty from './Empty.js'
12
+ var {
13
+ n,
14
+ classes
15
+ } = createNamespace('result');
16
+ import { renderSlot as _renderSlot, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString } from "vue";
17
+ export function render(_ctx, _cache) {
18
+ return _openBlock(), _createElementBlock("div", {
19
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box')))
20
+ }, [_renderSlot(_ctx.$slots, "image", {}, () => [_ctx.type ? (_openBlock(), _createElementBlock("div", {
21
+ key: 0,
22
+ class: _normalizeClass(_ctx.n('image-container'))
23
+ }, [_createElementVNode("div", {
24
+ class: _normalizeClass(_ctx.classes(_ctx.n('image'), _ctx.n(_ctx.type))),
25
+ style: _normalizeStyle({
26
+ width: _ctx.circleSize,
27
+ height: _ctx.circleSize,
28
+ borderWidth: _ctx.borderSize
29
+ })
30
+ }, [(_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.type), {
31
+ "border-size": _ctx.borderSize,
32
+ animation: _ctx.animation
33
+ }, null, 8
34
+ /* PROPS */
35
+ , ["border-size", "animation"]))], 6
36
+ /* CLASS, STYLE */
37
+ )], 2
38
+ /* CLASS */
39
+ )) : _createCommentVNode("v-if", true)]), _renderSlot(_ctx.$slots, "title", {}, () => [_ctx.title ? (_openBlock(), _createElementBlock("div", {
40
+ key: 0,
41
+ class: _normalizeClass(_ctx.n('title'))
42
+ }, _toDisplayString(_ctx.title), 3
43
+ /* TEXT, CLASS */
44
+ )) : _createCommentVNode("v-if", true)]), _renderSlot(_ctx.$slots, "description", {}, () => [_ctx.description ? (_openBlock(), _createElementBlock("div", {
45
+ key: 0,
46
+ class: _normalizeClass(_ctx.n('description'))
47
+ }, _toDisplayString(_ctx.description), 3
48
+ /* TEXT, CLASS */
49
+ )) : _createCommentVNode("v-if", true)]), _ctx.$slots.footer ? (_openBlock(), _createElementBlock("div", {
50
+ key: 0,
51
+ class: _normalizeClass(_ctx.n('footer'))
52
+ }, [_renderSlot(_ctx.$slots, "footer")], 2
53
+ /* CLASS */
54
+ )) : _createCommentVNode("v-if", true)], 2
55
+ /* CLASS */
56
+ );
57
+ }
58
+ export default defineComponent({
59
+ render,
60
+ name: 'VarResult',
61
+ components: {
62
+ Info,
63
+ Success,
64
+ Warning,
65
+ Error,
66
+ Question,
67
+ Empty
68
+ },
69
+ props,
70
+
71
+ setup(props) {
72
+ var circleSize = computed(() => {
73
+ var {
74
+ imageSize
75
+ } = props;
76
+ return "calc(" + (imageSize ? toSizeUnit(imageSize) : 'var(--result-image-size)') + " * 0.9)";
77
+ });
78
+ var borderSize = computed(() => {
79
+ var {
80
+ imageSize
81
+ } = props;
82
+ return "calc(" + (imageSize ? toSizeUnit(props.imageSize) : 'var(--result-image-size)') + " * 0.05)";
83
+ });
84
+ return {
85
+ n,
86
+ classes,
87
+ toNumber,
88
+ toPxNum,
89
+ toSizeUnit,
90
+ circleSize,
91
+ borderSize
92
+ };
93
+ }
94
+
95
+ });
File without changes