@opentiny/vue-renderless 3.28.2 → 3.30.0

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 (64) hide show
  1. package/alert/vue.js +4 -1
  2. package/anchor/index.js +11 -1
  3. package/anchor/vue.js +2 -2
  4. package/base-select/index.js +6 -3
  5. package/base-select/vue.js +1 -1
  6. package/calendar-view/index.js +44 -2
  7. package/calendar-view/vue.js +6 -0
  8. package/date-range/index.js +1 -1
  9. package/dialog-box/vue.js +4 -1
  10. package/dialog-select/index.js +1 -1
  11. package/drawer/index.js +13 -1
  12. package/drawer/vue.js +13 -3
  13. package/fluent-editor/index.js +142 -10
  14. package/fluent-editor/vue.js +30 -8
  15. package/form-item/index.js +1 -1
  16. package/form-item/vue.js +11 -1
  17. package/grid-select/index.js +3 -3
  18. package/guide/index.js +17 -11
  19. package/guide/vue.js +2 -1
  20. package/input/vue.js +3 -2
  21. package/modal/index.js +11 -11
  22. package/modal/vue.js +3 -0
  23. package/notify/vue.js +4 -1
  24. package/package.json +3 -3
  25. package/picker/vue.js +3 -2
  26. package/qr-code/vue.js +3 -1
  27. package/rate/index.js +5 -4
  28. package/rate/vue.js +1 -1
  29. package/rich-text/index.js +91 -2
  30. package/rich-text/vue.js +11 -2
  31. package/search/vue.js +6 -1
  32. package/select/index.js +11 -3
  33. package/select/vue.js +5 -4
  34. package/statistic/index.js +48 -1
  35. package/statistic/vue.js +31 -11
  36. package/tabs-mf/index.js +10 -2
  37. package/tag-group/index.js +3 -0
  38. package/tag-input/index.js +91 -0
  39. package/tag-input/vue.js +72 -0
  40. package/time/index.js +22 -0
  41. package/time/vue.js +14 -2
  42. package/time-spinner/index.js +2 -2
  43. package/tree-select/index.js +49 -14
  44. package/types/action-menu.type.d.ts +4 -0
  45. package/types/alert.type.d.ts +2 -0
  46. package/types/anchor.type.d.ts +1 -1
  47. package/types/button-group.type.d.ts +5 -0
  48. package/types/date-picker.type.d.ts +1 -1
  49. package/types/dialog-box.type.d.ts +2 -0
  50. package/types/drawer.type.d.ts +7 -1
  51. package/types/{dropdown-item.type-b3ced3ce.d.ts → dropdown-item.type-f83b014f.d.ts} +1 -1
  52. package/types/dropdown-item.type.d.ts +1 -1
  53. package/types/dropdown-menu.type.d.ts +1 -1
  54. package/types/form-item.type.d.ts +1 -1
  55. package/types/{form.type-a54e1c06.d.ts → form.type-e0db2f7c.d.ts} +9 -0
  56. package/types/form.type.d.ts +1 -1
  57. package/types/modal.type.d.ts +2 -0
  58. package/types/popeditor.type.d.ts +2 -2
  59. package/types/rate.type.d.ts +5 -2
  60. package/types/search.type.d.ts +1 -0
  61. package/types/statistic.type.d.ts +17 -1
  62. package/types/tag-input.type.d.ts +113 -0
  63. package/types/tree-menu.type.d.ts +1 -1
  64. package/user/index.js +5 -5
@@ -27,6 +27,18 @@ declare const statisticProps: {
27
27
  type: StringConstructor;
28
28
  default: string;
29
29
  };
30
+ duration: {
31
+ type: NumberConstructor;
32
+ default: number;
33
+ };
34
+ startValue: {
35
+ type: NumberConstructor;
36
+ default: number;
37
+ };
38
+ useAnimation: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
30
42
  tiny_mode: StringConstructor;
31
43
  tiny_mode_root: BooleanConstructor;
