@varlet/ui 3.3.9 → 3.3.11

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.3.9",
4
+ "version": "3.3.11",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -5112,13 +5112,22 @@
5112
5112
  },
5113
5113
  {
5114
5114
  "name": "option-count",
5115
- "description": "Number of visible options",
5115
+ "description": "Number of visible columns",
5116
5116
  "default": "6",
5117
5117
  "value": {
5118
5118
  "type": "string | number",
5119
5119
  "kind": "expression"
5120
5120
  }
5121
5121
  },
5122
+ {
5123
+ "name": "columns-count",
5124
+ "description": "Number of visible columns",
5125
+ "default": "-",
5126
+ "value": {
5127
+ "type": "string | number",
5128
+ "kind": "expression"
5129
+ }
5130
+ },
5122
5131
  {
5123
5132
  "name": "confirm-button-text",
5124
5133
  "description": "Confirm button text",
@@ -5317,6 +5326,15 @@
5317
5326
  "type": "boolean",
5318
5327
  "kind": "expression"
5319
5328
  }
5329
+ },
5330
+ {
5331
+ "name": "z-index",
5332
+ "description": "The zIndex of element",
5333
+ "default": "-",
5334
+ "value": {
5335
+ "type": "number",
5336
+ "kind": "expression"
5337
+ }
5320
5338
  }
5321
5339
  ],
5322
5340
  "events": [
@@ -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.3.9",
4
+ "version": "3.3.11",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -5278,6 +5278,15 @@
5278
5278
  "kind": "expression"
5279
5279
  }
5280
5280
  },
5281
+ {
5282
+ "name": "columns-count",
5283
+ "description": "最大显示列数",
5284
+ "default": "-",
5285
+ "value": {
5286
+ "type": "string | number",
5287
+ "kind": "expression"
5288
+ }
5289
+ },
5281
5290
  {
5282
5291
  "name": "confirm-button-text",
5283
5292
  "description": "确认按钮文字",
@@ -5476,6 +5485,15 @@
5476
5485
  "type": "boolean",
5477
5486
  "kind": "expression"
5478
5487
  }
5488
+ },
5489
+ {
5490
+ "name": "z-index",
5491
+ "description": "元素 z-index",
5492
+ "default": "-",
5493
+ "value": {
5494
+ "type": "number",
5495
+ "kind": "expression"
5496
+ }
5479
5497
  }
5480
5498
  ],
