@varlet/ui 3.5.1-alpha.1726764162524 → 3.5.2

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.
@@ -3,5 +3,5 @@ import '../../icon/icon.css'
3
3
  import '../../ripple/ripple.css'
4
4
  import '../../popup/popup.css'
5
5
  import '../actionSheet.css'
6
- import '../ActionSheetSfc.css'
7
6
  import '../ActionItemSfc.css'
7
+ import '../ActionSheetSfc.css'
package/es/col/Col.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, computed, watch } from "vue";
1
+ import { defineComponent, computed } from "vue";
2
2
  import { isPlainObject, toNumber, call } from "@varlet/shared";
3
3
  import { props } from "./props.mjs";
4
4
  import { useRow } from "./provide.mjs";
@@ -47,17 +47,13 @@ const __sfc__ = defineComponent({
47
47
  setup(props2) {
48
48
  const span = computed(() => toNumber(props2.span));
49
49
  const offset = computed(() => toNumber(props2.offset));
50
- const padding = ref({ left: 0, right: 0, top: 0, bottom: 0 });
51
- const { row, bindRow } = useRow();
52
- const colProvider = {
53
- setPadding(pad) {
54
- padding.value = pad;
55
- }
56
- };
57
- watch([() => props2.span, () => props2.offset], () => {
58
- row == null ? void 0 : row.computePadding();
50
+ const padding = computed(() => {
51
+ var _a;
52
+ const [y = 0, x = 0] = (_a = row == null ? void 0 : row.average.value) != null ? _a : [];
53
+ return { left: x, right: x, top: y, bottom: y };
59
54
  });
60
- call(bindRow, colProvider);
55
+ const { row, bindRow } = useRow();
56
+ call(bindRow, null);
61
57
  function getSize(mode, size) {
62
58
  const classes2 = [];
63
59
  if (size == null) {
@@ -65,10 +61,16 @@ const __sfc__ = defineComponent({
65
61
  }
66
62
  if (isPlainObject(size)) {
67
63
  const { offset: offset2, span: span2 } = size;
68
- Number(span2) >= 0 && classes2.push(n(`--span-${mode}-${span2}`));
69
- offset2 && classes2.push(n(`--offset-${mode}-${offset2}`));
70
- } else {
71
- Number(size) >= 0 && classes2.push(n(`--span-${mode}-${size}`));
64
+ if (Number(span2) >= 0) {
65
+ classes2.push(n(`--span-${mode}-${span2}`));
66
+ }
67
+ if (offset2) {
68
+ classes2.push(n(`--offset-${mode}-${offset2}`));
69
+ }
70
+ return classes2;
71
+ }
72
+ if (Number(size) >= 0) {
73
+ classes2.push(n(`--span-${mode}-${size}`));
72
74
  }
73
75
  return classes2;
74
76
  }
@@ -1,7 +1,7 @@
1
1
  import { useParent } from "@varlet/use";
2
2
  import { ROW_BIND_COL_KEY } from "../row/provide.mjs";
3
3
  function useRow() {
4
- const { parentProvider, index, bindParent } = useParent(ROW_BIND_COL_KEY);
4
+ const { index, bindParent, parentProvider } = useParent(ROW_BIND_COL_KEY);
5
5
  return {
6
6
  index,
7
7
  row: parentProvider,
@@ -268,7 +268,7 @@ import './tooltip/style/index.mjs'
268
268
  import './uploader/style/index.mjs'
269
269
  import './watermark/style/index.mjs'
270
270
 
271
- const version = '3.5.1-alpha.1726764162524'
271
+ const version = '3.5.2'
272
272
 
273
273
  function install(app) {
274
274
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -178,7 +178,7 @@ export * from './tooltip/index.mjs'
178
178
  export * from './uploader/index.mjs'
179
179
  export * from './watermark/index.mjs'
180
180
 
181
- const version = '3.5.1-alpha.1726764162524'
181
+ const version = '3.5.2'
182
182
 
183
183
  function install(app) {
184
184
  ActionSheet.install && app.use(ActionSheet)
package/es/row/Row.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, watch } from "vue";
1
+ import { defineComponent, computed } from "vue";
2
2
  import { props } from "./props.mjs";
3
3
  import { isArray, call } from "@varlet/shared";
4
4
  import { useCols } from "./provide.mjs";
@@ -32,17 +32,8 @@ const __sfc__ = defineComponent({
32
32
  const average = computed(
33
33
  () => isArray(props2.gutter) ? props2.gutter.map((numeric) => toPxNum(numeric) / 2) : [0, toPxNum(props2.gutter) / 2]
34
34
  );
35
- const { cols, bindCols, length } = useCols();
36
- const rowProvider = { computePadding };
37
- watch(() => length.value, computePadding);
38
- watch(() => props2.gutter, computePadding);
39
- bindCols(rowProvider);
40
- function computePadding() {
41
- cols.forEach((col) => {
42
- const [y, x] = average.value;
43
- col.setPadding({ left: x, right: x, top: y, bottom: y });
44
- });
45
- }
35
+ const { bindCols } = useCols();
36
+ bindCols({ average });
46
37
  function handleClick(e) {
47
38
  call(props2.onClick, e);
48
39
  }
@@ -1,10 +1,10 @@
1
1
  import { useChildren } from "@varlet/use";
2
2
  const ROW_BIND_COL_KEY = Symbol("ROW_BIND_COL_KEY");
3
3
  function useCols() {
4
- const { bindChildren, childProviders, length } = useChildren(ROW_BIND_COL_KEY);
4
+ const { length, childProviders: cols, bindChildren } = useChildren(ROW_BIND_COL_KEY);
5
5
  return {
6
6
  length,
7
- cols: childProviders,
7
+ cols,
8
8
  bindCols: bindChildren
9
9
  };
10
10
  }
package/es/varlet.esm.js CHANGED
@@ -7338,19 +7338,19 @@ const zp = {
7338
7338
  onClick: A()
7339
7339
  }, Op = Symbol("ROW_BIND_COL_KEY");
7340
7340
  function Wk() {
7341
- const { bindChildren: e, childProviders: n, length: o } = mn(Op);
7341
+ const { length: e, childProviders: n, bindChildren: o } = mn(Op);
7342
7342
  return {
7343
- length: o,
7343
+ length: e,
7344
7344
  cols: n,
7345
- bindCols: e
7345
+ bindCols: o
7346
7346
  };
7347
7347
  }
7348
7348
  function Kk() {
7349
- const { parentProvider: e, index: n, bindParent: o } = vn(Op);
7349
+ const { index: e, bindParent: n, parentProvider: o } = vn(Op);
7350
7350
  return {
7351
- index: n,
7352
- row: e,
7353
- bindRow: o
7351
+ index: e,
7352
+ row: o,
7353
+ bindRow: n
7354
7354
  };
7355
7355
  }
7356
7356
  const { name: qk, n: st, classes: Xk } = ee("col");
@@ -7393,27 +7393,24 @@ const Tp = x({
7393
7393
  name: qk,
7394
7394
  props: zp,
7395
7395
  setup(e) {
7396
- const n = I(() => F(e.span)), o = I(() => F(e.offset)), r = $({ left: 0, right: 0, top: 0, bottom: 0 }), { row: t, bindRow: a } = Kk(), i = {
7397
- setPadding(u) {
7398
- r.value = u;
7396
+ const n = I(() => F(e.span)), o = I(() => F(e.offset)), r = I(() => {
7397
+ var s;
7398
+ const [u = 0, c = 0] = (s = t == null ? void 0 : t.average.value) != null ? s : [];
7399
+ return { left: c, right: c, top: u, bottom: u };
7400
+ }), { row: t, bindRow: a } = Kk();
7401
+ C(a, null);
7402
+ function i(s, u) {
7403
+ const c = [];
7404
+ if (u == null)
7405
+ return c;
7406
+ if (zo(u)) {
7407
+ const { offset: d, span: f } = u;
7408
+ return Number(f) >= 0 && c.push(st(`--span-${s}-${f}`)), d && c.push(st(`--offset-${s}-${d}`)), c;
7399
7409
  }
7400
- };
7401
- fe([() => e.span, () => e.offset], () => {
7402
- t == null || t.computePadding();
7403
- }), C(a, i);
7404
- function l(u, c) {
7405
- const d = [];
7406
- if (c == null)
7407
- return d;
7408
- if (zo(c)) {
7409
- const { offset: f, span: v } = c;
7410
- Number(v) >= 0 && d.push(st(`--span-${u}-${v}`)), f && d.push(st(`--offset-${u}-${f}`));
7411
- } else
7412
- Number(c) >= 0 && d.push(st(`--span-${u}-${c}`));
7413
- return d;
7410
+ return Number(u) >= 0 && c.push(st(`--span-${s}-${u}`)), c;
7414
7411
  }
7415
- function s(u) {
7416
- C(e.onClick, u);
7412
+ function l(s) {
7413
+ C(e.onClick, s);
7417
7414
  }
7418
7415
  return {
7419
7416
  span: n,
@@ -7423,8 +7420,8 @@ const Tp = x({
7423
7420
  classes: Xk,
7424
7421
  toNumber: F,
7425
7422
  toSizeUnit: ze,
7426
- getSize: l,
7427
- handleClick: s,
7423
+ getSize: i,
7424
+ handleClick: l,
7428
7425
  padStartFlex: Tt
7429
7426
  };
7430
7427
  }
@@ -16390,23 +16387,17 @@ const Em = x({
16390
16387
  props: Tm,
16391
16388
  setup(e) {
16392
16389
  const n = I(
16393
- () => Xe(e.gutter) ? e.gutter.map((s) => xe(s) / 2) : [0, xe(e.gutter) / 2]
16394
- ), { cols: o, bindCols: r, length: t } = Wk(), a = { computePadding: i };
16395
- fe(() => t.value, i), fe(() => e.gutter, i), r(a);
16396
- function i() {
16397
- o.forEach((s) => {
16398
- const [u, c] = n.value;
16399
- s.setPadding({ left: c, right: c, top: u, bottom: u });
16400
- });
16401
- }
16402
- function l(s) {
16403
- C(e.onClick, s);
16390
+ () => Xe(e.gutter) ? e.gutter.map((t) => xe(t) / 2) : [0, xe(e.gutter) / 2]
16391
+ ), { bindCols: o } = Wk();
16392
+ o({ average: n });
16393
+ function r(t) {
16394
+ C(e.onClick, t);
16404
16395
  }
16405
16396
  return {
16406
16397
  average: n,
16407
16398
  n: _2,
16408
16399
  classes: x2,
16409
- handleClick: l,
16400
+ handleClick: r,
16410
16401
  padStartFlex: Tt
16411
16402
  };
16412
16403
  }
@@ -23165,7 +23156,7 @@ oe(Ci);
23165
23156
  le(Ci, gh);
23166
23157
  const L5 = Ci;
23167
23158
  var ts = Ci;
23168
- const nT = "3.5.1-alpha.1726764162524";
23159
+ const nT = "3.5.2";
23169
23160
  function oT(e) {
23170
23161
  Ri.install && e.use(Ri), Li.install && e.use(Li), Hi.install && e.use(Hi), Wi.install && e.use(Wi), Ki.install && e.use(Ki), qi.install && e.use(qi), Bt.install && e.use(Bt), Xi.install && e.use(Xi), Gi.install && e.use(Gi), Zi.install && e.use(Zi), Ji.install && e.use(Ji), zn.install && e.use(zn), Qi.install && e.use(Qi), _i.install && e.use(_i), xi.install && e.use(xi), lr.install && e.use(lr), el.install && e.use(el), Dt.install && e.use(Dt), nl.install && e.use(nl), ol.install && e.use(ol), rl.install && e.use(rl), tl.install && e.use(tl), Nn.install && e.use(Nn), sl.install && e.use(sl), vl.install && e.use(vl), hl.install && e.use(hl), gl.install && e.use(gl), bl.install && e.use(bl), Rt.install && e.use(Rt), yl.install && e.use(yl), kl.install && e.use(kl), Mr.install && e.use(Mr), $l.install && e.use($l), wl.install && e.use(wl), Pn.install && e.use(Pn), En.install && e.use(En), Vn.install && e.use(Vn), Ze.install && e.use(Ze), Cl.install && e.use(Cl), jr.install && e.use(jr), Sl.install && e.use(Sl), Pl.install && e.use(Pl), Nr.install && e.use(Nr), Fr.install && e.use(Fr), zl.install && e.use(zl), Ol.install && e.use(Ol), cr.install && e.use(cr), Tl.install && e.use(Tl), Ai.install && e.use(Ai), El.install && e.use(El), Rr.install && e.use(Rr), sr.install && e.use(sr), Lr.install && e.use(Lr), Ft.install && e.use(Ft), Bl.install && e.use(Bl), Dl.install && e.use(Dl), Il.install && e.use(Il), Ml.install && e.use(Ml), Oo.install && e.use(Oo), Nl.install && e.use(Nl), Al.install && e.use(Al), Ut.install && e.use(Ut), Vl.install && e.use(Vl), Rl.install && e.use(Rl), Ll.install && e.use(Ll), nn.install && e.use(nn), Fl.install && e.use(Fl), Ul.install && e.use(Ul), Hl.install && e.use(Hl), Yl.install && e.use(Yl), Wl.install && e.use(Wl), Kl.install && e.use(Kl), ql.install && e.use(ql), Xl.install && e.use(Xl), pr.install && e.use(pr), Gl.install && e.use(Gl), Hr.install && e.use(Hr), Yr.install && e.use(Yr), Zl.install && e.use(Zl), Jl.install && e.use(Jl), Ql.install && e.use(Ql), _l.install && e.use(_l), xl.install && e.use(xl), es.install && e.use(es), ns.install && e.use(ns), os.install && e.use(os), Lt.install && e.use(Lt), rs.install && e.use(rs), ts.install && e.use(ts);
23171
23162
  }
@@ -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.5.1-alpha.1726764162524",
4
+ "version": "3.5.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -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.5.1-alpha.1726764162524",
4
+ "version": "3.5.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
package/lib/varlet.cjs.js CHANGED
@@ -9323,15 +9323,15 @@ const props$R = {
9323
9323
  };
9324
9324
  const ROW_BIND_COL_KEY = Symbol("ROW_BIND_COL_KEY");
9325
9325
  function useCols() {
9326
- const { bindChildren, childProviders, length } = useChildren(ROW_BIND_COL_KEY);
9326
+ const { length, childProviders: cols, bindChildren } = useChildren(ROW_BIND_COL_KEY);
9327
9327
  return {
9328
9328
  length,
9329
- cols: childProviders,
9329
+ cols,
9330
9330
  bindCols: bindChildren
9331
9331
  };
9332
9332
  }
9333
9333
  function useRow() {
9334
- const { parentProvider, index, bindParent } = useParent(ROW_BIND_COL_KEY);
9334
+ const { index, bindParent, parentProvider } = useParent(ROW_BIND_COL_KEY);
9335
9335
  return {
9336
9336
  index,
9337
9337
  row: parentProvider,
@@ -9380,17 +9380,13 @@ const __sfc__$_ = vue.defineComponent({
9380
9380
  setup(props2) {
9381
9381
  const span = vue.computed(() => toNumber(props2.span));
9382
9382
  const offset2 = vue.computed(() => toNumber(props2.offset));
9383
- const padding = vue.ref({ left: 0, right: 0, top: 0, bottom: 0 });
9384
- const { row, bindRow } = useRow();
9385
- const colProvider = {
9386
- setPadding(pad) {
9387
- padding.value = pad;
9388
- }
9389
- };
9390
- vue.watch([() => props2.span, () => props2.offset], () => {
9391
- row == null ? void 0 : row.computePadding();
9383
+ const padding = vue.computed(() => {
9384
+ var _a;
9385
+ const [y = 0, x = 0] = (_a = row == null ? void 0 : row.average.value) != null ? _a : [];
9386
+ return { left: x, right: x, top: y, bottom: y };
9392
9387
  });
9393
- call(bindRow, colProvider);
9388
+ const { row, bindRow } = useRow();
9389
+ call(bindRow, null);
9394
9390
  function getSize2(mode, size) {
9395
9391
  const classes2 = [];
9396
9392
  if (size == null) {
@@ -9398,10 +9394,16 @@ const __sfc__$_ = vue.defineComponent({
9398
9394
  }
9399
9395
  if (isPlainObject(size)) {
9400
9396
  const { offset: offset22, span: span2 } = size;
9401
- Number(span2) >= 0 && classes2.push(n$Z(`--span-${mode}-${span2}`));
9402
- offset22 && classes2.push(n$Z(`--offset-${mode}-${offset22}`));
9403
- } else {
9404
- Number(size) >= 0 && classes2.push(n$Z(`--span-${mode}-${size}`));
9397
+ if (Number(span2) >= 0) {
9398
+ classes2.push(n$Z(`--span-${mode}-${span2}`));
9399
+ }
9400
+ if (offset22) {
9401
+ classes2.push(n$Z(`--offset-${mode}-${offset22}`));
9402
+ }
9403
+ return classes2;
9404
+ }
9405
+ if (Number(size) >= 0) {
9406
+ classes2.push(n$Z(`--span-${mode}-${size}`));
9405
9407
  }
9406
9408
  return classes2;
9407
9409
  }
@@ -21477,17 +21479,8 @@ const __sfc__$i = vue.defineComponent({
21477
21479
  const average = vue.computed(
21478
21480
  () => isArray(props2.gutter) ? props2.gutter.map((numeric) => toPxNum(numeric) / 2) : [0, toPxNum(props2.gutter) / 2]
21479
21481
  );
21480
- const { cols, bindCols, length } = useCols();
21481
- const rowProvider = { computePadding };
21482
- vue.watch(() => length.value, computePadding);
21483
- vue.watch(() => props2.gutter, computePadding);
21484
- bindCols(rowProvider);
21485
- function computePadding() {
21486
- cols.forEach((col) => {
21487
- const [y, x] = average.value;
21488
- col.setPadding({ left: x, right: x, top: y, bottom: y });
21489
- });
21490
- }
21482
+ const { bindCols } = useCols();
21483
+ bindCols({ average });
21491
21484
  function handleClick(e) {
21492
21485
  call(props2.onClick, e);
21493
21486
  }
@@ -29304,7 +29297,7 @@ withInstall(stdin_default$1);
29304
29297
  withPropsDefaultsSetter(stdin_default$1, props);
29305
29298
  const _WatermarkComponent = stdin_default$1;
29306
29299
  var stdin_default = stdin_default$1;
29307
- const version = "3.5.1-alpha.1726764162524";
29300
+ const version = "3.5.2";
29308
29301
  function install(app) {
29309
29302
  stdin_default$5I.install && app.use(stdin_default$5I);
29310
29303
  stdin_default$5G.install && app.use(stdin_default$5G);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.5.1-alpha.1726764162524",
3
+ "version": "3.5.2",
4
4
  "description": "A material like components library",
5
5
  "main": "lib/varlet.cjs.js",
6
6
  "module": "es/index.mjs",
@@ -48,9 +48,9 @@
48
48
  "@popperjs/core": "^2.11.6",
49
49
  "dayjs": "^1.10.4",
50
50
  "decimal.js": "^10.2.1",
51
- "@varlet/icons": "3.5.1-alpha.1726764162524",
52
- "@varlet/use": "3.5.1-alpha.1726764162524",
53
- "@varlet/shared": "3.5.1-alpha.1726764162524"
51
+ "@varlet/icons": "3.5.2",
52
+ "@varlet/shared": "3.5.2",
53
+ "@varlet/use": "3.5.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.4.21",
@@ -65,9 +65,9 @@
65
65
  "typescript": "^5.1.5",
66
66
  "vue": "3.4.21",
67
67
  "vue-router": "4.2.0",
68
- "@varlet/cli": "3.5.1-alpha.1726764162524",
69
- "@varlet/ui": "3.5.1-alpha.1726764162524",
70
- "@varlet/touch-emulator": "3.5.1-alpha.1726764162524"
68
+ "@varlet/cli": "3.5.2",
69
+ "@varlet/ui": "3.5.2",
70
+ "@varlet/touch-emulator": "3.5.2"
71
71
  },
72
72
  "scripts": {
73
73
  "dev": "varlet-cli dev",