32
44
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -39,10 +51,14 @@ declare const statisticProps: {
39
51
  type IStatisticProps = ExtractPropTypes<typeof statisticProps>;
40
52
  type IStatisticConstants = typeof $constants;
41
53
  interface IStatisticState {
42
- getIntegerAndDecimal: number | string;
54
+ value: string | number;
55
+ animatingValue: number | string;
56
+ IStatisticState: number | string;
43
57
  }
44
58
  interface IStatisticApi {
59
+ state: IStatisticState;
45
60
  getIntegerAndDecimal: (value: string | number) => string | undefined;
61
+ animateValue: () => void;
46
62
  }
47
63
  type IStatisticPcRenderlessParams = ISharedRenderlessFunctionParams<never> & {
48
64
  state: IStatisticState;
@@ -0,0 +1,113 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ import { ISharedRenderlessFunctionParams } from './shared.type.js';
3
+
4
+ declare const tagInputProps: {
5
+ modelValue: {
6
+ type: ArrayConstructor;
7
+ default: () => never[];
8
+ };
9
+ size: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ validator: (value: string) => boolean;
13
+ };
14
+ tagType: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ validator: (value: string) => boolean;
18
+ };
19
+ tagEffect: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ validator: (value: string) => boolean;
23
+ };
24
+ clearable: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ disabled: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
32
+ placeholder: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ max: {
37
+ type: NumberConstructor;
38
+ default: number;
39
+ };
40
+ readonly: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ separator: {
45
+ type: StringConstructor;
46
+ default: undefined;
47
+ };
48
+ minCollapsedNum: {
49
+ type: NumberConstructor;
50
+ default: number;
51
+ };
52
+ draggable: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ tiny_mode: StringConstructor;
57
+ tiny_mode_root: BooleanConstructor;
58
+ tiny_template: (FunctionConstructor | ObjectConstructor)[];
59
+ tiny_renderless: FunctionConstructor;
60
+ tiny_theme: StringConstructor;
61
+ tiny_mcp_config: ObjectConstructor;
62
+ tiny_chart_theme: ObjectConstructor;
63
+ };
64
+
65
+ declare const addTag: ({ emit, props, state }: Pick<ITagInputRenderlessParams, 'emit' | 'props' | 'state'>) => () => void;
66
+ declare const removeTag: ({ emit, props, state }: Pick<ITagInputRenderlessParams, 'emit' | 'props' | 'state'>) => (index: number) => void;
67
+ declare const handleBackspace: ({ emit, props, state }: Pick<ITagInputRenderlessParams, 'emit' | 'props' | 'state'>) => () => void;
68
+ declare const handleClear: ({ emit, props, state }: Pick<ITagInputRenderlessParams, 'emit' | 'props' | 'state'>) => () => void;
69
+ declare const handleMouseOver: ({ state }: Pick<ITagInputRenderlessParams, 'state'>) => (event: MouseEvent) => void;
70
+ declare const handleMouseLeave: ({ state }: Pick<ITagInputRenderlessParams, 'state'>) => () => void;
71
+ declare const handleInputFocus: ({ state }: Pick<ITagInputRenderlessParams, 'state'>) => () => void;
72
+ declare const handleInputBlur: ({ state }: Pick<ITagInputRenderlessParams, 'state'>) => () => void;
73
+ declare const handleDragStart: ({ state }: Pick<ITagInputRenderlessParams, 'state'>) => (index: number, event: DragEvent) => void;
74
+ declare const handleDragOver: () => (index: number, event: DragEvent) => void;
75
+ declare const handleDragEnter: ({ state, emit }: Pick<ITagInputRenderlessParams, 'state' | 'emit'>) => (index: number, event: DragEvent) => void;
76
+ declare const handleDrop: ({ emit, props, state }: Pick<ITagInputRenderlessParams, 'emit' | 'props' | 'state'>) => (index: number, event: DragEvent) => void;
77
+
78
+ interface ITagInputState {
79
+ currentValue: string;
80
+ tagList: string[];
81
+ disabled: boolean;
82
+ closeable: boolean;
83
+ showClearIcon: boolean;
84
+ showTagList: string[];
85
+ collapsedTagList: string[];
86
+ isHovering: boolean;
87
+ isFocused: boolean;
88
+ draggingIndex: null | number;
89
+ dragTargetIndex: null | number;
90
+ }
91
+ interface ITagInputApi {
92
+ state: ITagInputState;
93
+ addTag: ReturnType<typeof addTag>;
94
+ removeTag: ReturnType<typeof removeTag>;
95
+ handleBackspace: ReturnType<typeof handleBackspace>;
96
+ handleClear: ReturnType<typeof handleClear>;
97
+ handleMouseLeave: ReturnType<typeof handleMouseLeave>;
98
+ handleMouseOver: ReturnType<typeof handleMouseOver>;
99
+ handleInputBlur: ReturnType<typeof handleInputBlur>;
100
+ handleInputFocus: ReturnType<typeof handleInputFocus>;
101
+ handleDragStart: ReturnType<typeof handleDragStart>;
102
+ handleDragOver: ReturnType<typeof handleDragOver>;
103
+ handleDragEnter: ReturnType<typeof handleDragEnter>;
104
+ handleDrop: ReturnType<typeof handleDrop>;
105
+ }
106
+ type ITagInputProps = ExtractPropTypes<typeof tagInputProps>;
107
+ type ITagInputRenderlessParams = ISharedRenderlessFunctionParams<never> & {
108
+ state: ITagInputState;
109
+ props: ITagInputProps;
110
+ api: ITagInputApi;
111
+ };
112
+
113
+ export { ITagInputApi, ITagInputProps, ITagInputRenderlessParams, ITagInputState };
@@ -30,7 +30,7 @@ declare const treeMenuProps: {
30
30
  underlay: {
31
31
  type: ObjectConstructor;
32
32
  };
33
- }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
33
+ }, () => _opentiny_vue_common.VNode<vue.RendererNode, vue.RendererElement, {
34
34
  [key: string]: any;
35
35
  }>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{
36
36
  shape: {
package/user/index.js CHANGED
@@ -286,7 +286,7 @@ const userChange = ({ api, emit, props, state, dispatch, constants }) => (value,
286
286
  const syncCacheIds = ({ props, state }) => (ids, queryIds, cacheData) => {
287
287
  const { cacheFields, cacheKey } = props;
288
288
  const { valueField } = state;
289
- const cacheUsers = toJson(window.localStorage.getItem(cacheKey)) || {};
289
+ const cacheUsers = toJson(window.sessionStorage.getItem(cacheKey)) || {};
290
290
  const caseCacheUsers = getLowerCaseObj(cacheUsers);
291
291
  ids.forEach((id) => {
292
292
  const caseId = toLowerCase(id);
@@ -294,7 +294,7 @@ const syncCacheIds = ({ props, state }) => (ids, queryIds, cacheData) => {
294
294
  if (cacheUser2) {
295
295
  const textField = state.textField === "userCN" || state.textField === "userId" || state.textField === "dept" ? "" : state.textField;
296
296
  if (textField !== "" && !cacheUser2.a) {
297
- window.localStorage.removeItem(cacheKey);
297
+ window.sessionStorage.removeItem(cacheKey);
298
298
  queryIds.push(id);
299
299
  }
300
300
  const user = {
@@ -344,7 +344,7 @@ const getUsers = ({ api, props, state, emit }) => (value) => {
344
344
  });
345
345
  };
346
346
  const updateCache = ({ props, state }) => () => {
347
- const users = toJson(window.localStorage.getItem(props.cacheKey)) || {};
347
+ const users = toJson(window.sessionStorage.getItem(props.cacheKey)) || {};
348
348
  const currDate = toDateStr(/* @__PURE__ */ new Date(), "yyyyMMdd");
349
349
  if (currDate !== users.t) {
350
350
  users.t = currDate;
@@ -362,12 +362,12 @@ const updateCache = ({ props, state }) => () => {
362
362
  state.cache = users;
363
363
  };
364
364
  const saveCache = ({ props }) => (cache) => {
365
- window.localStorage.setItem(props.cacheKey, toJsonStr(cache));
365
+ window.sessionStorage.setItem(props.cacheKey, toJsonStr(cache));
366
366
  };
367
367
  const cacheUser = ({ api, props, service, state }) => (users) => {
368
368
  const { cacheKey } = props;
369
369
  const { valueField } = state;
370
- const cacheUser2 = toJson(window.localStorage.getItem(cacheKey)) || {};
370
+ const cacheUser2 = toJson(window.sessionStorage.getItem(cacheKey)) || {};
371
371
  const cacheFields = service.userCache;
372
372
  let user;
373
373
  for (let i = 0; i < users.length; i++) {