5481
5499
  "events": [
package/lib/varlet.cjs.js CHANGED
@@ -1013,6 +1013,7 @@ const props$1h = {
1013
1013
  type: Boolean,
1014
1014
  default: true
1015
1015
  },
1016
+ zIndex: Number,
1016
1017
  safeArea: Boolean,
1017
1018
  safeAreaTop: Boolean,
1018
1019
  teleport: {
@@ -1200,9 +1201,13 @@ var stdin_default$5V = vue.defineComponent({
1200
1201
  const {
1201
1202
  zIndex
1202
1203
  } = useZIndex(() => props2.show, 3);
1204
+ const normalizedZIndex = vue.computed(() => {
1205
+ var _a;
1206
+ return (_a = props2.zIndex) != null ? _a : zIndex.value;
1207
+ });
1203
1208
  const {
1204
1209
  onStackTop
1205
- } = useStack(() => props2.show, zIndex);
1210
+ } = useStack(() => props2.show, normalizedZIndex);
1206
1211
  const {
1207
1212
  disabled
1208
1213
  } = useTeleport();
@@ -1237,7 +1242,7 @@ var stdin_default$5V = vue.defineComponent({
1237
1242
  return vue.createVNode("div", {
1238
1243
  "class": classes$1a(n$1p("overlay"), overlayClass),
1239
1244
  "style": __spreadValues$u({
1240
- zIndex: zIndex.value - 1
1245
+ zIndex: normalizedZIndex.value - 1
1241
1246
  }, overlayStyle),
1242
1247
  "onClick": hidePopup
1243
1248
  }, null);
@@ -1246,7 +1251,7 @@ var stdin_default$5V = vue.defineComponent({
1246
1251
  return vue.withDirectives(vue.createVNode("div", vue.mergeProps({
1247
1252
  "class": classes$1a(n$1p("content"), n$1p(`--${props2.position}`), [props2.defaultStyle, n$1p("--content-background-color")], [props2.defaultStyle, n$1p("$-elevation--3")], [props2.safeArea, n$1p("--safe-area")], [props2.safeAreaTop, n$1p("--safe-area-top")]),
1248
1253
  "style": {
1249
- zIndex: zIndex.value
1254
+ zIndex: normalizedZIndex.value
1250
1255
  },
1251
1256
  "role": "dialog",
1252
1257
  "aria-modal": "true"
@@ -1261,7 +1266,7 @@ var stdin_default$5V = vue.defineComponent({
1261
1266
  default: () => [vue.withDirectives(vue.createVNode("div", {
1262
1267
  "class": classes$1a(n$1p("$--box"), n$1p(), [!props2.overlay, n$1p("--pointer-events-none")]),
1263
1268
  "style": {
1264
- zIndex: zIndex.value - 2
1269
+ zIndex: normalizedZIndex.value - 2
1265
1270
  }
1266
1271
  }, [props2.overlay && renderOverlay(), vue.createVNode(vue.Transition, {
1267
1272
  "name": props2.transition || n$1p(`$-pop-${props2.position}`)
@@ -19087,6 +19092,7 @@ const props$o = __spreadValues$7({
19087
19092
  type: [Number, String],
19088
19093
  default: 6
19089
19094
  },
19095
+ columnsCount: [String, Number],
19090
19096
  confirmButtonText: String,
19091
19097
  cancelButtonText: String,
19092
19098
  confirmButtonTextColor: String,
@@ -19331,6 +19337,7 @@ const __sfc__$v = vue.defineComponent({
19331
19337
  setup(props2) {
19332
19338
  const modelValue = useVModel(props2, "modelValue");
19333
19339
  const scrollColumns = vue.ref([]);
19340
+ const visibleColumnsCount = vue.computed(() => toNumber(props2.columnsCount));
19334
19341
  const optionHeight = vue.computed(() => toPxNum(props2.optionHeight));
19335
19342
  const optionCount = vue.computed(() => toPxNum(props2.optionCount));
19336
19343
  const center = vue.computed(() => optionCount.value * optionHeight.value / 2 - optionHeight.value / 2);
@@ -19357,7 +19364,8 @@ const __sfc__$v = vue.defineComponent({
19357
19364
  prevIndexes = [...indexes];
19358
19365
  }
19359
19366
  function normalizeNormalMode(columns) {
19360
- return columns.map((column, idx) => {
19367
+ const visibleColumns = props2.columnsCount != null ? columns.slice(0, visibleColumnsCount.value) : columns;
19368
+ return visibleColumns.map((column, idx) => {
19361
19369
  const scrollColumn = {
19362
19370
  id: sid$1++,
19363
19371
  prevY: 0,
@@ -19383,9 +19391,9 @@ const __sfc__$v = vue.defineComponent({
19383
19391
  createChildren(scrollColumns2, column);
19384
19392
  return scrollColumns2;
19385
19393
  }
19386
- function createChildren(scrollColumns2, children, syncModelValue = true) {
19394
+ function createChildren(scrollColumns2, children, syncModelValue = true, depth = 1) {
19387
19395
  var _a;
19388
- if (children.length) {
19396
+ if (children.length && (props2.columnsCount == null || depth <= visibleColumnsCount.value)) {
19389
19397
  const scrollColumn = {
19390
19398
  id: sid$1++,
19391
19399
  prevY: 0,
@@ -19409,7 +19417,8 @@ const __sfc__$v = vue.defineComponent({
19409
19417
  createChildren(
19410
19418
  scrollColumns2,
19411
19419
  (_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : [],
19412
- syncModelValue
19420
+ syncModelValue,
19421
+ depth + 1
19413
19422
  );
19414
19423
  }
19415
19424
  }
@@ -19419,7 +19428,8 @@ const __sfc__$v = vue.defineComponent({
19419
19428
  createChildren(
19420
19429
  scrollColumns.value,
19421
19430
  (_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : [],
19422
- false
19431
+ false,
19432
+ scrollColumns.value.length + 1
19423
19433
  );
19424
19434
  }
19425
19435
  function initScrollColumns() {
@@ -29109,7 +29119,7 @@ withInstall(stdin_default$1);
29109
29119
  withPropsDefaultsSetter(stdin_default$1, props);
29110
29120
  const _WatermarkComponent = stdin_default$1;
29111
29121
  var stdin_default = stdin_default$1;
29112
- const version = "3.3.9";
29122
+ const version = "3.3.11";
29113
29123
  function install(app) {
29114
29124
  stdin_default$5G.install && app.use(stdin_default$5G);
29115
29125
  stdin_default$5E.install && app.use(stdin_default$5E);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.3.9",
3
+ "version": "3.3.11",
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.3.9",
52
- "@varlet/use": "3.3.9",
53
- "@varlet/shared": "3.3.9"
51
+ "@varlet/icons": "3.3.11",
52
+ "@varlet/shared": "3.3.11",
53
+ "@varlet/use": "3.3.11"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.4.21",
@@ -64,9 +64,9 @@
64
64
  "typescript": "^5.1.5",
65
65
  "vue": "3.4.21",
66
66
  "vue-router": "4.2.0",
67
- "@varlet/cli": "3.3.9",
68
- "@varlet/ui": "3.3.9",
69
- "@varlet/touch-emulator": "3.3.9"
67
+ "@varlet/ui": "3.3.11",
68
+ "@varlet/cli": "3.3.11",
69
+ "@varlet/touch-emulator": "3.3.11"
70
70
  },
71
71
  "scripts": {
72
72
  "dev": "varlet-cli dev",
package/types/picker.d.ts CHANGED
@@ -24,6 +24,7 @@ export interface PickerProps {
24
24
  cascade?: boolean
25
25
  optionHeight?: string | number
26
26
  optionCount?: string | number
27
+ columnsCount?: string | number
27
28
  confirmButtonText?: string
28
29
  cancelButtonText?: string
29
30
  confirmButtonTextColor?: string
@@ -70,6 +71,7 @@ export interface PickerOptions {
70
71
  cascade?: boolean
71
72
  optionHeight?: number | string
72
73
  optionCount?: number | string
74
+ columnsCount?: number | string
73
75
  confirmButtonText?: string
74
76
  cancelButtonText?: string
75
77
  confirmButtonTextColor?: string
package/types/popup.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface PopupProps extends BasicAttributes {
17
17
  defaultStyle?: boolean
18
18
  safeArea?: boolean
19
19
  safeAreaTop?: boolean
20
+ zIndex?: number
20
21
  teleport?: TeleportProps['to'] | false
21
22
  onOpen?: ListenerProp<() => void>
22
23
  onOpened?: ListenerProp<() => void>