duck-vue-components 0.0.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 (123) hide show
  1. package/README.md +29 -0
  2. package/dist/MyButton-C1krVCi6.cjs +36 -0
  3. package/dist/MyButton-C7riFwH6.js +28 -0
  4. package/dist/_plugin-vue_export-helper-DQXgr64F.cjs +13 -0
  5. package/dist/_plugin-vue_export-helper-DbXABBKy.js +8 -0
  6. package/dist/affix-CYU-9qMr.cjs +71 -0
  7. package/dist/affix-D9EM8_Um.js +66 -0
  8. package/dist/button-CGv1WHzT.cjs +132 -0
  9. package/dist/button-tOWSPPxz.js +126 -0
  10. package/dist/chunk-CZWwpsFl.cjs +43 -0
  11. package/dist/chunk-pbuEa-1d.js +13 -0
  12. package/dist/config.cjs +1 -0
  13. package/dist/config.js +1 -0
  14. package/dist/constants/json.cjs +4 -0
  15. package/dist/constants/json.d.cts +2 -0
  16. package/dist/constants/json.d.ts +2 -0
  17. package/dist/constants/json.js +2 -0
  18. package/dist/constants.cjs +14 -0
  19. package/dist/constants.d.cts +3 -0
  20. package/dist/constants.d.ts +3 -0
  21. package/dist/constants.js +3 -0
  22. package/dist/controls/MyButton.cjs +3 -0
  23. package/dist/controls/MyButton.d.cts +2 -0
  24. package/dist/controls/MyButton.d.ts +2 -0
  25. package/dist/controls/MyButton.js +2 -0
  26. package/dist/controls/affix.cjs +8 -0
  27. package/dist/controls/affix.d.cts +2 -0
  28. package/dist/controls/affix.d.ts +2 -0
  29. package/dist/controls/affix.js +2 -0
  30. package/dist/controls/button.cjs +8 -0
  31. package/dist/controls/button.js +2 -0
  32. package/dist/controls.cjs +18 -0
  33. package/dist/controls.d.cts +10 -0
  34. package/dist/controls.d.ts +10 -0
  35. package/dist/controls.js +5 -0
  36. package/dist/dom-CllENWMY.js +346 -0
  37. package/dist/dom-DS4YqkjW.cjs +580 -0
  38. package/dist/index-1ELDRrC5.d.ts +1397 -0
  39. package/dist/index-5JdIJn1m.d.cts +74 -0
  40. package/dist/index-6KzLtJFy.d.cts +157 -0
  41. package/dist/index-BGkTN1DD.d.cts +15 -0
  42. package/dist/index-BHq-BMCP.d.ts +74 -0
  43. package/dist/index-BI-hrf4t.d.ts +332 -0
  44. package/dist/index-BtOBjeH7.d.ts +10 -0
  45. package/dist/index-C-uY4885.d.cts +23 -0
  46. package/dist/index-C5SJLWEN.d.ts +23 -0
  47. package/dist/index-CSvc8L11.d.cts +51 -0
  48. package/dist/index-CeemHBNT.d.ts +51 -0
  49. package/dist/index-CfkAYIKD.d.cts +80 -0
  50. package/dist/index-CiJC-ieW.d.ts +157 -0
  51. package/dist/index-DamAmum6.d.ts +15 -0
  52. package/dist/index-DhOoJCHW.d.cts +1397 -0
  53. package/dist/index-PhthUD7x.d.cts +10 -0
  54. package/dist/index-oDsyZ3t2.d.cts +332 -0
  55. package/dist/index-x9xs2cbA.d.ts +80 -0
  56. package/dist/json-BkkaM20u.cjs +31034 -0
  57. package/dist/json-D-_zTSK6.js +31023 -0
  58. package/dist/locale-DhlAaV1Q.js +597 -0
  59. package/dist/locale-WzzxOobw.cjs +658 -0
  60. package/dist/locale.cjs +12 -0
  61. package/dist/locale.js +2 -0
  62. package/dist/objects-CLXPNOUW.js +134 -0
  63. package/dist/objects-o7u5s_lI.cjs +272 -0
  64. package/dist/packages/config.cjs +10 -0
  65. package/dist/packages/config.d.cts +2 -0
  66. package/dist/packages/config.d.ts +2 -0
  67. package/dist/packages/config.js +5 -0
  68. package/dist/packages/constants/json.cjs +4 -0
  69. package/dist/packages/constants/json.js +2 -0
  70. package/dist/packages/constants.cjs +78 -0
  71. package/dist/packages/constants.js +67 -0
  72. package/dist/packages/controls/MyButton.cjs +3 -0
  73. package/dist/packages/controls/MyButton.js +2 -0
  74. package/dist/packages/controls/affix.cjs +8 -0
  75. package/dist/packages/controls/affix.js +2 -0
  76. package/dist/packages/controls/button.cjs +8 -0
  77. package/dist/packages/controls/button.d.cts +2 -0
  78. package/dist/packages/controls/button.d.ts +2 -0
  79. package/dist/packages/controls/button.js +2 -0
  80. package/dist/packages/controls.cjs +31 -0
  81. package/dist/packages/controls.js +12 -0
  82. package/dist/packages/locale.cjs +12 -0
  83. package/dist/packages/locale.d.cts +39 -0
  84. package/dist/packages/locale.d.ts +39 -0
  85. package/dist/packages/locale.js +2 -0
  86. package/dist/packages/stores.cjs +337 -0
  87. package/dist/packages/stores.js +320 -0
  88. package/dist/packages/utils/dom.cjs +32 -0
  89. package/dist/packages/utils/dom.d.cts +2 -0
  90. package/dist/packages/utils/dom.d.ts +2 -0
  91. package/dist/packages/utils/dom.js +2 -0
  92. package/dist/packages/utils/vue/props.cjs +63 -0
  93. package/dist/packages/utils/vue/props.d.cts +2 -0
  94. package/dist/packages/utils/vue/props.d.ts +2 -0
  95. package/dist/packages/utils/vue/props.js +56 -0
  96. package/dist/packages/utils/vue.cjs +32 -0
  97. package/dist/packages/utils/vue.d.cts +3 -0
  98. package/dist/packages/utils/vue.d.ts +3 -0
  99. package/dist/packages/utils/vue.js +24 -0
  100. package/dist/packages/utils.cjs +190 -0
  101. package/dist/packages/utils.js +6 -0
  102. package/dist/packages.cjs +15 -0
  103. package/dist/packages.d.cts +3 -0
  104. package/dist/packages.d.ts +3 -0
  105. package/dist/packages.js +3 -0
  106. package/dist/stores.cjs +17 -0
  107. package/dist/stores.d.cts +805 -0
  108. package/dist/stores.d.ts +805 -0
  109. package/dist/stores.js +4 -0
  110. package/dist/style.css +15 -0
  111. package/dist/utils/dom.cjs +32 -0
  112. package/dist/utils/dom.js +2 -0
  113. package/dist/utils/vue/props.cjs +7 -0
  114. package/dist/utils/vue/props.js +2 -0
  115. package/dist/utils/vue.cjs +11 -0
  116. package/dist/utils/vue.js +3 -0
  117. package/dist/utils-DlBKdS0t.js +696 -0
  118. package/dist/utils-egS_3P4w.cjs +850 -0
  119. package/dist/utils.cjs +190 -0
  120. package/dist/utils.d.cts +5 -0
  121. package/dist/utils.d.ts +5 -0
  122. package/dist/utils.js +6 -0
  123. package/package.json +184 -0
