zartui 3.1.15 → 3.1.17-beta.1

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.
Files changed (59) hide show
  1. package/es/cell/Cell.d.ts +1 -1
  2. package/es/cell/index.d.ts +1 -1
  3. package/es/collapse-item/CollapseItem.mjs +2 -1
  4. package/es/date-time-picker/DateTimePicker.mjs +1 -1
  5. package/es/dropdown-item/types.d.ts +3 -3
  6. package/es/field/Field.d.ts +1 -1
  7. package/es/field/index.d.ts +1 -1
  8. package/es/index.d.ts +1 -1
  9. package/es/index.mjs +1 -1
  10. package/es/lazyload/vue-lazyload/index.d.ts +55 -55
  11. package/es/media-picker/MediaPicker.d.ts +4 -0
  12. package/es/media-picker/MediaPicker.mjs +22 -2
  13. package/es/media-picker/index.css +1 -1
  14. package/es/media-picker/index.d.ts +3 -0
  15. package/es/media-picker/style/index.mjs +1 -0
  16. package/es/media-picker/type.d.ts +1 -0
  17. package/es/pull-refresh/PullRefresh.d.ts +5 -1
  18. package/es/pull-refresh/PullRefresh.mjs +15 -4
  19. package/es/pull-refresh/index.d.ts +2 -0
  20. package/es/style/base.css +1 -1
  21. package/es/style/css-variables.css +1 -1
  22. package/es/tabs/Tabs.mjs +12 -5
  23. package/es/utils/dom.d.ts +2 -0
  24. package/es/utils/dom.mjs +15 -0
  25. package/es/vue-sfc-shim.d.ts +6 -6
  26. package/es/vue-tsx-shim.d.ts +23 -23
  27. package/lib/cell/Cell.d.ts +1 -1
  28. package/lib/cell/index.d.ts +1 -1
  29. package/lib/collapse-item/CollapseItem.js +2 -1
  30. package/lib/date-time-picker/DateTimePicker.js +1 -1
  31. package/lib/dropdown-item/types.d.ts +3 -3
  32. package/lib/field/Field.d.ts +1 -1
  33. package/lib/field/index.d.ts +1 -1
  34. package/lib/index.css +1 -1
  35. package/lib/index.d.ts +1 -1
  36. package/lib/index.js +1 -1
  37. package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
  38. package/lib/media-picker/MediaPicker.d.ts +4 -0
  39. package/lib/media-picker/MediaPicker.js +22 -2
  40. package/lib/media-picker/index.css +1 -1
  41. package/lib/media-picker/index.d.ts +3 -0
  42. package/lib/media-picker/style/index.js +1 -0
  43. package/lib/media-picker/type.d.ts +1 -0
  44. package/lib/pull-refresh/PullRefresh.d.ts +5 -1
  45. package/lib/pull-refresh/PullRefresh.js +13 -2
  46. package/lib/pull-refresh/index.d.ts +2 -0
  47. package/lib/style/base.css +1 -1
  48. package/lib/style/css-variables.css +1 -1
  49. package/lib/tabs/Tabs.js +12 -5
  50. package/lib/utils/dom.d.ts +2 -0
  51. package/lib/utils/dom.js +15 -0
  52. package/lib/vue-sfc-shim.d.ts +6 -6
  53. package/lib/vue-tsx-shim.d.ts +23 -23
  54. package/lib/web-types.json +1 -1
  55. package/lib/zartui.cjs.js +64 -12
  56. package/lib/zartui.es.js +64 -12
  57. package/lib/zartui.js +64 -12
  58. package/lib/zartui.min.js +1 -1
  59. package/package.json +79 -79
