@varlet/ui 2.13.4 → 2.13.5-alpha.1690475177454
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/icon/icon.css +1 -1
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/menu/props.mjs +8 -0
- package/es/menu/usePopover.mjs +15 -11
- package/es/progress/Progress.mjs +6 -11
- package/es/progress/progress.css +1 -1
- package/es/style.css +1 -1
- package/es/tooltip/props.mjs +8 -0
- package/es/varlet.esm.js +2567 -2556
- package/highlight/web-types.en-US.json +19 -1
- package/highlight/web-types.zh-CN.json +19 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +37 -28
- package/package.json +6 -6
- package/types/menu.d.ts +4 -0
- package/types/tooltip.d.ts +4 -0
- package/umd/varlet.js +5 -5
package/lib/varlet.cjs.js
CHANGED
|
@@ -13046,12 +13046,17 @@ function usePopover(options) {
|
|
|
13046
13046
|
call(options.onClosed);
|
|
13047
13047
|
};
|
|
13048
13048
|
var getPosition = () => {
|
|
13049
|
+
var {
|
|
13050
|
+
offsetX,
|
|
13051
|
+
offsetY,
|
|
13052
|
+
placement
|
|
13053
|
+
} = options;
|
|
13049
13054
|
computeHostSize();
|
|
13050
13055
|
var offset2 = {
|
|
13051
|
-
x: toPxNum(
|
|
13052
|
-
y: toPxNum(
|
|
13056
|
+
x: toPxNum(offsetX),
|
|
13057
|
+
y: toPxNum(offsetY)
|
|
13053
13058
|
};
|
|
13054
|
-
switch (
|
|
13059
|
+
switch (placement) {
|
|
13055
13060
|
case "cover-top":
|
|
13056
13061
|
return {
|
|
13057
13062
|
placement: "bottom",
|
|
@@ -13104,7 +13109,7 @@ function usePopover(options) {
|
|
|
13104
13109
|
case "left-start":
|
|
13105
13110
|
case "left-end":
|
|
13106
13111
|
return {
|
|
13107
|
-
placement
|
|
13112
|
+
placement,
|
|
13108
13113
|
skidding: offset2.y,
|
|
13109
13114
|
distance: -offset2.x
|
|
13110
13115
|
};
|
|
@@ -13112,7 +13117,7 @@ function usePopover(options) {
|
|
|
13112
13117
|
case "top-start":
|
|
13113
13118
|
case "top-end":
|
|
13114
13119
|
return {
|
|
13115
|
-
placement
|
|
13120
|
+
placement,
|
|
13116
13121
|
skidding: offset2.x,
|
|
13117
13122
|
distance: -offset2.y
|
|
13118
13123
|
};
|
|
@@ -13120,7 +13125,7 @@ function usePopover(options) {
|
|
|
13120
13125
|
case "bottom-start":
|
|
13121
13126
|
case "bottom-end":
|
|
13122
13127
|
return {
|
|
13123
|
-
placement
|
|
13128
|
+
placement,
|
|
13124
13129
|
skidding: offset2.x,
|
|
13125
13130
|
distance: offset2.y
|
|
13126
13131
|
};
|
|
@@ -13128,7 +13133,7 @@ function usePopover(options) {
|
|
|
13128
13133
|
case "right-start":
|
|
13129
13134
|
case "right-end":
|
|
13130
13135
|
return {
|
|
13131
|
-
placement
|
|
13136
|
+
placement,
|
|
13132
13137
|
skidding: offset2.y,
|
|
13133
13138
|
distance: offset2.x
|
|
13134
13139
|
};
|
|
@@ -13165,7 +13170,8 @@ function usePopover(options) {
|
|
|
13165
13170
|
}];
|
|
13166
13171
|
return {
|
|
13167
13172
|
placement,
|
|
13168
|
-
modifiers
|
|
13173
|
+
modifiers,
|
|
13174
|
+
strategy: options.strategy
|
|
13169
13175
|
};
|
|
13170
13176
|
};
|
|
13171
13177
|
var getReference = () => options.reference ? host.value.querySelector(options.reference) : host.value;
|
|
@@ -13187,9 +13193,7 @@ function usePopover(options) {
|
|
|
13187
13193
|
call(options["onUpdate:show"], false);
|
|
13188
13194
|
};
|
|
13189
13195
|
useClickOutside(getReference, "click", handleClickOutside);
|
|
13190
|
-
vue.watch(() => options.offsetX, resize);
|
|
13191
|
-
vue.watch(() => options.offsetY, resize);
|
|
13192
|
-
vue.watch(() => options.placement, resize);
|
|
13196
|
+
vue.watch(() => [options.offsetX, options.offsetY, options.placement, options.strategy], resize);
|
|
13193
13197
|
vue.watch(() => options.disabled, close);
|
|
13194
13198
|
vue.onMounted(() => {
|
|
13195
13199
|
var _getReference;
|
|
@@ -13225,6 +13229,9 @@ function placementValidator$1(alignment) {
|
|
|
13225
13229
|
function typeValidator$5(type) {
|
|
13226
13230
|
return ["default", "primary", "info", "success", "warning", "danger"].includes(type);
|
|
13227
13231
|
}
|
|
13232
|
+
function strategyValidator$1(strategy) {
|
|
13233
|
+
return ["absolute", "fixed"].includes(strategy);
|
|
13234
|
+
}
|
|
13228
13235
|
var props$I = {
|
|
13229
13236
|
type: {
|
|
13230
13237
|
type: String,
|
|
@@ -13258,6 +13265,11 @@ var props$I = {
|
|
|
13258
13265
|
default: "bottom",
|
|
13259
13266
|
validator: placementValidator$1
|
|
13260
13267
|
},
|
|
13268
|
+
strategy: {
|
|
13269
|
+
type: String,
|
|
13270
|
+
default: "absolute",
|
|
13271
|
+
validator: strategyValidator$1
|
|
13272
|
+
},
|
|
13261
13273
|
offsetX: {
|
|
13262
13274
|
type: [Number, String],
|
|
13263
13275
|
default: 0
|
|
@@ -17021,6 +17033,9 @@ function triggerValidator(trigger) {
|
|
|
17021
17033
|
function placementValidator(alignment) {
|
|
17022
17034
|
return ["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end", "cover-top", "cover-top-start", "cover-top-end", "cover-bottom", "cover-bottom-start", "cover-bottom-end", "cover-left", "cover-right"].includes(alignment);
|
|
17023
17035
|
}
|
|
17036
|
+
function strategyValidator(strategy) {
|
|
17037
|
+
return ["absolute", "fixed"].includes(strategy);
|
|
17038
|
+
}
|
|
17024
17039
|
var props$s = {
|
|
17025
17040
|
show: {
|
|
17026
17041
|
type: Boolean,
|
|
@@ -17043,6 +17058,11 @@ var props$s = {
|
|
|
17043
17058
|
default: "cover-top-start",
|
|
17044
17059
|
validator: placementValidator
|
|
17045
17060
|
},
|
|
17061
|
+
strategy: {
|
|
17062
|
+
type: String,
|
|
17063
|
+
default: "absolute",
|
|
17064
|
+
validator: strategyValidator
|
|
17065
|
+
},
|
|
17046
17066
|
offsetX: {
|
|
17047
17067
|
type: [Number, String],
|
|
17048
17068
|
default: 0
|
|
@@ -18567,27 +18587,16 @@ function __render__$s(_ctx, _cache) {
|
|
|
18567
18587
|
[vue.createElementVNode(
|
|
18568
18588
|
"div",
|
|
18569
18589
|
{
|
|
18570
|
-
class: vue.normalizeClass(_ctx.n("linear-block")),
|
|
18590
|
+
class: vue.normalizeClass(_ctx.classes(_ctx.n("linear-block"), [_ctx.track, _ctx.n("linear-background")])),
|
|
18571
18591
|
style: vue.normalizeStyle({
|
|
18572
|
-
height: _ctx.toSizeUnit(_ctx.lineWidth)
|
|
18592
|
+
height: _ctx.toSizeUnit(_ctx.lineWidth),
|
|
18593
|
+
background: _ctx.trackColor
|
|
18573
18594
|
})
|
|
18574
18595
|
},
|
|
18575
|
-
[_ctx.
|
|
18596
|
+
[_ctx.indeterminate ? (vue.openBlock(), vue.createElementBlock(
|
|
18576
18597
|
"div",
|
|
18577
18598
|
{
|
|
18578
18599
|
key: 0,
|
|
18579
|
-
class: vue.normalizeClass(_ctx.n("linear-background")),
|
|
18580
|
-
style: vue.normalizeStyle({
|
|
18581
|
-
background: _ctx.trackColor
|
|
18582
|
-
})
|
|
18583
|
-
},
|
|
18584
|
-
null,
|
|
18585
|
-
6
|
|
18586
|
-
/* CLASS, STYLE */
|
|
18587
|
-
)) : vue.createCommentVNode("v-if", true), _ctx.indeterminate ? (vue.openBlock(), vue.createElementBlock(
|
|
18588
|
-
"div",
|
|
18589
|
-
{
|
|
18590
|
-
key: 1,
|
|
18591
18600
|
class: vue.normalizeClass(_ctx.classes([_ctx.indeterminate, _ctx.n("linear-indeterminate")]))
|
|
18592
18601
|
},
|
|
18593
18602
|
[vue.createElementVNode(
|
|
@@ -18618,7 +18627,7 @@ function __render__$s(_ctx, _cache) {
|
|
|
18618
18627
|
)) : (vue.openBlock(), vue.createElementBlock(
|
|
18619
18628
|
"div",
|
|
18620
18629
|
{
|
|
18621
|
-
key:
|
|
18630
|
+
key: 1,
|
|
18622
18631
|
class: vue.normalizeClass(_ctx.classes(_ctx.n("linear-certain"), _ctx.n("linear--" + _ctx.type), [_ctx.ripple, _ctx.n("linear-ripple")])),
|
|
18623
18632
|
style: vue.normalizeStyle({
|
|
18624
18633
|
background: _ctx.color,
|
|
@@ -25137,7 +25146,7 @@ const TimePickerSfc = "";
|
|
|
25137
25146
|
const TooltipSfc = "";
|
|
25138
25147
|
const uploader = "";
|
|
25139
25148
|
const UploaderSfc = "";
|
|
25140
|
-
const version = "2.13.
|
|
25149
|
+
const version = "2.13.5-alpha.1690475177454";
|
|
25141
25150
|
function install(app) {
|
|
25142
25151
|
ActionSheet.install && app.use(ActionSheet);
|
|
25143
25152
|
AppBar.install && app.use(AppBar);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.5-alpha.1690475177454",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"main": "lib/varlet.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@popperjs/core": "^2.11.6",
|
|
47
47
|
"dayjs": "^1.10.4",
|
|
48
48
|
"decimal.js": "^10.2.1",
|
|
49
|
-
"@varlet/
|
|
50
|
-
"@varlet/
|
|
51
|
-
"@varlet/
|
|
49
|
+
"@varlet/use": "2.13.5-alpha.1690475177454",
|
|
50
|
+
"@varlet/icons": "2.13.5-alpha.1690475177454",
|
|
51
|
+
"@varlet/shared": "2.13.5-alpha.1690475177454"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@vue/runtime-core": "3.3.4",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"typescript": "^5.1.5",
|
|
64
64
|
"vue": "3.3.4",
|
|
65
65
|
"vue-router": "4.2.0",
|
|
66
|
-
"@varlet/cli": "2.13.
|
|
67
|
-
"@varlet/touch-emulator": "2.13.
|
|
66
|
+
"@varlet/cli": "2.13.5-alpha.1690475177454",
|
|
67
|
+
"@varlet/touch-emulator": "2.13.5-alpha.1690475177454"
|
|
68
68
|
},
|
|
69
69
|
"browserslist": [
|
|
70
70
|
"Chrome >= 54",
|
package/types/menu.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VarComponent, BasicAttributes, ListenerProp } from './varComponent'
|
|
2
2
|
import { Placement as PopperPlacement } from '@popperjs/core/lib/enums'
|
|
3
3
|
import { TeleportProps, VNode } from 'vue'
|
|
4
|
+
import { PositioningStrategy } from '@popperjs/core'
|
|
4
5
|
|
|
5
6
|
export declare const menuProps: Record<string, any>
|
|
6
7
|
|
|
@@ -19,12 +20,15 @@ export type MenuPlacement =
|
|
|
19
20
|
|
|
20
21
|
export type MenuTrigger = 'click' | 'hover'
|
|
21
22
|
|
|
23
|
+
export type MenuStrategy = PositioningStrategy
|
|
24
|
+
|
|
22
25
|
export interface MenuProps extends BasicAttributes {
|
|
23
26
|
show?: boolean
|
|
24
27
|
disabled?: boolean
|
|
25
28
|
trigger?: MenuTrigger
|
|
26
29
|
reference?: string
|
|
27
30
|
placement?: MenuPlacement
|
|
31
|
+
strategy?: MenuStrategy
|
|
28
32
|
offsetX?: string | number
|
|
29
33
|
offsetY?: string | number
|
|
30
34
|
teleport?: TeleportProps['to']
|
package/types/tooltip.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VarComponent, BasicAttributes, ListenerProp } from './varComponent'
|
|
2
2
|
import { Placement as PopperPlacement } from '@popperjs/core/lib/enums'
|
|
3
3
|
import { TeleportProps, VNode } from 'vue'
|
|
4
|
+
import { PositioningStrategy } from '@popperjs/core'
|
|
4
5
|
|
|
5
6
|
export declare const tooltipProps: Record<string, any>
|
|
6
7
|
|
|
@@ -12,6 +13,8 @@ export type TooltipTrigger = 'click' | 'hover'
|
|
|
12
13
|
|
|
13
14
|
export type TooltipType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger'
|
|
14
15
|
|
|
16
|
+
export type TooltipStrategy = PositioningStrategy
|
|
17
|
+
|
|
15
18
|
export interface TooltipProps extends BasicAttributes {
|
|
16
19
|
show?: boolean
|
|
17
20
|
disabled?: boolean
|
|
@@ -21,6 +24,7 @@ export interface TooltipProps extends BasicAttributes {
|
|
|
21
24
|
trigger?: TooltipTrigger
|
|
22
25
|
reference?: string
|
|
23
26
|
placement?: TooltipPlacement
|
|
27
|
+
strategy?: TooltipStrategy
|
|
24
28
|
offsetX?: string | number
|
|
25
29
|
offsetY?: string | number
|
|
26
30
|
teleport?: TeleportProps['to']
|