@qynpm/ui 1.0.35 → 1.0.36

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 (65) hide show
  1. package/README.md +63 -28
  2. package/dist/index.cjs +4 -3
  3. package/dist/index.mjs +60 -58
  4. package/dist/qy-action-bar/index.cjs +1 -1
  5. package/dist/qy-action-bar/index.mjs +1 -1
  6. package/dist/qy-dialog/index.cjs +1 -1
  7. package/dist/qy-dialog/index.mjs +1 -1
  8. package/dist/qy-drawer/index.cjs +1 -1
  9. package/dist/qy-drawer/index.mjs +1 -1
  10. package/dist/qy-file-picker/index.cjs +1 -1
  11. package/dist/qy-file-picker/index.mjs +1 -1
  12. package/dist/qy-form-section/index.cjs +1 -1
  13. package/dist/qy-form-section/index.mjs +1 -1
  14. package/dist/qy-image-upload/index.cjs +1 -1
  15. package/dist/qy-image-upload/index.mjs +1 -1
  16. package/dist/qy-input-number/index.cjs +1 -1
  17. package/dist/qy-input-number/index.mjs +1 -1
  18. package/dist/qy-input-tag/index.cjs +1 -0
  19. package/dist/qy-input-tag/index.mjs +7 -0
  20. package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
  21. package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
  22. package/dist/qy-money-input/index.cjs +1 -1
  23. package/dist/qy-money-input/index.mjs +5 -2
  24. package/dist/qy-record-quote-search/index.cjs +1 -1
  25. package/dist/qy-record-quote-search/index.mjs +1 -1
  26. package/dist/qy-remark-image/index.cjs +1 -1
  27. package/dist/qy-remark-image/index.mjs +1 -1
  28. package/dist/qy-remote-select/index.cjs +1 -1
  29. package/dist/qy-remote-select/index.mjs +1 -1
  30. package/dist/qy-search-input/index.cjs +1 -1
  31. package/dist/qy-search-input/index.mjs +1 -1
  32. package/dist/qy-selection-dialog/index.cjs +1 -1
  33. package/dist/qy-selection-dialog/index.mjs +1 -1
  34. package/dist/qy-upload/index.cjs +1 -1
  35. package/dist/qy-upload/index.mjs +5 -2
  36. package/dist/shared/index-BYX0biqw.mjs +766 -0
  37. package/dist/shared/index-BxxwEr52.mjs +107 -0
  38. package/dist/shared/index-C1i-hd-W.cjs +1 -0
  39. package/dist/shared/index-D654b42n.mjs +2754 -0
  40. package/dist/shared/index-DnNIseRJ.cjs +1 -0
  41. package/dist/shared/index-aIqtIYsu.cjs +1 -0
  42. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BiIgNax-.cjs +1 -0
  43. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DIWWHODS.mjs +197 -0
  44. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DwFGEW4B.mjs +143 -0
  45. package/dist/shared/index.vue_vue_type_script_setup_true_lang-ccFLNRry.cjs +1 -0
  46. package/dist/shared/index.vue_vue_type_style_index_0_lang-B1FgJZbw.mjs +148 -0
  47. package/dist/shared/index.vue_vue_type_style_index_0_lang-DVXf-yUs.cjs +1 -0
  48. package/index.d.ts +82 -25
  49. package/package.json +489 -483
  50. package/qy-file-picker/index.d.ts +4 -1
  51. package/qy-image-preview/index.d.ts +0 -1
  52. package/qy-image-upload/index.d.ts +69 -12
  53. package/qy-input/index.d.ts +76 -18
  54. package/qy-input-number/index.d.ts +64 -30
  55. package/qy-input-tag/index.d.ts +69 -0
  56. package/qy-money-input/index.d.ts +87 -12
  57. package/qy-upload/index.d.ts +99 -5
  58. package/dist/shared/index-BekN1g_r.mjs +0 -3541
  59. package/dist/shared/index-BkX9xlbI.cjs +0 -1
  60. package/dist/shared/index-C_1KP3l9.mjs +0 -129
  61. package/dist/shared/index-Ce_hvR--.cjs +0 -1
  62. package/dist/shared/index.vue_vue_type_style_index_0_lang-B0CXLnL1.mjs +0 -132
  63. package/dist/shared/index.vue_vue_type_style_index_0_lang-DccRGtZE.cjs +0 -1
  64. /package/dist/shared/{index.vue_vue_type_script_setup_true_lang-q37rBg6Z.mjs → index.vue_vue_type_script_setup_true_lang-CGsXVhJy.mjs} +0 -0
  65. /package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CglCPcj-.cjs → index.vue_vue_type_script_setup_true_lang-Dk83TGiU.cjs} +0 -0
