@opentiny/vue-renderless 3.11.0-alpha.0 → 3.11.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/anchor/index.js +4 -1
  2. package/color-picker/alpha-select/index.js +2 -6
  3. package/color-picker/alpha-select/vue.js +10 -8
  4. package/color-picker/color-select/index.js +2 -6
  5. package/color-picker/color-select/vue.js +9 -19
  6. package/color-picker/vue.js +1 -2
  7. package/color-select-panel/alpha-select/index.js +2 -6
  8. package/color-select-panel/alpha-select/vue.js +11 -9
  9. package/color-select-panel/hue-select/index.js +2 -6
  10. package/color-select-panel/hue-select/vue.js +9 -19
  11. package/color-select-panel/index.js +5 -1
  12. package/color-select-panel/vue.js +19 -24
  13. package/common/deps/fastdom/singleton.js +1 -1
  14. package/common/deps/popper.js +15 -8
  15. package/common/deps/popup-manager.js +1 -0
  16. package/common/event.js +8 -1
  17. package/common/index.js +1 -1
  18. package/common/runtime.js +1 -1
  19. package/dialog-box/index.js +2 -2
  20. package/form/index.js +22 -0
  21. package/form/vue.js +9 -0
  22. package/form-item/index.js +24 -0
  23. package/form-item/vue.js +11 -2
  24. package/grid/utils/dom.js +2 -1
  25. package/image/index.js +38 -3
  26. package/image/vue.js +7 -2
  27. package/image-viewer/index.js +326 -41
  28. package/image-viewer/vue.js +63 -18
  29. package/nav-menu/index.js +96 -14
  30. package/nav-menu/vue.js +18 -8
  31. package/package.json +1 -1
  32. package/picker/vue.js +1 -1
  33. package/popover/vue.js +8 -3
  34. package/rich-text-edtior/index.js +4 -0
  35. package/rich-text-edtior/vue.js +14 -14
  36. package/search/index.js +4 -1
  37. package/search/vue.js +3 -3
  38. package/tabbar/index.js +35 -2
  39. package/tabbar/vue.js +35 -9
  40. package/tabbar-item/index.js +10 -5
  41. package/tabbar-item/vue.js +13 -8
  42. package/tag/index.js +1 -1
  43. package/types/anchor.type.d.mts +4 -0
  44. package/types/file-upload.type.d.mts +1 -1
  45. package/types/form-item.type.d.mts +1 -1
  46. package/types/{form.type-7fc7c2ad.d.ts → form.type-1e2e9272.d.ts} +31 -11
  47. package/types/form.type.d.mts +1 -1
  48. package/types/image.type.d.mts +37 -4
  49. package/types/nav-menu.type.d.mts +7 -1
  50. package/types/popover.type.d.mts +1 -0
  51. package/types/shared.type.d.mts +5 -5
  52. package/types/upload-dragger.type.d.mts +1 -1
  53. package/types/{upload-list.type-4dfd7aba.d.ts → upload-list.type-b934f279.d.ts} +8 -1
  54. package/types/upload-list.type.d.mts +1 -1
  55. package/types/upload.type.d.mts +1 -1
  56. package/upload/index.js +23 -0
  57. package/upload/vue.js +3 -0
  58. package/user/index.js +2 -1
  59. package/user/vue.js +1 -1
@@ -8,16 +8,17 @@ const getRouteActive = ({ props, route }) => () => {
8
8
  return pathMatched || nameMatched;
9
9
  }
10
10
  };
