@qynpm/ui 1.0.22 → 1.0.24

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 (137) hide show
  1. package/README.md +230 -54
  2. package/dist/index.cjs +16 -5
  3. package/dist/index.mjs +53 -34
  4. package/dist/qy-action-bar/index.cjs +1 -1
  5. package/dist/qy-action-bar/index.mjs +1 -1
  6. package/dist/qy-autocomplete/index.cjs +1 -1
  7. package/dist/qy-autocomplete/index.mjs +4 -2
  8. package/dist/qy-button/index.cjs +1 -1
  9. package/dist/qy-button/index.mjs +1 -1
  10. package/dist/qy-checkbox/index.cjs +1 -1
  11. package/dist/qy-checkbox/index.mjs +5 -2
  12. package/dist/qy-checkbox-group/index.cjs +1 -0
  13. package/dist/qy-checkbox-group/index.mjs +7 -0
  14. package/dist/qy-date-picker/index.cjs +1 -1
  15. package/dist/qy-date-picker/index.mjs +5 -2
  16. package/dist/qy-dialog/index.cjs +1 -1
  17. package/dist/qy-dialog/index.mjs +2 -2
  18. package/dist/qy-dropdown/index.cjs +1 -1
  19. package/dist/qy-dropdown/index.mjs +1 -1
  20. package/dist/qy-file-picker/index.cjs +1 -0
  21. package/dist/qy-file-picker/index.mjs +7 -0
  22. package/dist/qy-form-section/index.cjs +1 -1
  23. package/dist/qy-form-section/index.mjs +1 -1
  24. package/dist/qy-image/index.cjs +1 -1
  25. package/dist/qy-image/index.mjs +4 -2
  26. package/dist/qy-image-preview/index.cjs +1 -1
  27. package/dist/qy-image-preview/index.mjs +6 -3
  28. package/dist/qy-image-upload/index.cjs +1 -1
  29. package/dist/qy-image-upload/index.mjs +1 -1
  30. package/dist/qy-input/index.cjs +2 -2
  31. package/dist/qy-input/index.mjs +6 -3
  32. package/dist/qy-input-number/index.cjs +1 -1
  33. package/dist/qy-input-number/index.mjs +5 -2
  34. package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
  35. package/dist/qy-legacy-selection-dialog/index.mjs +2 -2
  36. package/dist/qy-menu-actions/index.cjs +1 -1
  37. package/dist/qy-menu-actions/index.mjs +1 -1
  38. package/dist/qy-money-input/index.cjs +1 -1
  39. package/dist/qy-money-input/index.mjs +2 -2
  40. package/dist/qy-popover/index.cjs +2 -0
  41. package/dist/qy-popover/index.mjs +8 -0
  42. package/dist/qy-radio/index.cjs +1 -0
  43. package/dist/qy-radio/index.mjs +7 -0
  44. package/dist/qy-radio-group/index.cjs +1 -1
  45. package/dist/qy-radio-group/index.mjs +5 -2
  46. package/dist/qy-record-quote-search/index.cjs +1 -1
  47. package/dist/qy-record-quote-search/index.mjs +1 -1
  48. package/dist/qy-remark-image/index.cjs +1 -1
  49. package/dist/qy-remark-image/index.mjs +2 -2
  50. package/dist/qy-remote-select/index.cjs +1 -1
  51. package/dist/qy-remote-select/index.mjs +1 -1
  52. package/dist/qy-search-input/index.cjs +1 -1
  53. package/dist/qy-search-input/index.mjs +2 -2
  54. package/dist/qy-select/index.cjs +1 -1
  55. package/dist/qy-select/index.mjs +5 -2
  56. package/dist/qy-selection-dialog/index.cjs +1 -1
  57. package/dist/qy-selection-dialog/index.mjs +1 -1
  58. package/dist/qy-switch/index.cjs +1 -0
  59. package/dist/qy-switch/index.mjs +7 -0
  60. package/dist/qy-table-column-settings/index.cjs +1 -1
  61. package/dist/qy-table-column-settings/index.mjs +1 -1
  62. package/dist/qy-tag/index.cjs +1 -0
  63. package/dist/qy-tag/index.mjs +7 -0
  64. package/dist/qy-tooltip/index.cjs +2 -0
  65. package/dist/qy-tooltip/index.mjs +8 -0
  66. package/dist/qy-tree-select/index.cjs +1 -1
  67. package/dist/qy-tree-select/index.mjs +4 -2
  68. package/dist/qy-upload/index.cjs +1 -1
  69. package/dist/qy-upload/index.mjs +1 -1
  70. package/dist/shared/index-8u4DJZwd.mjs +90 -0
  71. package/dist/shared/index-9WJeVamR.cjs +1 -0
  72. package/dist/shared/index-BDFscU3G.mjs +72 -0
  73. package/dist/shared/index-BYme5QGm.cjs +1 -0
  74. package/dist/shared/index-B_mI-37S.cjs +1 -0
  75. package/dist/shared/index-BrV6CR4H.mjs +54 -0
  76. package/dist/shared/index-C8CA7nkO.cjs +1 -0
  77. package/dist/shared/index-CTtAQ1LD.cjs +1 -0
  78. package/dist/shared/index-CczrP1H7.mjs +149 -0
  79. package/dist/shared/index-ClmefDi6.cjs +1 -0
  80. package/dist/shared/{index-DaqN69ii.mjs → index-DJnmpqCc.mjs} +63 -63
  81. package/dist/shared/index-DMGXEAyl.mjs +119 -0
  82. package/dist/shared/index-DYohs_aV.mjs +225 -0
  83. package/dist/shared/index-DixSXWJj.mjs +68 -0
  84. package/dist/shared/index-M4vEHYZ_.cjs +1 -0
  85. package/dist/shared/index-aiJ7R6G-.cjs +1 -0
  86. package/dist/shared/index-c7lnX4vT.mjs +3356 -0
  87. package/dist/shared/index-dEWJKTS-.cjs +1 -0
  88. package/dist/shared/index-fBuu4V3A.mjs +129 -0
  89. package/dist/shared/index-wIXCDvwC.cjs +1 -0
  90. package/dist/shared/index.vue_vue_type_script_setup_true_lang-5gku7Zwv.cjs +1 -0
  91. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BF82tses.cjs +1 -0
  92. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BNjoxcAR.mjs +61 -0
  93. package/dist/shared/index.vue_vue_type_script_setup_true_lang-C-Pf9TJ0.mjs +152 -0
  94. package/dist/shared/index.vue_vue_type_script_setup_true_lang-CKp87br2.cjs +1 -0
  95. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DWS8bsiP.cjs +1 -0
  96. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DmmW8UUK.mjs +106 -0
  97. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DoL8xnpo.mjs +48 -0
  98. package/dist/shared/index.vue_vue_type_script_setup_true_lang-EiHoQBXt.mjs +94 -0
  99. package/dist/shared/index.vue_vue_type_script_setup_true_lang-tyM4_aoa.cjs +1 -0
  100. package/dist/shared/index.vue_vue_type_style_index_0_lang-1cTut9Ql.cjs +1 -0
  101. package/dist/shared/index.vue_vue_type_style_index_0_lang-BZQLyvw8.cjs +1 -0
  102. package/dist/shared/index.vue_vue_type_style_index_0_lang-BtbAft4t.cjs +1 -0
  103. package/dist/shared/index.vue_vue_type_style_index_0_lang-CJhIFeBC.mjs +166 -0
  104. package/dist/shared/index.vue_vue_type_style_index_0_lang-DSur831A.mjs +68 -0
  105. package/dist/shared/index.vue_vue_type_style_index_0_lang-DVqGYfD9.mjs +132 -0
  106. package/dist/shared/index.vue_vue_type_style_index_0_lang-Dm1r1WBK.cjs +1 -0
  107. package/dist/shared/index.vue_vue_type_style_index_0_lang-Q2gFF0PP.cjs +1 -0
  108. package/dist/shared/index.vue_vue_type_style_index_0_lang-aqtfjdVm.mjs +140 -0
  109. package/dist/shared/index.vue_vue_type_style_index_0_lang-ztD-It-2.mjs +121 -0
  110. package/dist/shared/utils-D2KAQCCB.cjs +1 -0
  111. package/dist/shared/utils-DUntDntI.mjs +112 -0
  112. package/index.d.ts +155 -17
  113. package/package.json +260 -218
  114. package/qy-checkbox/index.d.ts +42 -2
  115. package/qy-checkbox-group/index.d.ts +48 -0
  116. package/qy-date-picker/index.d.ts +140 -5
  117. package/qy-file-picker/index.d.ts +49 -0
  118. package/qy-input/index.d.ts +50 -5
  119. package/qy-input-number/index.d.ts +45 -5
  120. package/qy-popover/index.d.ts +63 -0
  121. package/qy-radio/index.d.ts +44 -0
  122. package/qy-radio-group/index.d.ts +60 -12
  123. package/qy-select/index.d.ts +67 -5
  124. package/qy-switch/index.d.ts +46 -0
  125. package/qy-tag/index.d.ts +44 -0
  126. package/qy-tooltip/index.d.ts +54 -0
  127. package/dist/shared/index-BMqHC4GE.mjs +0 -4239
  128. package/dist/shared/index-BZ2L7Rch.cjs +0 -1
  129. package/dist/shared/index-BnMUdIAd.cjs +0 -1
  130. package/dist/shared/index-Cuw6WFH3.cjs +0 -1
  131. package/dist/shared/index-D8iNLsjJ.mjs +0 -153
  132. package/dist/shared/index.vue_vue_type_style_index_0_lang-B_A4Nq6v.cjs +0 -1
  133. package/dist/shared/index.vue_vue_type_style_index_0_lang-DKFiK2fQ.mjs +0 -152
  134. /package/dist/shared/{index-CagHZ25z.mjs → index-BYLXkIxS.mjs} +0 -0
  135. /package/dist/shared/{index-CRZsiNVW.cjs → index-C1p86ezL.cjs} +0 -0
  136. /package/dist/shared/{index-BO5aWk3f.cjs → index-ClUqUsAv.cjs} +0 -0
  137. /package/dist/shared/{index-CSxCewXP.mjs → index-Cy_Glkc-.mjs} +0 -0
