@varlet/ui 3.10.7 → 3.10.9-alpha.1749629591895

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.
@@ -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": "3.10.7",
4
+ "version": "3.10.9-alpha.1749629591895",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -8173,6 +8173,15 @@
8173
8173
  "kind": "expression"
8174
8174
  }
8175
8175
  },
8176
+ {
8177
+ "name": "animated",
8178
+ "description": "Whether to enable content switching animation",
8179
+ "default": "true",
8180
+ "value": {
8181
+ "type": "boolean",
8182
+ "kind": "expression"
8183
+ }
8184
+ },
8176
8185
  {
8177
8186
  "name": "loop",
8178
8187
  "description": "Whether to allow cycle switching",
@@ -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": "3.10.7",
4
+ "version": "3.10.9-alpha.1749629591895",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -8387,6 +8387,15 @@
8387
8387
  "kind": "expression"
8388
8388
  }
8389
8389
  },
8390
+ {
8391
+ "name": "animated",
8392
+ "description": "是否启用内容切换动画",
8393
+ "default": "true",
8394
+ "value": {
8395
+ "type": "boolean",
8396
+ "kind": "expression"
8397
+ }
8398
+ },
8390
8399
  {
8391
8400
  "name": "loop",
8392
8401
  "description": "是否允许循环切换",
package/lib/varlet.cjs.js CHANGED
@@ -27042,6 +27042,10 @@ const props$3 = {
27042
27042
  type: Boolean,
27043
27043
  default: true
27044
27044
  },
27045
+ animated: {
27046
+ type: Boolean,
27047
+ default: true
27048
+ },
27045
27049
  loop: Boolean,
27046
27050
  "onUpdate:active": defineListenerProp()
27047
27051
  };
@@ -27072,6 +27076,7 @@ function __render__$4(_ctx, _cache) {
27072
27076
  ref: "swipe",
27073
27077
  class: vue.normalizeClass(_ctx.n()),
27074
27078
  loop: _ctx.loop,
27079
+ duration: _ctx.animated ? void 0 : 0,
27075
27080
  touchable: _ctx.canSwipe,
27076
27081
  indicator: false,
27077
27082
  onChange: _ctx.handleSwipeChange
@@ -27081,7 +27086,7 @@ function __render__$4(_ctx, _cache) {
27081
27086
  ]),
27082
27087
  _: 3
27083
27088
  /* FORWARDED */
27084
- }, 8, ["class", "loop", "touchable", "onChange"]);
27089
+ }, 8, ["class", "loop", "duration", "touchable", "onChange"]);
27085
27090
  }
27086
27091
  const __sfc__$4 = vue.defineComponent({
27087
27092
  name: name$3,
@@ -27141,6 +27146,12 @@ withInstall(stdin_default$3i);
27141
27146
  withPropsDefaultsSetter(stdin_default$3i, props$3);
27142
27147
  const _TabsItemsComponent = stdin_default$3i;
27143
27148
  var stdin_default$3h = stdin_default$3i;
27149
+ function convert(theme, converter) {
27150
+ return Object.entries(theme).reduce((target, [key3, value]) => {
27151
+ target[key3] = value.includes("px") ? value.replace(/(\d+(\.\d+)?)px/g, (_, p1) => converter(p1)) : value;
27152
+ return target;
27153
+ }, {});
27154
+ }
27144
27155
  var stdin_default$3g = {
27145
27156
  "--action-sheet-background": "var(--color-surface-container-low)",
27146
27157
  "--action-sheet-title-color": "#aaa",
@@ -30254,17 +30265,15 @@ var stdin_default$8 = __spreadValues$1(__spreadValues$1(__spreadValues$1(__sprea
30254
30265
  "--shadow-key-penumbra-opacity": "rgba(0, 0, 0, 0.14)",
30255
30266
  "--shadow-key-ambient-opacity": "rgba(0, 0, 0, 0.12)"
30256
30267
  }, stdin_default$10), stdin_default$19), stdin_default$M), stdin_default$D), stdin_default$B), stdin_default$C), stdin_default$Q), stdin_default$11), stdin_default$H), stdin_default$_), stdin_default$x), stdin_default$17), stdin_default$P), stdin_default$Z), stdin_default$s), stdin_default$$), stdin_default$Y), stdin_default$b), stdin_default$d), stdin_default$f), stdin_default$e), stdin_default$W), stdin_default$q), stdin_default$13), stdin_default$12), stdin_default$k), stdin_default$1a), stdin_default$S), stdin_default$t), stdin_default$v), stdin_default$w), stdin_default$O), stdin_default$15), stdin_default$o), stdin_default$A), stdin_default$l), stdin_default$a), stdin_default$c), stdin_default$T), stdin_default$g), stdin_default$r), stdin_default$16), stdin_default$14), stdin_default$V), stdin_default$U), stdin_default$R), stdin_default$N), stdin_default$L), stdin_default$K), stdin_default$J), stdin_default$I), stdin_default$G), stdin_default$F), stdin_default$E), stdin_default$z), stdin_default$y), stdin_default$u), stdin_default$p), stdin_default$m), stdin_default$j), stdin_default$i), stdin_default$h), stdin_default$9), stdin_default$18), stdin_default$X), stdin_default$n);
