@varlet/ui 2.11.3 → 2.11.5

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/lib/varlet.cjs.js CHANGED
@@ -17618,10 +17618,10 @@ function __render__$v(_ctx, _cache) {
17618
17618
  [vue.createVNode(
17619
17619
  _component_var_menu,
17620
17620
  {
17621
+ placement: "cover-top",
17621
17622
  disabled: _ctx.disabled,
17622
17623
  show: _ctx.menuVisible,
17623
- "onUpdate:show": _cache[6] || (_cache[6] = ($event) => _ctx.menuVisible = $event),
17624
- "offset-x": -4
17624
+ "onUpdate:show": _cache[6] || (_cache[6] = ($event) => _ctx.menuVisible = $event)
17625
17625
  },
17626
17626
  {
17627
17627
  menu: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(
@@ -17691,7 +17691,7 @@ function __render__$v(_ctx, _cache) {
17691
17691
  "li",
17692
17692
  {
17693
17693
  key: 3,
17694
- class: vue.normalizeClass(_ctx.classes(_ctx.n("quickly"), [_ctx.disabled, "item--disabled"]))
17694
+ class: vue.normalizeClass(_ctx.classes(_ctx.n("quickly"), [_ctx.disabled, _ctx.n("item--disabled")]))
17695
17695
  },
17696
17696
  [vue.createTextVNode(
17697
17697
  vue.toDisplayString(_ctx.pack.paginationJump) + " ",
@@ -17717,7 +17717,7 @@ function __render__$v(_ctx, _cache) {
17717
17717
  "li",
17718
17718
  {
17719
17719
  key: 4,
17720
- class: vue.normalizeClass(_ctx.n("total"))
17720
+ class: vue.normalizeClass(_ctx.classes(_ctx.n("total"), [_ctx.disabled, _ctx.n("item--disabled")]))
17721
17721
  },
17722
17722
  vue.toDisplayString(_ctx.totalText),
17723
17723
  3
@@ -19622,6 +19622,10 @@ var props$i = {
19622
19622
  type: Boolean,
19623
19623
  default: true
19624
19624
  },
19625
+ clearable: {
19626
+ type: Boolean,
19627
+ default: false
19628
+ },
19625
19629
  rules: {
19626
19630
  type: Array
19627
19631
  },
@@ -19735,6 +19739,7 @@ var __sfc__$p = vue.defineComponent({
19735
19739
  hovering
19736
19740
  } = useHoverOverlay();
19737
19741
  var currentHoveringValue = vue.ref(-1);
19742
+ var lastScore = Number(props2.modelValue);
19738
19743
  var getStyle2 = (val) => {
19739
19744
  var {
19740
19745
  count,
@@ -19790,13 +19795,20 @@ var __sfc__$p = vue.defineComponent({
19790
19795
  };
19791
19796
  };
19792
19797
  var changeValue = (score, event) => {
19793
- if (props2.half) {
19798
+ var {
19799
+ half: half2,
19800
+ clearable
19801
+ } = props2;
19802
+ if (half2) {
19794
19803
  var {
19795
19804
  offsetWidth
19796
19805
  } = event.target;
19797
19806
  if (event.offsetX <= Math.floor(offsetWidth / 2))
19798
19807
  score -= 0.5;
19799
19808
  }
19809
+ if (lastScore === score && clearable)
19810
+ score = 0;
19811
+ lastScore = score;
19800
19812
  call(props2["onUpdate:modelValue"], score);
19801
19813
  };
19802
19814
  var validate = () => v(props2.rules, toNumber(props2.modelValue));
@@ -22347,11 +22359,9 @@ var STEPS_BIND_STEP_KEY = Symbol("STEPS_BIND_STEP_KEY");
22347
22359
  function useStep() {
22348
22360
  var {
22349
22361
  bindChildren,
22350
- length,
22351
22362
  childProviders
22352
22363
  } = useChildren(STEPS_BIND_STEP_KEY);
22353
22364
  return {
22354
- length,
22355
22365
  step: childProviders,
22356
22366
  bindStep: bindChildren
22357
22367
  };
@@ -22393,89 +22403,76 @@ function __render__$a(_ctx, _cache) {
22393
22403
  [vue.createElementVNode(
22394
22404
  "div",
22395
22405
  {
22396
- class: vue.normalizeClass(_ctx.n(_ctx.direction + "-main")),
22397
- ref: _ctx.getRef
22406
+ class: vue.normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-tag"), [_ctx.isActive || _ctx.isCurrent, _ctx.n(_ctx.direction + "-tag--active")])),
22407
+ style: vue.normalizeStyle({
22408
+ backgroundColor: _ctx.isActive || _ctx.isCurrent ? _ctx.activeColor : _ctx.inactiveColor
22409
+ }),
22410
+ onClick: _cache[0] || (_cache[0] = function() {
22411
+ return _ctx.click && _ctx.click(...arguments);
22412
+ })
22398
22413
  },
22399
- [vue.createElementVNode(
22400
- "div",
22414
+ [_ctx.isActive ? (vue.openBlock(), vue.createBlock(
22415
+ _component_var_icon,
22401
22416
  {
22402
- class: vue.normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-tag"), [_ctx.isActive || _ctx.isCurrent, _ctx.n(_ctx.direction + "-tag--active")])),
22403
- style: vue.normalizeStyle({
22404
- backgroundColor: _ctx.isActive || _ctx.isCurrent ? _ctx.activeColor : _ctx.inactiveColor
22405
- }),
22406
- onClick: _cache[0] || (_cache[0] = function() {
22407
- return _ctx.click && _ctx.click(...arguments);
22408
- })
22417
+ key: 0,
22418
+ class: vue.normalizeClass(_ctx.n("icon")),
22419
+ "var-step-cover": "",
22420
+ name: _ctx.activeIcon
22409
22421
  },
22410
- [_ctx.isActive ? (vue.openBlock(), vue.createBlock(
22411
- _component_var_icon,
22412
- {
22413
- key: 0,
22414
- class: vue.normalizeClass(_ctx.n("icon")),
22415
- "var-step-cover": "",
22416
- name: _ctx.activeIcon
22417
- },
22418
- null,
22419
- 8,
22420
- ["class", "name"]
22421
- )) : _ctx.isCurrent && _ctx.currentIcon ? (vue.openBlock(), vue.createBlock(
22422
- _component_var_icon,
22423
- {
22424
- key: 1,
22425
- class: vue.normalizeClass(_ctx.n("icon")),
22426
- "var-step-cover": "",
22427
- name: _ctx.currentIcon
22428
- },
22429
- null,
22430
- 8,
22431
- ["class", "name"]
22432
- )) : _ctx.inactiveIcon ? (vue.openBlock(), vue.createBlock(
22433
- _component_var_icon,
22434
- {
22435
- key: 2,
22436
- class: vue.normalizeClass(_ctx.n("icon")),
22437
- "var-step-cover": "",
22438
- name: _ctx.inactiveIcon
22439
- },
22440
- null,
22441
- 8,
22442
- ["class", "name"]
22443
- )) : (vue.openBlock(), vue.createElementBlock(
22444
- "span",
22445
- _hoisted_1$2,
22446
- vue.toDisplayString(_ctx.index + 1),
22447
- 1
22448
- /* TEXT */
22449
- ))],
22450
- 6
22451
- /* CLASS, STYLE */
22452
- ), vue.createElementVNode(
22453
- "div",
22422
+ null,
22423
+ 8,
22424
+ ["class", "name"]
22425
+ )) : _ctx.isCurrent && _ctx.currentIcon ? (vue.openBlock(), vue.createBlock(
22426
+ _component_var_icon,
22454
22427
  {
22455
- class: vue.normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-content"), [_ctx.isActive || _ctx.isCurrent, _ctx.n(_ctx.direction + "-content--active")])),
22456
- onClick: _cache[1] || (_cache[1] = function() {
22457
- return _ctx.click && _ctx.click(...arguments);
22458
- })
22428
+ key: 1,
22429
+ class: vue.normalizeClass(_ctx.n("icon")),
22430
+ "var-step-cover": "",
22431
+ name: _ctx.currentIcon
22459
22432
  },
22460
- [vue.renderSlot(_ctx.$slots, "default")],
22461
- 2
22462
- /* CLASS */
22463
- )],
22433
+ null,
22434
+ 8,
22435
+ ["class", "name"]
22436
+ )) : _ctx.inactiveIcon ? (vue.openBlock(), vue.createBlock(
22437
+ _component_var_icon,
22438
+ {
22439
+ key: 2,
22440
+ class: vue.normalizeClass(_ctx.n("icon")),
22441
+ "var-step-cover": "",
22442
+ name: _ctx.inactiveIcon
22443
+ },
22444
+ null,
22445
+ 8,
22446
+ ["class", "name"]
22447
+ )) : (vue.openBlock(), vue.createElementBlock(
22448
+ "span",
22449
+ _hoisted_1$2,
22450
+ vue.toDisplayString(_ctx.index + 1),
22451
+ 1
22452
+ /* TEXT */
22453
+ ))],
22454
+ 6
22455
+ /* CLASS, STYLE */
22456
+ ), vue.createElementVNode(
22457
+ "div",
22458
+ {
22459
+ class: vue.normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-content"), [_ctx.isActive || _ctx.isCurrent, _ctx.n(_ctx.direction + "-content--active")])),
22460
+ onClick: _cache[1] || (_cache[1] = function() {
22461
+ return _ctx.click && _ctx.click(...arguments);
22462
+ })
22463
+ },
22464
+ [vue.renderSlot(_ctx.$slots, "default")],
22464
22465
  2
22465
22466
  /* CLASS */
22466
- ), !_ctx.isLastChild ? (vue.openBlock(), vue.createElementBlock(
22467
+ ), vue.createElementVNode(
22467
22468
  "div",
22468
22469
  {
22469
- key: 0,
22470
- class: vue.normalizeClass(_ctx.n(_ctx.direction + "-line")),
22471
- style: vue.normalizeStyle({
22472
- margin: _ctx.lineMargin
22473
- })
22470
+ class: vue.normalizeClass(_ctx.n(_ctx.direction + "-line"))
22474
22471
  },
22475
22472
  null,
22476
- 6
22477
- /* CLASS, STYLE */
22478
- )) : vue.createCommentVNode("v-if", true)],
22473
+ 2
22474
+ /* CLASS */
22475
+ )],
22479
22476
  2
22480
22477
  /* CLASS */
22481
22478
  )],
@@ -22490,9 +22487,6 @@ var __sfc__$b = vue.defineComponent({
22490
22487
  },
22491
22488
  props: props$a,
22492
22489
  setup() {
22493
- var main2 = vue.ref(null);
22494
- var lineMargin = vue.ref("");
22495
- var isLastChild = vue.ref(false);
22496
22490
  var {
22497
22491
  index,
22498
22492
  steps: steps2,
@@ -22500,7 +22494,6 @@ var __sfc__$b = vue.defineComponent({
22500
22494
  } = useSteps();
22501
22495
  var {
22502
22496
  active,
22503
- length,
22504
22497
  activeColor,
22505
22498
  inactiveColor,
22506
22499
  direction,
@@ -22512,33 +22505,17 @@ var __sfc__$b = vue.defineComponent({
22512
22505
  index
22513
22506
  };
22514
22507
  var click = () => clickStep(index.value);
22515
- var getRef = (el) => {
22516
- if (direction.value === "horizontal") {
22517
- main2.value = el;
22518
- }
22519
- };
22520
22508
  bindSteps(stepProvider);
22521
- vue.watch(length, (newLength) => {
22522
- isLastChild.value = newLength - 1 === index.value;
22523
- if (main2.value) {
22524
- var margin = main2.value.offsetWidth / 2 - 14;
22525
- lineMargin.value = "0 -" + margin + "px";
22526
- }
22527
- });
22528
22509
  return {
22529
22510
  n: n$b,
22530
22511
  classes: classes$8,
22531
- main: main2,
22532
22512
  index,
22533
22513
  isActive,
22534
22514
  isCurrent,
22535
22515
  direction,
22536
- lineMargin,
22537
22516
  activeColor,
22538
22517
  inactiveColor,
22539
- isLastChild,
22540
- click,
22541
- getRef
22518
+ click
22542
22519
  };
22543
22520
  }
22544
22521
  });
@@ -22595,7 +22572,6 @@ var __sfc__$a = vue.defineComponent({
22595
22572
  var inactiveColor = vue.computed(() => props2.inactiveColor);
22596
22573
  var direction = vue.computed(() => props2.direction);
22597
22574
  var {
22598
- length,
22599
22575
  bindStep
22600
22576
  } = useStep();
22601
22577
  var clickStep = (index) => {
@@ -22603,7 +22579,6 @@ var __sfc__$a = vue.defineComponent({
22603
22579
  };
22604
22580
  var stepsProvider = {
22605
22581
  active,
22606
- length,
22607
22582
  direction,
22608
22583
  activeColor,
22609
22584
  inactiveColor,
@@ -23742,8 +23717,9 @@ const fieldDecorator$1 = {
23742
23717
  "--field-decorator-blur-color": "rgb(255, 255, 255, .7)"
23743
23718
  };
23744
23719
  const pagination$1 = {
23720
+ "--pagination-text-color": "#fff",
23745
23721
  "--pagination-list-bg-color": "#303030",
23746
- "--pagination-hover-bg-color": "#25293a",
23722
+ "--pagination-hover-bg-color": "rgba(255, 255, 255, .15)",
23747
23723
  "--pagination-list-active-bg-color": "#25293a",
23748
23724
  "--pagination-list-active-color": "#4a7afe",
23749
23725
  "--pagination-item-background": "#303030"
@@ -25560,7 +25536,7 @@ const TimePickerSfc = "";
25560
25536
  const TooltipSfc = "";
25561
25537
  const uploader = "";
25562
25538
  const UploaderSfc = "";
25563
- const version = "2.11.3";
25539
+ const version = "2.11.5";
25564
25540
  function install(app) {
25565
25541
  ActionSheet.install && app.use(ActionSheet);
25566
25542
  AppBar.install && app.use(AppBar);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "2.11.3",
3
+ "version": "2.11.5",
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/icons": "2.11.3",
50
- "@varlet/use": "2.11.3",
51
- "@varlet/shared": "2.11.3"
49
+ "@varlet/icons": "2.11.5",
50
+ "@varlet/shared": "2.11.5",
51
+ "@varlet/use": "2.11.5"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@vue/runtime-core": "3.3.1",
@@ -63,8 +63,8 @@
63
63
  "typescript": "^4.4.4",
64
64
  "vue": "3.3.2",
65
65
  "vue-router": "4.2.0",
66
- "@varlet/cli": "2.11.3",
67
- "@varlet/touch-emulator": "2.11.3"
66
+ "@varlet/cli": "2.11.5",
67
+ "@varlet/touch-emulator": "2.11.5"
68
68
  },
69
69
  "browserslist": [
70
70
  "Chrome >= 54",
package/types/rate.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface RateProps extends BasicAttributes {
17
17
  half?: boolean
18
18
  disabled?: boolean
19
19
  readonly?: boolean
20
+ clearable?: boolean
20
21
  ripple?: boolean
21
22
  rules?: Array<(value: any) => any>
22
23
  onChange?: ListenerProp<(value: string | number) => void>