package/es/cell/Cell.d.ts CHANGED
@@ -194,8 +194,8 @@ declare const _default: import("vue").DefineComponent<{
194
194
  onClear?: ((...args: any[]) => any) | undefined;
195
195
  }, {
196
196
  replace: boolean;
197
- value: string;
198
197
  center: boolean;
198
+ value: string;
199
199
  border: boolean;
200
200
  direction: CellDirection;
201
201
  isLink: boolean;
@@ -97,8 +97,8 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
97
97
  onClear?: ((...args: any[]) => any) | undefined;
98
98
  }, {
99
99
  replace: boolean;
100
- value: string;
101
100
  center: boolean;
101
+ value: string;
102
102
  border: boolean;
103
103
  direction: import("./types").CellDirection;
104
104
  isLink: boolean;
@@ -83,6 +83,7 @@ var stdin_default = defineComponent({
83
83
  toggle();
84
84
  };
85
85
  const renderTitle = () => {
86
+ var _a;
86
87
  const {
87
88
  titleBackground,
88
89
  color
@@ -96,7 +97,7 @@ var stdin_default = defineComponent({
96
97
  custom: titleBackground
97
98
  }),
98
99
  "style": color ? `background:${color};` : ""
99
- }, null), _createVNode("span", {
100
+ }, null), slots.title ? (_a = slots.title) == null ? void 0 : _a.call(slots) : _createVNode("span", {
100
101
  "style": color ? `color:${color};` : "",
101
102
  "class": bem("text", {
102
103
  custom: titleBackground
@@ -124,7 +124,7 @@ var stdin_default = defineComponent({
124
124
  }
125
125
  }
126
126
  onClose();
127
- emit("confirm");
127
+ emit("confirm", currentValue.value);
128
128
  };
129
129
  const onOpen = () => {
130
130
  var _a, _b, _c;
@@ -3,10 +3,10 @@ import type { VNode, ComponentPublicInstance } from 'vue';
3
3
  import type { Numeric } from '../utils';
4
4
  export type DropdownItemOptionValue = Numeric | boolean | string;
5
5
  export type DropdownItemOption = {
6
- text: string;
6
+ text?: string;
7
7
  icon?: string;
8
- value: DropdownItemOptionValue;
9
- selected: boolean;
8
+ value?: DropdownItemOptionValue;
9
+ selected?: boolean;
10
10
  [key: PropertyKey]: any;
11
11
  };
12
12
  export type DropdownItemExpose = {
@@ -382,11 +382,11 @@ declare const _default: import("vue").DefineComponent<{
382
382
  onClickRightIcon?: ((...args: any[]) => any) | undefined;
383
383
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
384
384
  }, {
385
+ center: boolean;
385
386
  type: FieldType;
386
387
  autofocus: boolean;
387
388
  disabled: boolean;
388
389
  value: string;
389
- center: boolean;
390
390
  border: boolean;
391
391
  direction: import("../cell").CellDirection;
392
392
  isLink: boolean;
@@ -227,11 +227,11 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
227
227
  onClickRightIcon?: ((...args: any[]) => any) | undefined;
228
228
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
229
229
  }, {
230
+ center: boolean;
230
231
  type: import("./types").FieldType;
231
232
  autofocus: boolean;
232
233
  disabled: boolean;
233
234
  value: string;
234
- center: boolean;
235
235
  border: boolean;
236
236
  direction: import("..").CellDirection;
237
237
  isLink: boolean;
package/es/index.d.ts CHANGED
@@ -81,4 +81,4 @@ declare namespace _default {
81
81
  }
82
82
  export default _default;
83
83
  export function install(app: any): void;
84
- export const version: "3.1.15";
84
+ export const version: "3.1.16";
package/es/index.mjs CHANGED
@@ -74,7 +74,7 @@ import { TimePicker } from "./time-picker/index.mjs";
74
74
  import { Timeline } from "./timeline/index.mjs";
75
75
  import { Toast } from "./toast/index.mjs";
76
76
  import { Uploader } from "./uploader/index.mjs";
77
- const version = "3.1.15";
77
+ const version = "3.1.16";
78
78
  function install(app) {
79
79
  const components = [
80
80
  ActionSheet,
@@ -1,55 +1,55 @@
1
- import type { App } from 'vue';
2
-
3
- declare type ListenEvent =
4
- | 'scroll'
5
- | 'wheel'
6
- | 'mousewheel'
7
- | 'resize'
8
- | 'animationend'
9
- | 'transitionend'
10
- | 'touchmove';
11
-
12
- // eslint-disable-next-line
13
- declare type Callback = (listener: any, options: LazyloadOptions) => void;
14
-
15
- declare type Filter = {
16
- webp?: Callback;
17
- progressive?: Callback;
18
- };
19
-
20
- declare type Adapter = {
21
- error?: Callback;
22
- loaded?: Callback;
23
- loading?: Callback;
24
- };
25
-
26
- export declare type LazyloadOptions = {
27
- error?: string;
28
- filter?: Filter;
29
- silent?: boolean;
30
- adapter?: Adapter;
31
- loading?: string;
32
- attempt?: number;
33
- preLoad?: number;
34
- observer?: boolean;
35
- lazyImage?: boolean;
36
- throttleWait?: number;
37
- listenEvents?: ListenEvent[];
38
- dispatchEvent?: boolean;
39
- lazyComponent?: boolean;
40
- observerOptions?: IntersectionObserverInit;
41
- };
42
-
43
- export declare const Lazyload: {
44
- install(app: App, options?: LazyloadOptions): void;
45
- };
46
-
47
- declare module '@vue/runtime-core' {
48
- interface ComponentCustomProperties {
49
- $Lazyload: {
50
- $on: (event: string, handler: Callback) => void;
51
- $off: (event: string, handler?: Callback) => void;
52
- $once: (event: string, handler: Callback) => void;
53
- };
54
- }
55
- }
1
+ import type { App } from 'vue';
2
+
3
+ declare type ListenEvent =
4
+ | 'scroll'
5
+ | 'wheel'
6
+ | 'mousewheel'
7
+ | 'resize'
8
+ | 'animationend'
9
+ | 'transitionend'
10
+ | 'touchmove';
11
+
12
+ // eslint-disable-next-line
13
+ declare type Callback = (listener: any, options: LazyloadOptions) => void;
14
+
15
+ declare type Filter = {
16
+ webp?: Callback;
17
+ progressive?: Callback;
18
+ };
19
+
20
+ declare type Adapter = {
21
+ error?: Callback;
22
+ loaded?: Callback;
23
+ loading?: Callback;
24
+ };
25
+
26
+ export declare type LazyloadOptions = {
27
+ error?: string;
28
+ filter?: Filter;
29
+ silent?: boolean;
30
+ adapter?: Adapter;
31
+ loading?: string;
32
+ attempt?: number;
33
+ preLoad?: number;
34
+ observer?: boolean;
35
+ lazyImage?: boolean;
36
+ throttleWait?: number;
37
+ listenEvents?: ListenEvent[];
38
+ dispatchEvent?: boolean;
39
+ lazyComponent?: boolean;
40
+ observerOptions?: IntersectionObserverInit;
41
+ };
42
+
43
+ export declare const Lazyload: {
44
+ install(app: App, options?: LazyloadOptions): void;
45
+ };
46
+
47
+ declare module '@vue/runtime-core' {
48
+ interface ComponentCustomProperties {
49
+ $Lazyload: {
50
+ $on: (event: string, handler: Callback) => void;
51
+ $off: (event: string, handler?: Callback) => void;
52
+ $once: (event: string, handler: Callback) => void;
53
+ };
54
+ }
55
+ }
@@ -3,6 +3,7 @@ import type { Media, MediaAfterRead, MediaBeforeDelete, MediaBeforeRead, MediaPi
3
3
  declare const mediaPickerProps: {
4
4
  disabled: BooleanConstructor;
5
5
  showTitle: BooleanConstructor;
6
+ useFileNameAsLabel: BooleanConstructor;
6
7
  title: {
7
8
  type: PropType<string>;
8
9
  default: string;
@@ -76,6 +77,7 @@ export type MediaPickerProps = ExtractPropTypes<typeof mediaPickerProps>;
76
77
  declare const _default: import("vue").DefineComponent<{
77
78
  disabled: BooleanConstructor;
78
79
  showTitle: BooleanConstructor;
80
+ useFileNameAsLabel: BooleanConstructor;
79
81
  title: {
80
82
  type: PropType<string>;
81
83
  default: string;
@@ -147,6 +149,7 @@ declare const _default: import("vue").DefineComponent<{
147
149
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:mediaList" | "delete")[], "update:mediaList" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
148
150
  disabled: BooleanConstructor;
149
151
  showTitle: BooleanConstructor;
152
+ useFileNameAsLabel: BooleanConstructor;
150
153
  title: {
151
154
  type: PropType<string>;
152
155
  default: string;
@@ -222,6 +225,7 @@ declare const _default: import("vue").DefineComponent<{
222
225
  title: string;
223
226
  disabled: boolean;
224
227
  showTitle: boolean;
228
+ useFileNameAsLabel: boolean;
225
229
  mediaList: Media[];
226
230
  maxImageSideLength: number;
227
231
  maxImageFileSize: number;
@@ -24,11 +24,13 @@ import { ResizeOptions } from "./watermark/resize-options.mjs";
24
24
  import { CompressOptions } from "./watermark/compress-options.mjs";
25
25
  import { checkWatermarkConfigSupported } from "./watermark/watermark.mjs";
26
26
  import { ImageProcessor } from "./watermark/image-processor.mjs";
27
+ import { isEmptyValue } from "../field/utils.mjs";
27
28
  const [name, bem] = createNamespace("media-picker");
28
29
  const FILE_SIZE_LIMIT = 100;
29
30
  const mediaPickerProps = {
30
31
  disabled: Boolean,
31
32
  showTitle: Boolean,
33
+ useFileNameAsLabel: Boolean,
32
34
  title: makeStringProp("\u6DFB\u52A0\u9644\u4EF6"),
33
35
  mediaList: makeArrayProp(),
34
36
  // 图片压缩后的最大边长
@@ -79,7 +81,8 @@ var stdin_default = defineComponent({
79
81
  props: mediaPickerProps,
80
82
  emits: ["update:mediaList", "delete"],
81
83
  setup(props, {
82
- emit
84
+ emit,
85
+ slots
83
86
  }) {
84
87
  const videoOptionsVisible = ref(false);
85
88
  const audioOptionsVisible = ref(false);
@@ -363,6 +366,11 @@ var stdin_default = defineComponent({
363
366
  newMedias = newMedias.concat(medias);
364
367
  }
365
368
  }).finally(() => {
369
+ if (props.useFileNameAsLabel) {
370
+ newMedias.forEach((newMedia) => {
371
+ newMedia.label = newMedia.originalName;
372
+ });
373
+ }
366
374
  emit("update:mediaList", [...props.mediaList, ...newMedias]);
367
375
  if (props.afterRead) {
368
376
  props.afterRead(newMedias);
@@ -581,6 +589,18 @@ var stdin_default = defineComponent({
581
589
  }, null);
582
590
  }
583
591
  };
592
+ const renderMediaLabel = (media) => {
593
+ if (slots["preview-cover"]) {
594
+ return slots["preview-cover"]({
595
+ file: media
596
+ });
597
+ }
598
+ if (!isEmptyValue(media.label)) {
599
+ return _createVNode("div", {
600
+ "class": bem("thumbnail-label")
601
+ }, [media.label]);
602
+ }
603
+ };
584
604
  const onDelete = (media, index) => {
585
605
  if (props.beforeDelete) {
586
606
  const response = props.beforeDelete(media);
@@ -634,7 +654,7 @@ var stdin_default = defineComponent({
634
654
  "key": media.uniqueCode,
635
655
  "onClick": () => previewMedia(index)
636
656
  }, {
637
- default: () => [renderMediaThumbnail(media), genThumbnailMask(media), deleteIcon]
657
+ default: () => [renderMediaThumbnail(media), renderMediaLabel(media), genThumbnailMask(media), deleteIcon]
638
658
  });
639
659
  });
640
660
  const selectAction = (action) => {
@@ -1 +1 @@
1
- :root{--zt-media-picker-image-color: var(--zt-text-color);--zt-media-picker-button-background: linear-gradient(135deg, #e6ebf0 0%, #fff 100%, #fff 100%);--zt-media-picker-button-box-shadow: -4px -4px 8px 0 var(--zt-white), 4px 4px 8px 0 var(--zt-gray-a1);--zt-media-picker-button-border: 0;--zt-media-picker-button-active-border: 1px solid rgba(255, 255, 255, .75);--zt-media-picker-button-active-box-shadow: inset 4px 4px 8px 0 var(--zt-gray-a2);--zt-media-picker-line-height: 46px;--zt-media-picker-box-size: 48px;--zt-media-picker-icon-size: 32px;--zt-media-picker-title-height: 44px}:root[zt-theme-size=large]{--zt-media-picker-line-height: 52px;--zt-media-picker-box-size: 54px;--zt-media-picker-icon-size: 38px;--zt-media-picker-title-height: 56px}.zt-media-picker__hidden{display:none}.zt-media-picker__title{position:relative;height:var(--zt-media-picker-title-height);line-height:var(--zt-media-picker-title-height);font-weight:700;font-size:var(--zt-font-size-lg);color:var(--zt-text-color);padding:0 16px}.zt-media-picker__title:before{position:absolute;width:4px;height:16px;background:var(--zt-primary-color);left:0;top:14px;content:" "}.zt-media-picker__title:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid var(--zt-border-color);transform:scaleY(.5)}.zt-media-picker__line{width:100%;height:calc(var(--zt-media-picker-line-height) * 2);display:flex;align-items:center;overflow-x:auto}.zt-media-picker__line::-webkit-scrollbar{width:0;height:0}.zt-media-picker__line:after{content:" ";min-width:16px;height:10px}.zt-media-picker__box{width:var(--zt-media-picker-box-size);display:flex;flex-direction:column;align-items:center}.zt-media-picker__box:first-child{margin-left:16px}.zt-media-picker__box:not(:last-child){margin-right:24px}.zt-media-picker__button{display:flex;align-items:center;justify-content:center;width:var(--zt-media-picker-box-size);height:var(--zt-media-picker-box-size);background:var(--zt-media-picker-button-background);box-shadow:var(--zt-media-picker-button-box-shadow);border:var(--zt-media-picker-button-border);border-radius:8px;box-sizing:border-box}.zt-media-picker__button:active{background:var(--zt-gray-a04);border:var(--zt-media-picker-button-active-border);box-shadow:var(--zt-media-picker-button-active-box-shadow)}.zt-media-picker__icon{width:var(--zt-media-picker-icon-size);height:var(--zt-media-picker-icon-size);color:var(--zt-media-picker-image-color)}.zt-media-picker__label{margin-top:8px;font-size:var(--zt-font-size-sm);color:var(--zt-gray-a8);letter-spacing:0;text-align:center;line-height:var(--zt-line-height-sm);-webkit-user-select:none;user-select:none}.zt-media-picker__grid{padding:0 16px 8px!important}.zt-media-picker__delete{box-sizing:content-box;width:20px;height:20px;position:absolute;padding:4px;top:0;right:0}.zt-media-picker .zt-image{width:100%;height:100%}.zt-media-picker .zt-grid-item__content{padding:0}.zt-media-picker__thumbnail{width:100%;height:100%}.zt-media-picker__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--zt-white);background-color:var(--zt-uploader-mask-background);border-radius:4px}.zt-media-picker__mask-icon{font-size:var(--zt-font-size-xxxl)}.zt-media-picker__mask-message{margin-top:6px;padding:0 var(--zt-padding-base);font-size:var(--zt-font-size-sm);line-height:var(--zt-uploader-mask-message-line-height)}.zt-media-picker__loading{width:var(--zt-uploader-loading-icon-size);height:var(--zt-uploader-loading-icon-size);color:var(--zt-uploader-icon-color)}.zt-theme-dark{--zt-media-picker-button-background: linear-gradient(135deg, #111c29 0%, #1d2c3e 100%, #1c2a3c 100%);--zt-media-picker-button-box-shadow: -4px -4px 8px 0 rgba(255, 255, 255, .08), 4px 4px 8px 0 rgba(0, 12, 24, .8);--zt-media-picker-button-border: 1px solid var(--zt-gray-a1);--zt-media-picker-button-active-border: 1px solid var(--zt-gray-a1);--zt-media-picker-button-active-box-shadow: inset 6px 6px 6px 0 #000d1b}
1
+ :root{--zt-media-picker-image-color: var(--zt-text-color);--zt-media-picker-button-background: linear-gradient(135deg, #e6ebf0 0%, #fff 100%, #fff 100%);--zt-media-picker-button-box-shadow: -4px -4px 8px 0 var(--zt-white), 4px 4px 8px 0 var(--zt-gray-a1);--zt-media-picker-button-border: 0;--zt-media-picker-button-active-border: 1px solid rgba(255, 255, 255, .75);--zt-media-picker-button-active-box-shadow: inset 4px 4px 8px 0 var(--zt-gray-a2);--zt-media-picker-line-height: 46px;--zt-media-picker-box-size: 48px;--zt-media-picker-icon-size: 32px;--zt-media-picker-title-height: 44px;--zt-media-picker-thumbnail-label-background: rgba(var(--zt-gray-rgb), .5);--zt-media-picker-thumbnail-label-color: var(--zt-white)}:root[zt-theme-size=large]{--zt-media-picker-line-height: 52px;--zt-media-picker-box-size: 54px;--zt-media-picker-icon-size: 38px;--zt-media-picker-title-height: 56px}.zt-media-picker__hidden{display:none}.zt-media-picker__title{position:relative;height:var(--zt-media-picker-title-height);line-height:var(--zt-media-picker-title-height);font-weight:700;font-size:var(--zt-font-size-lg);color:var(--zt-text-color);padding:0 16px}.zt-media-picker__title:before{position:absolute;width:4px;height:16px;background:var(--zt-primary-color);left:0;top:14px;content:" "}.zt-media-picker__title:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid var(--zt-border-color);transform:scaleY(.5)}.zt-media-picker__line{width:100%;height:calc(var(--zt-media-picker-line-height) * 2);display:flex;align-items:center;overflow-x:auto}.zt-media-picker__line::-webkit-scrollbar{width:0;height:0}.zt-media-picker__line:after{content:" ";min-width:16px;height:10px}.zt-media-picker__box{width:var(--zt-media-picker-box-size);display:flex;flex-direction:column;align-items:center}.zt-media-picker__box:first-child{margin-left:16px}.zt-media-picker__box:not(:last-child){margin-right:24px}.zt-media-picker__button{display:flex;align-items:center;justify-content:center;width:var(--zt-media-picker-box-size);height:var(--zt-media-picker-box-size);background:var(--zt-media-picker-button-background);box-shadow:var(--zt-media-picker-button-box-shadow);border:var(--zt-media-picker-button-border);border-radius:8px;box-sizing:border-box}.zt-media-picker__button:active{background:var(--zt-gray-a04);border:var(--zt-media-picker-button-active-border);box-shadow:var(--zt-media-picker-button-active-box-shadow)}.zt-media-picker__icon{width:var(--zt-media-picker-icon-size);height:var(--zt-media-picker-icon-size);color:var(--zt-media-picker-image-color)}.zt-media-picker__label{margin-top:8px;font-size:var(--zt-font-size-sm);color:var(--zt-gray-a8);letter-spacing:0;text-align:center;line-height:var(--zt-line-height-sm);-webkit-user-select:none;user-select:none}.zt-media-picker__grid{padding:0 16px 8px!important}.zt-media-picker__delete{box-sizing:content-box;width:20px;height:20px;position:absolute;padding:4px;top:0;right:0}.zt-media-picker .zt-image{width:100%;height:100%}.zt-media-picker .zt-grid-item__content{padding:0}.zt-media-picker__thumbnail{width:100%;height:100%}.zt-media-picker__thumbnail-label{position:absolute;bottom:0;left:0;box-sizing:border-box;width:100%;height:var(--zt-line-height-lg);line-height:var(--zt-line-height-lg);padding:0 var(--zt-padding-xs);overflow:hidden;text-align:center;border-radius:0 0 4px 4px;font-size:var(--zt-font-size-sm);text-overflow:ellipsis;word-break:break-all;white-space:nowrap;color:var(--zt-media-picker-thumbnail-label-color);background-color:var(--zt-media-picker-thumbnail-label-background)}.zt-media-picker__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--zt-white);background-color:var(--zt-uploader-mask-background);border-radius:4px}.zt-media-picker__mask-icon{font-size:var(--zt-font-size-xxxl)}.zt-media-picker__mask-message{margin-top:6px;padding:0 var(--zt-padding-base);font-size:var(--zt-font-size-sm);line-height:var(--zt-uploader-mask-message-line-height)}.zt-media-picker__loading{width:var(--zt-uploader-loading-icon-size);height:var(--zt-uploader-loading-icon-size);color:var(--zt-uploader-icon-color)}.zt-theme-dark{--zt-media-picker-button-background: linear-gradient(135deg, #111c29 0%, #1d2c3e 100%, #1c2a3c 100%);--zt-media-picker-button-box-shadow: -4px -4px 8px 0 rgba(255, 255, 255, .08), 4px 4px 8px 0 rgba(0, 12, 24, .8);--zt-media-picker-button-border: 1px solid var(--zt-gray-a1);--zt-media-picker-button-active-border: 1px solid var(--zt-gray-a1);--zt-media-picker-button-active-box-shadow: inset 6px 6px 6px 0 #000d1b}
@@ -1,6 +1,7 @@
1
1
  export declare const MediaPicker: import("../utils").WithInstall<import("vue").DefineComponent<{
2
2
  disabled: BooleanConstructor;
3
3
  showTitle: BooleanConstructor;
4
+ useFileNameAsLabel: BooleanConstructor;
4
5
  title: {
5
6
  type: import("vue").PropType<string>;
6
7
  default: string;
@@ -62,6 +63,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
62
63
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:mediaList" | "delete")[], "update:mediaList" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
63
64
  disabled: BooleanConstructor;
64
65
  showTitle: BooleanConstructor;
66
+ useFileNameAsLabel: BooleanConstructor;
65
67
  title: {
66
68
  type: import("vue").PropType<string>;
67
69
  default: string;
@@ -127,6 +129,7 @@ export declare const MediaPicker: import("../utils").WithInstall<import("vue").D
127
129
  title: string;
128
130
  disabled: boolean;
129
131
  showTitle: boolean;
132
+ useFileNameAsLabel: boolean;
130
133
  mediaList: import("./type").Media[];
131
134
  maxImageSideLength: number;
132
135
  maxImageFileSize: number;
@@ -11,6 +11,7 @@ import "../../action-sheet/index.css";
11
11
  import "../../swipe/index.css";
12
12
  import "../../swipe-item/index.css";
13
13
  import "../../image-preview/index.css";
14
+ import "../../field/index.css";
14
15
  import "../../grid/index.css";
15
16
  import "../../grid-item/index.css";
16
17
  import "../index.css";
@@ -17,6 +17,7 @@ export type Media = {
17
17
  message?: string;
18
18
  mediaShot?: string;
19
19
  extra?: object;
20
+ label?: string;
20
21
  };
21
22
  export type MediaBeforeRead = (files: Array<File>) => boolean | Promise<Array<File>>;
22
23
  export type MediaAfterRead = (medias: Array<Media>) => void;
@@ -1,4 +1,5 @@
1
- import type { ExtractPropTypes } from 'vue';
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ import { TargetContainer } from '../utils';
2
3
  declare const pullRefreshProps: {
3
4
  disabled: BooleanConstructor;
4
5
  modelValue: BooleanConstructor;
@@ -19,6 +20,7 @@ declare const pullRefreshProps: {
19
20
  type: (NumberConstructor | StringConstructor)[];
20
21
  default: number;
21
22
  };
23
+ scrollElement: PropType<TargetContainer>;
22
24
  };
23
25
  export type PullRefreshProps = ExtractPropTypes<typeof pullRefreshProps>;
24
26
  declare const _default: import("vue").DefineComponent<{
@@ -41,6 +43,7 @@ declare const _default: import("vue").DefineComponent<{
41
43
  type: (NumberConstructor | StringConstructor)[];
42
44
  default: number;
43
45
  };
46
+ scrollElement: PropType<TargetContainer>;
44
47
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
45
48
  disabled: BooleanConstructor;
46
49
  modelValue: BooleanConstructor;
@@ -61,6 +64,7 @@ declare const _default: import("vue").DefineComponent<{
61
64
  type: (NumberConstructor | StringConstructor)[];
62
65
  default: number;
63
66
  };
67
+ scrollElement: PropType<TargetContainer>;
64
68
  }>> & {
65
69
  onChange?: ((...args: any[]) => any) | undefined;
66
70
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -1,6 +1,6 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { ref, watch, reactive, nextTick, defineComponent } from "vue";
3
- import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp } from "../utils/index.mjs";
2
+ import { ref, watch, reactive, nextTick, defineComponent, computed } from "vue";
3
+ import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp, getTargetDom } from "../utils/index.mjs";
4
4
  import { useEventListener, useScrollParent } from "@zartui/use";
5
5
  import { useTouch } from "../composables/use-touch.mjs";
6
6
  import { Loading } from "../loading/index.mjs";
@@ -17,7 +17,8 @@ const pullRefreshProps = {
17
17
  loadingText: String,
18
18
  pullDistance: numericProp,
19
19
  successDuration: makeNumericProp(500),
20
- animationDuration: makeNumericProp(300)
20
+ animationDuration: makeNumericProp(300),
21
+ scrollElement: null
21
22
  };
22
23
  var stdin_default = defineComponent({
23
24
  name,
@@ -30,7 +31,17 @@ var stdin_default = defineComponent({
30
31
  let reachTop;
31
32
  const root = ref();
32
33
  const track = ref();
33
- const scrollParent = useScrollParent(root);
34
+ const rootScrollElement = useScrollParent(root);
35
+ const scrollParent = computed(() => {
36
+ if (props.scrollElement) {
37
+ const targetDom = getTargetDom(props.scrollElement);
38
+ if (!targetDom) {
39
+ console.warn("\u8BF7\u68C0\u67E5props scroll-element\u5143\u7D20\u662F\u5426\u5B58\u5728\uFF01");
40
+ }
41
+ return targetDom != null ? targetDom : rootScrollElement.value;
42
+ }
43
+ return rootScrollElement.value;
44
+ });
34
45
  const state = reactive({
35
46
  status: "normal",
36
47
  distance: 0,
@@ -18,6 +18,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
18
18
  type: (NumberConstructor | StringConstructor)[];
19
19
  default: number;
20
20
  };
21
+ scrollElement: import("vue").PropType<import("../utils").TargetContainer>;
21
22
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
22
23
  disabled: BooleanConstructor;
23
24
  modelValue: BooleanConstructor;
@@ -38,6 +39,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
38
39
  type: (NumberConstructor | StringConstructor)[];
39
40
  default: number;
40
41
  };
42
+ scrollElement: import("vue").PropType<import("../utils").TargetContainer>;
41
43
  }>> & {
42
44
  onChange?: ((...args: any[]) => any) | undefined;
43
45
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
package/es/style/base.css CHANGED
@@ -1 +1 @@
1
- :root{--zt-green-r: 40;--zt-green-g: 205;--zt-green-b: 120;--zt-green-rgb: var(--zt-green-r), var(--zt-green-g), var(--zt-green-b);--zt-orange-r: 255;--zt-orange-g: 150;--zt-orange-b: 35;--zt-orange-rgb: var(--zt-orange-r), var(--zt-orange-g), var(--zt-orange-b);--zt-yellow-r: 255;--zt-yellow-g: 205;--zt-yellow-b: 35;--zt-yellow-rgb: var(--zt-yellow-r), var(--zt-yellow-g), var(--zt-yellow-b);--zt-blue-r: 0;--zt-blue-g: 145;--zt-blue-b: 250;--zt-blue-rgb: var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b);--zt-gray-r: 45;--zt-gray-g: 75;--zt-gray-b: 115;--zt-gray-rgb: var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b);--zt-red-r: 255;--zt-red-g: 80;--zt-red-b: 35;--zt-red-rgb: var(--zt-red-r), var(--zt-red-g), var(--zt-red-b);--zt-primary-color-r: 0;--zt-primary-color-g: 145;--zt-primary-color-b: 250;--zt-primary-color-rgb: var(--zt-primary-color-r), var(--zt-primary-color-g), var(--zt-primary-color-b);--zt-black: #000;--zt-white: #fff;--zt-gray: rgb(var(--zt-gray-rgb));--zt-gray-3: #ebedf0;--zt-gray-4: #dcdee0;--zt-gray-5: #c8c9cc;--zt-gray-6: #969799;--zt-gray-7: #646566;--zt-gray-8: #323233;--zt-gray-a04: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .04);--zt-gray-a06: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .06);--zt-gray-a08: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .08);--zt-gray-a1: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .1);--zt-gray-a2: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .2);--zt-gray-a4: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .4);--zt-gray-a6: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .6);--zt-gray-a8: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .8);--zt-red: rgb(var(--zt-red-rgb));--zt-blue: rgb(var(--zt-blue-rgb));--zt-blue-a6: rgb(var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b), .6);--zt-orange: rgb(var(--zt-orange-rgb));--zt-green: rgb(var(--zt-green-rgb));--zt-yellow: rgb(var(--zt-yellow-rgb));--zt-text-color-rgb: var(--zt-gray-rgb);--zt-primary-color: rgb(var(--zt-primary-color-rgb));--zt-primary-color-light: rgb(var(--zt-primary-color-r), calc(var(--zt-primary-color-g) + 30), var(--zt-primary-color-b));--zt-primary-color-a1: rgba(var(--zt-primary-color-rgb), .1);--zt-primary-color-a2: rgba(var(--zt-primary-color-rgb), .2);--zt-primary-color-a6: rgba(var(--zt-primary-color-rgb), .6);--zt-success-color: var(--zt-green);--zt-danger-color: var(--zt-red);--zt-warning-color: var(--zt-orange);--zt-text-color: var(--zt-gray);--zt-text-color-2: var(--zt-gray-6);--zt-text-color-3: var(--zt-gray-5);--zt-placeholder-color: var(--zt-gray-a2);--zt-active-color: var(--zt-gray-a2);--zt-active-opacity: .6;--zt-disabled-opacity: .4;--zt-background: #f5faff;--zt-background-2: #edf3fa;--zt-background-popup: var(--zt-white);--zt-background-card: var(--zt-white);--zt-padding-xxs: 2px;--zt-padding-base: 4px;--zt-padding-xs: 8px;--zt-padding-sm: 12px;--zt-padding-md: 16px;--zt-padding-lg: 24px;--zt-padding-xl: 32px;--zt-font-bold: 600;--zt-font-size-xs: 10px;--zt-font-size-sm: 12px;--zt-font-size-md: 14px;--zt-font-size-lg: 16px;--zt-font-size-xl: 18px;--zt-font-size-xxl: 20px;--zt-font-size-xxxl: 22px;--zt-line-height-xs: calc(2 * var(--zt-font-size-xs) - 8px);--zt-line-height-sm: calc(2 * var(--zt-font-size-sm) - 8px);--zt-line-height-md: calc(2 * var(--zt-font-size-md) - 8px);--zt-line-height-lg: calc(2 * var(--zt-font-size-lg) - 8px);--zt-line-height-xl: calc(2 * var(--zt-font-size-xl) - 8px);--zt-base-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Segoe UI, Arial, Roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;--zt-price-font: avenir-heavy, "PingFang SC", helvetica neue, arial, sans-serif;--zt-duration-base: .3s;--zt-duration-fast: .2s;--zt-ease-out: ease-out;--zt-ease-in: ease-in;--zt-border-color: var(--zt-gray-a1);--zt-border-width: 1px;--zt-radius-sm: 2px;--zt-radius-md: 4px;--zt-radius-lg: 8px;--zt-radius-gt: 16px;--zt-radius-max: 999px}:root[zt-theme-size=large]{--zt-font-size-sm: 18px;--zt-font-size-md: 20px;--zt-font-size-lg: 22px;--zt-font-size-xl: 24px;--zt-font-size-xxl: 26px;--zt-font-size-xxxl: 28px}.zt-theme-dark{--zt-gray-r: 255;--zt-gray-g: 255;--zt-gray-b: 255;--zt-text-color-2: #707070;--zt-text-color-3: #4d4d4d;--zt-background: #0f1923;--zt-background-popup: #19232d;--zt-background-2: #19232d;--zt-background-card: var(--zt-gray-a04)}html{-webkit-tap-highlight-color:transparent}:root{margin:0;font-family:var(--zt-base-font)}a{text-decoration:none}input,button,textarea{color:inherit;font:inherit}a:focus,input:focus,button:focus,textarea:focus,[class*=zt-]:focus{outline:none}ol,ul{margin:0;padding:0;list-style:none}@keyframes zt-slide-up-enter{0%{transform:translate3d(0,100%,0)}}@keyframes zt-slide-up-leave{to{transform:translate3d(0,100%,0)}}@keyframes zt-slide-down-enter{0%{transform:translate3d(0,-100%,0)}}@keyframes zt-slide-down-leave{to{transform:translate3d(0,-100%,0)}}@keyframes zt-slide-left-enter{0%{transform:translate3d(-100%,0,0)}}@keyframes zt-slide-left-leave{to{transform:translate3d(-100%,0,0)}}@keyframes zt-slide-right-enter{0%{transform:translate3d(100%,0,0)}}@keyframes zt-slide-right-leave{to{transform:translate3d(100%,0,0)}}@keyframes zt-fade-in{0%{opacity:0}to{opacity:1}}@keyframes zt-fade-out{0%{opacity:1}to{opacity:0}}@keyframes zt-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.zt-fade-enter-active{animation:var(--zt-duration-base) zt-fade-in both var(--zt-ease-out)}.zt-fade-leave-active{animation:var(--zt-duration-base) zt-fade-out both var(--zt-ease-in)}.zt-slide-up-enter-active{animation:zt-slide-up-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-up-leave-active{animation:zt-slide-up-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-slide-down-enter-active{animation:zt-slide-down-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-down-leave-active{animation:zt-slide-down-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-slide-left-enter-active{animation:zt-slide-left-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-left-leave-active{animation:zt-slide-left-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-slide-right-enter-active{animation:zt-slide-right-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-right-leave-active{animation:zt-slide-right-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-clearfix:after{display:table;clear:both;content:""}.zt-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.zt-multi-ellipsis--l2{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical}.zt-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:3;-webkit-box-orient:vertical}.zt-safe-area-top{padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.zt-safe-area-bottom{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.zt-haptics-feedback{cursor:pointer}.zt-haptics-feedback:active{opacity:var(--zt-active-opacity)}[class*=zt-hairline]:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid var(--zt-border-color);transform:scale(.5)}.zt-hairline,.zt-hairline--top,.zt-hairline--left,.zt-hairline--right,.zt-hairline--bottom,.zt-hairline--surround,.zt-hairline--top-bottom{position:relative}.zt-hairline--top:after{border-top-width:var(--zt-border-width)}.zt-hairline--left:after{border-left-width:var(--zt-border-width)}.zt-hairline--right:after{border-right-width:var(--zt-border-width)}.zt-hairline--bottom:after{border-bottom-width:var(--zt-border-width)}.zt-hairline--top-bottom:after,.zt-hairline-unset--top-bottom:after{border-width:var(--zt-border-width) 0}.zt-hairline--surround:after{border-width:var(--zt-border-width)}
1
+ :root{--zt-green-r: 40;--zt-green-g: 205;--zt-green-b: 120;--zt-green-rgb: var(--zt-green-r), var(--zt-green-g), var(--zt-green-b);--zt-dark-green-r: 0;--zt-dark-green-g: 175;--zt-dark-green-b: 145;--zt-dark-green-rgb: var(--zt-dark-green-r), var(--zt-dark-green-g), var(--zt-dark-green-b);--zt-orange-r: 255;--zt-orange-g: 150;--zt-orange-b: 35;--zt-orange-rgb: var(--zt-orange-r), var(--zt-orange-g), var(--zt-orange-b);--zt-yellow-r: 255;--zt-yellow-g: 205;--zt-yellow-b: 35;--zt-yellow-rgb: var(--zt-yellow-r), var(--zt-yellow-g), var(--zt-yellow-b);--zt-blue-r: 0;--zt-blue-g: 145;--zt-blue-b: 250;--zt-blue-rgb: var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b);--zt-gray-r: 45;--zt-gray-g: 75;--zt-gray-b: 115;--zt-gray-rgb: var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b);--zt-red-r: 255;--zt-red-g: 80;--zt-red-b: 35;--zt-red-rgb: var(--zt-red-r), var(--zt-red-g), var(--zt-red-b);--zt-primary-color-r: 0;--zt-primary-color-g: 145;--zt-primary-color-b: 250;--zt-primary-color-rgb: var(--zt-primary-color-r), var(--zt-primary-color-g), var(--zt-primary-color-b);--zt-black: #000;--zt-white: #fff;--zt-gray: rgb(var(--zt-gray-rgb));--zt-gray-3: #ebedf0;--zt-gray-4: #dcdee0;--zt-gray-5: #c8c9cc;--zt-gray-6: #969799;--zt-gray-7: #646566;--zt-gray-8: #323233;--zt-gray-a04: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .04);--zt-gray-a06: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .06);--zt-gray-a08: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .08);--zt-gray-a1: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .1);--zt-gray-a2: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .2);--zt-gray-a4: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .4);--zt-gray-a6: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .6);--zt-gray-a8: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .8);--zt-red: rgb(var(--zt-red-rgb));--zt-blue: rgb(var(--zt-blue-rgb));--zt-blue-a6: rgb(var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b), .6);--zt-orange: rgb(var(--zt-orange-rgb));--zt-green: rgb(var(--zt-green-rgb));--zt-dark-green: rgb(var(--zt-dark-green-rgb));--zt-yellow: rgb(var(--zt-yellow-rgb));--zt-text-color-rgb: var(--zt-gray-rgb);--zt-primary-color: rgb(var(--zt-primary-color-rgb));--zt-primary-color-light: rgb(var(--zt-primary-color-r), calc(var(--zt-primary-color-g) + 30), var(--zt-primary-color-b));--zt-primary-color-a1: rgba(var(--zt-primary-color-rgb), .1);--zt-primary-color-a2: rgba(var(--zt-primary-color-rgb), .2);--zt-primary-color-a6: rgba(var(--zt-primary-color-rgb), .6);--zt-success-color: var(--zt-green);--zt-danger-color: var(--zt-red);--zt-warning-color: var(--zt-orange);--zt-text-color: var(--zt-gray);--zt-text-color-2: var(--zt-gray-6);--zt-text-color-3: var(--zt-gray-5);--zt-placeholder-color: var(--zt-gray-a2);--zt-active-color: var(--zt-gray-a2);--zt-active-opacity: .6;--zt-disabled-opacity: .4;--zt-background: #f5faff;--zt-background-2: #edf3fa;--zt-background-popup: var(--zt-white);--zt-background-card: var(--zt-white);--zt-padding-xxs: 2px;--zt-padding-base: 4px;--zt-padding-xs: 8px;--zt-padding-sm: 12px;--zt-padding-md: 16px;--zt-padding-lg: 24px;--zt-padding-xl: 32px;--zt-font-bold: 600;--zt-font-size-xs: 10px;--zt-font-size-sm: 12px;--zt-font-size-md: 14px;--zt-font-size-lg: 16px;--zt-font-size-xl: 18px;--zt-font-size-xxl: 20px;--zt-font-size-xxxl: 22px;--zt-line-height-xs: calc(2 * var(--zt-font-size-xs) - 8px);--zt-line-height-sm: calc(2 * var(--zt-font-size-sm) - 8px);--zt-line-height-md: calc(2 * var(--zt-font-size-md) - 8px);--zt-line-height-lg: calc(2 * var(--zt-font-size-lg) - 8px);--zt-line-height-xl: calc(2 * var(--zt-font-size-xl) - 8px);--zt-base-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Segoe UI, Arial, Roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;--zt-price-font: avenir-heavy, "PingFang SC", helvetica neue, arial, sans-serif;--zt-duration-base: .3s;--zt-duration-fast: .2s;--zt-ease-out: ease-out;--zt-ease-in: ease-in;--zt-border-color: var(--zt-gray-a1);--zt-border-width: 1px;--zt-radius-sm: 2px;--zt-radius-md: 4px;--zt-radius-lg: 8px;--zt-radius-gt: 16px;--zt-radius-max: 999px}:root[zt-theme-size=large]{--zt-font-size-sm: 18px;--zt-font-size-md: 20px;--zt-font-size-lg: 22px;--zt-font-size-xl: 24px;--zt-font-size-xxl: 26px;--zt-font-size-xxxl: 28px}.zt-theme-dark{--zt-gray-r: 255;--zt-gray-g: 255;--zt-gray-b: 255;--zt-text-color-2: #707070;--zt-text-color-3: #4d4d4d;--zt-background: #0f1923;--zt-background-popup: #19232d;--zt-background-2: #19232d;--zt-background-card: var(--zt-gray-a04)}html{-webkit-tap-highlight-color:transparent}:root{margin:0;font-family:var(--zt-base-font)}a{text-decoration:none}input,button,textarea{color:inherit;font:inherit}a:focus,input:focus,button:focus,textarea:focus,[class*=zt-]:focus{outline:none}ol,ul{margin:0;padding:0;list-style:none}@keyframes zt-slide-up-enter{0%{transform:translate3d(0,100%,0)}}@keyframes zt-slide-up-leave{to{transform:translate3d(0,100%,0)}}@keyframes zt-slide-down-enter{0%{transform:translate3d(0,-100%,0)}}@keyframes zt-slide-down-leave{to{transform:translate3d(0,-100%,0)}}@keyframes zt-slide-left-enter{0%{transform:translate3d(-100%,0,0)}}@keyframes zt-slide-left-leave{to{transform:translate3d(-100%,0,0)}}@keyframes zt-slide-right-enter{0%{transform:translate3d(100%,0,0)}}@keyframes zt-slide-right-leave{to{transform:translate3d(100%,0,0)}}@keyframes zt-fade-in{0%{opacity:0}to{opacity:1}}@keyframes zt-fade-out{0%{opacity:1}to{opacity:0}}@keyframes zt-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.zt-fade-enter-active{animation:var(--zt-duration-base) zt-fade-in both var(--zt-ease-out)}.zt-fade-leave-active{animation:var(--zt-duration-base) zt-fade-out both var(--zt-ease-in)}.zt-slide-up-enter-active{animation:zt-slide-up-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-up-leave-active{animation:zt-slide-up-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-slide-down-enter-active{animation:zt-slide-down-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-down-leave-active{animation:zt-slide-down-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-slide-left-enter-active{animation:zt-slide-left-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-left-leave-active{animation:zt-slide-left-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-slide-right-enter-active{animation:zt-slide-right-enter var(--zt-duration-base) both var(--zt-ease-out)}.zt-slide-right-leave-active{animation:zt-slide-right-leave var(--zt-duration-base) both var(--zt-ease-in)}.zt-clearfix:after{display:table;clear:both;content:""}.zt-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.zt-multi-ellipsis--l2{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical}.zt-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:3;-webkit-box-orient:vertical}.zt-safe-area-top{padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.zt-safe-area-bottom{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.zt-haptics-feedback{cursor:pointer}.zt-haptics-feedback:active{opacity:var(--zt-active-opacity)}[class*=zt-hairline]:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid var(--zt-border-color);transform:scale(.5)}.zt-hairline,.zt-hairline--top,.zt-hairline--left,.zt-hairline--right,.zt-hairline--bottom,.zt-hairline--surround,.zt-hairline--top-bottom{position:relative}.zt-hairline--top:after{border-top-width:var(--zt-border-width)}.zt-hairline--left:after{border-left-width:var(--zt-border-width)}.zt-hairline--right:after{border-right-width:var(--zt-border-width)}.zt-hairline--bottom:after{border-bottom-width:var(--zt-border-width)}.zt-hairline--top-bottom:after,.zt-hairline-unset--top-bottom:after{border-width:var(--zt-border-width) 0}.zt-hairline--surround:after{border-width:var(--zt-border-width)}
@@ -1 +1 @@
1
- :root{--zt-green-r: 40;--zt-green-g: 205;--zt-green-b: 120;--zt-green-rgb: var(--zt-green-r), var(--zt-green-g), var(--zt-green-b);--zt-orange-r: 255;--zt-orange-g: 150;--zt-orange-b: 35;--zt-orange-rgb: var(--zt-orange-r), var(--zt-orange-g), var(--zt-orange-b);--zt-yellow-r: 255;--zt-yellow-g: 205;--zt-yellow-b: 35;--zt-yellow-rgb: var(--zt-yellow-r), var(--zt-yellow-g), var(--zt-yellow-b);--zt-blue-r: 0;--zt-blue-g: 145;--zt-blue-b: 250;--zt-blue-rgb: var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b);--zt-gray-r: 45;--zt-gray-g: 75;--zt-gray-b: 115;--zt-gray-rgb: var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b);--zt-red-r: 255;--zt-red-g: 80;--zt-red-b: 35;--zt-red-rgb: var(--zt-red-r), var(--zt-red-g), var(--zt-red-b);--zt-primary-color-r: 0;--zt-primary-color-g: 145;--zt-primary-color-b: 250;--zt-primary-color-rgb: var(--zt-primary-color-r), var(--zt-primary-color-g), var(--zt-primary-color-b);--zt-black: #000;--zt-white: #fff;--zt-gray: rgb(var(--zt-gray-rgb));--zt-gray-3: #ebedf0;--zt-gray-4: #dcdee0;--zt-gray-5: #c8c9cc;--zt-gray-6: #969799;--zt-gray-7: #646566;--zt-gray-8: #323233;--zt-gray-a04: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .04);--zt-gray-a06: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .06);--zt-gray-a08: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .08);--zt-gray-a1: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .1);--zt-gray-a2: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .2);--zt-gray-a4: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .4);--zt-gray-a6: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .6);--zt-gray-a8: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .8);--zt-red: rgb(var(--zt-red-rgb));--zt-blue: rgb(var(--zt-blue-rgb));--zt-blue-a6: rgb(var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b), .6);--zt-orange: rgb(var(--zt-orange-rgb));--zt-green: rgb(var(--zt-green-rgb));--zt-yellow: rgb(var(--zt-yellow-rgb));--zt-text-color-rgb: var(--zt-gray-rgb);--zt-primary-color: rgb(var(--zt-primary-color-rgb));--zt-primary-color-light: rgb(var(--zt-primary-color-r), calc(var(--zt-primary-color-g) + 30), var(--zt-primary-color-b));--zt-primary-color-a1: rgba(var(--zt-primary-color-rgb), .1);--zt-primary-color-a2: rgba(var(--zt-primary-color-rgb), .2);--zt-primary-color-a6: rgba(var(--zt-primary-color-rgb), .6);--zt-success-color: var(--zt-green);--zt-danger-color: var(--zt-red);--zt-warning-color: var(--zt-orange);--zt-text-color: var(--zt-gray);--zt-text-color-2: var(--zt-gray-6);--zt-text-color-3: var(--zt-gray-5);--zt-placeholder-color: var(--zt-gray-a2);--zt-active-color: var(--zt-gray-a2);--zt-active-opacity: .6;--zt-disabled-opacity: .4;--zt-background: #f5faff;--zt-background-2: #edf3fa;--zt-background-popup: var(--zt-white);--zt-background-card: var(--zt-white);--zt-padding-xxs: 2px;--zt-padding-base: 4px;--zt-padding-xs: 8px;--zt-padding-sm: 12px;--zt-padding-md: 16px;--zt-padding-lg: 24px;--zt-padding-xl: 32px;--zt-font-bold: 600;--zt-font-size-xs: 10px;--zt-font-size-sm: 12px;--zt-font-size-md: 14px;--zt-font-size-lg: 16px;--zt-font-size-xl: 18px;--zt-font-size-xxl: 20px;--zt-font-size-xxxl: 22px;--zt-line-height-xs: calc(2 * var(--zt-font-size-xs) - 8px);--zt-line-height-sm: calc(2 * var(--zt-font-size-sm) - 8px);--zt-line-height-md: calc(2 * var(--zt-font-size-md) - 8px);--zt-line-height-lg: calc(2 * var(--zt-font-size-lg) - 8px);--zt-line-height-xl: calc(2 * var(--zt-font-size-xl) - 8px);--zt-base-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Segoe UI, Arial, Roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;--zt-price-font: avenir-heavy, "PingFang SC", helvetica neue, arial, sans-serif;--zt-duration-base: .3s;--zt-duration-fast: .2s;--zt-ease-out: ease-out;--zt-ease-in: ease-in;--zt-border-color: var(--zt-gray-a1);--zt-border-width: 1px;--zt-radius-sm: 2px;--zt-radius-md: 4px;--zt-radius-lg: 8px;--zt-radius-gt: 16px;--zt-radius-max: 999px}:root[zt-theme-size=large]{--zt-font-size-sm: 18px;--zt-font-size-md: 20px;--zt-font-size-lg: 22px;--zt-font-size-xl: 24px;--zt-font-size-xxl: 26px;--zt-font-size-xxxl: 28px}.zt-theme-dark{--zt-gray-r: 255;--zt-gray-g: 255;--zt-gray-b: 255;--zt-text-color-2: #707070;--zt-text-color-3: #4d4d4d;--zt-background: #0f1923;--zt-background-popup: #19232d;--zt-background-2: #19232d;--zt-background-card: var(--zt-gray-a04)}
1
+ :root{--zt-green-r: 40;--zt-green-g: 205;--zt-green-b: 120;--zt-green-rgb: var(--zt-green-r), var(--zt-green-g), var(--zt-green-b);--zt-dark-green-r: 0;--zt-dark-green-g: 175;--zt-dark-green-b: 145;--zt-dark-green-rgb: var(--zt-dark-green-r), var(--zt-dark-green-g), var(--zt-dark-green-b);--zt-orange-r: 255;--zt-orange-g: 150;--zt-orange-b: 35;--zt-orange-rgb: var(--zt-orange-r), var(--zt-orange-g), var(--zt-orange-b);--zt-yellow-r: 255;--zt-yellow-g: 205;--zt-yellow-b: 35;--zt-yellow-rgb: var(--zt-yellow-r), var(--zt-yellow-g), var(--zt-yellow-b);--zt-blue-r: 0;--zt-blue-g: 145;--zt-blue-b: 250;--zt-blue-rgb: var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b);--zt-gray-r: 45;--zt-gray-g: 75;--zt-gray-b: 115;--zt-gray-rgb: var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b);--zt-red-r: 255;--zt-red-g: 80;--zt-red-b: 35;--zt-red-rgb: var(--zt-red-r), var(--zt-red-g), var(--zt-red-b);--zt-primary-color-r: 0;--zt-primary-color-g: 145;--zt-primary-color-b: 250;--zt-primary-color-rgb: var(--zt-primary-color-r), var(--zt-primary-color-g), var(--zt-primary-color-b);--zt-black: #000;--zt-white: #fff;--zt-gray: rgb(var(--zt-gray-rgb));--zt-gray-3: #ebedf0;--zt-gray-4: #dcdee0;--zt-gray-5: #c8c9cc;--zt-gray-6: #969799;--zt-gray-7: #646566;--zt-gray-8: #323233;--zt-gray-a04: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .04);--zt-gray-a06: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .06);--zt-gray-a08: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .08);--zt-gray-a1: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .1);--zt-gray-a2: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .2);--zt-gray-a4: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .4);--zt-gray-a6: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .6);--zt-gray-a8: rgb(var(--zt-gray-r), var(--zt-gray-g), var(--zt-gray-b), .8);--zt-red: rgb(var(--zt-red-rgb));--zt-blue: rgb(var(--zt-blue-rgb));--zt-blue-a6: rgb(var(--zt-blue-r), var(--zt-blue-g), var(--zt-blue-b), .6);--zt-orange: rgb(var(--zt-orange-rgb));--zt-green: rgb(var(--zt-green-rgb));--zt-dark-green: rgb(var(--zt-dark-green-rgb));--zt-yellow: rgb(var(--zt-yellow-rgb));--zt-text-color-rgb: var(--zt-gray-rgb);--zt-primary-color: rgb(var(--zt-primary-color-rgb));--zt-primary-color-light: rgb(var(--zt-primary-color-r), calc(var(--zt-primary-color-g) + 30), var(--zt-primary-color-b));--zt-primary-color-a1: rgba(var(--zt-primary-color-rgb), .1);--zt-primary-color-a2: rgba(var(--zt-primary-color-rgb), .2);--zt-primary-color-a6: rgba(var(--zt-primary-color-rgb), .6);--zt-success-color: var(--zt-green);--zt-danger-color: var(--zt-red);--zt-warning-color: var(--zt-orange);--zt-text-color: var(--zt-gray);--zt-text-color-2: var(--zt-gray-6);--zt-text-color-3: var(--zt-gray-5);--zt-placeholder-color: var(--zt-gray-a2);--zt-active-color: var(--zt-gray-a2);--zt-active-opacity: .6;--zt-disabled-opacity: .4;--zt-background: #f5faff;--zt-background-2: #edf3fa;--zt-background-popup: var(--zt-white);--zt-background-card: var(--zt-white);--zt-padding-xxs: 2px;--zt-padding-base: 4px;--zt-padding-xs: 8px;--zt-padding-sm: 12px;--zt-padding-md: 16px;--zt-padding-lg: 24px;--zt-padding-xl: 32px;--zt-font-bold: 600;--zt-font-size-xs: 10px;--zt-font-size-sm: 12px;--zt-font-size-md: 14px;--zt-font-size-lg: 16px;--zt-font-size-xl: 18px;--zt-font-size-xxl: 20px;--zt-font-size-xxxl: 22px;--zt-line-height-xs: calc(2 * var(--zt-font-size-xs) - 8px);--zt-line-height-sm: calc(2 * var(--zt-font-size-sm) - 8px);--zt-line-height-md: calc(2 * var(--zt-font-size-md) - 8px);--zt-line-height-lg: calc(2 * var(--zt-font-size-lg) - 8px);--zt-line-height-xl: calc(2 * var(--zt-font-size-xl) - 8px);--zt-base-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Segoe UI, Arial, Roboto, "PingFang SC", "miui", "Hiragino Sans GB", "Microsoft Yahei", sans-serif;--zt-price-font: avenir-heavy, "PingFang SC", helvetica neue, arial, sans-serif;--zt-duration-base: .3s;--zt-duration-fast: .2s;--zt-ease-out: ease-out;--zt-ease-in: ease-in;--zt-border-color: var(--zt-gray-a1);--zt-border-width: 1px;--zt-radius-sm: 2px;--zt-radius-md: 4px;--zt-radius-lg: 8px;--zt-radius-gt: 16px;--zt-radius-max: 999px}:root[zt-theme-size=large]{--zt-font-size-sm: 18px;--zt-font-size-md: 20px;--zt-font-size-lg: 22px;--zt-font-size-xl: 24px;--zt-font-size-xxl: 26px;--zt-font-size-xxxl: 28px}.zt-theme-dark{--zt-gray-r: 255;--zt-gray-g: 255;--zt-gray-b: 255;--zt-text-color-2: #707070;--zt-text-color-3: #4d4d4d;--zt-background: #0f1923;--zt-background-popup: #19232d;--zt-background-2: #19232d;--zt-background-card: var(--zt-gray-a04)}
package/es/tabs/Tabs.mjs CHANGED
@@ -50,6 +50,7 @@ var stdin_default = defineComponent({
50
50
  const root = ref();
51
51
  const navRef = ref();
52
52
  const wrapRef = ref();
53
+ const navTopRef = ref();
53
54
  const id = useId();
54
55
  const scroller = useScrollParent(root);
55
56
  const [titleRefs, setTitleRefs] = useRefs();
@@ -83,7 +84,11 @@ var stdin_default = defineComponent({
83
84
  const offsetTopPx = computed(() => unitToPx(props.offsetTop));
84
85
  const scrollOffset = computed(() => {
85
86
  if (props.sticky) {
86
- return offsetTopPx.value + tabHeight;
87
+ let navTopHeight = 0;
88
+ if (navTopRef.value) {
89
+ navTopHeight = useRect(navTopRef.value).height;
90
+ }
91
+ return offsetTopPx.value + tabHeight + navTopHeight;
87
92
  }
88
93
  return 0;
89
94
  });
@@ -350,7 +355,7 @@ var stdin_default = defineComponent({
350
355
  scrollIntoView
351
356
  });
352
357
  return () => {
353
- var _a;
358
+ var _a, _b;
354
359
  return _createVNode("div", {
355
360
  "ref": root,
356
361
  "class": bem([props.type])
@@ -360,10 +365,12 @@ var stdin_default = defineComponent({
360
365
  "onScroll": onStickyScroll
361
366
  }, {
362
367
  default: () => {
363
- var _a2;
364
- return [renderHeader(), (_a2 = slots["nav-bottom"]) == null ? void 0 : _a2.call(slots)];
368
+ var _a2, _b2;
369
+ return [slots["nav-top"] ? _createVNode("div", {
370
+ "ref": navTopRef
371
+ }, [(_a2 = slots["nav-top"]) == null ? void 0 : _a2.call(slots)]) : null, renderHeader(), (_b2 = slots["nav-bottom"]) == null ? void 0 : _b2.call(slots)];
365
372
  }
366
- }) : [renderHeader(), (_a = slots["nav-bottom"]) == null ? void 0 : _a.call(slots)], _createVNode(TabsContent, {
373
+ }) : [(_a = slots["nav-top"]) == null ? void 0 : _a.call(slots), renderHeader(), (_b = slots["nav-bottom"]) == null ? void 0 : _b.call(slots)], _createVNode(TabsContent, {
367
374
  "count": children.length,
368
375
  "inited": state.inited,
369
376
  "animated": props.animated,
package/es/utils/dom.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  export type ScrollElement = Element | Window;
3
+ export type TargetContainer = string | HTMLElement | (() => HTMLElement);
3
4
  export declare function getScrollTop(el: ScrollElement): number;
4
5
  export declare function setScrollTop(el: ScrollElement, value: number): void;
5
6
  export declare function getRootScrollTop(): number;
@@ -10,4 +11,5 @@ export declare const stopPropagation: (event: Event) => void;
10
11
  export declare function preventDefault(event: Event, isStopPropagation?: boolean): void;
11
12
  export declare function isHidden(elementRef: HTMLElement | Ref<HTMLElement | undefined>): boolean;
12
13
  export declare function colorFromCSSClass(className: string, defaultColor: string): string;
14
+ export declare const getTargetDom: (target: TargetContainer) => HTMLElement;
13
15
  export declare const windowWidth: Ref<number>, windowHeight: Ref<number>;
package/es/utils/dom.mjs CHANGED
@@ -61,12 +61,27 @@ function colorFromCSSClass(className, defaultColor) {
61
61
  document.body.removeChild(tmp);
62
62
  return !classColor ? defaultColor : classColor;
63
63
  }
64
+ const getTargetDom = (target) => {
65
+ if (target) {
66
+ if (typeof target === "string") {
67
+ return document.querySelectorAll(target)[0];
68
+ }
69
+ if (typeof target === "function") {
70
+ return target();
71
+ }
72
+ if (typeof target === "object" && target instanceof window.HTMLElement) {
73
+ return target;
74
+ }
75
+ }
76
+ return document.body;
77
+ };
64
78
  const { width: windowWidth, height: windowHeight } = useWindowSize();
65
79
  export {
66
80
  colorFromCSSClass,
67
81
  getElementTop,
68
82
  getRootScrollTop,
69
83
  getScrollTop,
84
+ getTargetDom,
70
85
  isHidden,
71
86
  preventDefault,
72
87
  resetScroll,
@@ -1,6 +1,6 @@
1
- declare module '*.vue' {
2
- // eslint-disable-next-line
3
- import { DefineComponent } from 'vue';
4
- const Component: DefineComponent;
5
- export default Component;
6
- }
1
+ declare module '*.vue' {
2
+ // eslint-disable-next-line
3
+ import { DefineComponent } from 'vue';
4
+ const Component: DefineComponent;
5
+ export default Component;
6
+ }