n-design-readonly-plugin 1.0.7 → 1.0.9

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.0.8] - 2026-03-05
6
+
7
+ ### Added
8
+ - 添加组件类型提示
9
+
5
10
  ## [1.0.7] - 2026-02-25
6
11
 
7
12
  ### Added
package/dist/index.d.ts CHANGED
@@ -1,5 +1,88 @@
1
- import { Plugin } from 'vue';
1
+ import { Component, Plugin } from 'vue';
2
2
  import { withReadonly } from './withReadonly';
3
+ import { InputProps, InputNumberProps, TextAreaProps, SelectProps, TreeSelectProps, CascaderProps, DatePickerProps, TimePickerProps, RadioProps, CheckboxProps, SwitchProps, SliderProps, RateProps, FormProps, FormItemProps } from 'n-designv3';
3
4
  declare const NDesignReadolyPlugin: Plugin;
4
5
  export default NDesignReadolyPlugin;
5
6
  export { withReadonly };
7
+ export type FormModelValue = string | number | boolean | Array<any> | Object | null | undefined;
8
+ export interface ReadonlyExtraPropsType {
9
+ readonly?: boolean;
10
+ copyable?: boolean;
11
+ emptyText?: string;
12
+ valueToLabel?: (value: FormModelValue) => string;
13
+ [key: string]: any;
14
+ }
15
+ export interface NkComponents {
16
+ NkInput: Component<Omit<InputProps, 'modelValue' | 'value'> & {
17
+ modelValue?: FormModelValue;
18
+ value?: FormModelValue;
19
+ } & Partial<ReadonlyExtraPropsType>>;
20
+ NkInputNumber: Component<Omit<InputNumberProps, 'modelValue' | 'value'> & {
21
+ modelValue?: FormModelValue;
22
+ value?: FormModelValue;
23
+ } & Partial<ReadonlyExtraPropsType>>;
24
+ NkTextarea: Component<Omit<TextAreaProps, 'modelValue' | 'value'> & {
25
+ modelValue?: FormModelValue;
26
+ value?: FormModelValue;
27
+ } & Partial<ReadonlyExtraPropsType>>;
28
+ NkSelect: Component<Omit<SelectProps, 'modelValue' | 'value'> & {
29
+ modelValue?: FormModelValue;
30
+ value?: FormModelValue;
31
+ } & Partial<ReadonlyExtraPropsType>>;
32
+ NkSelectOption: Component<SelectProps['options']>;
33
+ NkTreeSelect: Component<Omit<TreeSelectProps, 'modelValue' | 'value'> & {
34
+ modelValue?: FormModelValue;
35
+ value?: FormModelValue;
36
+ } & Partial<ReadonlyExtraPropsType>>;
37
+ NkCascader: Component<Omit<CascaderProps, 'modelValue' | 'value'> & {
38
+ modelValue?: FormModelValue;
39
+ value?: FormModelValue;
40
+ } & Partial<ReadonlyExtraPropsType>>;
41
+ NkDatePicker: Component<Omit<DatePickerProps, 'modelValue' | 'value'> & {
42
+ modelValue?: FormModelValue;
43
+ value?: FormModelValue;
44
+ } & Partial<ReadonlyExtraPropsType>>;
45
+ NkTimePicker: Component<Omit<TimePickerProps, 'modelValue' | 'value'> & {
46
+ modelValue?: FormModelValue;
47
+ value?: FormModelValue;
48
+ } & Partial<ReadonlyExtraPropsType>>;
49
+ NkRadio: Component<Omit<RadioProps, 'modelValue' | 'value' | 'checked'> & {
50
+ modelValue?: FormModelValue;
51
+ value?: FormModelValue;
52
+ checked?: boolean;
53
+ } & Partial<ReadonlyExtraPropsType>>;
54
+ NkCheckbox: Component<Omit<CheckboxProps, 'modelValue' | 'value' | 'checked'> & {
55
+ modelValue?: FormModelValue;
56
+ value?: FormModelValue;
57
+ checked?: boolean;
58
+ } & Partial<ReadonlyExtraPropsType>>;
59
+ NkRadioGroup: Component<Omit<RadioProps, 'modelValue' | 'value'> & {
60
+ modelValue?: FormModelValue;
61
+ value?: FormModelValue;
62
+ } & Partial<ReadonlyExtraPropsType>>;
63
+ NkCheckboxGroup: Component<Omit<CheckboxProps, 'modelValue' | 'value'> & {
64
+ modelValue?: FormModelValue;
65
+ value?: FormModelValue;
66
+ } & Partial<ReadonlyExtraPropsType>>;
67
+ NkSwitch: Component<Omit<SwitchProps, 'modelValue' | 'value' | 'checked'> & {
68
+ modelValue?: FormModelValue;
69
+ value?: FormModelValue;
70
+ checked?: boolean;
71
+ } & Partial<ReadonlyExtraPropsType>>;
72
+ NkSlider: Component<Omit<SliderProps, 'modelValue' | 'value'> & {
73
+ modelValue?: FormModelValue;
74
+ value?: FormModelValue;
75
+ } & Partial<ReadonlyExtraPropsType>>;
76
+ NkRate: Component<Omit<RateProps, 'modelValue' | 'value'> & {
77
+ modelValue?: FormModelValue;
78
+ value?: FormModelValue;
79
+ } & Partial<ReadonlyExtraPropsType>>;
80
+ NkForm: Component<FormProps> & {
81
+ readonly?: boolean;
82
+ };
83
+ NkFormItem: Component<FormItemProps>;
84
+ }
85
+ declare module 'vue' {
86
+ interface GlobalComponents extends NkComponents {
87
+ }
88
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n-design-readonly-plugin",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "只读模式插件 for n-designv3",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",