@varlet/ui 2.3.0 → 2.4.0-alpha.1670569085974

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 (67) hide show
  1. package/es/card/Card.js +1 -1
  2. package/es/index.js +10 -0
  3. package/es/link/props.js +0 -4
  4. package/es/loading-bar/LoadingBar.js +32 -0
  5. package/es/loading-bar/index.js +60 -0
  6. package/es/loading-bar/loadingBar.css +1 -0
  7. package/es/loading-bar/props.js +23 -0
  8. package/es/loading-bar/style/index.js +2 -0
  9. package/es/popup/Popup.js +1 -1
  10. package/es/popup/popup.css +1 -1
  11. package/es/popup/props.js +4 -0
  12. package/es/result/Empty.js +23 -0
  13. package/es/result/Error.js +23 -0
  14. package/es/result/Info.js +23 -0
  15. package/es/result/Question.js +23 -0
  16. package/es/result/Result.js +95 -0
  17. package/es/result/ResultSfc.css +0 -0
  18. package/es/result/Success.js +74 -0
  19. package/es/result/Warning.js +23 -0
  20. package/es/result/index.js +8 -0
  21. package/es/result/props.js +24 -0
  22. package/es/result/result.css +1 -0
  23. package/es/result/style/index.js +2 -0
  24. package/es/style.css +1 -1
  25. package/es/style.js +2 -0
  26. package/es/themes/dark/index.js +2 -1
  27. package/es/themes/dark/result.js +9 -0
  28. package/es/umdIndex.js +10 -0
  29. package/es/varlet.esm.js +5078 -4694
  30. package/highlight/attributes.json +24 -0
  31. package/highlight/tags.json +13 -0
  32. package/highlight/web-types.json +85 -1
  33. package/lib/card/Card.js +1 -1
  34. package/lib/index.js +6 -0
  35. package/lib/link/props.js +0 -4
  36. package/lib/loading-bar/LoadingBar.js +48 -0
  37. package/lib/loading-bar/index.js +72 -0
  38. package/lib/loading-bar/loadingBar.css +1 -0
  39. package/lib/loading-bar/props.js +28 -0
  40. package/lib/loading-bar/style/index.js +2 -0
  41. package/lib/popup/Popup.js +1 -1
  42. package/lib/popup/popup.css +1 -1
  43. package/lib/popup/props.js +4 -0
  44. package/lib/result/Empty.js +32 -0
  45. package/lib/result/Error.js +32 -0
  46. package/lib/result/Info.js +32 -0
  47. package/lib/result/Question.js +32 -0
  48. package/lib/result/Result.js +117 -0
  49. package/lib/result/ResultSfc.css +0 -0
  50. package/lib/result/Success.js +86 -0
  51. package/lib/result/Warning.js +32 -0
  52. package/lib/result/index.js +17 -0
  53. package/lib/result/props.js +30 -0
  54. package/lib/result/result.css +1 -0
  55. package/lib/result/style/index.js +2 -0
  56. package/lib/snackbar/style/index.js +1 -1
  57. package/lib/style.css +1 -1
  58. package/lib/style.js +2 -0
  59. package/lib/themes/dark/index.js +3 -1
  60. package/lib/themes/dark/result.js +14 -0
  61. package/package.json +8 -9
  62. package/types/index.d.ts +4 -0
  63. package/types/loadingBar.d.ts +17 -0
  64. package/types/popup.d.ts +1 -0
  65. package/types/result.d.ts +25 -0
  66. package/umd/varlet.js +7 -7
  67. package/CHANGELOG.md +0 -1885
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ exports.render = render;
6
+
7
+ var _vue = require("vue");
8
+
9
+ var _shared = require("@varlet/shared");
10
+
11
+ var _props = require("./props");
12
+
13
+ var _components = require("../utils/components");
14
+
15
+ var _elements = require("../utils/elements");
16
+
17
+ var _Info = _interopRequireDefault(require("./Info.js"));
18
+
19
+ var _Error = _interopRequireDefault(require("./Error.js"));
20
+
21
+ var _Warning = _interopRequireDefault(require("./Warning.js"));
22
+
23
+ var _Success = _interopRequireDefault(require("./Success.js"));
24
+
25
+ var _Question = _interopRequireDefault(require("./Question.js"));
26
+
27
+ var _Empty = _interopRequireDefault(require("./Empty.js"));
28
+
29
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
+
31
+ var {
32
+ n,
33
+ classes
34
+ } = (0, _components.createNamespace)('result');
35
+
36
+ function render(_ctx, _cache) {
37
+ return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
38
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), _ctx.n('$--box')))
39
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "image", {}, () => [_ctx.type ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
40
+ key: 0,
41
+ class: (0, _vue.normalizeClass)(_ctx.n('image-container'))
42
+ }, [(0, _vue.createElementVNode)("div", {
43
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('image'), _ctx.n(_ctx.type))),
44
+ style: (0, _vue.normalizeStyle)({
45
+ width: _ctx.circleSize,
46
+ height: _ctx.circleSize,
47
+ borderWidth: _ctx.borderSize
48
+ })
49
+ }, [((0, _vue.openBlock)(), (0, _vue.createBlock)((0, _vue.resolveDynamicComponent)(_ctx.type), {
50
+ "border-size": _ctx.borderSize,
51
+ animation: _ctx.animation
52
+ }, null, 8
53
+ /* PROPS */
54
+ , ["border-size", "animation"]))], 6
55
+ /* CLASS, STYLE */
56
+ )], 2
57
+ /* CLASS */
58
+ )) : (0, _vue.createCommentVNode)("v-if", true)]), (0, _vue.renderSlot)(_ctx.$slots, "title", {}, () => [_ctx.title ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
59
+ key: 0,
60
+ class: (0, _vue.normalizeClass)(_ctx.n('title'))
61
+ }, (0, _vue.toDisplayString)(_ctx.title), 3
62
+ /* TEXT, CLASS */
63
+ )) : (0, _vue.createCommentVNode)("v-if", true)]), (0, _vue.renderSlot)(_ctx.$slots, "description", {}, () => [_ctx.description ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
64
+ key: 0,
65
+ class: (0, _vue.normalizeClass)(_ctx.n('description'))
66
+ }, (0, _vue.toDisplayString)(_ctx.description), 3
67
+ /* TEXT, CLASS */
68
+ )) : (0, _vue.createCommentVNode)("v-if", true)]), _ctx.$slots.footer ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
69
+ key: 0,
70
+ class: (0, _vue.normalizeClass)(_ctx.n('footer'))
71
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "footer")], 2
72
+ /* CLASS */
73
+ )) : (0, _vue.createCommentVNode)("v-if", true)], 2
74
+ /* CLASS */
75
+ );
76
+ }
77
+
78
+ var _default = (0, _vue.defineComponent)({
79
+ render,
80
+ name: 'VarResult',
81
+ components: {
82
+ Info: _Info.default,
83
+ Success: _Success.default,
84
+ Warning: _Warning.default,
85
+ Error: _Error.default,
86
+ Question: _Question.default,
87
+ Empty: _Empty.default
88
+ },
89
+ props: _props.props,
90
+
91
+ setup(props) {
92
+ var circleSize = (0, _vue.computed)(() => {
93
+ var {
94
+ imageSize
95
+ } = props;
96
+ return "calc(" + (imageSize ? (0, _elements.toSizeUnit)(imageSize) : 'var(--result-image-size)') + " * 0.9)";
97
+ });
98
+ var borderSize = (0, _vue.computed)(() => {
99
+ var {
100
+ imageSize
101
+ } = props;
102
+ return "calc(" + (imageSize ? (0, _elements.toSizeUnit)(props.imageSize) : 'var(--result-image-size)') + " * 0.05)";
103
+ });
104
+ return {
105
+ n,
106
+ classes,
107
+ toNumber: _shared.toNumber,
108
+ toPxNum: _elements.toPxNum,
109
+ toSizeUnit: _elements.toSizeUnit,
110
+ circleSize,
111
+ borderSize
112
+ };
113
+ }
114
+
115
+ });
116
+
117
+ exports.default = _default;
File without changes
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ exports.render = render;
6
+
7
+ var _vue = require("vue");
8
+
9
+ var _components = require("../utils/components");
10
+
11
+ var _shared = require("@varlet/shared");
12
+
13
+ var {
14
+ n,
15
+ classes
16
+ } = (0, _components.createNamespace)('result');
17
+
18
+ function render(_ctx, _cache) {
19
+ return (0, _vue.openBlock)(), (0, _vue.createElementBlock)(_vue.Fragment, null, [(0, _vue.createElementVNode)("span", {
20
+ class: (0, _vue.normalizeClass)(_ctx.n('success-cover-left'))
21
+ }, null, 2
22
+ /* CLASS */
23
+ ), (0, _vue.createElementVNode)("span", {
24
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('success-line'), _ctx.n('success-line-tip'))),
25
+ style: (0, _vue.normalizeStyle)({
26
+ animationDuration: _ctx.animation ? "760ms" : '0ms',
27
+ borderRadius: "calc(" + _ctx.borderSize + " * 0.625)"
28
+ })
29
+ }, null, 6
30
+ /* CLASS, STYLE */
31
+ ), (0, _vue.createElementVNode)("span", {
32
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('success-line'), _ctx.n('success-line-long'))),
33
+ style: (0, _vue.normalizeStyle)({
34
+ animationDuration: _ctx.animation ? "770ms" : '0ms',
35
+ borderRadius: "calc(" + _ctx.borderSize + " * 0.625)"
36
+ })
37
+ }, null, 6
38
+ /* CLASS, STYLE */
39
+ ), (0, _vue.createElementVNode)("span", {
40
+ ref: "circle",
41
+ class: (0, _vue.normalizeClass)(_ctx.n('success-circle')),
42
+ style: (0, _vue.normalizeStyle)({
43
+ left: "-" + _ctx.borderSize,
44
+ top: "-" + _ctx.borderSize,
45
+ borderWidth: _ctx.borderSize
46
+ })
47
+ }, null, 6
48
+ /* CLASS, STYLE */
49
+ ), (0, _vue.createElementVNode)("span", {
50
+ class: (0, _vue.normalizeClass)(_ctx.n('success-line-fix'))
51
+ }, null, 2
52
+ /* CLASS */
53
+ ), (0, _vue.createElementVNode)("span", {
54
+ class: (0, _vue.normalizeClass)(_ctx.n('success-cover-right')),
55
+ style: (0, _vue.normalizeStyle)({
56
+ animationDuration: _ctx.animation ? "4250ms" : '0ms'
57
+ })
58
+ }, null, 6
59
+ /* CLASS, STYLE */
60
+ )], 64
61
+ /* STABLE_FRAGMENT */
62
+ );
63
+ }
64
+
65
+ var _default = (0, _vue.defineComponent)({
66
+ render,
67
+ props: {
68
+ animation: {
69
+ type: Boolean
70
+ },
71
+ borderSize: {
72
+ type: String
73
+ }
74
+ },
75
+
76
+ setup() {
77
+ return {
78
+ n,
79
+ classes,
80
+ toNumber: _shared.toNumber
81
+ };
82
+ }
83
+
84
+ });
85
+
86
+ exports.default = _default;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ exports.render = render;
6
+
7
+ var _vue = require("vue");
8
+
9
+ var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
10
+
11
+ var _hoisted_1 = {
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ viewBox: "-6 -4 35 35"
14
+ };
15
+
16
+ var _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/(0, _vue.createElementVNode)("path", {
17
+ d: "M10,21H14A2,2 0 0,1 12,23A2,2 0 0,1 10,21M21,19V20H3V19L5,17V11C5,7.9 7.03,5.17 10,4.29C10,4.19 10,4.1 10,4A2,2 0 0,1 12,2A2,2 0 0,1 14,4C14,4.1 14,4.19 14,4.29C16.97,5.17 19,7.9 19,11V17L21,19M17,11A5,5 0 0,0 12,6A5,5 0 0,0 7,11V18H17V11M19.75,3.19L18.33,4.61M1,11"
18
+ }, null, -1
19
+ /* HOISTED */
20
+ ));
21
+
22
+ var _hoisted_3 = [_hoisted_2];
23
+
24
+ function render(_ctx, _cache) {
25
+ return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("svg", _hoisted_1, _hoisted_3);
26
+ }
27
+
28
+ var _default = (0, _vue.defineComponent)({
29
+ render
30
+ });
31
+
32
+ exports.default = _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports._ResultComponent = void 0;
5
+
6
+ var _Result = _interopRequireDefault(require("./Result.js"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ _Result.default.install = function (app) {
11
+ app.component(_Result.default.name, _Result.default);
12
+ };
13
+
14
+ var _ResultComponent = _Result.default;
15
+ exports._ResultComponent = _ResultComponent;
16
+ var _default = _Result.default;
17
+ exports.default = _default;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.props = void 0;
5
+
6
+ function typeValidator(type) {
7
+ return ['info', 'success', 'warning', 'error', 'question', 'empty'].includes(type);
8
+ }
9
+
10
+ var props = {
11
+ imageSize: {
12
+ type: [String, Number]
13
+ },
14
+ type: {
15
+ type: String,
16
+ default: 'success',
17
+ validator: typeValidator
18
+ },
19
+ title: {
20
+ type: String
21
+ },
22
+ description: {
23
+ type: String
24
+ },
25
+ animation: {
26
+ type: Boolean,
27
+ default: true
28
+ }
29
+ };
30
+ exports.props = props;
@@ -0,0 +1 @@
1
+ :root { --result-background: #fff; --result-padding: 24px; --result-border-radius: 3px; --result-title-color: #444; --result-title-font-size: 32px; --result-title-margin: 15px 0 0 0; --result-image-size: 80px; --result-title-font-weight: 500; --result-description-margin: 10px 0 0 0; --result-description-font-size: 14px; --result-description-color: rgba(0, 0, 0, 0.6); --result-description-line-height: 1.6; --result-info-color: var(--color-info); --result-info-border-color: rgba(0, 175, 239, 0.3); --result-success-color: var(--color-success); --result-success-border-color: rgba(0, 196, 143, 0.3); --result-error-color: var(--color-danger); --result-error-border-color: rgba(244, 67, 54, 0.3); --result-warning-color: var(--color-warning); --result-warning-border-color: rgba(255, 159, 0, 0.3); --result-question-color: #607d8b; --result-question-border-color: rgba(96, 125, 139, 0.3); --result-empty-color: #9e9e9e; --result-empty-border-color: rgba(158, 158, 158, 0.3);}.var-result { display: flex; flex-direction: column; align-items: center; border-radius: var(--result-border-radius); width: 100%; padding: var(--result-padding); background-color: var(--result-background); transition: background-color 0.25s;}.var-result__image-container { overflow: hidden;}.var-result__image { margin: 0 auto; position: relative; border-radius: 50%; box-sizing: content-box; border-style: solid; border-color: transparent; width: var(--result-image-size); height: var(--result-image-size); display: flex; justify-content: center; align-items: center;}.var-result__image svg { margin: 0 auto; display: block; width: 100%; height: 100%;}.var-result__info { border-color: var(--result-info-border-color);}.var-result__info path { fill: var(--result-info-color);}.var-result__empty { border-color: var(--result-empty-border-color);}.var-result__empty path { fill: var(--result-empty-color);}.var-result__question { border-color: var(--result-question-border-color);}.var-result__question path { fill: var(--result-question-color);}.var-result__error { border-color: var(--result-error-border-color);}.var-result__error path { fill: var(--result-error-color);}.var-result__warning { border-color: var(--result-warning-border-color);}.var-result__warning path { fill: var(--result-warning-color);}.var-result__success { border-color: var(--result-success-color);}.var-result__success-cover-left { display: block; position: absolute; z-index: 1; top: -0.875%; left: -41.27%; width: 75%; height: 150%; border-radius: 150% 0 0 150%; transform: rotate(-45deg); background: var(--result-background); transition: background-color 0.25s;}.var-result__success-cover-right { display: block; position: absolute; top: -13.75%; left: 37.5%; width: 75%; height: 150%; border-radius: 0 125% 125% 0; animation-name: rotate-circle; animation-timing-function: ease-in; transform-origin: 0 50%; transform: rotate(-45deg); background: var(--result-background); transition: background-color 0.25s;}.var-result__success-line { height: 6.8%; background-color: var(--result-success-color); display: block; position: absolute; z-index: 10; transition: background-color 0.25s;}.var-result__success-line-tip { transform: rotate(45deg); animation-name: success-line-tip; animation-fill-mode: forwards;}.var-result__success-line-long { transform: rotate(-45deg); animation-name: success-line-long; animation-fill-mode: forwards;}.var-result__success-circle { z-index: 10; width: 100%; height: 100%; border-radius: 50%; position: absolute; box-sizing: content-box !important; border-style: solid; border-color: var(--result-success-border-color);}.var-result__success-line-fix { top: 10%; left: 32.5%; width: 8.75%; height: 112.5%; z-index: 1; position: absolute; transform: rotate(-45deg); background: var(--result-background); transition: background-color 0.25s;}@keyframes success-line-tip { 0% { top: 23.75%; left: 1.25%; width: 0; } 54% { top: 20.25%; left: 1%; width: 0; } 70% { top: 43.75%; left: -9.5%; width: 62.5%; } 84% { top: 60%; left: 26.25%; width: 21.25%; } 100% { top: 56.25%; left: 17.5%; width: 31.25%; }}@keyframes success-line-long { 0% { top: 67.5%; right: 57.5%; width: 0; } 65% { top: 67.5%; right: 57.5%; width: 0; } 84% { top: 43.75%; right: 0; width: 68.75%; } 100% { top: 47%; right: 9%; width: 58.75%; }}@keyframes rotate-circle { 0% { transform: rotate(-45deg); } 5% { transform: rotate(-45deg); } 12% { transform: rotate(-405deg); } 100% { transform: rotate(-405deg); }}.var-result__title { font-size: var(--result-title-font-size); word-break: break-word; margin: var(--result-title-margin); font-weight: var(--result-title-font-weight); color: var(--result-title-color); text-align: center;}.var-result__description { font-size: var(--result-description-font-size); word-break: break-word; color: var(--result-description-color); margin: var(--result-description-margin); line-height: var(--result-description-line-height); text-align: center;}.var-result__footer { z-index: 1; margin-top: 20px;}
@@ -0,0 +1,2 @@
1
+ require('../result.css')
2
+ require('../ResultSfc.css')
@@ -1,8 +1,8 @@
1
1
  require('../../styles/common.css')
2
+ require('../SnackbarSfc.css')
2
3
  require('../../styles/elevation.css')
3
4
  require('../../loading/loading.css')
4
5
  require('../../button/button.css')
5
6
  require('../../icon/icon.css')
6
7
  require('../snackbar.css')
7
8
  require('../coreSfc.css')
8
- require('../SnackbarSfc.css')