@@ -0,0 +1,112 @@
1
+ import { h as d, createApp as m } from "vue";
2
+ import { ElImageViewer as f } from "element-plus";
3
+ const h = {
4
+ w: 200,
5
+ h: 200,
6
+ q: 50
7
+ };
8
+ function l(t) {
9
+ const r = String(t || "").trim();
10
+ return r ? r.includes("ys.diansan.com") ? r.replace(/^http:\/\//, "https://").replace("ys.diansan.com", "admin.qiyinbz.com") : r : "";
11
+ }
12
+ function w(t, r = !0) {
13
+ const n = String(t || "").trim();
14
+ if (!n) return "";
15
+ const e = l(n);
16
+ if (!r) return e;
17
+ const o = u(r);
18
+ return n.includes("ys.diansan.com") ? `${e}?small=true&style=image/resize,h_${o.h},w_${o.w}` : `${e}?w=${o.w}`;
19
+ }
20
+ async function S(t, r = {}) {
21
+ const n = l(t);
22
+ if (!n) throw new Error("图片地址不能为空");
23
+ const e = r.compressor ?? !0;
24
+ if (!e)
25
+ return {
26
+ src: n,
27
+ source: "original"
28
+ };
29
+ const o = w(t, e), i = r.loadBlob ?? g, a = r.compressBlob ?? b;
30
+ try {
31
+ return await i(o), {
32
+ src: o,
33
+ source: "thumbnail"
34
+ };
35
+ } catch {
36
+ const c = await i(n);
37
+ return {
38
+ src: await a(c, u(e)),
39
+ source: "fallback"
40
+ };
41
+ }
42
+ }
43
+ function _(t = {}) {
44
+ if (typeof document > "u") return { close() {
45
+ } };
46
+ const r = y(t.urlList, t.url);
47
+ if (!r.length) return { close() {
48
+ } };
49
+ const n = globalThis.__QY_IMAGE_PREVIEW_CREATE_APP__ ?? m, e = document.createElement("div"), o = document.body.style.overflow;
50
+ let i = !1, a;
51
+ const c = () => {
52
+ var s;
53
+ i || (i = !0, document.body.style.overflow = o, (s = a == null ? void 0 : a.unmount) == null || s.call(a), e.parentNode && e.parentNode.removeChild(e));
54
+ };
55
+ return document.body.appendChild(e), document.body.style.overflow = "hidden", a = n({
56
+ setup() {
57
+ return () => d(f, {
58
+ urlList: r,
59
+ initialIndex: t.initialIndex ?? 0,
60
+ hideOnClickModal: t.hideOnClickModal ?? !0,
61
+ teleport: "body",
62
+ onClose: c
63
+ });
64
+ }
65
+ }), a.mount(e), { close: c };
66
+ }
67
+ function u(t) {
68
+ return {
69
+ ...h,
70
+ ...typeof t == "object" ? t : {}
71
+ };
72
+ }
73
+ function y(t, r) {
74
+ return (Array.isArray(t) ? t : [r]).map((e) => l(e)).filter(Boolean);
75
+ }
76
+ async function g(t) {
77
+ const r = await fetch(t, { redirect: "follow" });
78
+ if (!r.ok) throw new Error(t);
79
+ return r.blob();
80
+ }
81
+ async function b(t, r) {
82
+ if (typeof document > "u" || typeof Image > "u")
83
+ return v(t);
84
+ const n = URL.createObjectURL(t);
85
+ try {
86
+ const e = await p(n), o = document.createElement("canvas"), i = I(e, r);
87
+ return o.width = Math.max(1, Math.round(e.naturalWidth * i)), o.height = Math.max(1, Math.round(e.naturalHeight * i)), o.getContext("2d").drawImage(e, 0, 0, o.width, o.height), o.toDataURL(t.type || "image/jpeg", r.q / 100);
88
+ } finally {
89
+ URL.revokeObjectURL(n);
90
+ }
91
+ }
92
+ function p(t) {
93
+ return new Promise((r, n) => {
94
+ const e = new Image();
95
+ e.onload = () => r(e), e.onerror = n, e.src = t;
96
+ });
97
+ }
98
+ function I(t, r) {
99
+ const n = r.w ? r.w / t.naturalWidth : 1, e = r.h ? r.h / t.naturalHeight : 1;
100
+ return Math.min(1, n, e);
101
+ }
102
+ function v(t) {
103
+ return new Promise((r, n) => {
104
+ const e = new FileReader();
105
+ e.onloadend = () => r(e.result), e.onerror = n, e.readAsDataURL(t);
106
+ });
107
+ }
108
+ export {
109
+ l as n,
110
+ _ as o,
111
+ S as r
112
+ };
package/index.d.ts CHANGED
@@ -1,4 +1,128 @@
1
- import type { App, Plugin } from 'vue'
1
+ import type { App, Plugin } from 'vue'
2
+ import type QyFilePickerComponent from './qy-file-picker'
3
+ import type QyCheckboxComponent from './qy-checkbox'
4
+ import type QyCheckboxGroupComponent from './qy-checkbox-group'
5
+ import type QyRadioComponent from './qy-radio'
6
+ import type QyRadioGroupComponent from './qy-radio-group'
7
+ import type QySelectComponent from './qy-select'
8
+ import type QySwitchComponent from './qy-switch'
9
+ import type QyTagComponent from './qy-tag'
10
+ import type QyTooltipComponent from './qy-tooltip'
11
+ import type QyPopoverComponent from './qy-popover'
12
+ import type QyInputComponent from './qy-input'
13
+ import type QyDatePickerComponent from './qy-date-picker'
14
+
15
+ export type {
16
+ QyInputNumberClearValue,
17
+ QyInputNumberControlsPosition,
18
+ QyInputNumberEmits,
19
+ QyInputNumberExposed,
20
+ QyInputNumberProps,
21
+ QyInputNumberSize,
22
+ QyInputNumberValue
23
+ } from './qy-input-number'
24
+
25
+ export type {
26
+ QyInputEmits,
27
+ QyInputExposed,
28
+ QyInputModelValue,
29
+ QyInputProps,
30
+ QyInputSize,
31
+ QyInputTrimMode,
32
+ QyInputType,
33
+ QyInputValue
34
+ } from './qy-input'
35
+
36
+ export type {
37
+ QyFilePickerExposed,
38
+ QyFilePickerEmits,
39
+ QyFilePickerInvalidCode,
40
+ QyFilePickerInvalidDetail,
41
+ QyFilePickerProps
42
+ } from './qy-file-picker'
43
+ export type {
44
+ QyCheckboxEmits,
45
+ QyCheckboxProps,
46
+ QyCheckboxSize,
47
+ QyCheckboxValue
48
+ } from './qy-checkbox'
49
+ export type {
50
+ QyCheckboxGroupEmits,
51
+ QyCheckboxGroupOption,
52
+ QyCheckboxGroupProps,
53
+ QyCheckboxGroupSize
54
+ } from './qy-checkbox-group'
55
+ export type {
56
+ QyRadioEmits,
57
+ QyRadioProps,
58
+ QyRadioSize,
59
+ QyRadioValue
60
+ } from './qy-radio'
61
+ export type {
62
+ QyRadioGroupEmits,
63
+ QyRadioGroupExposed,
64
+ QyRadioGroupOption,
65
+ QyRadioGroupProps,
66
+ QyRadioGroupSize,
67
+ QyRadioGroupType
68
+ } from './qy-radio-group'
69
+ export type {
70
+ QySelectEmits,
71
+ QySelectExposed,
72
+ QySelectModelValue,
73
+ QySelectObjectValue,
74
+ QySelectOption,
75
+ QySelectPrimitive,
76
+ QySelectProps,
77
+ QySelectSize,
78
+ QySelectValue
79
+ } from './qy-select'
80
+ export type {
81
+ QySwitchEmits,
82
+ QySwitchProps,
83
+ QySwitchSize,
84
+ QySwitchValue
85
+ } from './qy-switch'
86
+ export type {
87
+ QyTagEffect,
88
+ QyTagEmits,
89
+ QyTagProps,
90
+ QyTagSize,
91
+ QyTagTone
92
+ } from './qy-tag'
93
+ export type {
94
+ QyTooltipEffect,
95
+ QyTooltipEmits,
96
+ QyTooltipPlacement,
97
+ QyTooltipProps
98
+ } from './qy-tooltip'
99
+ export type {
100
+ QyPopoverEffect,
101
+ QyPopoverEmits,
102
+ QyPopoverExposed,
103
+ QyPopoverPlacement,
104
+ QyPopoverProps,
105
+ QyPopoverTrigger
106
+ } from './qy-popover'
107
+ export type {
108
+ QyDatePickerCalendarChangeValue,
109
+ QyDatePickerDateCell,
110
+ QyDatePickerEmits,
111
+ QyDatePickerExposed,
112
+ QyDatePickerModelValue,
113
+ QyDatePickerPanelDate,
114
+ QyDatePickerPanelMode,
115
+ QyDatePickerPanelSlotProps,
116
+ QyDatePickerPanelView,
117
+ QyDatePickerProps,
118
+ QyDatePickerRangeValue,
119
+ QyDatePickerScalarValue,
120
+ QyDatePickerShortcut,
121
+ QyDatePickerShortcutValue,
122
+ QyDatePickerSize,
123
+ QyDatePickerSlots,
124
+ QyDatePickerType
125
+ } from './qy-date-picker'
2
126
 
3
127
  // 根入口类型声明,对应 @qynpm/ui 的命名导出和 app.use(QyUI) 整包注册。
4
128
  export const QyUpload: Plugin
@@ -8,25 +132,32 @@ export const QyImageUpload: Plugin
8
132
  export const QyDialog: Plugin
9
133
  export const QyButton: Plugin
10
134
  export const QyDropdown: Plugin
11
- export const QyInput: Plugin
12
- export const QyInputNumber: Plugin
13
- export const QyMoneyInput: Plugin
14
- export const QyDatePicker: Plugin
15
- export const QyCheckbox: Plugin
135
+ export const QyInput: typeof QyInputComponent
136
+ export { QyInputNumber } from './qy-input-number'
137
+ export const QyMoneyInput: Plugin
138
+ export const QyDatePicker: typeof QyDatePickerComponent
139
+ export const QyCheckbox: typeof QyCheckboxComponent
140
+ export const QyCheckboxGroup: typeof QyCheckboxGroupComponent
141
+ export const QyRadio: typeof QyRadioComponent
16
142
  export const QyAutocomplete: Plugin
17
143
  export const QyMenuActions: Plugin
18
144
  export const QyTableColumnSettings: Plugin
19
- export const QyRadioGroup: Plugin
145
+ export const QyRadioGroup: typeof QyRadioGroupComponent
20
146
  export const QyRemoteSelect: Plugin
21
147
  export const QySearchInput: Plugin
22
148
  export const QyRecordQuoteSearch: Plugin
23
- export const QySelect: Plugin
149
+ export const QySelect: typeof QySelectComponent
24
150
  export const QyTreeSelect: Plugin
25
151
  export const QySelectionDialog: Plugin
26
152
  export const QyLegacySelectionDialog: Plugin
27
153
  export const QyFormSection: Plugin
28
- export const QyActionBar: Plugin
29
- export const QyRemarkImage: Plugin
154
+ export const QyActionBar: Plugin
155
+ export const QyFilePicker: typeof QyFilePickerComponent
156
+ export const QySwitch: typeof QySwitchComponent
157
+ export const QyTag: typeof QyTagComponent
158
+ export const QyTooltip: typeof QyTooltipComponent
159
+ export const QyPopover: typeof QyPopoverComponent
160
+ export const QyRemarkImage: Plugin
30
161
  export function parseRemarkText(remarkText: string): {
31
162
  imageUrl: string
32
163
  text: string
@@ -52,10 +183,12 @@ declare const _default: Plugin & {
52
183
  QyButton: typeof QyButton
53
184
  QyDropdown: typeof QyDropdown
54
185
  QyInput: typeof QyInput
55
- QyInputNumber: typeof QyInputNumber
56
- QyMoneyInput: typeof QyMoneyInput
57
- QyDatePicker: typeof QyDatePicker
58
- QyCheckbox: typeof QyCheckbox
186
+ QyInputNumber: typeof QyInputNumber
187
+ QyMoneyInput: typeof QyMoneyInput
188
+ QyDatePicker: typeof QyDatePickerComponent
189
+ QyCheckbox: typeof QyCheckbox
190
+ QyCheckboxGroup: typeof QyCheckboxGroup
191
+ QyRadio: typeof QyRadio
59
192
  QyAutocomplete: typeof QyAutocomplete
60
193
  QyMenuActions: typeof QyMenuActions
61
194
  QyTableColumnSettings: typeof QyTableColumnSettings
@@ -68,8 +201,13 @@ declare const _default: Plugin & {
68
201
  QySelectionDialog: typeof QySelectionDialog
69
202
  QyLegacySelectionDialog: typeof QyLegacySelectionDialog
70
203
  QyFormSection: typeof QyFormSection
71
- QyActionBar: typeof QyActionBar
72
- QyRemarkImage: typeof QyRemarkImage
73
- }
204
+ QyActionBar: typeof QyActionBar
205
+ QyFilePicker: typeof QyFilePicker
206
+ QySwitch: typeof QySwitch
207
+ QyTag: typeof QyTag
208
+ QyTooltip: typeof QyTooltip
209
+ QyPopover: typeof QyPopover
210
+ QyRemarkImage: typeof QyRemarkImage
211
+ }
74
212
 
75
213
  export default _default