@@ -0,0 +1,74 @@
1
+ //#region src/packages/constants/aria.d.ts
2
+ declare const EVENT_CODE: {
3
+ tab: string;
4
+ enter: string;
5
+ space: string;
6
+ left: string;
7
+ up: string;
8
+ right: string;
9
+ down: string;
10
+ esc: string;
11
+ delete: string;
12
+ backspace: string;
13
+ numpadEnter: string;
14
+ pageUp: string;
15
+ pageDown: string;
16
+ home: string;
17
+ end: string;
18
+ };
19
+ //#endregion
20
+ //#region src/packages/constants/date.d.ts
21
+ declare const datePickTypes: readonly ["year", "years", "month", "months", "date", "dates", "week", "datetime", "datetimerange", "daterange", "monthrange", "yearrange"];
22
+ declare const WEEK_DAYS: readonly ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
23
+ type DatePickType = typeof datePickTypes[number];
24
+ //#endregion
25
+ //#region src/packages/constants/event.d.ts
26
+ declare const UPDATE_MODEL_EVENT = "update:modelValue";
27
+ declare const CHANGE_EVENT = "change";
28
+ declare const INPUT_EVENT = "input";
29
+ //#endregion
30
+ //#region src/packages/constants/key.d.ts
31
+ declare const INSTALLED_KEY: unique symbol;
32
+ //#endregion
33
+ //#region src/packages/constants/size.d.ts
34
+ declare const componentSizes: readonly ["", "default", "small", "large"];
35
+ type ComponentSize = typeof componentSizes[number];
36
+ declare const componentSizeMap: {
37
+ readonly large: 40;
38
+ readonly default: 32;
39
+ readonly small: 24;
40
+ };
41
+ type typeT = 'primary' | 'success' | 'info' | 'warning' | 'danger' | '';
42
+ type sizeT = 'small' | 'default' | 'large' | '';
43
+ //#endregion
44
+ //#region src/packages/constants/control.d.ts
45
+ /** 定义最小单位内容 */
46
+ type controlBaseTypeT = 'text' | 'label' | 'divider' | 'button' | 'dropdown' | 'popConfirm' | 'null' | 'content' | 'tag' | 'card' | 'echarts' | 'statistic' | 'between';
47
+ /** 表示需要绑定数据的控件,以后还会再加,包括自定义组件 */
48
+ type controlInputTypeT = 'switch' | 'upload' | 'tvVodUpload' | 'editor' | 'videoplayer' | 'select' | 'virtualizedSelect' | 'input' | 'inputNumber' | 'time' | 'date' | 'checkboxInput' | 'selectIcon' | 'map' | 'cascader' | 'tag' | 'between';
49
+ /** 定义其下还有子内容的组件 */
50
+ type controlContainerTypeT = 'tabs' | 'form' | 'buttonGroup';
51
+ type areaT = "form" | "search" | "operateButtons" | "tableButtons" | "tableLine" | "inForm" | "custom";
52
+ type modelT = "add" | "edit" | "info";
53
+ type labelPositionI = "left" | "right" | "top";
54
+ type complexT = "like" | "=" | "<>" | "NOT LIKE" | ">" | ">=" | "<" | "<=" | "FINDIN" | "IN" | "BETWEEN" | "RANGE" | "NULL";
55
+ //#endregion
56
+ //#region src/packages/constants/apidata.d.ts
57
+ type JSONValue = string | number | undefined | null | boolean | JSONValue[] | {
58
+ [key: string]: JSONValue;
59
+ };
60
+ interface infoI {
61
+ [key: string]: JSONValue;
62
+ }
63
+ //#endregion
64
+ //#region src/packages/constants/type.d.ts
65
+ type baseT = {
66
+ name: string;
67
+ label?: string;
68
+ controlType: string;
69
+ moduleName?: string;
70
+ show?: boolean;
71
+ style?: Record<string, string>;
72
+ };
73
+ //#endregion
74
+ export { EVENT_CODE as C, datePickTypes as S, CHANGE_EVENT as _, complexT as a, DatePickType as b, controlInputTypeT as c, ComponentSize as d, componentSizeMap as f, INSTALLED_KEY as g, typeT as h, areaT as i, labelPositionI as l, sizeT as m, JSONValue as n, controlBaseTypeT as o, componentSizes as p, infoI as r, controlContainerTypeT as s, baseT as t, modelT as u, INPUT_EVENT as v, WEEK_DAYS as x, UPDATE_MODEL_EVENT as y };
@@ -0,0 +1,157 @@
1
+ import { ExtractPropTypes, PropType } from "vue";
2
+
3
+ //#region src/packages/utils/vue/props/util.d.ts
4
+ type Writable<T> = { -readonly [P in keyof T]: T[P] };
5
+ type WritableArray<T> = T extends readonly any[] ? Writable<T> : T;
6
+ type IfNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
7
+ type IfUnknown<T, Y, N> = [unknown] extends [T] ? Y : N;
8
+ type UnknownToNever<T> = IfUnknown<T, never, T>;
9
+ //#endregion
10
+ //#region src/packages/utils/vue/props/runtime.d.ts
11
+ declare const epPropKey = "__epPropKey";
12
+ declare const definePropType: <T>(val: any) => PropType<T>;
13
+ declare const isEpProp: (val: unknown) => val is EpProp<any, any, any>;
14
+ /**
15
+ * @description Build prop. It can better optimize prop types
16
+ * @description 生成 prop,能更好地优化类型
17
+ * @example
18
+ // limited options
19
+ // the type will be PropType<'light' | 'dark'>
20
+ buildProp({
21
+ type: String,
22
+ values: ['light', 'dark'],
23
+ } as const)
24
+ * @example
25
+ // limited options and other types
26
+ // the type will be PropType<'small' | 'large' | number>
27
+ buildProp({
28
+ type: [String, Number],
29
+ values: ['small', 'large'],
30
+ validator: (val: unknown): val is number => typeof val === 'number',
31
+ } as const)
32
+ @link see more: https://github.com/element-plus/element-plus/pull/3341
33
+ */
34
+ declare const buildProp: <Type = never, Value = never, Validator = never, Default extends EpPropMergeType<Type, Value, Validator> = never, Required extends boolean = false>(prop: EpPropInput<Type, Value, Validator, Default, Required>, key?: string) => EpPropFinalized<Type, Value, Validator, Default, Required>;
35
+ declare const buildProps: <Props extends Record<string, {
36
+ [epPropKey]: true;
37
+ } | NativePropType | EpPropInput<any, any, any, any, any>>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>> };
38
+ //#endregion
39
+ //#region src/packages/utils/vue/props/types.d.ts
40
+ type Value<T> = T[keyof T];
41
+ /**
42
+ * Extract the type of a single prop
43
+ *
44
+ * 提取单个 prop 的参数类型
45
+ *
46
+ * @example
47
+ * ExtractPropType<{ type: StringConstructor }> => string | undefined
48
+ * ExtractPropType<{ type: StringConstructor, required: true }> => string
49
+ * ExtractPropType<{ type: BooleanConstructor }> => boolean
50
+ */
51
+ type ExtractPropType<T extends object> = Value<ExtractPropTypes<{
52
+ key: T;
53
+ }>>;
54
+ /**
55
+ * Extracts types via `ExtractPropTypes`, accepting `PropType<T>`, `XXXConstructor`, `never`...
56
+ *
57
+ * 通过 `ExtractPropTypes` 提取类型,接受 `PropType<T>`、`XXXConstructor`、`never`...
58
+ *
59
+ * @example
60
+ * ResolvePropType<BooleanConstructor> => boolean
61
+ * ResolvePropType<PropType<T>> => T
62
+ **/
63
+ type ResolvePropType<T> = IfNever<T, never, ExtractPropType<{
64
+ type: WritableArray<T>;
65
+ required: true;
66
+ }>>;
67
+ /**
68
+ * Merge Type, Value, Validator types
69
+ * 合并 Type、Value、Validator 的类型
70
+ *
71
+ * @example
72
+ * EpPropMergeType<StringConstructor, '1', 1> => 1 | "1" // ignores StringConstructor
73
+ * EpPropMergeType<StringConstructor, never, number> => string | number
74
+ */
75
+ type EpPropMergeType<Type, Value, Validator> = IfNever<UnknownToNever<Value>, ResolvePropType<Type>, never> | UnknownToNever<Value> | UnknownToNever<Validator>;
76
+ /**
77
+ * Handling default values for input (constraints)
78
+ *
79
+ * 处理输入参数的默认值(约束)
80
+ */
81
+ type EpPropInputDefault<Required extends boolean, Default> = Required extends true ? never : Default extends Record<string, unknown> | Array<any> ? () => Default : (() => Default) | Default;
82
+ /**
83
+ * Native prop types, e.g: `BooleanConstructor`, `StringConstructor`, `null`, `undefined`, etc.
84
+ *
85
+ * 原生 prop `类型,BooleanConstructor`、`StringConstructor`、`null`、`undefined` 等
86
+ */
87
+ type NativePropType = ((...args: any) => any) | {
88
+ new (...args: any): any;
89
+ } | undefined | null;
90
+ type IfNativePropType<T, Y, N> = [T] extends [NativePropType] ? Y : N;
91
+ /**
92
+ * input prop `buildProp` or `buildProps` (constraints)
93
+ *
94
+ * prop 输入参数(约束)
95
+ *
96
+ * @example
97
+ * EpPropInput<StringConstructor, 'a', never, never, true>
98
+ * ⬇️
99
+ * {
100
+ type?: StringConstructor | undefined;
101
+ required?: true | undefined;
102
+ values?: readonly "a"[] | undefined;
103
+ validator?: ((val: any) => boolean) | ((val: any) => val is never) | undefined;
104
+ default?: undefined;
105
+ }
106
+ */
107
+ type EpPropInput<Type, Value, Validator, Default extends EpPropMergeType<Type, Value, Validator>, Required extends boolean> = {
108
+ type?: Type;
109
+ required?: Required;
110
+ values?: readonly Value[];
111
+ validator?: ((val: any) => val is Validator) | ((val: any) => boolean);
112
+ default?: EpPropInputDefault<Required, Default>;
113
+ };
114
+ /**
115
+ * output prop `buildProp` or `buildProps`.
116
+ *
117
+ * prop 输出参数。
118
+ *
119
+ * @example
120
+ * EpProp<'a', 'b', true>
121
+ * ⬇️
122
+ * {
123
+ readonly type: PropType<"a">;
124
+ readonly required: true;
125
+ readonly validator: ((val: unknown) => boolean) | undefined;
126
+ readonly default: "b";
127
+ __epPropKey: true;
128
+ }
129
+ */
130
+ type EpProp<Type, Default, Required> = {
131
+ readonly type: PropType<Type>;
132
+ readonly required: [Required] extends [true] ? true : false;
133
+ readonly validator: ((val: unknown) => boolean) | undefined;
134
+ [epPropKey]: true;
135
+ } & IfNever<Default, unknown, {
136
+ readonly default: Default;
137
+ }>;
138
+ /**
139
+ * Determine if it is `EpProp`
140
+ */
141
+ type IfEpProp<T, Y, N> = T extends {
142
+ [epPropKey]: true;
143
+ } ? Y : N;
144
+ /**
145
+ * Converting input to output.
146
+ *
147
+ * 将输入转换为输出
148
+ */
149
+ type EpPropConvert<Input> = Input extends EpPropInput<infer Type, infer Value, infer Validator, any, infer Required> ? EpPropFinalized<Type, Value, Validator, Input['default'], Required> : never;
150
+ /**
151
+ * Finalized conversion output
152
+ *
153
+ * 最终转换 EpProp
154
+ */
155
+ type EpPropFinalized<Type, Value, Validator, Default, Required> = EpProp<EpPropMergeType<Type, Value, Validator>, UnknownToNever<Default>, Required>;
156
+ //#endregion
157
+ export { IfNever as _, EpPropInputDefault as a, Writable as b, IfEpProp as c, ResolvePropType as d, buildProp as f, isEpProp as g, epPropKey as h, EpPropInput as i, IfNativePropType as l, definePropType as m, EpPropConvert as n, EpPropMergeType as o, buildProps as p, EpPropFinalized as r, ExtractPropType as s, EpProp as t, NativePropType as u, IfUnknown as v, WritableArray as x, UnknownToNever as y };
@@ -0,0 +1,15 @@
1
+ import { AppContext, Directive, EmitsOptions, Plugin, SetupContext } from "vue";
2
+
3
+ //#region src/packages/utils/vue/typescript.d.ts
4
+ type SFCWithInstall<T> = T & Plugin;
5
+ type SFCInstallWithContext<T> = SFCWithInstall<T> & {
6
+ _context: AppContext | null;
7
+ };
8
+ type EmitFn<E extends EmitsOptions> = SetupContext<E>['emit'];
9
+ //#endregion
10
+ //#region src/packages/utils/vue/install.d.ts
11
+ declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
12
+ declare const withInstallFunction: <T>(fn: T, name: string) => SFCInstallWithContext<T>;
13
+ declare const withInstallDirective: <T extends Directive>(directive: T, name: string) => SFCWithInstall<T>;
14
+ //#endregion
15
+ export { SFCInstallWithContext as a, EmitFn as i, withInstallDirective as n, SFCWithInstall as o, withInstallFunction as r, withInstall as t };
@@ -0,0 +1,74 @@
1
+ //#region src/packages/constants/aria.d.ts
2
+ declare const EVENT_CODE: {
3
+ tab: string;
4
+ enter: string;
5
+ space: string;
6
+ left: string;
7
+ up: string;
8
+ right: string;
9
+ down: string;
10
+ esc: string;
11
+ delete: string;
12
+ backspace: string;
13
+ numpadEnter: string;
14
+ pageUp: string;
15
+ pageDown: string;
16
+ home: string;
17
+ end: string;
18
+ };
19
+ //#endregion
20
+ //#region src/packages/constants/date.d.ts
21
+ declare const datePickTypes: readonly ["year", "years", "month", "months", "date", "dates", "week", "datetime", "datetimerange", "daterange", "monthrange", "yearrange"];
22
+ declare const WEEK_DAYS: readonly ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
23
+ type DatePickType = typeof datePickTypes[number];
24
+ //#endregion
25
+ //#region src/packages/constants/event.d.ts
26
+ declare const UPDATE_MODEL_EVENT = "update:modelValue";
27
+ declare const CHANGE_EVENT = "change";
28
+ declare const INPUT_EVENT = "input";
29
+ //#endregion
30
+ //#region src/packages/constants/key.d.ts
31
+ declare const INSTALLED_KEY: unique symbol;
32
+ //#endregion
33
+ //#region src/packages/constants/size.d.ts
34
+ declare const componentSizes: readonly ["", "default", "small", "large"];
35
+ type ComponentSize = typeof componentSizes[number];
36
+ declare const componentSizeMap: {
37
+ readonly large: 40;
38
+ readonly default: 32;
39
+ readonly small: 24;
40
+ };
41
+ type typeT = 'primary' | 'success' | 'info' | 'warning' | 'danger' | '';
42
+ type sizeT = 'small' | 'default' | 'large' | '';
43
+ //#endregion
44
+ //#region src/packages/constants/control.d.ts
45
+ /** 定义最小单位内容 */
46
+ type controlBaseTypeT = 'text' | 'label' | 'divider' | 'button' | 'dropdown' | 'popConfirm' | 'null' | 'content' | 'tag' | 'card' | 'echarts' | 'statistic' | 'between';
47
+ /** 表示需要绑定数据的控件,以后还会再加,包括自定义组件 */
48
+ type controlInputTypeT = 'switch' | 'upload' | 'tvVodUpload' | 'editor' | 'videoplayer' | 'select' | 'virtualizedSelect' | 'input' | 'inputNumber' | 'time' | 'date' | 'checkboxInput' | 'selectIcon' | 'map' | 'cascader' | 'tag' | 'between';
49
+ /** 定义其下还有子内容的组件 */
50
+ type controlContainerTypeT = 'tabs' | 'form' | 'buttonGroup';
51
+ type areaT = "form" | "search" | "operateButtons" | "tableButtons" | "tableLine" | "inForm" | "custom";
52
+ type modelT = "add" | "edit" | "info";
53
+ type labelPositionI = "left" | "right" | "top";
54
+ type complexT = "like" | "=" | "<>" | "NOT LIKE" | ">" | ">=" | "<" | "<=" | "FINDIN" | "IN" | "BETWEEN" | "RANGE" | "NULL";
55
+ //#endregion
56
+ //#region src/packages/constants/apidata.d.ts
57
+ type JSONValue = string | number | undefined | null | boolean | JSONValue[] | {
58
+ [key: string]: JSONValue;
59
+ };
60
+ interface infoI {
61
+ [key: string]: JSONValue;
62
+ }
63
+ //#endregion
64
+ //#region src/packages/constants/type.d.ts
65
+ type baseT = {
66
+ name: string;
67
+ label?: string;
68
+ controlType: string;
69
+ moduleName?: string;
70
+ show?: boolean;
71
+ style?: Record<string, string>;
72
+ };
73
+ //#endregion
74
+ export { EVENT_CODE as C, datePickTypes as S, CHANGE_EVENT as _, complexT as a, DatePickType as b, controlInputTypeT as c, ComponentSize as d, componentSizeMap as f, INSTALLED_KEY as g, typeT as h, areaT as i, labelPositionI as l, sizeT as m, JSONValue as n, controlBaseTypeT as o, componentSizes as p, infoI as r, controlContainerTypeT as s, baseT as t, modelT as u, INPUT_EVENT as v, WEEK_DAYS as x, UPDATE_MODEL_EVENT as y };
@@ -0,0 +1,332 @@
1
+ import * as _$vue from "vue";
2
+ import { InjectionKey } from "vue";
3
+ import { isClient, isIOS } from "@vueuse/core";
4
+ import * as _$_vue_shared0 from "@vue/shared";
5
+ import { NOOP, camelize, hyphenate, hyphenate as kebabCase, isArray as isArray$1, isDate, isFunction, isObject as isObject$1, isPlainObject, isPromise, isString as isString$1, isSymbol, toRawType } from "@vue/shared";
6
+ import { castArray as ensureArray } from "lodash-unified";
7
+ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
8
+ import { JSONValue } from "@rw-vue-framework/constants";
9
+
10
+ //#region src/packages/utils/arrays.d.ts
11
+ declare const unique: <T>(arr: T[]) => T[];
12
+ declare const uniqueBy: <T extends Record<string, any>>(arr: T[], key: keyof T) => T[];
13
+ declare const uniqueByFn: <T extends Record<string, any>>(arr: T[], compareFn: (item: T) => any) => T[];
14
+ type Many<T> = T | ReadonlyArray<T>;
15
+ /** like `_.castArray`, except falsy value returns empty array. */
16
+ declare const castArray: <T>(arr: Many<T>) => T[];
17
+ //#endregion
18
+ //#region src/packages/utils/browser.d.ts
19
+ declare const isFirefox: () => boolean;
20
+ declare const loadScript: (src: string, options?: {
21
+ async?: boolean;
22
+ charset?: string;
23
+ type?: string;
24
+ defer?: boolean;
25
+ }) => Promise<void>;
26
+ //#endregion
27
+ //#region src/packages/utils/error.d.ts
28
+ declare function throwError(scope: string, m: string): never;
29
+ declare function debugWarn(err: Error): void;
30
+ declare function debugWarn(scope: string, message: string): void;
31
+ //#endregion
32
+ //#region src/packages/utils/objects.d.ts
33
+ type Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];
34
+ declare const keysOf: <T extends object>(arr: T) => Array<keyof T>;
35
+ declare const entriesOf: <T extends object>(arr: T) => Entries<T>;
36
+ declare const hasOwn: (val: object, key: string | symbol) => key is keyof typeof val;
37
+ declare const deepMerge: <T extends Record<string, any>>(target: T, ...sources: Partial<T>[]) => T;
38
+ declare const deepMergeInPlace: <T extends Record<string, any>>(target: T, source?: Partial<T> | Record<string, any>) => T;
39
+ declare const validateObjectStructure: (data: any, requiredKeys?: string[]) => boolean;
40
+ declare const safeSet: (obj: Record<string, any>, path: string, value: any) => boolean;
41
+ declare const safeGet: (obj: Record<string, any>, path: string, defaultValue?: any) => any;
42
+ declare const getProp: <T = any>(obj: Record<string, any>, path: Arrayable<string>, defaultValue?: any) => {
43
+ value: T;
44
+ };
45
+ declare function assignmentData(initial: any, current: any): {};
46
+ declare function transDataToString(initial: any): {};
47
+ //#endregion
48
+ //#region src/packages/utils/raf.d.ts
49
+ declare const rAF: (fn: () => void) => number;
50
+ declare const cAF: (handle: number) => void;
51
+ //#endregion
52
+ //#region src/packages/utils/rand.d.ts
53
+ /**
54
+ * @deprecated Use `useId` `useIdInjection` instead
55
+ * Generate random number in range [0, 1000]
56
+ * Maybe replace with [uuid](https://www.npmjs.com/package/uuid)
57
+ */
58
+ declare const generateId: () => number;
59
+ /**
60
+ * @deprecated
61
+ * Generating a random int in range (0, max - 1)
62
+ * @param max {number}
63
+ */
64
+ declare const getRandomInt: (max: number) => number;
65
+ //#endregion
66
+ //#region src/packages/utils/strings.d.ts
67
+ /**
68
+ * fork from {@link https://github.com/sindresorhus/escape-string-regexp}
69
+ */
70
+ declare const escapeStringRegexp: (string?: string) => string;
71
+ declare const capitalize$1: <T extends string>(str: T) => Capitalize<T>;
72
+ //#endregion
73
+ //#region src/packages/utils/types.d.ts
74
+ declare const isUndefined: (val: any) => val is undefined;
75
+ declare const isBoolean: (val: any) => val is boolean;
76
+ declare const isNumber: (val: any) => val is number;
77
+ declare const isEmpty: (val: unknown) => boolean;
78
+ declare const isElement: (e: unknown) => e is Element;
79
+ declare const isPropAbsent: (prop: unknown) => prop is null | undefined;
80
+ declare const isStringNumber: (val: string) => boolean;
81
+ declare const isWindow: (val: unknown) => val is Window;
82
+ /** 增加 */
83
+ declare const isHTML: (val: string) => boolean;
84
+ declare const isComponent: (val: any) => boolean;
85
+ declare const renderTemplate: (template: string, data: any) => string;
86
+ declare const stringToArray: (value: string) => string[];
87
+ //#endregion
88
+ //#region src/packages/utils/typescript.d.ts
89
+ declare const mutable: <T extends readonly any[] | Record<string, unknown>>(val: T) => Mutable<typeof val>;
90
+ type Mutable<T> = { -readonly [P in keyof T]: T[P] };
91
+ type HTMLElementCustomized<T> = HTMLElement & T;
92
+ /**
93
+ * @deprecated stop to use null
94
+ * @see {@link https://github.com/sindresorhus/meta/discussions/7}
95
+ */
96
+ type Nullable<T> = T | null;
97
+ type Arrayable<T> = T | T[];
98
+ type Awaitable<T> = Promise<T> | T;
99
+ //#endregion
100
+ //#region src/packages/utils/throttleByRaf.d.ts
101
+ declare function throttleByRaf(cb: (...args: any[]) => void): {
102
+ (...args: any[]): void;
103
+ cancel(): void;
104
+ };
105
+ //#endregion
106
+ //#region src/packages/utils/easings.d.ts
107
+ declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
108
+ //#endregion
109
+ //#region src/packages/utils/http.d.ts
110
+ declare module 'axios' {
111
+ interface AxiosRequestConfig {
112
+ cache?: boolean;
113
+ useQueue?: boolean;
114
+ _retryCount?: number;
115
+ }
116
+ }
117
+ interface HttpPlugin {
118
+ name: string;
119
+ onRequest?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig | Promise<InternalAxiosRequestConfig>;
120
+ onResponse?: (response: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>;
121
+ onError?: (error: any) => any;
122
+ }
123
+ interface ResponseHandlerConfig {
124
+ successCodes?: number[];
125
+ reloginCodes?: number[];
126
+ loginPath?: string | (() => string);
127
+ redirectCodes?: {
128
+ [code: number]: string;
129
+ };
130
+ customHandlers?: {
131
+ [code: number]: (data: any, response: AxiosResponse) => any;
132
+ };
133
+ reLogin?: () => void;
134
+ routerPush?: (path: string) => void;
135
+ showMessage?: (message: string, type?: 'success' | 'error' | 'warning' | 'info') => void;
136
+ }
137
+ interface HttpConfig extends AxiosRequestConfig {
138
+ init?: boolean;
139
+ baseURL?: string;
140
+ repeatPost?: boolean;
141
+ repeatPostTime?: number;
142
+ showError?: boolean;
143
+ autoRelogin?: boolean;
144
+ isDebug?: boolean;
145
+ responseHandler?: ResponseHandlerConfig;
146
+ encrypt?: boolean;
147
+ encryptOptions?: {
148
+ encryptKey?: string;
149
+ encryptFunc?: (data: any, key: string) => any;
150
+ decryptFunc?: (data: any, key: string) => any;
151
+ };
152
+ defaultParams?: {
153
+ [key: string]: any;
154
+ };
155
+ errorHandler?: () => void;
156
+ reloginHandler?: () => Promise<boolean>;
157
+ plugins?: HttpPlugin[];
158
+ }
159
+ /**
160
+ * HTTP 请求类 - 单例模式实现
161
+ */
162
+ declare class Http {
163
+ private static instance;
164
+ private static domainInstances;
165
+ axiosInstance: AxiosInstance;
166
+ config: HttpConfig;
167
+ private plugins;
168
+ /**
169
+ * 私有构造函数,防止外部直接实例化
170
+ */
171
+ private constructor();
172
+ /**
173
+ * 获取单例实例
174
+ */
175
+ static getInstance(config?: HttpConfig): Http;
176
+ /**
177
+ * 获取指定域名的实例
178
+ * @param domain 域名
179
+ * @param config 配置
180
+ */
181
+ static getDomainInstance(domain: string, config?: HttpConfig): Http;
182
+ /**
183
+ * 创建新的 HTTP 实例(用于特殊需求)
184
+ */
185
+ static createInstance(config?: HttpConfig): Http;
186
+ /**
187
+ * 重新配置实例
188
+ */
189
+ reconfigure(config: HttpConfig): void;
190
+ /**
191
+ * 注册内置插件
192
+ */
193
+ private registerBuiltinPlugins;
194
+ /**
195
+ * 注册插件
196
+ */
197
+ use(...plugins: HttpPlugin[]): Http;
198
+ /**
199
+ * 设置拦截器
200
+ */
201
+ private setupInterceptors;
202
+ /**
203
+ * 创建防重复提交插件
204
+ */
205
+ private createRepeatPostPlugin;
206
+ /**
207
+ * 创建错误处理插件
208
+ */
209
+ private createErrorHandlerPlugin;
210
+ /**
211
+ * 创建重新登录插件
212
+ */
213
+ private createReloginPlugin;
214
+ /**
215
+ * 创建调试插件
216
+ */
217
+ private createDebugPlugin;
218
+ /**
219
+ * 创建统一响应处理插件
220
+ */
221
+ private createResponseHandlerPlugin;
222
+ /**
223
+ * 检查是否重复提交
224
+ */
225
+ private isRepeatPost;
226
+ /**
227
+ * GET 请求
228
+ * @param url 请求路径
229
+ * @param params 请求参数
230
+ * @param config 请求配置
231
+ * @param domain 可选的域名,如果提供则使用该域名发送请求
232
+ */
233
+ get<T = any>(url: string, params?: {}, config?: {}, domain?: string): Promise<T>;
234
+ /**
235
+ * POST 请求
236
+ * @param url 请求路径
237
+ * @param data 请求数据
238
+ * @param config 请求配置
239
+ * @param domain 可选的域名,如果提供则使用该域名发送请求
240
+ */
241
+ post<T = any>(url: string, data?: {}, config?: {}, domain?: string): Promise<T>;
242
+ /**
243
+ * PUT 请求
244
+ * @param url 请求路径
245
+ * @param data 请求数据
246
+ * @param config 请求配置
247
+ * @param domain 可选的域名,如果提供则使用该域名发送请求
248
+ */
249
+ put<T = any>(url: string, data?: {}, config?: {}, domain?: string): Promise<T>;
250
+ /**
251
+ * DELETE 请求
252
+ * @param url 请求路径
253
+ * @param config 请求配置
254
+ * @param domain 可选的域名,如果提供则使用该域名发送请求
255
+ */
256
+ delete<T = any>(url: string, config?: {}, domain?: string): Promise<T>;
257
+ /**
258
+ * 直接请求特定域名
259
+ * @param domain 域名
260
+ */
261
+ domain(domain: string): Http;
262
+ /**
263
+ * 添加请求取消功能
264
+ */
265
+ /**
266
+ * 文件上传请求
267
+ */
268
+ upload<T = any>(url: string, file: File | FormData, config?: {}, domain?: string): Promise<T>;
269
+ /**
270
+ * 文件下载请求
271
+ */
272
+ download(url: string, params?: {}, config?: {}, domain?: string): Promise<Blob>;
273
+ }
274
+ declare const http: Http;
275
+ declare const initHttp: (HttpConfig: any) => void;
276
+ declare const useHttp: () => Http;
277
+ //#endregion
278
+ //#region src/packages/utils/encrypt.d.ts
279
+ declare function rwEncode(data: JSONValue, privateKey?: any): any;
280
+ declare function rwDecode(data: string, privateKey?: any, showError?: boolean): any;
281
+ declare const md5: (sourceString: string | object) => string;
282
+ //#endregion
283
+ //#region src/packages/utils/loadConfig.d.ts
284
+ declare const loadConfig: () => Promise<{
285
+ appconfig: boolean;
286
+ }>;
287
+ //#endregion
288
+ //#region src/packages/utils/exportExcel.d.ts
289
+ declare function exportExcel(structName: string, data: Record<string, any>[], columns: any[]): void;
290
+ declare const exportExcelAll: (url: string, postData: any, config: any) => void;
291
+ //#endregion
292
+ //#region src/packages/utils/mapUtils.d.ts
293
+ declare function gcj02ToBd09(lng: number, lat: number): number[];
294
+ declare function bd09ToGcj02(bd_lon: number, bd_lat: number): number[];
295
+ //#endregion
296
+ //#region src/packages/utils/formData.d.ts
297
+ type NestedKeyOf<T> = { [K in keyof T & (string | number)]: T[K] extends Record<string, any> ? `${K}` | `${K}.${NestedKeyOf<T[K]>}` : `${K}` }[keyof T & (string | number)];
298
+ type PathValue<T, P extends string> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? PathValue<T[K], Rest> : never : P extends keyof T ? T[P] : never;
299
+ interface FormData$1<T = Record<string, any>> {
300
+ formId: string;
301
+ data: T;
302
+ setFieldValue: <P extends string>(field: P, value: PathValue<T, P>) => void;
303
+ getFieldValue: <P extends string>(field: P) => PathValue<T, P> | undefined;
304
+ setFieldsValue: (values: Partial<T>) => void;
305
+ getFieldsValue: () => T;
306
+ deleteField: (field: string) => void;
307
+ hasField: (field: string) => boolean;
308
+ validate: () => Promise<boolean>;
309
+ }
310
+ declare class PathUtils {
311
+ private static cache;
312
+ static parsePath(path: string): string[];
313
+ static getValue(obj: any, path: string): any;
314
+ static setValue(obj: any, path: string, value: any): void;
315
+ static deleteValue(obj: any, path: string): boolean;
316
+ static hasValue(obj: any, path: string): boolean;
317
+ }
318
+ declare function createFormData<T extends Record<string, any>>(formId: string, initialData?: T): FormData$1<T>;
319
+ declare function useFormField<T = any>(fieldName: string): {
320
+ value: [T | undefined] extends [_$vue.Ref<any, any>] ? _$_vue_shared0.IfAny<_$vue.Ref<any, any> & T, _$vue.Ref<_$vue.Ref<any, any> & T, _$vue.Ref<any, any> & T>, _$vue.Ref<any, any> & T> : _$vue.Ref<_$vue.UnwrapRef<T> | undefined, T | _$vue.UnwrapRef<T> | undefined>;
321
+ hasValue: _$vue.Ref<boolean, boolean>;
322
+ deleteField: () => void;
323
+ setField: (value: T) => void;
324
+ } | {
325
+ value: _$vue.WritableComputedRef<T | undefined, T | undefined>;
326
+ hasValue: _$vue.ComputedRef<boolean>;
327
+ deleteField: () => void;
328
+ setField: (value: T) => void;
329
+ };
330
+ declare const FormDataKey: InjectionKey<FormData$1>;
331
+ //#endregion
332
+ export { escapeStringRegexp as $, mutable as A, isObject$1 as B, easeInOutCubic as C, isIOS as Ct, HTMLElementCustomized as D, unique as Dt, Awaitable as E, ensureArray as Et, isElement as F, isStringNumber as G, isPromise as H, isEmpty as I, isWindow as J, isSymbol as K, isFunction as L, isBoolean as M, isComponent as N, Mutable as O, uniqueBy as Ot, isDate as P, capitalize$1 as Q, isHTML as R, useHttp as S, isFirefox as St, Arrayable as T, castArray as Tt, isPropAbsent as U, isPlainObject as V, isString$1 as W, stringToArray as X, renderTemplate as Y, camelize as Z, HttpConfig as _, NOOP as _t, PathValue as a, rAF as at, http as b, throwError as bt, bd09ToGcj02 as c, deepMergeInPlace as ct, exportExcelAll as d, hasOwn as dt, hyphenate as et, loadConfig as f, keysOf as ft, Http as g, validateObjectStructure as gt, rwEncode as h, transDataToString as ht, PathUtils as i, cAF as it, isArray$1 as j, Nullable as k, uniqueByFn as kt, gcj02ToBd09 as l, entriesOf as lt, rwDecode as m, safeSet as mt, FormDataKey as n, generateId as nt, createFormData as o, assignmentData as ot, md5 as p, safeGet as pt, isUndefined as q, NestedKeyOf as r, getRandomInt as rt, useFormField as s, deepMerge as st, FormData$1 as t, kebabCase as tt, exportExcel as u, getProp as ut, HttpPlugin as v, toRawType as vt, throttleByRaf as w, loadScript as wt, initHttp as x, isClient as xt, ResponseHandlerConfig as y, debugWarn as yt, isNumber as z };
@@ -0,0 +1,10 @@
1
+ import * as _$vue from "vue";
2
+
3
+ //#region src/packages/controls/MyButton/MyButton.vue.d.ts
4
+ type __VLS_Props = {
5
+ type?: 'primary';
6
+ };
7
+ declare const __VLS_export: _$vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
9
+ //#endregion
10
+ export { _default as t };