11
- const onClick = ({ api, emit, parent, props, router, state }) => () => {
12
- parent.onChange(props.name || parent.index || state.index);
11
+ const onClick = ({ api, emit, parent, props, router, state, dispatch }) => (event) => {
12
+ dispatch("Tabbar", "activeItem", props.name || parent.index || state.index);
13
13
  emit("click", event);
14
14
  api.routeTab(router);
15
15
  };
16
- const bindChildren = (parent) => () => {
17
- if (!parent) {
16
+ const bindChildren = ({ parent, vm, dispatch }) => () => {
17
+ if (!parent.$parent) {
18
18
  return;
19
19
  }
20
- parent.state.children = parent.getChildrens();
20
+ dispatch("Tabbar", "updateItems", vm);
21
+ dispatch("Tabbar", "showIndex");
21
22
  };
22
23
  const routeTab = (props, state) => (router) => {
23
24
  const { to, replace } = props;
@@ -35,9 +36,13 @@ const routeTab = (props, state) => (router) => {
35
36
  replace ? location.replace(url) : location.href = url;
36
37
  }
37
38
  };
39
+ const getTabbarItemsWidth = (state) => (tabbarWidth, tabbarNumber) => {
40
+ state.itemWidth = tabbarWidth / tabbarNumber + "px";
41
+ };
38
42
  export {
39
43
  bindChildren,
40
44
  getRouteActive,
45
+ getTabbarItemsWidth,
41
46
  onClick,
42
47
  routeTab
43
48
  };
@@ -1,23 +1,28 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { getRouteActive, onClick, bindChildren, routeTab } from "./index";
3
- import { xss } from "../common/xss.js";
4
- const api = ["state", "onClick"];
5
- const renderless = (props, { computed, onMounted, reactive }, { parent, emit, nextTick, route, router }) => {
2
+ import { getRouteActive, onClick, bindChildren, routeTab, getTabbarItemsWidth } from "./index";
3
+ import { xss } from "../common";
4
+ const api = ["state", "onClick", "getTabbarItemsWidth"];
5
+ const renderless = (props, { computed, onMounted, reactive }, { parent, emit, nextTick, route, router, dispatch, vm }) => {
6
6
  const api2 = {};
7
7
  const state = reactive({
8
+ index: -1,
8
9
  active: false,
9
10
  info: computed(() => props.dot ? "" : !props.dot && props.badge),
10
11
  url: computed(() => xss.filterUrl(props.url)),
11
12
  routeActive: computed(() => api2.getRouteActive()),
12
- renderActive: computed(() => parent.route ? state.routeActive : state.active),
13
- renderColor: computed(() => parent[state.active ? "activeColor" : "inactiveColor"])
13
+ renderActive: computed(() => parent.$parent.route ? state.routeActive : state.active),
14
+ renderColor: computed(() => parent.$parent[state.active ? "activeColor" : "inactiveColor"]),
15
+ showVm: true,
16
+ itemWidth: null,
17
+ childrenNumber: 0
14
18
  });
15
19
  Object.assign(api2, {
16
20
  state,
17
- bindChildren: bindChildren(parent),
21
+ bindChildren: bindChildren({ parent, dispatch, vm }),
18
22
  routeTab: routeTab(props, state),
19
23
  getRouteActive: getRouteActive({ props, route }),
20
- onClick: onClick({ api: api2, emit, parent, props, router, state })
24
+ onClick: onClick({ api: api2, emit, parent, props, router, state, dispatch }),
25
+ getTabbarItemsWidth: getTabbarItemsWidth(state)
21
26
  });
22
27
  onMounted(() => nextTick(api2.bindChildren));
23
28
  return api2;
package/tag/index.js CHANGED
@@ -8,7 +8,7 @@ const handleClose = ({ emit, props, state }) => (event) => {
8
8
  props.beforeDelete ? props.beforeDelete(close) : close();
9
9
  };
10
10
  const handleClick = ({ emit, props, parent, state }) => (event) => {
11
- if (props.selectable || props.disabled)
11
+ if (!props.selectable || props.disabled)
12
12
  return;
13
13
  parent.$parent && parent.$parent.tagSelectable && event.stopPropagation();
14
14
  state.selected = !state.selected;
@@ -18,6 +18,10 @@ declare const anchorProps: {
18
18
  type: StringConstructor;
19
19
  default: string;
20
20
  };
21
+ type: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
21
25
  };
22
26
 
23
27
  /**
@@ -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-4dfd7aba.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-b934f279.js';
3
3
  import './shared.type.mjs';
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-7fc7c2ad.js';
2
+ export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-1e2e9272.js';
3
3
  import './shared.type.mjs';
@@ -4,7 +4,11 @@ import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils, ITinyVm }
4
4
  declare const formProps: {
5
5
  model: ObjectConstructor;
6
6
  rules: ObjectConstructor;
7
- inlineMessage: BooleanConstructor;
7
+ inlineMessage: {
8
+ type: BooleanConstructor;
9
+ default: undefined;
10
+ };
11
+ messageType: StringConstructor;
8
12
  statusIcon: BooleanConstructor;
9
13
  showMessage: {
10
14
  type: BooleanConstructor;
@@ -21,8 +25,8 @@ declare const formProps: {
21
25
  default: boolean;
22
26
  };
23
27
  hideRequiredAsterisk: {
24
- type: (BooleanConstructor | null)[];
25
- default: null;
28
+ type: BooleanConstructor;
29
+ default: undefined;
26
30
  };
27
31
  labelPosition: {
28
32
  type: StringConstructor;
@@ -55,6 +59,7 @@ declare const formProps: {
55
59
  default: string;
56
60
  validator(value: string): boolean;
57
61
  };
62
+ validateIcon: ObjectConstructor;
58
63
  manual: {
59
64
  type: BooleanConstructor;
60
65
  default: boolean;
@@ -97,7 +102,7 @@ declare const formItemProps: {
97
102
  };
98
103
  appendToBody: {
99
104
  type: BooleanConstructor;
100
- default: boolean;
105
+ default: undefined;
101
106
  };
102
107
  error: {
103
108
  type: StringConstructor;
@@ -105,9 +110,10 @@ declare const formItemProps: {
105
110
  };
106
111
  for: StringConstructor;
107
112
  inlineMessage: {
108
- type: (StringConstructor | BooleanConstructor)[];
109
- default: string;
113
+ type: BooleanConstructor;
114
+ default: undefined;
110
115
  };
116
+ messageType: StringConstructor;
111
117
  label: StringConstructor;
112
118
  labelWidth: StringConstructor;
113
119
  manual: BooleanConstructor;
@@ -131,10 +137,7 @@ declare const formItemProps: {
131
137
  validatePosition: StringConstructor;
132
138
  validateStatus: StringConstructor;
133
139
  validateType: StringConstructor;
134
- validateIcon: {
135
- type: ObjectConstructor;
136
- default: null;
137
- };
140
+ validateIcon: ObjectConstructor;
138
141
  ellipsis: {
139
142
  type: BooleanConstructor;
140
143
  default: boolean;
@@ -166,6 +169,9 @@ declare const formItemProps: {
166
169
  declare const watchError: (state: IFormItemRenderlessParams['state']) => (value: string) => void;
167
170
  declare const watchValidateStatus: (state: IFormItemRenderlessParams['state']) => (value: IFormItemValidateStatus) => void;
168
171
  declare const computedGetValidateType: ({ props, state }: Pick<IFormItemRenderlessParams, 'props' | 'state'>) => () => string;
172
+ declare const computedValidateIcon$1: ({ props, state }: Pick<IFormItemRenderlessParams, 'props' | 'state'>) => () => object | null;
173
+ declare const computedIsErrorInline$1: ({ props, state }: Pick<IFormItemRenderlessParams, 'props' | 'state'>) => () => boolean;
174
+ declare const computedIsErrorBlock$1: ({ props, state }: Pick<IFormItemRenderlessParams, 'props' | 'state'>) => () => boolean;
169
175
  declare const computedLabelStyle: ({ props, state }: Pick<IFormItemRenderlessParams, 'props' | 'state'>) => () => IFormItemLabelStyle;
170
176
  declare const computedValueStyle: ({ props, state }: Pick<IFormItemRenderlessParams, 'props' | 'state'>) => () => {
171
177
  width: string;
@@ -255,9 +261,11 @@ interface IFormItemState {
255
261
  labelSuffix: string;
256
262
  labelWidth: string;
257
263
  showMessage: boolean;
258
- inlineMessage: boolean;
259
264
  sizeClass: string | undefined;
260
265
  getValidateType: string;
266
+ validateIcon: object | null;
267
+ isErrorInline: boolean;
268
+ isErrorBlock: boolean;
261
269
  }
262
270
  type IFormItemConstants = typeof $constants;
263
271
  type IFormItemProps = ExtractPropTypes<typeof formItemProps>;
@@ -281,6 +289,9 @@ interface IFormItemApi {
281
289
  computedForm: ReturnType<typeof computedForm>;
282
290
  computedFieldValue: ReturnType<typeof computedFieldValue>;
283
291
  computedGetValidateType: ReturnType<typeof computedGetValidateType>;
292
+ computedValidateIcon: ReturnType<typeof computedValidateIcon$1>;
293
+ computedIsErrorInline: ReturnType<typeof computedIsErrorInline$1>;
294
+ computedIsErrorBlock: ReturnType<typeof computedIsErrorBlock$1>;
284
295
  clearValidate: ReturnType<typeof clearValidate$1>;
285
296
  getRules: ReturnType<typeof getRules>;
286
297
  updateComputedLabelWidth: ReturnType<typeof updateComputedLabelWidth>;
@@ -317,6 +328,9 @@ type IFormItemInstance = ITinyVm<IFormItemConstants> & IFormItemProps & IFormIte
317
328
  declare const watchRules: ({ api, props, state }: Pick<IFormRenderlessParams, 'api' | 'props' | 'state'>) => (newRules?: {}, oldRules?: {}) => void;
318
329
  declare const computedAutoLabelWidth: ({ state }: Pick<IFormRenderlessParams, 'state'>) => () => string;
319
330
  declare const computedHideRequiredAsterisk: ({ props, designConfig }: Pick<IFormRenderlessParams, 'props' | 'designConfig'>) => () => boolean;
331
+ declare const computedValidateIcon: ({ props, designConfig }: Pick<IFormRenderlessParams, 'props' | 'designConfig'>) => () => object | null;
332
+ declare const computedIsErrorInline: ({ props, designConfig }: Pick<IFormRenderlessParams, 'props' | 'designConfig'>) => () => boolean;
333
+ declare const computedIsErrorBlock: ({ props, designConfig }: Pick<IFormRenderlessParams, 'props' | 'designConfig'>) => () => boolean;
320
334
  declare const created: ({ parent, state }: Pick<IFormRenderlessParams, 'parent' | 'state'>) => () => void;
321
335
  declare const resetFields: ({ props, state }: Pick<IFormRenderlessParams, 'props' | 'state'>) => () => void;
322
336
  declare const updateTip: ({ props, state }: Pick<IFormRenderlessParams, 'props' | 'state'>) => () => void;
@@ -343,6 +357,9 @@ interface IFormState {
343
357
  isDisplayOnly: boolean;
344
358
  hasRequired: boolean;
345
359
  hideRequiredAsterisk: boolean;
360
+ validateIcon: object | null;
361
+ isErrorInline: boolean;
362
+ isErrorBlock: boolean;
346
363
  }
347
364
  type IFormProps = ExtractPropTypes<typeof formProps>;
348
365
  type IFormRenderlessParams = ISharedRenderlessFunctionParams<never> & {
@@ -356,6 +373,9 @@ interface IFormApi {
356
373
  updateTip: ReturnType<typeof updateTip>;
357
374
  computedAutoLabelWidth: ReturnType<typeof computedAutoLabelWidth>;
358
375
  computedHideRequiredAsterisk: ReturnType<typeof computedHideRequiredAsterisk>;
376
+ computedValidateIcon: ReturnType<typeof computedValidateIcon>;
377
+ computedIsErrorInline: ReturnType<typeof computedIsErrorInline>;
378
+ computedIsErrorBlock: ReturnType<typeof computedIsErrorBlock>;
359
379
  created: ReturnType<typeof created>;
360
380
  resetFields: ReturnType<typeof resetFields>;
361
381
  clearValidate: ReturnType<typeof clearValidate>;
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-7fc7c2ad.js';
2
+ export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-1e2e9272.js';
3
3
  import './shared.type.mjs';
@@ -79,11 +79,25 @@ declare const imageProps: {
79
79
  *
80
80
  */
81
81
 
82
- declare const computedGetImageStyle: ({ props }: Pick<IImageRenderlessParams, 'props'>) => () => {
83
- 'object-fit': string;
82
+ declare const computedGetImageStyle: ({ props, api }: Pick<IImageRenderlessParams, 'props' | 'api'>) => () => {
83
+ width?: undefined;
84
+ height?: undefined;
85
+ } | {
86
+ width: string;
87
+ height: string;
88
+ } | {
89
+ width: string;
90
+ height?: undefined;
84
91
  } | {
85
- 'object-fit'?: undefined;
92
+ height: string;
93
+ width?: undefined;
94
+ } | {
95
+ 'object-fit': string;
86
96
  };
97
+ declare const computedGetAlignCenter: ({ props, constants }: {
98
+ props: any;
99
+ constants: any;
100
+ }) => () => boolean;
87
101
  declare const computedGetPreview: (props: IImageProps) => () => boolean;
88
102
  declare const loadImage: ({ state, api, attrs, props }: Pick<IImageRenderlessParams, 'api' | 'state' | 'props' | 'attrs'>) => () => void;
89
103
  declare const handleLoad: ({ state, emit }: Pick<IImageRenderlessParams, 'emit' | 'state'>) => (event: Event, img: HTMLImageElement) => void;
@@ -93,7 +107,23 @@ declare const handleError: ({ state, emit }: Pick<IImageRenderlessParams, 'emit'
93
107
  declare const handleLazyLoad: ({ state, api, vm, nextTick }: Pick<IImageRenderlessParams, 'api' | 'state' | 'nextTick' | 'vm'>) => () => void;
94
108
  declare const addLazyLoadListener: ({ props, state, api, vm }: Pick<IImageRenderlessParams, 'api' | 'state' | 'props' | 'vm'>) => () => void;
95
109
  declare const removeLazyLoadListener: (state: IImageState) => () => void;
96
- declare const clickHandler: (state: IImageState) => () => boolean;
110
+ /**
111
+ * simulate object-fit behavior to compatible with IE11 and other browsers which not support object-fit
112
+ */
113
+ declare const getImageStyle: ({ state, vm, constants }: Pick<IImageRenderlessParams, 'state' | 'vm' | 'constants'>) => (fit: any) => {
114
+ width?: undefined;
115
+ height?: undefined;
116
+ } | {
117
+ width: string;
118
+ height: string;
119
+ } | {
120
+ width: string;
121
+ height?: undefined;
122
+ } | {
123
+ height: string;
124
+ width?: undefined;
125
+ };
126
+ declare const clickHandler: (state: IImageState) => () => void;
97
127
  declare const closeViewer: (state: IImageState) => () => boolean;
98
128
  declare const mounted: ({ props, api }: Pick<IImageRenderlessParams, 'props' | 'api'>) => () => void;
99
129
 
@@ -112,6 +142,7 @@ interface IImageState {
112
142
  /** 判定previewSrcList不为空是,返回true。 名字更应该为: hasPreview */
113
143
  getPreview: boolean;
114
144
  getImageStyle: object;
145
+ getAlignCenter: object;
115
146
  _scrollContainer: HTMLElement | null;
116
147
  _lazyLoadHandler: ((...args: any[]) => void) | null;
117
148
  }
@@ -129,6 +160,8 @@ interface IImageApi {
129
160
  computedGetImageStyle: ReturnType<typeof computedGetImageStyle>;
130
161
  addLazyLoadListener: ReturnType<typeof addLazyLoadListener>;
131
162
  deleteHander: ReturnType<typeof deleteHander>;
163
+ computedGetAlignCenter: ReturnType<typeof computedGetAlignCenter>;
164
+ getImageStyle: ReturnType<typeof getImageStyle>;
132
165
  }
133
166
  /** image的混合上下文 */
134
167
  type IImageRenderlessParams = ISharedRenderlessFunctionParams<IImageConstants> & {
@@ -64,10 +64,14 @@ interface INavMenuState {
64
64
  marginLeft: number;
65
65
  isShowMore: ComputedRef<boolean>;
66
66
  popClass: ComputedRef<boolean>;
67
- subMenus: ComputedRef<Array<menuItemType>>;
67
+ subMenus: Array<menuItemType>;
68
68
  menuStyle: ComputedRef<boolean>;
69
69
  popStyle: ComputedRef<boolean>;
70
70
  afterEach: (() => void) | null;
71
+ tooltipVisible: boolean;
72
+ tooltipContent: string | null;
73
+ isSaaSTheme: boolean;
74
+ menuClass: string;
71
75
  }
72
76
  interface INavMenuApi {
73
77
  state: INavMenuState;
@@ -100,6 +104,8 @@ interface INavMenuApi {
100
104
  willHideSubMenu: () => void;
101
105
  hideSubMenu: () => void;
102
106
  showSubMenu: (list: Array<menuItemType>, { more, index }: whitchSubMenuType, event: MouseEvent) => void;
107
+ handleTitleMouseenter: ($event: MouseEvent) => void;
108
+ handleTitleMouseleave: () => void;
103
109
  }
104
110
  interface fieldsType {
105
111
  textField: string;
@@ -158,6 +158,7 @@ type IPopoverRenderlessParams = ISharedRenderlessFunctionParams<never> & {
158
158
  props: IPopoverProps;
159
159
  state: IPopoverState;
160
160
  api: IPopoverApi;
161
+ updatePopper: () => void;
161
162
  };
162
163
 
163
164
  export { IPopoverApi, IPopoverProps, IPopoverRenderlessParams, IPopoverState };
@@ -27,8 +27,8 @@ interface ISharedRenderlessParamUtils<CT = never> {
27
27
  i18n: any;
28
28
  /** 组件内国际化,常用函数 */
29
29
  t: (path: string, options?: any) => string;
30
- /** 模式。
31
- * @mark 取值为:pc mobile mobile-first */
30
+ /** 组件模式。
31
+ * @mark 等同于 vm.$mode, 取值为:pc mobile mobile-first */
32
32
  mode: 'pc' | 'mobile' | 'mobile-first';
33
33
  /** 是否为 mobile */
34
34
  isMobileMode: boolean;
@@ -49,7 +49,7 @@ interface ISharedRenderlessParamUtils<CT = never> {
49
49
  /** 第一次mount加载后的所有refs,不会更新! ⭐要避免使用 */
50
50
  refs: Record<string, any>;
51
51
  /** 组件初化时的页面路由,不会更新!
52
- * @mark ⭐要避免使用 */
52
+ * @mark ⭐要避免使用, 请使用vm.$refs */
53
53
  route: any;
54
54
  /** 当前的router实例。 从app的根上读取 */
55
55
  router: any;
@@ -70,7 +70,7 @@ interface ISharedRenderlessParamUtils<CT = never> {
70
70
  /** 向实例的subTree 遍历。
71
71
  * 1、handler 是函数: handler入参{level,vm,el,options,isLevel1}. 给每个子节点遍历调用函数。
72
72
  * 2、handler 是非函数: 直接通过 instance.subTree 来生成一个同等树状的vm数据。
73
- * @mark ⭐全局有4个组件使用到 handler是函数 的用法 ,用于遍历子节点,将符合条件的信息收集到一个数组中。
73
+ * @mark ⭐全局有4个组件使用到`handler是函数`的用法 ,用于遍历子节点,将符合条件的信息收集到一个数组中。
74
74
  */
75
75
  childrenHandler: (handler?: (node: {
76
76
  level: number;
@@ -98,7 +98,7 @@ interface ISharedRenderlessParamUtils<CT = never> {
98
98
  defineParentInstanceProperties: (props: PropertyDescriptorMap & ThisType<any>) => void;
99
99
  /** 返回 context.emit */
100
100
  emit: (event: any, ...args: any[]) => void;
101
- /** Tiny 适配器中,自行封装的一个 EventBus模型。每次调用返回一个新的模型对象。
101
+ /** Tiny 适配器中,自行封装的一个 EventBus模型的工厂函数。⭐每次调用才返回一个新的模型对象。
102
102
  * @mark vm中,会给instance添加一个$emitter=emitter() ,就是该函数返回的模型。 vm中的$on, $off,$once 都是该模型的方法。
103
103
  * @mark ⭐所以不要直接使用该函数。
104
104
  */
@@ -1,6 +1,6 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
2
  import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.mjs';
3
- import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-4dfd7aba.js';
3
+ import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-b934f279.js';
4
4
 
5
5
  declare const UploadDraggerProps: {
6
6
  disabled: BooleanConstructor;
@@ -335,6 +335,10 @@ declare const fileUploadProps: {
335
335
  type: BooleanConstructor;
336
336
  default: boolean;
337
337
  };
338
+ pasteUpload: {
339
+ type: BooleanConstructor;
340
+ default: boolean;
341
+ };
338
342
  tiny_mode: StringConstructor;
339
343
  tiny_mode_root: BooleanConstructor;
340
344
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -553,6 +557,7 @@ declare const uploadProps: {
553
557
  };
554
558
  autoUpload: BooleanConstructor;
555
559
  beforeUpload: FunctionConstructor;
560
+ pasteUpload: BooleanConstructor;
556
561
  data: ObjectConstructor;
557
562
  disabled: BooleanConstructor;
558
563
  drag: BooleanConstructor;
@@ -640,12 +645,13 @@ declare const uploadProps: {
640
645
 
641
646
  declare const isImage: (str: string) => boolean;
642
647
  declare const handleChange: (api: IUploadRenderlessParams['api']) => (event: Event) => void;
648
+ declare const handlePaste: ({ api, props }: Pick<IUploadRenderlessParams, 'api' | 'props'>) => (event: ClipboardEvent) => void;
643
649
  declare const getFormData: ({ constants, state, props }: Pick<IUploadRenderlessParams, 'constants' | 'state' | 'props'>) => ({ formData, file, type }: {
644
650
  formData: IUploadFormData;
645
651
  file: IFileUploadFile;
646
652
  type: string;
647
653
  }) => void;
648
- declare const uploadFiles: ({ state, constants, Modal, props, t }: Pick<IUploadRenderlessParams, 'state' | 'constants' | 'props' | 't'> & IFileUploadModalVm) => (files: FileList) => void;
654
+ declare const uploadFiles: ({ state, constants, Modal, props, t }: Pick<IUploadRenderlessParams, 'state' | 'constants' | 'props' | 't'> & IFileUploadModalVm) => (files: FileList | IFileUploadFile[]) => void;
649
655
  declare const upload: ({ api, props, refs }: Pick<IUploadRenderlessParams, 'api' | 'props' | 'refs'>) => (rawFile: File) => void;
650
656
  declare const abort: ({ state, props, constants }: Pick<IUploadRenderlessParams, 'state' | 'props' | 'constants'>) => (file: IFileUploadFile) => void;
651
657
  declare const post: ({ api, constants, props, state, service }: Pick<IUploadRenderlessParams, 'api' | 'constants' | 'props' | 'state' | 'service'>) => (rawFile: IFileUploadFile) => void;
@@ -681,6 +687,7 @@ interface IUploadApi {
681
687
  handleClick: ReturnType<typeof handleClick>;
682
688
  onBeforeDestroy: ReturnType<typeof onBeforeDestroy>;
683
689
  handleUpdate: ReturnType<typeof handleUpdate>;
690
+ handlePaste: ReturnType<typeof handlePaste>;
684
691
  uploadFiles: ReturnType<typeof uploadFiles>;
685
692
  post: ReturnType<typeof post>;
686
693
  handleChange: ReturnType<typeof handleChange>;
@@ -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-4dfd7aba.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-b934f279.js';
3
3
  import './shared.type.mjs';
@@ -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-4dfd7aba.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-b934f279.js';
3
3
  import './shared.type.mjs';
package/upload/index.js CHANGED
@@ -8,6 +8,28 @@ const handleChange = (api) => (event) => {
8
8
  }
9
9
  api.uploadFiles(files);
10
10
  };
11
+ const handlePaste = ({ api, props }) => (event) => {
12
+ var _a;
13
+ event.preventDefault();
14
+ if (!props.pasteUpload) {
15
+ return;
16
+ }
17
+ const items = (_a = event.clipboardData) == null ? void 0 : _a.items;
18
+ if (!items) {
19
+ return;
20
+ }
21
+ const files = [];
22
+ for (let i = 0; i < items.length; i++) {
23
+ const file = items[i].getAsFile();
24
+ if (file) {
25
+ files.push(file);
26
+ }
27
+ }
28
+ if (!files.length) {
29
+ return;
30
+ }
31
+ api.uploadFiles(files);
32
+ };
11
33
  const getFormData = ({ constants, state, props }) => ({ formData, file, type }) => {
12
34
  const uploaderInner = state.uploader.$refs[constants.FILE_UPLOAD_INNER_TEMPLATE];
13
35
  if (uploaderInner.edm.upload) {
@@ -342,6 +364,7 @@ export {
342
364
  handleChange,
343
365
  handleClick,
344
366
  handleKeydown,
367
+ handlePaste,
345
368
  handleUpdate,
346
369
  isImage,
347
370
  mounted,
package/upload/vue.js CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  isImage,
5
5
  handleChange,
6
6
  uploadFiles,
7
+ handlePaste,
7
8
  upload,
8
9
  abort,
9
10
  post,
@@ -17,6 +18,7 @@ const api = [
17
18
  "state",
18
19
  "isImage",
19
20
  "handleChange",
21
+ "handlePaste",
20
22
  "uploadFiles",
21
23
  "upload",
22
24
  "abort",
@@ -60,6 +62,7 @@ const renderless = (props, { computed, inject, reactive, onMounted, onBeforeUnmo
60
62
  uploadFiles: uploadFiles({ constants, Modal, props, state, t }),
61
63
  post: post({ api: api2, constants, props, state, service }),
62
64
  handleChange: handleChange(api2),
65
+ handlePaste: handlePaste({ api: api2, props }),
63
66
  handleKeydown: handleKeydown(api2),
64
67
  upload: upload({ api: api2, props, refs }),
65
68
  mounted: mounted({ state, props, api: api2 })
package/user/index.js CHANGED
@@ -428,8 +428,9 @@ const initUser = ({ api, props, state }) => (value) => {
428
428
  api.userChange(value);
429
429
  });
430
430
  };
431
- const handleBlur = ({ constants, dispatch, state }) => () => {
431
+ const handleBlur = ({ constants, dispatch, state, emit }) => (e) => {
432
432
  dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.FormBlur, state.user);
433
+ emit("blur", e);
433
434
  };
434
435
  const initService = ({ props, service }) => {
435
436
  const noopFnCreator = (propName) => () => {
package/user/vue.js CHANGED
@@ -50,7 +50,7 @@ const renderless = (props, { reactive, watch, computed, provide }, { emit, nextT
50
50
  updateCache: updateCache({ props, state }),
51
51
  autoSelect: autoSelect({ props, state, nextTick }),
52
52
  updateOptions: updateOptions({ props, state, nextTick }),
53
- handleBlur: handleBlur({ constants, dispatch, state }),
53
+ handleBlur: handleBlur({ constants, dispatch, state, emit }),
54
54
  filter: filter({ props, state }),
55
55
  suggestUser: suggestUser(api2),
56
56
  cacheUser: cacheUser({ api: api2, props, service: $service, state }),