@varlet/ui 2.13.0-alpha.1689438329324 → 2.13.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.
- package/es/divider/Divider.mjs +33 -24
- package/es/divider/divider.css +1 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/varlet.esm.js +2602 -2604
- package/highlight/web-types.en-US.json +4 -4
- package/highlight/web-types.zh-CN.json +4 -4
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +96 -102
- package/package.json +6 -6
- package/types/divider.d.ts +1 -1
- package/umd/varlet.js +5 -5
package/es/divider/Divider.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineComponent, computed, reactive, onUpdated, toRefs } from 'vue';
|
|
1
|
+
import { defineComponent, computed, ref, onUpdated } from 'vue';
|
|
3
2
|
import { toSizeUnit } from '../utils/elements.mjs';
|
|
4
|
-
import {
|
|
3
|
+
import { toNumber, isBoolean } from '@varlet/shared';
|
|
5
4
|
import { props } from './props.mjs';
|
|
6
5
|
import { createNamespace } from '../utils/components.mjs';
|
|
7
6
|
import { onSmartMounted } from '@varlet/use';
|
|
@@ -12,12 +11,14 @@ var {
|
|
|
12
11
|
import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle } from "vue";
|
|
13
12
|
function __render__(_ctx, _cache) {
|
|
14
13
|
return _openBlock(), _createElementBlock("div", {
|
|
15
|
-
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), [_ctx.vertical, _ctx.n('--vertical')], [_ctx.withText, _ctx.n('--with-text')], [_ctx.
|
|
14
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), [_ctx.vertical, _ctx.n('--vertical')], [_ctx.withText, _ctx.n('--with-text')], [_ctx.withPresetInset, _ctx.n('--inset')], [_ctx.dashed, _ctx.n('--dashed')], [_ctx.hairline, _ctx.n('--hairline')])),
|
|
16
15
|
style: _normalizeStyle(_ctx.style)
|
|
17
|
-
}, [_renderSlot(_ctx.$slots, "default", {
|
|
16
|
+
}, [!_ctx.vertical ? _renderSlot(_ctx.$slots, "default", {
|
|
17
|
+
key: 0
|
|
18
|
+
}, () => [_ctx.description ? (_openBlock(), _createElementBlock("span", {
|
|
18
19
|
key: 0,
|
|
19
20
|
class: _normalizeClass(_ctx.n('text'))
|
|
20
|
-
}, _toDisplayString(_ctx.description), 3 /* TEXT, CLASS */)) : _createCommentVNode("v-if", true)])], 6 /* CLASS, STYLE */);
|
|
21
|
+
}, _toDisplayString(_ctx.description), 3 /* TEXT, CLASS */)) : _createCommentVNode("v-if", true)]) : _createCommentVNode("v-if", true)], 6 /* CLASS, STYLE */);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
var __sfc__ = defineComponent({
|
|
@@ -27,33 +28,41 @@ var __sfc__ = defineComponent({
|
|
|
27
28
|
var {
|
|
28
29
|
slots
|
|
29
30
|
} = _ref;
|
|
30
|
-
var
|
|
31
|
-
|
|
31
|
+
var withText = ref(false);
|
|
32
|
+
var withPresetInset = computed(() => {
|
|
33
|
+
// the inset is only effective in horizontal mode
|
|
34
|
+
var {
|
|
35
|
+
vertical,
|
|
36
|
+
inset
|
|
37
|
+
} = props;
|
|
38
|
+
return !vertical && inset === true;
|
|
32
39
|
});
|
|
33
|
-
var isInset = computed(() => isBoolean(props.inset) ? props.inset : true);
|
|
34
40
|
var style = computed(() => {
|
|
35
41
|
var {
|
|
36
42
|
inset,
|
|
37
43
|
vertical,
|
|
38
44
|
margin
|
|
39
45
|
} = props;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return _extends({}, baseStyle);
|
|
46
|
+
if (isBoolean(inset) || vertical) {
|
|
47
|
+
return {
|
|
48
|
+
margin
|
|
49
|
+
};
|
|
45
50
|
}
|
|
46
51
|
var _inset = toNumber(inset);
|
|
47
52
|
var absInsetWithUnit = Math.abs(_inset) + (inset + '').replace(_inset + '', '');
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
}) : _extends({}, baseStyle, {
|
|
53
|
+
return {
|
|
54
|
+
margin,
|
|
51
55
|
width: "calc(100% - " + toSizeUnit(absInsetWithUnit) + ")",
|
|
52
56
|
left: _inset > 0 ? toSizeUnit(absInsetWithUnit) : toSizeUnit(0)
|
|
53
|
-
}
|
|
57
|
+
};
|
|
54
58
|
});
|
|
55
59
|
var checkHasText = () => {
|
|
56
|
-
|
|
60
|
+
// the default slot or description is only effective in horizontal mode
|
|
61
|
+
var {
|
|
62
|
+
description,
|
|
63
|
+
vertical
|
|
64
|
+
} = props;
|
|
65
|
+
withText.value = (slots.default || description != null) && !vertical;
|
|
57
66
|
};
|
|
58
67
|
onSmartMounted(() => {
|
|
59
68
|
checkHasText();
|
|
@@ -61,13 +70,13 @@ var __sfc__ = defineComponent({
|
|
|
61
70
|
onUpdated(() => {
|
|
62
71
|
checkHasText();
|
|
63
72
|
});
|
|
64
|
-
return
|
|
73
|
+
return {
|
|
65
74
|
n,
|
|
66
|
-
classes
|
|
67
|
-
|
|
75
|
+
classes,
|
|
76
|
+
withText,
|
|
68
77
|
style,
|
|
69
|
-
|
|
70
|
-
}
|
|
78
|
+
withPresetInset
|
|
79
|
+
};
|
|
71
80
|
}
|
|
72
81
|
});
|
|
73
82
|
__sfc__.render = __render__;
|
package/es/divider/divider.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --divider-color: rgba(0, 0, 0, 0.12); --divider-text-color: #888; --divider-text-margin: 8px 0; --divider-text-padding: 0 8px; --divider-inset: 72px;
|
|
1
|
+
:root { --divider-color: rgba(0, 0, 0, 0.12); --divider-text-color: #888; --divider-text-margin: 8px 0; --divider-text-padding: 0 8px; --divider-inset: 72px;}.var-divider { position: relative; width: 100%; height: 0; border: none; border-top: 1px solid var(--divider-color); margin: var(--divider-text-margin); font-size: var(--font-size-md); color: var(--divider-text-color);}.var-divider--vertical { width: 0; height: auto; align-self: stretch; margin: 0 var(--divider-text-margin); border-top: none; border-left: 1px solid var(--divider-color);}.var-divider--inset { width: calc(100% - var(--divider-inset)); left: var(--divider-inset);}.var-divider__text { display: inline-block; padding: var(--divider-text-padding);}.var-divider--with-text { background-color: transparent; height: fit-content; display: flex; align-items: center; justify-content: center; border: none;}.var-divider--with-text::before,.var-divider--with-text::after { display: inline-block; content: ''; flex: 1; height: 0; border-top: 1px solid var(--divider-color);}.var-divider--dashed { border-top-style: dashed;}.var-divider--dashed.var-divider--vertical { border-top: none; border-left-style: dashed;}.var-divider--hairline { transform: scaleY(0.5);}.var-divider--hairline.var-divider--with-text { transform: none;}.var-divider--hairline.var-divider--with-text::before,.var-divider--hairline.var-divider--with-text::after { transform: scaleY(0.5);}.var-divider--hairline.var-divider--vertical { transform: scaleX(0.5);}
|
package/es/index.bundle.mjs
CHANGED
|
@@ -244,7 +244,7 @@ import './time-picker/style/index.mjs'
|
|
|
244
244
|
import './tooltip/style/index.mjs'
|
|
245
245
|
import './uploader/style/index.mjs'
|
|
246
246
|
|
|
247
|
-
const version = '2.13.0
|
|
247
|
+
const version = '2.13.0'
|
|
248
248
|
|
|
249
249
|
function install(app) {
|
|
250
250
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -162,7 +162,7 @@ export * from './time-picker/index.mjs'
|
|
|
162
162
|
export * from './tooltip/index.mjs'
|
|
163
163
|
export * from './uploader/index.mjs'
|
|
164
164
|
|
|
165
|
-
const version = '2.13.0
|
|
165
|
+
const version = '2.13.0'
|
|
166
166
|
|
|
167
167
|
function install(app) {
|
|
168
168
|
ActionSheet.install && app.use(ActionSheet)
|