zartui 3.1.54 → 3.1.56

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/es/index.d.ts CHANGED
@@ -84,4 +84,4 @@ declare namespace _default {
84
84
  }
85
85
  export default _default;
86
86
  export function install(app: any): void;
87
- export const version: "3.1.53";
87
+ export const version: "3.1.56";
package/es/index.mjs CHANGED
@@ -77,7 +77,7 @@ import { Timeline } from "./timeline/index.mjs";
77
77
  import { Toast } from "./toast/index.mjs";
78
78
  import { Uploader } from "./uploader/index.mjs";
79
79
  import { Video } from "./video/index.mjs";
80
- const version = "3.1.53";
80
+ const version = "3.1.56";
81
81
  function install(app) {
82
82
  const components = [
83
83
  ActionSheet,
@@ -2,6 +2,7 @@ import { ExtractPropTypes } from "vue";
2
2
  declare const speechRecognizerProps: {
3
3
  title: StringConstructor;
4
4
  value: StringConstructor;
5
+ type: StringConstructor;
5
6
  show: BooleanConstructor;
6
7
  closeOnPopstate: {
7
8
  type: BooleanConstructor;
@@ -16,6 +17,7 @@ export type speechRecognizerProps = ExtractPropTypes<typeof speechRecognizerProp
16
17
  declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
17
18
  title: StringConstructor;
18
19
  value: StringConstructor;
20
+ type: StringConstructor;
19
21
  show: BooleanConstructor;
20
22
  closeOnPopstate: {
21
23
  type: BooleanConstructor;
@@ -25,9 +27,10 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
25
27
  type: BooleanConstructor;
26
28
  default: true;
27
29
  };
28
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "update:show" | "confirm" | "update:value")[], "change" | "close" | "update:show" | "confirm" | "update:value", import("vue").PublicProps, Readonly<ExtractPropTypes<{
30
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onTouchend" | "onTouchstart" | "change" | "close" | "update:show" | "confirm" | "update:value")[], "onTouchend" | "onTouchstart" | "change" | "close" | "update:show" | "confirm" | "update:value", import("vue").PublicProps, Readonly<ExtractPropTypes<{
29
31
  title: StringConstructor;
30
32
  value: StringConstructor;
33
+ type: StringConstructor;
31
34
  show: BooleanConstructor;
32
35
  closeOnPopstate: {
33
36
  type: BooleanConstructor;
@@ -42,6 +45,8 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
42
45
  onClose?: ((...args: any[]) => any) | undefined;
43
46
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
44
47
  onConfirm?: ((...args: any[]) => any) | undefined;
48
+ onOnTouchend?: ((...args: any[]) => any) | undefined;
49
+ onOnTouchstart?: ((...args: any[]) => any) | undefined;
45
50
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
46
51
  }>, {
47
52
  show: boolean;
@@ -8,6 +8,7 @@ const [name, bem] = createNamespace("speech-recognizer");
8
8
  const speechRecognizerProps = {
9
9
  title: String,
10
10
  value: String,
11
+ type: String,
11
12
  show: Boolean,
12
13
  closeOnPopstate: truthProp,
13
14
  closeOnClickOverlay: truthProp
@@ -15,7 +16,7 @@ const speechRecognizerProps = {
15
16
  var stdin_default = defineComponent({
16
17
  name,
17
18
  props: speechRecognizerProps,
18
- emits: ["change", "confirm", "close", "update:show", "update:value"],
19
+ emits: ["change", "confirm", "close", "update:show", "update:value", "onTouchstart", "onTouchend"],
19
20
  setup(props, {
20
21
  emit,
21
22
  slots
@@ -25,7 +26,7 @@ var stdin_default = defineComponent({
25
26
  const {
26
27
  startRecording,
27
28
  stopRecording
28
- } = useRecorder(emit);
29
+ } = useRecorder(emit, props.type);
29
30
  const modelValue = computed({
30
31
  get: () => props.value,
31
32
  set: (val) => {
@@ -130,12 +131,14 @@ var stdin_default = defineComponent({
130
131
  e.preventDefault();
131
132
  };
132
133
  const onTouchstart = () => {
134
+ emit("onTouchstart");
133
135
  isPlaying.value = true;
134
136
  startRecording();
135
137
  };
136
138
  const onTouchend = () => {
137
139
  isPlaying.value = false;
138
140
  stopRecording();
141
+ emit("onTouchend");
139
142
  };
140
143
  const renderPlay = () => {
141
144
  const text = props.value ? props.value : "\u8BF7\u8BF4\u8BDD";
@@ -2,6 +2,7 @@ import { speechRecognizerProps } from './SpeechRecognizer';
2
2
  export declare const SpeechRecognizer: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
3
  title: StringConstructor;
4
4
  value: StringConstructor;
5
+ type: StringConstructor;
5
6
  show: BooleanConstructor;
6
7
  closeOnPopstate: {
7
8
  type: BooleanConstructor;
@@ -11,9 +12,10 @@ export declare const SpeechRecognizer: import("../utils").WithInstall<import("vu
11
12
  type: BooleanConstructor;
12
13
  default: true;
13
14
  };
14
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "update:show" | "confirm" | "update:value")[], "change" | "close" | "update:show" | "confirm" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onTouchend" | "onTouchstart" | "change" | "close" | "update:show" | "confirm" | "update:value")[], "onTouchend" | "onTouchstart" | "change" | "close" | "update:show" | "confirm" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
16
  title: StringConstructor;
16
17
  value: StringConstructor;
18
+ type: StringConstructor;
17
19
  show: BooleanConstructor;
18
20
  closeOnPopstate: {
19
21
  type: BooleanConstructor;
@@ -28,6 +30,8 @@ export declare const SpeechRecognizer: import("../utils").WithInstall<import("vu
28
30
  onClose?: ((...args: any[]) => any) | undefined;
29
31
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
30
32
  onConfirm?: ((...args: any[]) => any) | undefined;
33
+ onOnTouchend?: ((...args: any[]) => any) | undefined;
34
+ onOnTouchstart?: ((...args: any[]) => any) | undefined;
31
35
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
32
36
  }>, {
33
37
  show: boolean;
@@ -1,4 +1,4 @@
1
- export declare function useRecorder(emit: any): {
1
+ export declare function useRecorder(emit: any, type?: string): {
2
2
  startRecording: () => Promise<void>;
3
3
  stopRecording: () => void;
4
4
  recordedBlobs: import("vue").Ref<(string | {
@@ -20,7 +20,7 @@ var __async = (__this, __arguments, generator) => {
20
20
  };
21
21
  import { ref } from "vue";
22
22
  import { showFailToast } from "../toast/index.mjs";
23
- function useRecorder(emit) {
23
+ function useRecorder(emit, type = "") {
24
24
  const recordedBlobs = ref([]);
25
25
  const mediaRecorder = ref();
26
26
  if (!navigator.mediaDevices) {
@@ -55,6 +55,10 @@ function useRecorder(emit) {
55
55
  mediaRecorder.value.ondataavailable = (event) => {
56
56
  if (event.data && event.data.size > 0) {
57
57
  recordedBlobs.value.push(event.data);
58
+ if (type === "raw") {
59
+ emit("change", recordedBlobs.value);
60
+ return;
61
+ }
58
62
  const blob = new Blob(recordedBlobs.value, { type: "audio/wav" });
59
63
  convertBlobToBase64(blob);
60
64
  }
@@ -37,7 +37,8 @@ var stdin_default = defineComponent({
37
37
  }) {
38
38
  const sortOrder = ref("");
39
39
  const sortKey = ref("");
40
- const fixedColumn = computed(() => props.headList.filter((v) => v.fixed));
40
+ const tableRef = ref();
41
+ const fixedColumn = computed(() => props.headList.filter((v) => v.fixed || v.fixedRight));
41
42
  const formatColumns = computed(() => {
42
43
  const columns = [];
43
44
  let left = 0;
@@ -52,7 +53,7 @@ var stdin_default = defineComponent({
52
53
  } else {
53
54
  column.left = 0;
54
55
  }
55
- if (element.fixed && !nextColumn.fixed) {
56
+ if (element.fixed && !(nextColumn == null ? void 0 : nextColumn.fixed)) {
56
57
  column.lastFixLeft = true;
57
58
  }
58
59
  columns.push(column);
@@ -60,8 +61,12 @@ var stdin_default = defineComponent({
60
61
  return columns;
61
62
  });
62
63
  const pingedLeft = ref(false);
64
+ const pingedRight = ref(false);
63
65
  const resortHeadList = computed(() => fixedColumn.value.concat(props.headList.filter((v) => !v.fixed)));
64
66
  onMounted(() => {
67
+ if (tableRef.value) {
68
+ pingedRight.value = tableRef.value.scrollWidth > tableRef.value.clientWidth;
69
+ }
65
70
  const fixedIndexList = props.headList.map((v, i) => {
66
71
  if (v.sorter && v.defaultSortOrder) {
67
72
  sortOrder.value = v.defaultSortOrder || "";
@@ -109,18 +114,24 @@ var stdin_default = defineComponent({
109
114
  } = event;
110
115
  const mergedScrollLeft = typeof scrollLeft === "number" ? scrollLeft : currentTarget == null ? void 0 : currentTarget.scrollLeft;
111
116
  pingedLeft.value = mergedScrollLeft > 0;
117
+ const rightRemain = currentTarget.scrollWidth - currentTarget.scrollLeft - currentTarget.clientWidth;
118
+ pingedRight.value = rightRemain > 0;
112
119
  };
113
120
  const getHead = (colData) => {
114
121
  const headSlot = slots[`head-${colData.id}`];
115
122
  const headEllipsisType = colData.sorter ? "flat" : "dialog";
116
123
  if ((colData == null ? void 0 : colData.colSpan) !== 0) {
117
124
  return _createVNode("th", {
118
- "class": bem("left", {
125
+ "class": [bem("left", {
119
126
  fixed: colData.fixed,
120
127
  last: colData.lastFixLeft && pingedLeft.value
121
- }),
128
+ }), bem("right", {
129
+ fixed: colData.fixedRight,
130
+ last: colData.lastRight && pingedRight.value
131
+ })],
122
132
  "style": {
123
- left: colData.fixed ? colData.left : ""
133
+ left: colData.fixed ? colData.left : "",
134
+ right: colData.fixedRight ? colData.right : ""
124
135
  },
125
136
  "colspan": (colData == null ? void 0 : colData.colSpan) !== 1 ? colData == null ? void 0 : colData.colSpan : null
126
137
  }, [headSlot ? headSlot(colData) : _createVNode("div", {
@@ -177,12 +188,16 @@ var stdin_default = defineComponent({
177
188
  }
178
189
  const style = Object.assign({}, colData.style);
179
190
  style.left = colData.fixed ? colData.left : "";
191
+ style.right = colData.fixedRight ? colData.right : "";
180
192
  return (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 0 && (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 0 && _createVNode("td", {
181
193
  "onClick": () => colData.click && colData.click(rowData, rowIndex),
182
- "class": bem("left", {
194
+ "class": [bem("left", {
183
195
  fixed: colData.fixed,
184
196
  last: colData.lastFixLeft && pingedLeft.value
185
- }),
197
+ }), bem("right", {
198
+ fixed: colData.fixedRight,
199
+ last: colData.lastRight && pingedRight.value
200
+ })],
186
201
  "colspan": (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.colSpan : null,
187
202
  "rowspan": (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.rowSpan : null,
188
203
  "style": style
@@ -217,6 +232,7 @@ var stdin_default = defineComponent({
217
232
  skeleton: true
218
233
  })
219
234
  }, [getLoadingColumn()]) : _createVNode("div", {
235
+ "ref": tableRef,
220
236
  "class": bem({
221
237
  fixed: fixedColumn.value.length > 0,
222
238
  bordered: props.border,
@@ -1 +1 @@
1
- :root{--zt-table-head-color: var(--zt-primary-color);--zt-table-head-height: 40px;--zt-table-head-background: #e6f5ff;--zt-table-body-height: 40px;--zt-table-body-color: var(--zt-gray);--zt-table-body-background: var(--zt-white);--zt-table-sort-default: var(--zt-gray-5);--zt-table-sort-active: var(--zt-primary-color)}:root[zt-theme-size=large]{--zt-table-head-height: 52px}.zt-base-hair{position:relative}.zt-base-hair: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-table table{border-collapse:separate;border-spacing:0;width:100%;table-layout:auto;box-sizing:border-box}.zt-table--fixed{overflow:auto scroll}.zt-table--fixed::-webkit-scrollbar{width:0;height:0}.zt-table--fixed table{table-layout:fixed}.zt-table--thead-fixed{position:-webkit-sticky!important;position:sticky!important;z-index:2}.zt-table--bordered{position:relative}.zt-table--bordered: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-table--bordered:after{border-left-width:var(--zt-border-width)}.zt-table--bordered>table{position:relative}.zt-table--bordered>table: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-table--bordered>table:after{border-top-width:var(--zt-border-width)}.zt-table--bordered .zt-table__thead>tr>th{position:relative}.zt-table--bordered .zt-table__thead>tr>th: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-table--bordered .zt-table__thead>tr>th:after{border-right-width:var(--zt-border-width);border-bottom-width:var(--zt-border-width)}.zt-table--bordered .zt-table__tbody>tr>td{position:relative}.zt-table--bordered .zt-table__tbody>tr>td: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-table--bordered .zt-table__tbody>tr>td:after{border-right-width:var(--zt-border-width);border-bottom-width:var(--zt-border-width)}.zt-table__thead>tr>th{box-sizing:border-box;overflow-wrap:break-word;min-height:var(--zt-table-head-height);font-weight:600;font-size:var(--zt-font-size-md);color:var(--zt-table-head-color);text-align:center;line-height:var(--zt-table-head-height);background:var(--zt-table-head-background)}.zt-table__tbody>tr>td{box-sizing:border-box;overflow-wrap:break-word;min-height:var(--zt-table-body-height);font-size:var(--zt-font-size-md);color:var(--zt-table-body-color);text-align:center;line-height:var(--zt-line-height-md);background:var(--zt-table-body-background);padding:10px 16px}.zt-table--striped .zt-table__tbody>tr:nth-child(2n)>td{background:var(--zt-table-head-background)}.zt-table__left--last{border-right:none!important}.zt-table__left--last:after{content:"";position:absolute;top:0;right:-10px;width:10px;height:100%;opacity:.06;background-image:linear-gradient(90deg,#000000 0%,rgba(0,0,0,0) 100%)}.zt-table__left--fixed{position:-webkit-sticky!important;position:sticky!important;z-index:2}.zt-table__head{display:flex;justify-content:center}.zt-table__head-sort{display:inline-flex;align-items:center;justify-content:center;flex-direction:column;color:var(--zt-table-sort-default)}.zt-table__head-label{line-height:var(--zt-table-head-height)}.zt-table__head-label-ellipsis{width:100%}.zt-table__sort-active{color:var(--zt-table-sort-active)}.zt-table--skeleton{background-color:#fff;padding-bottom:10px}.zt-table__row{display:flex;box-sizing:border-box;padding:0 10px;height:40px}.zt-table__row--head{display:flex;justify-content:center;align-items:center;background-color:#e7f0fb;margin-bottom:8px}.zt-table__row--head .zt-table__col-item{background-color:#cfdae9;height:20px}.zt-table__col{display:flex;align-items:center;justify-content:center;box-sizing:border-box;flex:1;padding:4px 6px;height:40px}.zt-table__col-item{width:100%;height:100%;border-radius:4px;background-color:rgba(45,75,115,.06)}.zt-table--animate{animation:zt-table-blink var(--zt-skeleton-duration) ease-in-out infinite}@keyframes zt-table-blink{50%{opacity:.6}}
1
+ :root{--zt-table-head-color: var(--zt-primary-color);--zt-table-head-height: 40px;--zt-table-head-background: #e6f5ff;--zt-table-body-height: 40px;--zt-table-body-color: var(--zt-gray);--zt-table-body-background: var(--zt-white);--zt-table-sort-default: var(--zt-gray-5);--zt-table-sort-active: var(--zt-primary-color)}:root[zt-theme-size=large]{--zt-table-head-height: 52px}.zt-base-hair{position:relative}.zt-base-hair: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-table table{border-collapse:separate;border-spacing:0;width:100%;table-layout:auto;box-sizing:border-box}.zt-table--fixed{overflow:auto scroll}.zt-table--fixed::-webkit-scrollbar{width:0;height:0}.zt-table--fixed table{table-layout:fixed}.zt-table--thead-fixed{position:-webkit-sticky!important;position:sticky!important;z-index:2}.zt-table--bordered{position:relative}.zt-table--bordered: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-table--bordered:after{border-left-width:var(--zt-border-width)}.zt-table--bordered>table{position:relative}.zt-table--bordered>table: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-table--bordered>table:after{border-top-width:var(--zt-border-width)}.zt-table--bordered .zt-table__thead>tr>th{position:relative}.zt-table--bordered .zt-table__thead>tr>th: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-table--bordered .zt-table__thead>tr>th:after{border-right-width:var(--zt-border-width);border-bottom-width:var(--zt-border-width)}.zt-table--bordered .zt-table__tbody>tr>td{position:relative}.zt-table--bordered .zt-table__tbody>tr>td: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-table--bordered .zt-table__tbody>tr>td:after{border-right-width:var(--zt-border-width);border-bottom-width:var(--zt-border-width)}.zt-table__thead>tr>th{box-sizing:border-box;overflow-wrap:break-word;min-height:var(--zt-table-head-height);font-weight:600;font-size:var(--zt-font-size-md);color:var(--zt-table-head-color);text-align:center;line-height:var(--zt-table-head-height);background:var(--zt-table-head-background)}.zt-table__tbody>tr>td{box-sizing:border-box;overflow-wrap:break-word;min-height:var(--zt-table-body-height);font-size:var(--zt-font-size-md);color:var(--zt-table-body-color);text-align:center;line-height:var(--zt-line-height-md);background:var(--zt-table-body-background);padding:10px 16px}.zt-table--striped .zt-table__tbody>tr:nth-child(2n)>td{background:var(--zt-table-head-background)}.zt-table__left--last{border-right:none!important}.zt-table__left--last:after{content:"";position:absolute;top:0;right:-10px;width:10px;height:100%;opacity:.06;background-image:linear-gradient(90deg,#000000 0%,rgba(0,0,0,0) 100%)}.zt-table__right--last{border-left:none!important}.zt-table__right--last:after{content:"";position:absolute;top:0;left:-10px;width:10px;height:100%;opacity:.06;background-image:linear-gradient(-90deg,#000000 0%,rgba(0,0,0,0) 100%)}.zt-table__right--fixed,.zt-table__left--fixed{position:-webkit-sticky!important;position:sticky!important;z-index:2}.zt-table__head{display:flex;justify-content:center}.zt-table__head-sort{display:inline-flex;align-items:center;justify-content:center;flex-direction:column;color:var(--zt-table-sort-default)}.zt-table__head-label{line-height:var(--zt-table-head-height)}.zt-table__head-label-ellipsis{width:100%}.zt-table__sort-active{color:var(--zt-table-sort-active)}.zt-table--skeleton{background-color:#fff;padding-bottom:10px}.zt-table__row{display:flex;box-sizing:border-box;padding:0 10px;height:40px}.zt-table__row--head{display:flex;justify-content:center;align-items:center;background-color:#e7f0fb;margin-bottom:8px}.zt-table__row--head .zt-table__col-item{background-color:#cfdae9;height:20px}.zt-table__col{display:flex;align-items:center;justify-content:center;box-sizing:border-box;flex:1;padding:4px 6px;height:40px}.zt-table__col-item{width:100%;height:100%;border-radius:4px;background-color:rgba(45,75,115,.06)}.zt-table--animate{animation:zt-table-blink var(--zt-skeleton-duration) ease-in-out infinite}@keyframes zt-table-blink{50%{opacity:.6}}