@@ -0,0 +1,148 @@
1
+ import { defineComponent as I, useAttrs as L, computed as P, ref as c, onMounted as z, onBeforeUnmount as M, openBlock as N, createBlock as S, unref as k, mergeProps as A, createSlots as T, withCtx as s, renderSlot as d } from "vue";
2
+ import { ElInputNumber as U } from "element-plus";
3
+ const F = /* @__PURE__ */ I({
4
+ name: "QyInputNumber",
5
+ inheritAttrs: !1,
6
+ __name: "index",
7
+ props: {
8
+ id: {},
9
+ step: { default: 1 },
10
+ stepStrictly: { type: Boolean, default: !1 },
11
+ max: { default: void 0 },
12
+ min: { default: void 0 },
13
+ modelValue: { default: void 0 },
14
+ readonly: { type: Boolean, default: !1 },
15
+ disabled: { type: Boolean, default: !1 },
16
+ size: { default: void 0 },
17
+ controls: { type: Boolean, default: !0 },
18
+ controlsPosition: { default: "" },
19
+ valueOnClear: { default: null },
20
+ name: {},
21
+ placeholder: { default: "请输入数字" },
22
+ precision: { default: void 0 },
23
+ validateEvent: { type: Boolean },
24
+ ariaLabel: {}
25
+ },
26
+ emits: ["update:modelValue", "input", "change", "focus", "blur"],
27
+ setup(n, { expose: p, emit: b }) {
28
+ const t = n, o = b, h = L(), y = P(
29
+ () => Object.fromEntries(
30
+ Object.entries(h).filter(
31
+ ([e]) => e === "class" || e === "style" || e === "title" || e === "role" || e.startsWith("data-") || e.startsWith("aria-")
32
+ )
33
+ )
34
+ ), i = c(null), l = c(!1), f = c(t.modelValue);
35
+ function g() {
36
+ return t.valueOnClear === "min" ? t.min : t.valueOnClear === "max" ? t.max : t.valueOnClear;
37
+ }
38
+ function u(e = !1) {
39
+ var r, v;
40
+ if (!l.value) return;
41
+ l.value = !1;
42
+ const a = g();
43
+ o("update:modelValue", a), o("change", a, f.value), e && ((v = (r = i.value) == null ? void 0 : r.blur) == null || v.call(r));
44
+ }
45
+ function C(e) {
46
+ e === null && t.valueOnClear !== null && (l.value = !0, f.value = t.modelValue), o("update:modelValue", e);
47
+ }
48
+ function V(e) {
49
+ o("input", e);
50
+ }
51
+ function B(e, a) {
52
+ if (l.value && e === null) {
53
+ u();
54
+ return;
55
+ }
56
+ l.value = !1, o("change", e, a);
57
+ }
58
+ function O(e) {
59
+ o("focus", e);
60
+ }
61
+ function x(e) {
62
+ l.value && e.target instanceof HTMLInputElement && e.target.value === "" && u(), o("blur", e);
63
+ }
64
+ function E(e) {
65
+ l.value && e.key === "Tab" && e.target instanceof HTMLInputElement && e.target.value === "" && u(!0);
66
+ }
67
+ function m(e) {
68
+ const a = e.target;
69
+ l.value && a instanceof Element && !a.closest(".qy-input-number") && u(!0);
70
+ }
71
+ function $() {
72
+ var e, a;
73
+ (a = (e = i.value) == null ? void 0 : e.focus) == null || a.call(e);
74
+ }
75
+ function w() {
76
+ var e, a;
77
+ (a = (e = i.value) == null ? void 0 : e.blur) == null || a.call(e);
78
+ }
79
+ return p({
80
+ focus: $,
81
+ blur: w
82
+ }), z(() => {
83
+ document.addEventListener("pointerdown", m, !0);
84
+ }), M(() => {
85
+ document.removeEventListener("pointerdown", m, !0);
86
+ }), (e, a) => (N(), S(k(U), A({
87
+ ref_key: "inputNumberRef",
88
+ ref: i
89
+ }, y.value, {
90
+ class: "qy-input-number",
91
+ "model-value": n.modelValue,
92
+ min: n.min,
93
+ max: n.max,
94
+ step: n.step,
95
+ "step-strictly": n.stepStrictly,
96
+ precision: n.precision,
97
+ controls: n.controls,
98
+ "controls-position": n.controlsPosition,
99
+ placeholder: n.placeholder,
100
+ disabled: n.disabled,
101
+ readonly: n.readonly,
102
+ size: n.size,
103
+ "value-on-clear": n.valueOnClear,
104
+ "validate-event": n.validateEvent,
105
+ id: n.id,
106
+ name: n.name,
107
+ "aria-label": n.ariaLabel,
108
+ "onUpdate:modelValue": C,
109
+ onInput: V,
110
+ onChange: B,
111
+ onFocus: O,
112
+ onBlur: x,
113
+ onKeydownCapture: E
114
+ }), T({ _: 2 }, [
115
+ e.$slots.prefix ? {
116
+ name: "prefix",
117
+ fn: s(() => [
118
+ d(e.$slots, "prefix")
119
+ ]),
120
+ key: "0"
121
+ } : void 0,
122
+ e.$slots.suffix ? {
123
+ name: "suffix",
124
+ fn: s(() => [
125
+ d(e.$slots, "suffix")
126
+ ]),
127
+ key: "1"
128
+ } : void 0,
129
+ e.$slots["increase-icon"] ? {
130
+ name: "increase-icon",
131
+ fn: s(() => [
132
+ d(e.$slots, "increase-icon")
133
+ ]),
134
+ key: "2"
135
+ } : void 0,
136
+ e.$slots["decrease-icon"] ? {
137
+ name: "decrease-icon",
138
+ fn: s(() => [
139
+ d(e.$slots, "decrease-icon")
140
+ ]),
141
+ key: "3"
142
+ } : void 0
143
+ ]), 1040, ["model-value", "min", "max", "step", "step-strictly", "precision", "controls", "controls-position", "placeholder", "disabled", "readonly", "size", "value-on-clear", "validate-event", "id", "name", "aria-label"]));
144
+ }
145
+ });
146
+ export {
147
+ F as _
148
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("vue"),E=require("element-plus"),$=n.defineComponent({name:"QyInputNumber",inheritAttrs:!1,__name:"index",props:{id:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},max:{default:void 0},min:{default:void 0},modelValue:{default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:void 0},controls:{type:Boolean,default:!0},controlsPosition:{default:""},valueOnClear:{default:null},name:{},placeholder:{default:"请输入数字"},precision:{default:void 0},validateEvent:{type:Boolean},ariaLabel:{}},emits:["update:modelValue","input","change","focus","blur"],setup(t,{expose:m,emit:v}){const a=t,i=v,p=n.useAttrs(),h=n.computed(()=>Object.fromEntries(Object.entries(p).filter(([e])=>e==="class"||e==="style"||e==="title"||e==="role"||e.startsWith("data-")||e.startsWith("aria-")))),u=n.ref(null),o=n.ref(!1),d=n.ref(a.modelValue);function b(){return a.valueOnClear==="min"?a.min:a.valueOnClear==="max"?a.max:a.valueOnClear}function r(e=!1){var s,f;if(!o.value)return;o.value=!1;const l=b();i("update:modelValue",l),i("change",l,d.value),e&&((f=(s=u.value)==null?void 0:s.blur)==null||f.call(s))}function y(e){e===null&&a.valueOnClear!==null&&(o.value=!0,d.value=a.modelValue),i("update:modelValue",e)}function C(e){i("input",e)}function g(e,l){if(o.value&&e===null){r();return}o.value=!1,i("change",e,l)}function x(e){i("focus",e)}function V(e){o.value&&e.target instanceof HTMLInputElement&&e.target.value===""&&r(),i("blur",e)}function B(e){o.value&&e.key==="Tab"&&e.target instanceof HTMLInputElement&&e.target.value===""&&r(!0)}function c(e){const l=e.target;o.value&&l instanceof Element&&!l.closest(".qy-input-number")&&r(!0)}function O(){var e,l;(l=(e=u.value)==null?void 0:e.focus)==null||l.call(e)}function w(){var e,l;(l=(e=u.value)==null?void 0:e.blur)==null||l.call(e)}return m({focus:O,blur:w}),n.onMounted(()=>{document.addEventListener("pointerdown",c,!0)}),n.onBeforeUnmount(()=>{document.removeEventListener("pointerdown",c,!0)}),(e,l)=>(n.openBlock(),n.createBlock(n.unref(E.ElInputNumber),n.mergeProps({ref_key:"inputNumberRef",ref:u},h.value,{class:"qy-input-number","model-value":t.modelValue,min:t.min,max:t.max,step:t.step,"step-strictly":t.stepStrictly,precision:t.precision,controls:t.controls,"controls-position":t.controlsPosition,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,size:t.size,"value-on-clear":t.valueOnClear,"validate-event":t.validateEvent,id:t.id,name:t.name,"aria-label":t.ariaLabel,"onUpdate:modelValue":y,onInput:C,onChange:g,onFocus:x,onBlur:V,onKeydownCapture:B}),n.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0,e.$slots["increase-icon"]?{name:"increase-icon",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"increase-icon")]),key:"2"}:void 0,e.$slots["decrease-icon"]?{name:"decrease-icon",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"decrease-icon")]),key:"3"}:void 0]),1040,["model-value","min","max","step","step-strictly","precision","controls","controls-position","placeholder","disabled","readonly","size","value-on-clear","validate-event","id","name","aria-label"]))}});exports._sfc_main=$;
package/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import type { App, Plugin } from 'vue'
1
+ import type { App, Plugin } from 'vue'
2
+ import type QyUploadComponent from './qy-upload'
3
+ import type QyImageUploadComponent from './qy-image-upload'
2
4
  import type QyFilePickerComponent from './qy-file-picker'
