@varlet/ui 2.19.3 → 2.20.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/lib/varlet.cjs.js CHANGED
@@ -5454,9 +5454,31 @@ const __sfc__$10 = vue.defineComponent({
5454
5454
  collapseItem2.init(matchedItems.includes(collapseItem2));
5455
5455
  });
5456
5456
  }
5457
+ const toggleAll = (options) => {
5458
+ if (props2.accordion)
5459
+ return;
5460
+ const matchedItems = collapseItems.filter((item) => {
5461
+ var _a;
5462
+ const itemValue = (_a = item.name.value) != null ? _a : item.index.value;
5463
+ const expanded = normalizeValues.value.includes(itemValue);
5464
+ if (options.skipDisabled && item.disabled.value) {
5465
+ return expanded;
5466
+ }
5467
+ if (options.expand === "inverse") {
5468
+ return !expanded;
5469
+ }
5470
+ return options.expand;
5471
+ });
5472
+ const modelValue = matchedItems.map((item) => {
5473
+ var _a;
5474
+ return (_a = item.name.value) != null ? _a : item.index.value;
5475
+ });
5476
+ updateModelValue(modelValue);
5477
+ };
5457
5478
  return {
5458
5479
  divider: divider2,
5459
- n: n$$
5480
+ n: n$$,
5481
+ toggleAll
5460
5482
  };
5461
5483
  }
5462
5484
  });
@@ -5620,11 +5642,13 @@ const __sfc__$$ = vue.defineComponent({
5620
5642
  const showContent = vue.ref(false);
5621
5643
  const contentEl = vue.ref(null);
5622
5644
  const name2 = vue.computed(() => props2.name);
5645
+ const disabled = vue.computed(() => props2.disabled);
5623
5646
  const { index, collapse, bindCollapse } = useCollapse();
5624
5647
  const { offset: offset2, divider: divider2, elevation: elevation2, updateItem } = collapse;
5625
5648
  const collapseItemProvider = {
5626
5649
  index,
5627
5650
  name: name2,
5651
+ disabled,
5628
5652
  init
5629
5653
  };
5630
5654
  let isInitToTrigger = true;
@@ -10512,7 +10536,19 @@ function __render__$S(_ctx, _cache) {
10512
10536
  ],
10513
10537
  34
10514
10538
  /* CLASS, HYDRATE_EVENTS */
10515
- )
10539
+ ),
10540
+ _ctx.$slots.actions ? (vue.openBlock(), vue.createElementBlock(
10541
+ "div",
10542
+ {
10543
+ key: 0,
10544
+ class: vue.normalizeClass(_ctx.n("actions"))
10545
+ },
10546
+ [
10547
+ vue.renderSlot(_ctx.$slots, "actions")
10548
+ ],
10549
+ 2
10550
+ /* CLASS */
10551
+ )) : vue.createCommentVNode("v-if", true)
10516
10552
  ],
10517
10553
  2
10518
10554
  /* CLASS */
@@ -25049,7 +25085,7 @@ const uploader = "";
25049
25085
  const UploaderSfc = "";
25050
25086
  const watermark = "";
25051
25087
  const WatermarkSfc = "";
25052
- const version = "2.19.3";
25088
+ const version = "2.20.0";
25053
25089
  function install(app) {
25054
25090
  stdin_default$3k.install && app.use(stdin_default$3k);
25055
25091
  stdin_default$3i.install && app.use(stdin_default$3i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "2.19.3",
3
+ "version": "2.20.0",
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": "2.19.3",
52
- "@varlet/use": "2.19.3",
53
- "@varlet/shared": "2.19.3"
51
+ "@varlet/shared": "2.20.0",
52
+ "@varlet/use": "2.20.0",
53
+ "@varlet/icons": "2.20.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.3.4",
@@ -66,16 +66,16 @@
66
66
  "typescript": "^5.1.5",
67
67
  "vue": "3.3.4",
68
68
  "vue-router": "4.2.0",
69
- "@varlet/ui": "2.19.3",
70
- "@varlet/touch-emulator": "2.19.3",
71
- "@varlet/cli": "2.19.3"
69
+ "@varlet/ui": "2.20.0",
70
+ "@varlet/cli": "2.20.0",
71
+ "@varlet/touch-emulator": "2.20.0"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",
75
75
  "build": "varlet-cli build",
76
76
  "preview": "varlet-cli preview",
77
77
  "compile": "varlet-cli compile",
78
- "create": "varlet-cli create",
78
+ "create": "varlet-cli create -i",
79
79
  "test": "varlet-cli test",
80
80
  "test:watch": "varlet-cli test -w",
81
81
  "test:coverage": "varlet-cli test -cov"
@@ -5,6 +5,8 @@ export declare const collapseProps: Record<keyof CollapseProps, any>
5
5
 
6
6
  export type CollapseModelValue = undefined | string | number | Array<string | number | undefined>
7
7
 
8
+ export type CollapseToggleAllOptions = { expand: boolean | 'inverse'; skipDisabled?: boolean }
9
+
8
10
  export interface CollapseProps extends BasicAttributes {
9
11
  modelValue?: CollapseModelValue
10
12
  accordion?: boolean
@@ -23,6 +25,8 @@ export class Collapse extends VarComponent {
23
25
  $slots: {
24
26
  default(): VNode[]
25
27
  }
28
+
29
+ toggleAll(options: CollapseToggleAllOptions): void
26
30
  }
27
31
 
28
32
  export class _CollapseComponent extends Collapse {}
@@ -61,6 +61,7 @@ export class DatePicker extends VarComponent {
61
61
  date(data: DatePickerDate): VNode[]
62
62
  range(data: DatePickerRange): VNode[]
63
63
  multiple(data: DatePickerMultiple): VNode[]
64
+ actions(): VNode[]
64
65
  }
65
66
  }
66
67
 
@@ -381,8 +381,6 @@ export interface StyleVars {
381
381
  datePickerFontSize?: string
382
382
  '--date-picker-min-width'?: string
383
383
  datePickerMinWidth?: string
384
- '--date-picker-height'?: string
385
- datePickerHeight?: string
386
384
  '--date-picker-main-color'?: string
387
385
  datePickerMainColor?: string
388
386
  '--date-picker-title-hint-font-size'?: string
@@ -411,8 +409,12 @@ export interface StyleVars {
411
409
  datePickerTitleDateRangeFontSize?: string
412
410
  '--date-picker-body-background-color'?: string
413
411
  datePickerBodyBackgroundColor?: string
412
+ '--date-picker-body-height'?: string
413
+ datePickerBodyHeight?: string
414
414
  '--picker-header-padding'?: string
415
415
  pickerHeaderPadding?: string
416
+ '--picker-actions-padding'?: string
417
+ pickerActionsPadding?: string
416
418
  '--picker-header-color'?: string
417
419
  pickerHeaderColor?: string
418
420
  '--month-picker-padding'?: string