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/lib/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/lib/index.js CHANGED
@@ -182,7 +182,7 @@ __reExport(stdin_exports, require("./timeline"), module.exports);
182
182
  __reExport(stdin_exports, require("./toast"), module.exports);
183
183
  __reExport(stdin_exports, require("./uploader"), module.exports);
184
184
  __reExport(stdin_exports, require("./video"), module.exports);
185
- const version = "3.1.53";
185
+ const version = "3.1.56";
186
186
  function install(app) {
187
187
  const components = [
188
188
  import_action_sheet.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;
@@ -40,6 +40,7 @@ const [name, bem] = (0, import_utils.createNamespace)("speech-recognizer");
40
40
  const speechRecognizerProps = {
41
41
  title: String,
42
42
  value: String,
43
+ type: String,
43
44
  show: Boolean,
44
45
  closeOnPopstate: import_utils.truthProp,
45
46
  closeOnClickOverlay: import_utils.truthProp
@@ -47,7 +48,7 @@ const speechRecognizerProps = {
47
48
  var stdin_default = (0, import_vue.defineComponent)({
48
49
  name,
49
50
  props: speechRecognizerProps,
50
- emits: ["change", "confirm", "close", "update:show", "update:value"],
51
+ emits: ["change", "confirm", "close", "update:show", "update:value", "onTouchstart", "onTouchend"],
51
52
  setup(props, {
52
53
  emit,
53
54
  slots
@@ -57,7 +58,7 @@ var stdin_default = (0, import_vue.defineComponent)({
57
58
  const {
58
59
  startRecording,
59
60
  stopRecording
60
- } = (0, import_recorder.useRecorder)(emit);
61
+ } = (0, import_recorder.useRecorder)(emit, props.type);
61
62
  const modelValue = (0, import_vue.computed)({
62
63
  get: () => props.value,
63
64
  set: (val) => {
@@ -162,12 +163,14 @@ var stdin_default = (0, import_vue.defineComponent)({
162
163
  e.preventDefault();
163
164
  };
164
165
  const onTouchstart = () => {
166
+ emit("onTouchstart");
165
167
  isPlaying.value = true;
166
168
  startRecording();
167
169
  };
168
170
  const onTouchend = () => {
169
171
  isPlaying.value = false;
170
172
  stopRecording();
173
+ emit("onTouchend");
171
174
  };
172
175
  const renderPlay = () => {
173
176
  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 | {
@@ -42,7 +42,7 @@ __export(stdin_exports, {
42
42
  module.exports = __toCommonJS(stdin_exports);
43
43
  var import_vue = require("vue");
44
44
  var import_toast = require("../toast");
45
- function useRecorder(emit) {
45
+ function useRecorder(emit, type = "") {
46
46
  const recordedBlobs = (0, import_vue.ref)([]);
47
47
  const mediaRecorder = (0, import_vue.ref)();
48
48
  if (!navigator.mediaDevices) {
@@ -77,6 +77,10 @@ function useRecorder(emit) {
77
77
  mediaRecorder.value.ondataavailable = (event) => {
78
78
  if (event.data && event.data.size > 0) {
79
79
  recordedBlobs.value.push(event.data);
80
+ if (type === "raw") {
81
+ emit("change", recordedBlobs.value);
82
+ return;
83
+ }
80
84
  const blob = new Blob(recordedBlobs.value, { type: "audio/wav" });
81
85
  convertBlobToBase64(blob);
82
86
  }
@@ -70,7 +70,8 @@ var stdin_default = (0, import_vue.defineComponent)({
70
70
  }) {
71
71
  const sortOrder = (0, import_vue.ref)("");
72
72
  const sortKey = (0, import_vue.ref)("");
73
- const fixedColumn = (0, import_vue.computed)(() => props.headList.filter((v) => v.fixed));
73
+ const tableRef = (0, import_vue.ref)();
74
+ const fixedColumn = (0, import_vue.computed)(() => props.headList.filter((v) => v.fixed || v.fixedRight));
74
75
  const formatColumns = (0, import_vue.computed)(() => {
75
76
  const columns = [];
76
77
  let left = 0;
@@ -85,7 +86,7 @@ var stdin_default = (0, import_vue.defineComponent)({
85
86
  } else {
86
87
  column.left = 0;
87
88
  }
88
- if (element.fixed && !nextColumn.fixed) {
89
+ if (element.fixed && !(nextColumn == null ? void 0 : nextColumn.fixed)) {
89
90
  column.lastFixLeft = true;
90
91
  }
91
92
  columns.push(column);
@@ -93,8 +94,12 @@ var stdin_default = (0, import_vue.defineComponent)({
93
94
  return columns;
94
95
  });
95
96
  const pingedLeft = (0, import_vue.ref)(false);
97
+ const pingedRight = (0, import_vue.ref)(false);
96
98
  const resortHeadList = (0, import_vue.computed)(() => fixedColumn.value.concat(props.headList.filter((v) => !v.fixed)));
97
99
  (0, import_vue.onMounted)(() => {
100
+ if (tableRef.value) {
101
+ pingedRight.value = tableRef.value.scrollWidth > tableRef.value.clientWidth;
102
+ }
98
103
  const fixedIndexList = props.headList.map((v, i) => {
99
104
  if (v.sorter && v.defaultSortOrder) {
100
105
  sortOrder.value = v.defaultSortOrder || "";
@@ -142,18 +147,24 @@ var stdin_default = (0, import_vue.defineComponent)({
142
147
  } = event;
143
148
  const mergedScrollLeft = typeof scrollLeft === "number" ? scrollLeft : currentTarget == null ? void 0 : currentTarget.scrollLeft;
144
149
  pingedLeft.value = mergedScrollLeft > 0;
150
+ const rightRemain = currentTarget.scrollWidth - currentTarget.scrollLeft - currentTarget.clientWidth;
151
+ pingedRight.value = rightRemain > 0;
145
152
  };
146
153
  const getHead = (colData) => {
147
154
  const headSlot = slots[`head-${colData.id}`];
148
155
  const headEllipsisType = colData.sorter ? "flat" : "dialog";
149
156
  if ((colData == null ? void 0 : colData.colSpan) !== 0) {
150
157
  return (0, import_vue.createVNode)("th", {
151
- "class": bem("left", {
158
+ "class": [bem("left", {
152
159
  fixed: colData.fixed,
153
160
  last: colData.lastFixLeft && pingedLeft.value
154
- }),
161
+ }), bem("right", {
162
+ fixed: colData.fixedRight,
163
+ last: colData.lastRight && pingedRight.value
164
+ })],
155
165
  "style": {
156
- left: colData.fixed ? colData.left : ""
166
+ left: colData.fixed ? colData.left : "",
167
+ right: colData.fixedRight ? colData.right : ""
157
168
  },
158
169
  "colspan": (colData == null ? void 0 : colData.colSpan) !== 1 ? colData == null ? void 0 : colData.colSpan : null
159
170
  }, [headSlot ? headSlot(colData) : (0, import_vue.createVNode)("div", {
@@ -210,12 +221,16 @@ var stdin_default = (0, import_vue.defineComponent)({
210
221
  }
211
222
  const style = Object.assign({}, colData.style);
212
223
  style.left = colData.fixed ? colData.left : "";
224
+ style.right = colData.fixedRight ? colData.right : "";
213
225
  return (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 0 && (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 0 && (0, import_vue.createVNode)("td", {
214
226
  "onClick": () => colData.click && colData.click(rowData, rowIndex),
215
- "class": bem("left", {
227
+ "class": [bem("left", {
216
228
  fixed: colData.fixed,
217
229
  last: colData.lastFixLeft && pingedLeft.value
218
- }),
230
+ }), bem("right", {
231
+ fixed: colData.fixedRight,
232
+ last: colData.lastRight && pingedRight.value
233
+ })],
219
234
  "colspan": (additionalCellProps == null ? void 0 : additionalCellProps.colSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.colSpan : null,
220
235
  "rowspan": (additionalCellProps == null ? void 0 : additionalCellProps.rowSpan) !== 1 ? additionalCellProps == null ? void 0 : additionalCellProps.rowSpan : null,
221
236
  "style": style
@@ -250,6 +265,7 @@ var stdin_default = (0, import_vue.defineComponent)({
250
265
  skeleton: true
251
266
  })
252
267
  }, [getLoadingColumn()]) : (0, import_vue.createVNode)("div", {
268
+ "ref": tableRef,
253
269
  "class": bem({
254
270
  fixed: fixedColumn.value.length > 0,
255
271
  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}}