3
5
  import type QyCheckboxComponent from './qy-checkbox'
4
6
  import type QyCheckboxGroupComponent from './qy-checkbox-group'
@@ -47,29 +49,60 @@ import type QyProgressComponent from './qy-progress'
47
49
  import type QyStatisticComponent from './qy-statistic'
48
50
  import type QyAvatarComponent from './qy-avatar'
49
51
  import type QyTreeComponent from './qy-tree'
50
- import type QyInputComponent from './qy-input'
51
- import type QyDatePickerComponent from './qy-date-picker'
52
+ import type QyInputComponent from './qy-input'
53
+ import type QyInputTagComponent from './qy-input-tag'
54
+ import type QyInputNumberComponent from './qy-input-number'
55
+ import type QyDatePickerComponent from './qy-date-picker'
56
+ import type QyMoneyInputComponent from './qy-money-input'
52
57
 
53
58
  export type {
54
59
  QyInputNumberClearValue,
55
60
  QyInputNumberControlsPosition,
56
- QyInputNumberEmits,
57
- QyInputNumberExposed,
58
- QyInputNumberProps,
59
- QyInputNumberSize,
60
- QyInputNumberValue
61
- } from './qy-input-number'
61
+ QyInputNumberEmits,
62
+ QyInputNumberExposed,
63
+ QyInputNumberProps,
64
+ QyInputNumberSize,
65
+ QyInputNumberSlots,
66
+ QyInputNumberValue
67
+ } from './qy-input-number'
62
68
 
