@opentiny/vue-renderless 3.17.4 → 3.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,13 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { linkClick } from "./index";
3
3
  const api = ["linkClick", "state"];
4
- const renderless = (props, { reactive, inject }, { designConfig }, { refs, router, emit }) => {
4
+ const renderless = (props, { reactive, inject, computed }, { refs, router, emit, designConfig }) => {
5
5
  const breadcrumbEmitter = inject("breadcrumbEmitter");
6
6
  const breadcrumb = inject("breadcrumb");
7
7
  const constants = breadcrumb._constants;
8
- const separator = props.separator || (designConfig == null ? void 0 : designConfig.separator) || ">";
9
8
  const state = reactive({
10
9
  size: inject("size", null),
11
- separator
10
+ separator: computed(() => breadcrumb.separator || (designConfig == null ? void 0 : designConfig.separator) || ">")
12
11
  });
13
12
  const api2 = {
14
13
  state,
package/common/index.js CHANGED
@@ -237,7 +237,7 @@ const CASCADER = {
237
237
  PropsHover: "hoverThreshold",
238
238
  MenuConnector: "cascader-menu-"
239
239
  };
240
- const version = "3.17.4";
240
+ const version = "3.17.6";
241
241
  const log = (data, type = "log") => {
242
242
  uLog.logger[type](data);
243
243
  };
package/common/runtime.js CHANGED
@@ -22,7 +22,7 @@ import vuePopup from "./deps/vue-popup";
22
22
  import validate from "./validate";
23
23
  import memorize from "./deps/memorize";
24
24
  import * as common from ".";
25
- const version = "3.17.4";
25
+ const version = "3.17.6";
26
26
  const Renderless = {
27
27
  browser,
28
28
  array,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.17.4",
3
+ "version": "3.17.6",
4
4
  "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
5
5
  "author": "OpenTiny Team",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "xss": "1.0.11"
30
30
  },
31
31
  "devDependencies": {
32
- "esno": "^0.16.3",
32
+ "esno": "^4.7.0",
33
33
  "tsup": "7.2.0"
34
34
  },
35
35
  "scripts": {
@@ -10,9 +10,9 @@ const handleKeydown = (parent) => (event) => {
10
10
  switch (event.keyCode) {
11
11
  case KEY_CODE.ArrowDown:
12
12
  case KEY_CODE.ArrowRight:
13
+ event.stopPropagation();
14
+ event.preventDefault();
13
15
  if (index === length - 1) {
14
- event.stopPropagation();
15
- event.preventDefault();
16
16
  roleRadiosNodes[0].click();
17
17
  roleRadiosNodes[0].focus();
18
18
  } else {
package/tree-menu/vue.js CHANGED
@@ -67,7 +67,8 @@ const renderless = (props, { computed, watch, reactive, onMounted }, { t, servic
67
67
  treeStyle: computed(() => api2.computedTreeStyle()),
68
68
  defaultExpandedKeys: computed(
69
69
  () => props.defaultExpandedKeys && props.defaultExpandedKeys.length ? props.defaultExpandedKeys : state.currentKey
70
- )
70
+ ),
71
+ clearable: computed(() => props.clearable)
71
72
  });
72
73
  Object.assign(api2, {
73
74
  t,
@@ -0,0 +1,36 @@
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "../chunk-G2ADBYYC.js";
5
+ const filter = ({ vm: vm2 }) => (value) => {
6
+ vm2.$refs.treeRef.filter(value);
7
+ };
8
+ const nodeClick = ({ props, vm: vm2 }) => (data) => {
9
+ if (!props.multiple) {
10
+ vm2.$refs.baseSelectRef.updateSelectedData(__spreadProps(__spreadValues({}, data), {
11
+ currentLabel: data[props.textField],
12
+ value: data[props.valueField],
13
+ state: {
14
+ currentLabel: data[props.textField]
15
+ }
16
+ }));
17
+ vm2.$refs.baseSelectRef.hidePanel();
18
+ }
19
+ };
20
+ const check = ({ props }) => (data, { checkedNodes }) => {
21
+ if (props.multiple) {
22
+ vm.$refs.baseSelectRef.updateSelectedData(
23
+ checkedNodes.map((node) => {
24
+ return __spreadProps(__spreadValues({}, node), {
25
+ currentLabel: node[props.textField],
26
+ value: node[props.valueField]
27
+ });
28
+ })
29
+ );
30
+ }
31
+ };
32
+ export {
33
+ check,
34
+ filter,
35
+ nodeClick
36
+ };
@@ -0,0 +1,21 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ import { filter, nodeClick, check } from "./index";
3
+ const api = ["state", "filter", "nodeClick", "check"];
4
+ const renderless = (props, { reactive }, { vm }) => {
5
+ const api2 = {};
6
+ const state = reactive({
7
+ value: props.modelValue,
8
+ treeData: props.treeOp.data
9
+ });
10
+ Object.assign(api2, {
11
+ state,
12
+ filter: filter({ vm }),
13
+ nodeClick: nodeClick({ props, vm }),
14
+ check: check({ props })
15
+ });
16
+ return api2;
17
+ };
18
+ export {
19
+ api,
20
+ renderless
21
+ };
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-023fd6e9.js';
2
+ export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-02a1effb.js';
3
3
  import './shared.type.js';
@@ -237,7 +237,7 @@ declare const calculateNodeStyling: () => (targetElement: HTMLElement) => {
237
237
  borderSize: number;
238
238
  boxSizing: string;
239
239
  };
240
- declare const calcTextareaHeight: ({ api, hiddenTextarea, props, state, mode, constants }: Pick<IInputRenderlessParams, "state" | "props" | "mode" | "api" | "constants"> & {
240
+ declare const calcTextareaHeight: ({ api, hiddenTextarea, props, state, mode, constants }: Pick<IInputRenderlessParams, "mode" | "props" | "state" | "api" | "constants"> & {
241
241
  hiddenTextarea: HTMLTextAreaElement | null;
242
242
  }) => (targetElement: HTMLTextAreaElement, minRows?: number, maxRows?: null) => {
243
243
  minHeight?: string | undefined;
@@ -92,7 +92,7 @@ declare const popoverProps: {
92
92
  *
93
93
  */
94
94
 
95
- declare const mounted: ({ api, state, constants, props, nextTick, mode }: Pick<IPopoverRenderlessParams, "state" | "props" | "nextTick" | "mode" | "api"> & {
95
+ declare const mounted: ({ api, state, constants, props, nextTick, mode }: Pick<IPopoverRenderlessParams, "mode" | "props" | "state" | "api" | "nextTick"> & {
96
96
  constants: {
97
97
  IDPREFIX: string;
98
98
  };
@@ -108,14 +108,14 @@ declare const getSourceData: ({ props, Tree }: Pick<ITransferRenderlessParams, "
108
108
  Tree: string;
109
109
  }) => () => unknown[];
110
110
  /** 返回右边的数据项 */
111
- declare const getTargetData: ({ props, state, Tree, Table }: Pick<ITransferRenderlessParams, "state" | "props"> & {
111
+ declare const getTargetData: ({ props, state, Tree, Table }: Pick<ITransferRenderlessParams, "props" | "state"> & {
112
112
  Tree: string;
113
113
  Table: string;
114
114
  }) => () => unknown;
115
115
  declare const onSourceCheckedChange: ({ emit, state }: Pick<ITransferRenderlessParams, 'emit' | 'state'>) => (val: string[], movedKeys: string[]) => void;
116
116
  declare const onTargetCheckedChange: ({ emit, state }: Pick<ITransferRenderlessParams, 'emit' | 'state'>) => (val: string[], movedKeys: string[]) => void;
117
117
  declare const addToLeft: ({ emit, props, state }: Pick<ITransferRenderlessParams, 'emit' | 'props' | 'state'>) => (value: undefined | 'all') => void;
118
- declare const addToRight: ({ emit, refs, props, state, Tree }: Pick<ITransferRenderlessParams, "state" | "props" | "refs" | "emit"> & {
118
+ declare const addToRight: ({ emit, refs, props, state, Tree }: Pick<ITransferRenderlessParams, "emit" | "props" | "state" | "refs"> & {
119
119
  Tree: string;
120
120
  }) => (value: undefined | 'all') => void;
121
121
  declare const clearQuery: (refs: ITransferRenderlessParams['refs']) => (which: 'left' | 'right') => void;
@@ -126,7 +126,7 @@ declare const logicFun: ({ props, emit, state }: Pick<ITransferRenderlessParams,
126
126
  pullMode?: "sort" | undefined;
127
127
  }) => void;
128
128
  /** 组件加载后,给左右面板初始化Sortable的功能 */
129
- declare const sortableEvent: ({ api, droppanel, props, queryDom, refs }: Pick<ITransferRenderlessParams, "props" | "refs" | "api"> & {
129
+ declare const sortableEvent: ({ api, droppanel, props, queryDom, refs }: Pick<ITransferRenderlessParams, "props" | "api" | "refs"> & {
130
130
  droppanel: string;
131
131
  queryDom: string;
132
132
  }) => () => void;
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { ExtractPropTypes } from 'vue';
2
+ import { ComputedRef, ExtractPropTypes } from 'vue';
3
3
  import * as _opentiny_vue_common from '@opentiny/vue-common';
4
4
  import { ISharedRenderlessParamUtils } from './shared.type.js';
5
5
 
@@ -84,6 +84,10 @@ declare const treeMenuProps: {
84
84
  type: BooleanConstructor;
85
85
  default: boolean;
86
86
  };
87
+ clearable: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
87
91
  tiny_mode: StringConstructor;
88
92
  tiny_mode_root: BooleanConstructor;
89
93
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -166,6 +170,7 @@ interface ITreeMenuState {
166
170
  data?: unknown[];
167
171
  filterText: string;
168
172
  isCollapsed: boolean;
173
+ clearable: ComputedRef<boolean>;
169
174
  }
170
175
  type ITreeMenuProps = ExtractPropTypes<typeof treeMenuProps>;
171
176
  interface ITreeMenuApi {
@@ -1,6 +1,6 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
2
  import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
3
- import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-023fd6e9.js';
3
+ import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-02a1effb.js';
4
4
 
5
5
  declare const UploadDraggerProps: {
6
6
  disabled: BooleanConstructor;
@@ -404,7 +404,7 @@ declare const beforeUpload: ({ props, api, Modal, constants, t, state }: Pick<IF
404
404
  declare const startUpload: ({ state, constants, vm, Modal, api, t }: Pick<IFileUploadRenderlessParams, 'state' | 'constants' | 'vm' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile, isList: boolean) => void;
405
405
  declare const properFileSize: ({ props, state, api, constants, Modal, t }: Pick<IFileUploadRenderlessParams, 'props' | 'state' | 'constants' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile) => boolean;
406
406
  declare const addFileToList: ({ api, constants, emit, props, state, mode }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'props' | 'state' | 'mode'>) => (rawFile: IFileUploadFile, updateId: string, reUpload: boolean) => void;
407
- declare const getFileHash: ({ emit, Modal, constants, t, CryptoJS, state }: Pick<IFileUploadRenderlessParams, "state" | "emit" | "t" | "constants"> & IFileUploadModalVm & {
407
+ declare const getFileHash: ({ emit, Modal, constants, t, CryptoJS, state }: Pick<IFileUploadRenderlessParams, "emit" | "state" | "t" | "constants"> & IFileUploadModalVm & {
408
408
  CryptoJS: object;
409
409
  }) => ({ file, chunkSize, showTips }: {
410
410
  file: IFileUploadFile;
@@ -484,13 +484,13 @@ declare const sliceDownloadChunk: ({ state }: Pick<IFileUploadRenderlessParams,
484
484
  declare const batchSegmentDownload: ({ state, api }: Pick<IFileUploadRenderlessParams, 'state' | 'api'>) => ({ batchIndex, batches, docId, isBatch, isLessThan17G }: IFileUploadBatchSegmentDownload) => void;
485
485
  declare const downloadFileInner: ({ api, props, state }: Pick<IFileUploadRenderlessParams, 'api' | 'props' | 'state'>) => ({ batchIndex, file, range, isBatch, isChunk, isLessThan17G }: IFileUploadDownloadFileInner) => void;
486
486
  declare const afterDownload: ({ api, state }: Pick<IFileUploadRenderlessParams, 'api' | 'state'>) => ({ batchIndex, range, data, file, isBatch, isChunk, isLessThan17G }: IFileUploadAfterDownload) => void;
487
- declare const setWriterFile: ({ state, emit, Streamsaver }: Pick<IFileUploadRenderlessParams, "state" | "emit"> & {
487
+ declare const setWriterFile: ({ state, emit, Streamsaver }: Pick<IFileUploadRenderlessParams, "emit" | "state"> & {
488
488
  Streamsaver: IFileUploadStreamsaver;
489
489
  }) => ({ data, index, isLessThan17G, file }: IFileUploadSetWriterFile) => Function;
490
490
  declare const getFormData$1: ({ constants, props, state }: Pick<IFileUploadRenderlessParams, 'constants' | 'props' | 'state'>) => ({ formData, file, type }: IFileUploadGetFormData) => IUploadFormData;
491
491
  declare const largeDocumentUpload: ({ api, Modal, state, t, emit, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'state' | 't' | 'emit' | 'constants'> & IFileUploadModalVm) => (file: IFileUploadFile) => void;
492
492
  declare const segmentUploadInit: ({ api, props, service, state, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'props' | 'service' | 'state' | 'constants'>) => (file: IFileUploadFile) => Promise<unknown>;
493
- declare const segmentUpload: ({ api, props, service, state, emit, constants, CryptoJS }: Pick<IFileUploadRenderlessParams, "state" | "props" | "emit" | "api" | "constants" | "service"> & {
493
+ declare const segmentUpload: ({ api, props, service, state, emit, constants, CryptoJS }: Pick<IFileUploadRenderlessParams, "emit" | "props" | "state" | "api" | "constants" | "service"> & {
494
494
  CryptoJS: object;
495
495
  }) => (batchIndex: number, file: IFileUploadFile, progress: {
496
496
  file: IFileUploadFile;
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-023fd6e9.js';
2
+ export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-02a1effb.js';
3
3
  import './shared.type.js';
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-023fd6e9.js';
2
+ export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-02a1effb.js';
3
3
  import './shared.type.js';