30268
+ function toRem(theme, options = {}) {
30269
+ const { rootFontSize = 16, unitPrecision = 6 } = options;
30270
+ return convert(theme, (value) => `${Number((value / rootFontSize).toFixed(unitPrecision))}rem`);
30271
+ }
30257
30272
  function toViewport(theme, options = {}) {
30258
30273
  const { viewportWidth = 375, viewportUnit = "vmin", unitPrecision = 6 } = options;
30259
- return Object.entries(theme).reduce((target, [key3, value]) => {
30260
- target[key3] = value.includes("px") ? value.replace(
30261
- /(\d+(\.\d+)?)px/g,
30262
- (_, p1) => `${Number((p1 / viewportWidth * 100).toFixed(unitPrecision))}${viewportUnit}`
30263
- ) : value;
30264
- return target;
30265
- }, {});
30274
+ return convert(theme, (value) => `${Number((value / viewportWidth * 100).toFixed(unitPrecision))}${viewportUnit}`);
30266
30275
  }
30267
- const Themes = { dark: stdin_default$2e, md3Light: stdin_default$8, md3Dark: stdin_default$1b, toViewport };
30276
+ const Themes = { dark: stdin_default$2e, md3Light: stdin_default$8, md3Dark: stdin_default$1b, toViewport, toRem, convert };
30268
30277
  const _ThemesComponent = null;
30269
30278
  var stdin_default$7 = Themes;
30270
30279
  const hoursAmpm = ["12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"];
@@ -32018,7 +32027,7 @@ withInstall(stdin_default$1);
32018
32027
  withPropsDefaultsSetter(stdin_default$1, props);
32019
32028
  const _WatermarkComponent = stdin_default$1;
32020
32029
  var stdin_default = stdin_default$1;
32021
- const version = "3.10.7";
32030
+ const version = "3.10.9-alpha.1749629591895";
32022
32031
  function install(app) {
32023
32032
  stdin_default$60.install && app.use(stdin_default$60);
32024
32033
  stdin_default$5_.install && app.use(stdin_default$5_);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.10.7",
3
+ "version": "3.10.9-alpha.1749629591895",
4
4
  "description": "A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.",
5
5
  "keywords": [
6
6
  "Vue3",
@@ -44,9 +44,9 @@
44
44
  "@popperjs/core": "^2.11.6",
45
45
  "dayjs": "^1.10.4",
46
46
  "decimal.js": "^10.2.1",
47
- "@varlet/icons": "3.10.7",
48
- "@varlet/shared": "3.10.7",
49
- "@varlet/use": "3.10.7"
47
+ "@varlet/icons": "3.10.9-alpha.1749629591895",
48
+ "@varlet/shared": "3.10.9-alpha.1749629591895",
49
+ "@varlet/use": "3.10.9-alpha.1749629591895"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^18.7.20",
@@ -62,9 +62,9 @@
62
62
  "vue": "3.5.13",
63
63
  "vue-router": "4.5.0",
64
64
  "zod": "^3.23.8",
65
- "@varlet/touch-emulator": "3.10.7",
66
- "@varlet/ui": "3.10.7",
67
- "@varlet/cli": "3.10.7"
65
+ "@varlet/touch-emulator": "3.10.9-alpha.1749629591895",
66
+ "@varlet/ui": "3.10.9-alpha.1749629591895",
67
+ "@varlet/cli": "3.10.9-alpha.1749629591895"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vue": "^3.2.0"
@@ -6,6 +6,9 @@ export declare const tabsItemsProps: Record<keyof TabsItemsProps, any>
6
6
 
7
7
  export interface TabsItemsProps extends BasicAttributes {
8
8
  active?: string | number
9
+ canSwipe?: boolean
10
+ animated?: boolean
11
+ loop?: boolean
9
12
  'onUpdate:active'?: ListenerProp<(active: string | number) => void>
10
13
  }
11
14
 
package/types/themes.d.ts CHANGED
@@ -6,12 +6,19 @@ export interface ThemesToViewportOptions {
6
6
  unitPrecision?: number
7
7
  }
8
8
 
9
+ export interface ThemesToRemOptions {
10
+ rootFontSize?: number
11
+ unitPrecision?: number
12
+ }
13
+
9
14
  interface Themes {
10
15
  dark: StyleVars
11
16
  md3Light: StyleVars
12
17
  md3Dark: StyleVars
13
18
 
19
+ convert(theme: StyleVars, converter: (value: number) => string): StyleVars
14
20
  toViewport(theme: StyleVars, options?: ThemesToViewportOptions): StyleVars
21
+ toRem(theme: StyleVars, options?: ThemesToRemOptions): StyleVars
15
22
  }
16
23
 
17
24
  export declare const Themes: Themes