63
- export type {
64
- QyInputEmits,
65
- QyInputExposed,
66
- QyInputModelValue,
67
- QyInputProps,
68
- QyInputSize,
69
- QyInputTrimMode,
69
+ export type {
70
+ QyInputAutoSize,
71
+ QyInputEmits,
72
+ QyInputExposed,
73
+ QyInputIcon,
74
+ QyInputInputMode,
75
+ QyInputModelValue,
76
+ QyInputModelModifiers,
77
+ QyInputProps,
78
+ QyInputSize,
79
+ QyInputStyle,
80
+ QyInputTrimMode,
70
81
  QyInputType,
71
82
  QyInputValue
72
- } from './qy-input'
83
+ } from './qy-input'
84
+
85
+ export type {
86
+ QyInputTagEffect,
87
+ QyInputTagEmits,
88
+ QyInputTagExposed,
89
+ QyInputTagModelValue,
90
+ QyInputTagProps,
91
+ QyInputTagSize,
92
+ QyInputTagSlots,
93
+ QyInputTagTone,
94
+ QyInputTagTrigger
95
+ } from './qy-input-tag'
96
+
97
+ export type {
98
+ QyMoneyInputEmits,
99
+ QyMoneyInputExposed,
100
+ QyMoneyInputFormatTrigger,
101
+ QyMoneyInputProps,
102
+ QyMoneyInputSize,
103
+ QyMoneyInputSlots,
104
+ QyMoneyInputValue
105
+ } from './qy-money-input'
73
106
 
74
107
  export type {
75
108
  QyFilePickerExposed,
@@ -348,6 +381,27 @@ export type {
348
381
  QyCollapseItemProps,
349
382
  QyCollapseItemSlots
350
383
  } from './qy-collapse-item'
384
+ export type {
385
+ QyUploadEmits,
386
+ QyUploadExposed,
387
+ QyUploadInvalidCode,
388
+ QyUploadInvalidDetail,
389
+ QyUploadProps,
390
+ QyUploadRequest,
391
+ QyUploadRequestContext,
392
+ QyUploadResult,
393
+ QyUploadValue,
394
+ QyUploadValueFormat,
395
+ QyUploadVariant
396
+ } from './qy-upload'
397
+
398
+ export type {
399
+ QyImageUploadEmits,
400
+ QyImageUploadExposed,
401
+ QyImageUploadMode,
402
+ QyImageUploadProps
403
+ } from './qy-image-upload'
404
+
351
405
  export type {
352
406
  QyLinkAttrs,
353
407
  QyLinkEmits,
@@ -473,16 +527,17 @@ export type {
473
527
  } from './qy-date-picker'
474
528
 
475
529
  // 根入口类型声明,对应 @qynpm/ui 的命名导出和 app.use(QyUI) 整包注册。
476
- export const QyUpload: Plugin
530
+ export const QyUpload: typeof QyUploadComponent
477
531
  export const QyImage: Plugin
478
532
  export const QyImagePreview: Plugin
479
- export const QyImageUpload: Plugin
533
+ export const QyImageUpload: typeof QyImageUploadComponent
480
534
  export const QyDialog: typeof QyDialogComponent
481
535
  export const QyButton: Plugin
482
536
  export const QyDropdown: Plugin
483
- export const QyInput: typeof QyInputComponent
484
- export { QyInputNumber } from './qy-input-number'
485
- export const QyMoneyInput: Plugin
537
+ export const QyInput: typeof QyInputComponent
538
+ export const QyInputTag: typeof QyInputTagComponent
539
+ export { QyInputNumber } from './qy-input-number'
540
+ export const QyMoneyInput: typeof QyMoneyInputComponent
486
541
  export const QyDatePicker: typeof QyDatePickerComponent
487
542
  export const QyCheckbox: typeof QyCheckboxComponent
488
543
  export const QyCheckboxGroup: typeof QyCheckboxGroupComponent
@@ -500,7 +555,8 @@ export const QySelectionDialog: Plugin
500
555
  export const QyLegacySelectionDialog: Plugin
501
556
  export const QyFormSection: Plugin
502
557
  export const QyActionBar: Plugin
503
- export const QyFilePicker: typeof QyFilePickerComponent
558
+ /** @deprecated 请使用 QyUpload 的本地选择模式。 */
559
+ export const QyFilePicker: typeof QyFilePickerComponent
504
560
  export const QySwitch: typeof QySwitchComponent
505
561
  export const QyTag: typeof QyTagComponent
506
562
  export const QyBadge: typeof QyBadgeComponent
@@ -569,8 +625,9 @@ declare const _default: Plugin & {
569
625
  QyDialog: typeof QyDialog
570
626
  QyButton: typeof QyButton
571
627
  QyDropdown: typeof QyDropdown
572
- QyInput: typeof QyInput
573
- QyInputNumber: typeof QyInputNumber
628
+ QyInput: typeof QyInput
629
+ QyInputTag: typeof QyInputTagComponent
630
+ QyInputNumber: typeof QyInputNumberComponent
574
631
  QyMoneyInput: typeof QyMoneyInput
575
632
  QyDatePicker: typeof QyDatePickerComponent
576
633
  QyCheckbox: typeof QyCheckbox