@aplus-frontend/ui 0.0.1-beta.5 → 0.0.1-beta.6

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 (127) hide show
  1. package/es/index.mjs +86 -65
  2. package/es/src/ap-field/checkbox/helper.mjs +5 -0
  3. package/es/src/ap-field/checkbox/index.vue.d.ts +39 -0
  4. package/es/src/ap-field/checkbox/index.vue.mjs +56 -0
  5. package/es/src/ap-field/checkbox/index.vue2.mjs +4 -0
  6. package/es/src/ap-field/date/constant.mjs +50 -0
  7. package/es/src/ap-field/date/helper.d.ts +2 -0
  8. package/es/src/ap-field/date/helper.mjs +10 -0
  9. package/es/src/ap-field/date/index.vue.d.ts +57 -0
  10. package/es/src/ap-field/date/index.vue.mjs +75 -0
  11. package/es/src/ap-field/date/index.vue2.mjs +4 -0
  12. package/es/src/ap-field/date-range/index.vue.d.ts +59 -0
  13. package/es/src/ap-field/date-range/index.vue.mjs +87 -0
  14. package/es/src/ap-field/date-range/index.vue2.mjs +4 -0
  15. package/es/src/ap-field/index.d.ts +9 -3
  16. package/es/src/ap-field/interface.d.ts +64 -5
  17. package/es/src/ap-field/number/helper.d.ts +1 -0
  18. package/es/src/ap-field/number/helper.mjs +14 -0
  19. package/es/src/ap-field/number/index.vue.d.ts +72 -0
  20. package/es/src/ap-field/number/index.vue.mjs +108 -0
  21. package/es/src/ap-field/number/index.vue2.mjs +4 -0
  22. package/es/src/ap-field/number/style.css +6 -0
  23. package/es/src/ap-field/radio/helper.d.ts +4 -0
  24. package/es/src/ap-field/radio/helper.mjs +5 -0
  25. package/es/src/ap-field/radio/index.vue.d.ts +40 -0
  26. package/es/src/ap-field/radio/index.vue.mjs +68 -0
  27. package/es/src/ap-field/radio/index.vue2.mjs +4 -0
  28. package/es/src/ap-field/select/index.vue.d.ts +235 -0
  29. package/es/src/ap-field/select/index.vue.mjs +114 -0
  30. package/es/src/ap-field/select/index.vue2.mjs +4 -0
  31. package/es/src/ap-field/switch/index.vue.d.ts +54 -0
  32. package/es/src/ap-field/switch/index.vue.mjs +93 -0
  33. package/es/src/ap-field/switch/index.vue2.mjs +4 -0
  34. package/es/src/ap-field/text/index.vue.d.ts +63 -0
  35. package/es/src/ap-field/text/index.vue.mjs +132 -0
  36. package/es/src/ap-field/text/index.vue2.mjs +4 -0
  37. package/es/src/ap-field/text-area/index.vue.d.ts +49 -0
  38. package/es/src/ap-field/text-area/index.vue.mjs +86 -0
  39. package/es/src/ap-field/text-area/index.vue2.mjs +4 -0
  40. package/es/src/ap-field/text-area/style.css +5 -0
  41. package/es/src/ap-form/index.d.ts +12 -12
  42. package/es/src/basic/help.vue.d.ts +1 -1
  43. package/es/src/basic/index.d.ts +3 -3
  44. package/es/src/config-provider/config-provider.d.ts +2 -2
  45. package/es/src/config-provider/index.d.ts +6 -6
  46. package/es/src/design-token/index.d.ts +4 -0
  47. package/es/src/design-token/index.mjs +59 -0
  48. package/es/src/index.d.ts +2 -0
  49. package/es/src/index.mjs +104 -83
  50. package/es/src/modal/basic.vue.d.ts +1 -1
  51. package/es/src/modal/components/modal-footer.vue.d.ts +1 -1
  52. package/es/src/modal/components/modal.d.ts +1 -1
  53. package/es/src/modal/index.d.ts +3 -3
  54. package/es/src/pro-form/components/api-transfer.vue.d.ts +1 -1
  55. package/es/src/pro-form/hooks/use-form-events.mjs +22 -22
  56. package/es/src/pro-form/hooks/use-form-values.mjs +12 -12
  57. package/es/src/pro-form/hooks/use-label-width.d.ts +3 -3
  58. package/es/src/pro-form/pro-form.vue.mjs +23 -23
  59. package/es/src/pro-table/hooks/use-columns.mjs +24 -24
  60. package/es/src/theme/ap-field/number.css +6 -0
  61. package/es/src/theme/ap-field/text-area.css +5 -0
  62. package/es/src/type.d.ts +3 -1
  63. package/es/src/utils/index.d.ts +7 -0
  64. package/lib/index.js +1 -1
  65. package/lib/src/ap-field/checkbox/helper.js +1 -0
  66. package/lib/src/ap-field/checkbox/index.vue.d.ts +39 -0
  67. package/lib/src/ap-field/checkbox/index.vue.js +1 -0
  68. package/lib/src/ap-field/checkbox/index.vue2.js +1 -0
  69. package/lib/src/ap-field/date/constant.js +1 -0
  70. package/lib/src/ap-field/date/helper.d.ts +2 -0
  71. package/lib/src/ap-field/date/helper.js +1 -0
  72. package/lib/src/ap-field/date/index.vue.d.ts +57 -0
  73. package/lib/src/ap-field/date/index.vue.js +1 -0
  74. package/lib/src/ap-field/date/index.vue2.js +1 -0
  75. package/lib/src/ap-field/date-range/index.vue.d.ts +59 -0
  76. package/lib/src/ap-field/date-range/index.vue.js +1 -0
  77. package/lib/src/ap-field/date-range/index.vue2.js +1 -0
  78. package/lib/src/ap-field/index.d.ts +9 -3
  79. package/lib/src/ap-field/interface.d.ts +64 -5
  80. package/lib/src/ap-field/number/helper.d.ts +1 -0
  81. package/lib/src/ap-field/number/helper.js +1 -0
  82. package/lib/src/ap-field/number/index.vue.d.ts +72 -0
  83. package/lib/src/ap-field/number/index.vue.js +1 -0
  84. package/lib/src/ap-field/number/index.vue2.js +1 -0
  85. package/lib/src/ap-field/number/style.css +6 -0
  86. package/lib/src/ap-field/radio/helper.d.ts +4 -0
  87. package/lib/src/ap-field/radio/helper.js +1 -0
  88. package/lib/src/ap-field/radio/index.vue.d.ts +40 -0
  89. package/lib/src/ap-field/radio/index.vue.js +1 -0
  90. package/lib/src/ap-field/radio/index.vue2.js +1 -0
  91. package/lib/src/ap-field/select/index.vue.d.ts +235 -0
  92. package/lib/src/ap-field/select/index.vue.js +1 -0
  93. package/lib/src/ap-field/select/index.vue2.js +1 -0
  94. package/lib/src/ap-field/switch/index.vue.d.ts +54 -0
  95. package/lib/src/ap-field/switch/index.vue.js +1 -0
  96. package/lib/src/ap-field/switch/index.vue2.js +1 -0
  97. package/lib/src/ap-field/text/index.vue.d.ts +63 -0
  98. package/lib/src/ap-field/text/index.vue.js +1 -0
  99. package/lib/src/ap-field/text/index.vue2.js +1 -0
  100. package/lib/src/ap-field/text-area/index.vue.d.ts +49 -0
  101. package/lib/src/ap-field/text-area/index.vue.js +1 -0
  102. package/lib/src/ap-field/text-area/index.vue2.js +1 -0
  103. package/lib/src/ap-field/text-area/style.css +5 -0
  104. package/lib/src/ap-form/index.d.ts +12 -12
  105. package/lib/src/basic/help.vue.d.ts +1 -1
  106. package/lib/src/basic/index.d.ts +3 -3
  107. package/lib/src/config-provider/config-provider.d.ts +2 -2
  108. package/lib/src/config-provider/index.d.ts +6 -6
  109. package/lib/src/design-token/index.d.ts +4 -0
  110. package/lib/src/design-token/index.js +1 -0
  111. package/lib/src/index.d.ts +2 -0
  112. package/lib/src/index.js +1 -1
  113. package/lib/src/modal/basic.vue.d.ts +1 -1
  114. package/lib/src/modal/components/modal-footer.vue.d.ts +1 -1
  115. package/lib/src/modal/components/modal.d.ts +1 -1
  116. package/lib/src/modal/index.d.ts +3 -3
  117. package/lib/src/pro-form/components/api-transfer.vue.d.ts +1 -1
  118. package/lib/src/pro-form/hooks/use-form-events.js +1 -1
  119. package/lib/src/pro-form/hooks/use-form-values.js +1 -1
  120. package/lib/src/pro-form/hooks/use-label-width.d.ts +3 -3
  121. package/lib/src/pro-form/pro-form.vue.js +1 -1
  122. package/lib/src/pro-table/hooks/use-columns.js +1 -1
  123. package/lib/src/theme/ap-field/number.css +6 -0
  124. package/lib/src/theme/ap-field/text-area.css +5 -0
  125. package/lib/src/type.d.ts +3 -1
  126. package/lib/src/utils/index.d.ts +7 -0
  127. package/package.json +2 -2
package/es/index.mjs CHANGED
@@ -1,34 +1,34 @@
1
1
  import * as e from "./src/index.mjs";
2
- import { useMessage as f } from "./src/hooks/useMessage.mjs";
3
- import { useControllableValue as l } from "./src/hooks/useControllableValue.mjs";
2
+ import { useMessage as l } from "./src/hooks/useMessage.mjs";
3
+ import { useControllableValue as n } from "./src/hooks/useControllableValue.mjs";
4
4
  import { Icon as m, SvgIcon as x } from "./src/icon/index.mjs";
5
5
  import { configProviderProps as u } from "./src/config-provider/config-provider-props.mjs";
6
6
  import { configProviderContextKey as T, tableDefaultConfig as C } from "./src/config-provider/constants.mjs";
7
- import { keysOf as A, provideGlobalConfig as b, useGlobalConfig as g } from "./src/config-provider/hooks/use-global-config.mjs";
8
- import { buildLocaleContext as P, buildTranslator as B, localeContextKey as I, translate as F, useLocale as M } from "./src/config-provider/hooks/use-locale.mjs";
9
- import { defaultNamespace as G, namespaceContextKey as D, useGetDerivedNamespace as X, useNamespace as h } from "./src/config-provider/hooks/use-namespace.mjs";
10
- import { ConfigProvider as y } from "./src/config-provider/config-provider.mjs";
11
- import { APConfigProvider as E } from "./src/config-provider/index.mjs";
12
- import { Scrollbar as N } from "./src/scroll-bar/index.mjs";
7
+ import { keysOf as S, provideGlobalConfig as F, useGlobalConfig as b } from "./src/config-provider/hooks/use-global-config.mjs";
8
+ import { buildLocaleContext as v, buildTranslator as P, localeContextKey as B, translate as I, useLocale as R } from "./src/config-provider/hooks/use-locale.mjs";
9
+ import { defaultNamespace as M, namespaceContextKey as h, useGetDerivedNamespace as G, useNamespace as k } from "./src/config-provider/hooks/use-namespace.mjs";
10
+ import { ConfigProvider as X } from "./src/config-provider/config-provider.mjs";
11
+ import { APConfigProvider as N } from "./src/config-provider/index.mjs";
12
+ import { Scrollbar as E } from "./src/scroll-bar/index.mjs";
13
13
  import { CollapseContainer as H, ScrollContainer as L } from "./src/container/index.mjs";
14
14
  import { IconPicker as O } from "./src/icon-picker/index.mjs";
15
15
  import { default as $ } from "./src/locale/lang/zh-cn.mjs";
16
16
  import { default as q } from "./src/locale/lang/en.mjs";
17
17
  import { BasicArrow as Q, BasicHelp as U, BasicTitle as W } from "./src/basic/index.mjs";
18
18
  import { default as _ } from "./src/transition/collapse-transition.vue.mjs";
19
- import { ExpandTransition as eo, ExpandXTransition as ro, FadeTransition as to, ScaleRotateTransition as ao, ScaleTransition as no, ScrollXReverseTransition as po, ScrollXTransition as fo, ScrollYReverseTransition as io, ScrollYTransition as lo, SlideXReverseTransition as so, SlideXTransition as mo, SlideYReverseTransition as xo, SlideYTransition as uo } from "./src/transition/index.mjs";
19
+ import { ExpandTransition as eo, ExpandXTransition as ro, FadeTransition as to, ScaleRotateTransition as ao, ScaleTransition as po, ScrollXReverseTransition as fo, ScrollXTransition as lo, ScrollYReverseTransition as io, ScrollYTransition as no, SlideXReverseTransition as so, SlideXTransition as mo, SlideYReverseTransition as xo, SlideYTransition as uo } from "./src/transition/index.mjs";
20
20
  import { useDescription as To } from "./src/description/use-description.mjs";
21
- import { Description as So } from "./src/description/index.mjs";
22
- import { useForm as bo } from "./src/pro-form/hooks/use-form.mjs";
23
- import { isComponentFormSchema as vo, isSlotFormSchema as Po } from "./src/pro-form/types/form.mjs";
24
- import { Field as Io } from "./src/pro-form/index.mjs";
25
- import { default as Mo } from "./src/pro-form/components/api-cascader.vue.mjs";
26
- import { default as Go } from "./src/pro-form/components/api-radio-group.vue.mjs";
27
- import { default as Xo } from "./src/pro-form/components/api-select.vue.mjs";
21
+ import { Description as Ao } from "./src/description/index.mjs";
22
+ import { useForm as Fo } from "./src/pro-form/hooks/use-form.mjs";
23
+ import { isComponentFormSchema as go, isSlotFormSchema as vo } from "./src/pro-form/types/form.mjs";
24
+ import { Field as Bo } from "./src/pro-form/index.mjs";
25
+ import { default as Ro } from "./src/pro-form/components/api-cascader.vue.mjs";
26
+ import { default as Mo } from "./src/pro-form/components/api-radio-group.vue.mjs";
27
+ import { default as Go } from "./src/pro-form/components/api-select.vue.mjs";
28
28
  import { default as wo } from "./src/pro-form/components/api-transfer.vue.mjs";
29
- import { default as Yo } from "./src/pro-form/components/api-tree.vue.mjs";
30
- import { default as Ko } from "./src/pro-form/components/radio-button-group.vue.mjs";
31
- import { default as ko } from "./src/pro-form/pro-form.vue.mjs";
29
+ import { default as yo } from "./src/pro-form/components/api-tree.vue.mjs";
30
+ import { default as Yo } from "./src/pro-form/components/radio-button-group.vue.mjs";
31
+ import { default as Ko } from "./src/pro-form/pro-form.vue.mjs";
32
32
  import { default as Lo } from "./src/pro-form/components/api-tree-select.vue.mjs";
33
33
  import { default as Oo } from "./src/base-button/modal-button.vue.mjs";
34
34
  import { default as $o } from "./src/base-button/pop-confirm-button.vue.mjs";
@@ -37,16 +37,26 @@ import { StrengthMeter as Qo } from "./src/strength-meter/index.mjs";
37
37
  import { useModalContext as Wo } from "./src/modal/hooks/use-modal-context.mjs";
38
38
  import { useModal as _o, useModalInner as oe } from "./src/modal/hooks/use-modal.mjs";
39
39
  import { BaseModal as re } from "./src/modal/index.mjs";
40
- import { CropperAvatar as ae, CropperImage as ne } from "./src/cropper/index.mjs";
41
- import { CountdownButton as fe, CountdownInput as ie } from "./src/count-down/index.mjs";
40
+ import { CropperAvatar as ae, CropperImage as pe } from "./src/cropper/index.mjs";
41
+ import { CountdownButton as le, CountdownInput as ie } from "./src/count-down/index.mjs";
42
42
  import { createPrompt as se } from "./src/prompt/index.mjs";
43
43
  import { Dropdown as xe } from "./src/dropdown/index.mjs";
44
44
  import { default as ue } from "./src/pro-table/pro-table.vue.mjs";
45
45
  import { default as Te } from "./src/pro-table/components/table-action.vue.mjs";
46
- import { default as Se } from "./src/pro-table/components/edit-table-header-icon.vue.mjs";
47
- import { default as be } from "./src/pro-table/components/table-image.vue.mjs";
48
- import { useTable as ve } from "./src/pro-table/hooks/use-table.mjs";
49
- import { ApForm as Be, ApFormItem as Ie, ApFormItemGroup as Fe } from "./src/ap-form/index.mjs";
46
+ import { default as Ae } from "./src/pro-table/components/edit-table-header-icon.vue.mjs";
47
+ import { default as Fe } from "./src/pro-table/components/table-image.vue.mjs";
48
+ import { useTable as ge } from "./src/pro-table/hooks/use-table.mjs";
49
+ import { ApForm as Pe, ApFormItem as Be, ApFormItemGroup as Ie } from "./src/ap-form/index.mjs";
50
+ import { default as De } from "./src/ap-field/text/index.vue.mjs";
51
+ import { default as he } from "./src/ap-field/checkbox/index.vue.mjs";
52
+ import { default as ke } from "./src/ap-field/date/index.vue.mjs";
53
+ import { default as Xe } from "./src/ap-field/number/index.vue.mjs";
54
+ import { default as Ne } from "./src/ap-field/radio/index.vue.mjs";
55
+ import { default as Ee } from "./src/ap-field/switch/index.vue.mjs";
56
+ import { default as He } from "./src/ap-field/text-area/index.vue.mjs";
57
+ import { default as ze } from "./src/ap-field/date-range/index.vue.mjs";
58
+ import { default as Ve } from "./src/ap-field/select/index.vue.mjs";
59
+ import { adminToken as je, aplusToken as qe } from "./src/design-token/index.mjs";
50
60
  const a = {
51
61
  install: (r) => {
52
62
  for (const t in e) {
@@ -56,15 +66,24 @@ const a = {
56
66
  }
57
67
  };
58
68
  export {
59
- E as APConfigProvider,
60
- Be as ApForm,
61
- Ie as ApFormItem,
62
- Fe as ApFormItemGroup,
63
- Mo as ApiCascader,
64
- Go as ApiRadioGroup,
65
- Xo as ApiSelect,
69
+ N as APConfigProvider,
70
+ he as ApFieldCheckbox,
71
+ ke as ApFieldDate,
72
+ ze as ApFieldDateRange,
73
+ Xe as ApFieldNumber,
74
+ Ne as ApFieldRadio,
75
+ Ve as ApFieldSelect,
76
+ Ee as ApFieldSwitch,
77
+ De as ApFieldText,
78
+ He as ApFieldTextArea,
79
+ Pe as ApForm,
80
+ Be as ApFormItem,
81
+ Ie as ApFormItemGroup,
82
+ Ro as ApiCascader,
83
+ Mo as ApiRadioGroup,
84
+ Go as ApiSelect,
66
85
  wo as ApiTransfer,
67
- Yo as ApiTree,
86
+ yo as ApiTree,
68
87
  Lo as ApiTreeSelect,
69
88
  qo as BaseButton,
70
89
  re as BaseModal,
@@ -73,33 +92,33 @@ export {
73
92
  W as BasicTitle,
74
93
  H as CollapseContainer,
75
94
  _ as CollapseTransition,
76
- y as ConfigProvider,
77
- fe as CountdownButton,
95
+ X as ConfigProvider,
96
+ le as CountdownButton,
78
97
  ie as CountdownInput,
79
98
  ae as CropperAvatar,
80
- ne as CropperImage,
81
- So as Description,
99
+ pe as CropperImage,
100
+ Ao as Description,
82
101
  xe as Dropdown,
83
- Se as EditTableHeaderIcon,
102
+ Ae as EditTableHeaderIcon,
84
103
  eo as ExpandTransition,
85
104
  ro as ExpandXTransition,
86
105
  to as FadeTransition,
87
- Io as Field,
106
+ Bo as Field,
88
107
  m as Icon,
89
108
  O as IconPicker,
90
109
  Oo as ModalButton,
91
110
  $o as PopConfirmButton,
92
- ko as ProForm,
111
+ Ko as ProForm,
93
112
  ue as ProTable,
94
- Ko as RadioButtonGroup,
113
+ Yo as RadioButtonGroup,
95
114
  ao as ScaleRotateTransition,
96
- no as ScaleTransition,
115
+ po as ScaleTransition,
97
116
  L as ScrollContainer,
98
- po as ScrollXReverseTransition,
99
- fo as ScrollXTransition,
117
+ fo as ScrollXReverseTransition,
118
+ lo as ScrollXTransition,
100
119
  io as ScrollYReverseTransition,
101
- lo as ScrollYTransition,
102
- N as Scrollbar,
120
+ no as ScrollYTransition,
121
+ E as Scrollbar,
103
122
  so as SlideXReverseTransition,
104
123
  mo as SlideXTransition,
105
124
  xo as SlideYReverseTransition,
@@ -107,34 +126,36 @@ export {
107
126
  Qo as StrengthMeter,
108
127
  x as SvgIcon,
109
128
  Te as TableAction,
110
- be as TableImg,
111
- P as buildLocaleContext,
112
- B as buildTranslator,
129
+ Fe as TableImg,
130
+ je as adminToken,
131
+ qe as aplusToken,
132
+ v as buildLocaleContext,
133
+ P as buildTranslator,
113
134
  T as configProviderContextKey,
114
135
  u as configProviderProps,
115
136
  se as createPrompt,
116
137
  a as default,
117
- G as defaultNamespace,
138
+ M as defaultNamespace,
118
139
  q as en,
119
- vo as isComponentFormSchema,
120
- Po as isSlotFormSchema,
121
- A as keysOf,
122
- I as localeContextKey,
123
- D as namespaceContextKey,
124
- b as provideGlobalConfig,
140
+ go as isComponentFormSchema,
141
+ vo as isSlotFormSchema,
142
+ S as keysOf,
143
+ B as localeContextKey,
144
+ h as namespaceContextKey,
145
+ F as provideGlobalConfig,
125
146
  C as tableDefaultConfig,
126
- F as translate,
127
- l as useControllableValue,
147
+ I as translate,
148
+ n as useControllableValue,
128
149
  To as useDescription,
129
- bo as useForm,
130
- X as useGetDerivedNamespace,
131
- g as useGlobalConfig,
132
- M as useLocale,
133
- f as useMessage,
150
+ Fo as useForm,
151
+ G as useGetDerivedNamespace,
152
+ b as useGlobalConfig,
153
+ R as useLocale,
154
+ l as useMessage,
134
155
  _o as useModal,
135
156
  Wo as useModalContext,
136
157
  oe as useModalInner,
137
- h as useNamespace,
138
- ve as useTable,
158
+ k as useNamespace,
159
+ ge as useTable,
139
160
  $ as zhCn
140
161
  };
@@ -0,0 +1,5 @@
1
+ const t = (e) => typeof e == "object" ? e.value : e, o = (e) => typeof e == "object" ? e.label : e;
2
+ export {
3
+ o as getOptionLabel,
4
+ t as getOptionValue
5
+ };
@@ -0,0 +1,39 @@
1
+ import { ApFieldCheckboxProps, FieldMode } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ import { CheckboxOptionType } from 'ant-design-vue';
4
+
5
+ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldCheckboxProps>, {
6
+ emptyText: string;
7
+ mode: string;
8
+ options: () => never[];
9
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
10
+ "update:value": (...args: any[]) => void;
11
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldCheckboxProps>, {
12
+ emptyText: string;
13
+ mode: string;
14
+ options: () => never[];
15
+ }>>> & {
16
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
17
+ }, {
18
+ mode: FieldMode;
19
+ options: (string | number | CheckboxOptionType)[];
20
+ emptyText: string;
21
+ }, {}>;
22
+ export default _default;
23
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
24
+ type __VLS_TypePropsToRuntimeProps<T> = {
25
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
26
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
27
+ } : {
28
+ type: PropType<T[K]>;
29
+ required: true;
30
+ };
31
+ };
32
+ type __VLS_WithDefaults<P, D> = {
33
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
34
+ default: D[K];
35
+ }> : P[K];
36
+ };
37
+ type __VLS_Prettify<T> = {
38
+ [K in keyof T]: T[K];
39
+ } & {};
@@ -0,0 +1,56 @@
1
+ import { defineComponent as x, ref as k, onMounted as y, openBlock as o, createElementBlock as i, Fragment as p, unref as e, createTextVNode as m, toDisplayString as s, createBlock as g, mergeProps as h } from "vue";
2
+ import { isFunction as C, isNil as V } from "lodash-unified";
3
+ import { CheckboxGroup as b } from "ant-design-vue";
4
+ import "../../hooks/useMessage.mjs";
5
+ import { useControllableValue as _ } from "../../hooks/useControllableValue.mjs";
6
+ import { getOptionValue as B, getOptionLabel as T } from "./helper.mjs";
7
+ const D = /* @__PURE__ */ x({
8
+ name: "ApFieldCheckbox",
9
+ inheritAttrs: !1,
10
+ __name: "index",
11
+ props: {
12
+ mode: { default: "edit" },
13
+ defaultValue: {},
14
+ value: {},
15
+ onChange: {},
16
+ "onUpdate:value": {},
17
+ name: {},
18
+ prefixCls: {},
19
+ options: { default: () => [] },
20
+ disabled: { type: Boolean },
21
+ id: {},
22
+ emptyText: { default: "-" },
23
+ request: {}
24
+ },
25
+ emits: ["update:value"],
26
+ setup(d, { emit: f }) {
27
+ const c = f, t = d, a = k(t.options);
28
+ y(() => {
29
+ C(t.request) && t.request().then((l) => a.value = l);
30
+ });
31
+ const { value: n, updateValue: v } = _(
32
+ t,
33
+ c,
34
+ {
35
+ defaultValue: []
36
+ }
37
+ );
38
+ return (l, q) => {
39
+ var u;
40
+ return l.mode === "read" ? (o(), i(p, { key: 0 }, [
41
+ e(V)(e(n)) ? (o(), i(p, { key: 0 }, [
42
+ m(s(t.emptyText), 1)
43
+ ], 64)) : (o(), i(p, { key: 1 }, [
44
+ m(s(((u = a.value) == null ? void 0 : u.filter((r) => e(n).indexOf(e(B)(r)) > -1).map((r) => e(T)(r)).join("、")) || t.emptyText), 1)
45
+ ], 64))
46
+ ], 64)) : (o(), g(e(b), h({ key: 1 }, t, {
47
+ options: a.value,
48
+ value: e(n),
49
+ "onUpdate:value": e(v)
50
+ }), null, 16, ["options", "value", "onUpdate:value"]));
51
+ };
52
+ }
53
+ });
54
+ export {
55
+ D as default
56
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,50 @@
1
+ const Y = [
2
+ "Y",
3
+ "Y-M",
4
+ "Y-D",
5
+ "Y-h",
6
+ "Y-m",
7
+ "Y-s"
8
+ ], e = {
9
+ Y: "YYYY",
10
+ "Y-M": "YYYY-MM",
11
+ "Y-D": "YYYY-MM-DD",
12
+ "Y-h": "YYYY-MM-DD HH",
13
+ "Y-m": "YYYY-MM-DD HH:mm",
14
+ "Y-s": "YYYY-MM-DD HH:mm:ss"
15
+ }, s = {
16
+ Y: "year",
17
+ "Y-M": "month",
18
+ "Y-D": "date",
19
+ "Y-h": "date",
20
+ "Y-m": "date",
21
+ "Y-s": "date"
22
+ }, M = {
23
+ Y: {
24
+ showTime: !1
25
+ },
26
+ "Y-M": {
27
+ showTime: !1
28
+ },
29
+ "Y-D": {
30
+ showTime: !1
31
+ },
32
+ "Y-h": {
33
+ showTime: !0,
34
+ showSecond: !1,
35
+ showMinute: !1
36
+ },
37
+ "Y-m": {
38
+ showTime: !0,
39
+ showSecond: !1
40
+ },
41
+ "Y-s": {
42
+ showTime: !0
43
+ }
44
+ };
45
+ export {
46
+ Y as ApFieldDatePresetFormats,
47
+ e as PRESET_FORMAT_MAP,
48
+ s as PRESET_FORMAT_PICK_MAP,
49
+ M as PRESET_FORMAT_TIME_MAP
50
+ };
@@ -1,3 +1,5 @@
1
+ import { EventValue } from 'ant-design-vue/es/vc-picker/interface';
1
2
  import { Dayjs } from 'dayjs';
2
3
 
3
4
  export declare const formatDay: (d: Dayjs, f: string, begin?: boolean) => number | null;
5
+ export declare const formatValue: (v: EventValue<Dayjs>) => number | null;
@@ -0,0 +1,10 @@
1
+ const o = (e, n, f = !0) => {
2
+ if (!e)
3
+ return null;
4
+ let t = e.clone();
5
+ return t = t.millisecond(0), n.indexOf("ss") === -1 && (t = t.second(f ? 0 : 59)), n.indexOf("mm") === -1 && (t = t.minute(f ? 0 : 59)), n.indexOf("HH") === -1 && (t = t.hour(f ? 0 : 23)), n.indexOf("DD") === -1 && (t = t.date(f ? 1 : 0), f || (t = t.month(t.month() + 1))), n.indexOf("MM") === -1 && (t = t.month(f ? 0 : 12)), t.valueOf();
6
+ }, i = (e) => e && e.valueOf();
7
+ export {
8
+ o as formatDay,
9
+ i as formatValue
10
+ };
@@ -0,0 +1,57 @@
1
+ import { ApFieldDateProps, FieldMode } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ import { DatePickerProps } from 'ant-design-vue';
4
+
5
+ type ApFieldDataSlots = {
6
+ dateRender: any;
7
+ suffixIcon?: any;
8
+ prevIcon?: any;
9
+ nextIcon?: any;
10
+ superPrevIcon?: any;
11
+ superNextIcon?: any;
12
+ renderExtraFooter?: any;
13
+ monthCellRender?: any;
14
+ monthCellContentRender?: any;
15
+ clearIcon?: any;
16
+ default?: any;
17
+ };
18
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldDateProps>, {
19
+ format: string;
20
+ mode: string;
21
+ fieldProps: () => {};
22
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
23
+ "update:value": (...args: any[]) => void;
24
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldDateProps>, {
25
+ format: string;
26
+ mode: string;
27
+ fieldProps: () => {};
28
+ }>>> & {
29
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
30
+ }, {
31
+ mode: FieldMode;
32
+ format: string;
33
+ fieldProps: Omit< DatePickerProps, "value" | "defaultValue" | "onChange" | "mode" | "format" | "onOk">;
34
+ }, {}>, Readonly<ApFieldDataSlots> & ApFieldDataSlots>;
35
+ export default _default;
36
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
37
+ type __VLS_TypePropsToRuntimeProps<T> = {
38
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
39
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
40
+ } : {
41
+ type: PropType<T[K]>;
42
+ required: true;
43
+ };
44
+ };
45
+ type __VLS_WithDefaults<P, D> = {
46
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
47
+ default: D[K];
48
+ }> : P[K];
49
+ };
50
+ type __VLS_Prettify<T> = {
51
+ [K in keyof T]: T[K];
52
+ } & {};
53
+ type __VLS_WithTemplateSlots<T, S> = T & {
54
+ new (): {
55
+ $slots: S;
56
+ };
57
+ };
@@ -0,0 +1,75 @@
1
+ import { defineComponent as C, computed as s, unref as o, openBlock as p, createElementBlock as E, Fragment as F, createTextVNode as R, toDisplayString as M, createBlock as D, mergeProps as S, createSlots as V, renderList as x, withCtx as j, renderSlot as B, normalizeProps as I, guardReactiveProps as N } from "vue";
2
+ import i from "dayjs";
3
+ import { DatePicker as U } from "ant-design-vue";
4
+ import { ApFieldDatePresetFormats as $, PRESET_FORMAT_MAP as b, PRESET_FORMAT_PICK_MAP as w, PRESET_FORMAT_TIME_MAP as z } from "./constant.mjs";
5
+ import "../../hooks/useMessage.mjs";
6
+ import { useControllableValue as K } from "../../hooks/useControllableValue.mjs";
7
+ import { isNil as P } from "lodash-unified";
8
+ import { formatDay as d } from "./helper.mjs";
9
+ const X = /* @__PURE__ */ C({
10
+ name: "ApFieldDate",
11
+ inheritAttrs: !1,
12
+ __name: "index",
13
+ props: {
14
+ mode: { default: "edit" },
15
+ fieldProps: { default: () => ({}) },
16
+ emptyText: {},
17
+ value: {},
18
+ defaultValue: {},
19
+ onChange: {},
20
+ onOk: {},
21
+ format: { default: "Y-D" }
22
+ },
23
+ emits: ["update:value"],
24
+ setup(k, { emit: v }) {
25
+ const e = k, _ = v, { value: u, updateValue: c } = K(e, _), n = s(
26
+ () => $.indexOf(e.format) > -1
27
+ ), l = s(
28
+ () => n.value ? b[e.format] : e.format
29
+ ), O = s(() => P(o(u)) ? void 0 : i(o(u))), g = s(() => o(n) ? e.fieldProps.picker ?? w[e.format] : e.fieldProps.picker), h = s(() => {
30
+ const t = o(n) ? z[e.format] : {};
31
+ return {
32
+ ...e.fieldProps,
33
+ ...t
34
+ };
35
+ });
36
+ function y(t) {
37
+ if (P(t)) {
38
+ c(null);
39
+ return;
40
+ }
41
+ const r = i(t);
42
+ o(n) ? c(d(r, o(l))) : c(r.valueOf());
43
+ }
44
+ function T(t, r) {
45
+ var f;
46
+ const m = i(t), a = o(n) ? d(m, o(l)) : t ? m.valueOf() : null;
47
+ (f = e.onChange) == null || f.call(e, a, r);
48
+ }
49
+ function A(t) {
50
+ var a;
51
+ const r = i(t), m = o(n) ? d(r, o(l)) : t ? r.valueOf() : null;
52
+ (a = e.onOk) == null || a.call(e, m);
53
+ }
54
+ return (t, r) => t.mode === "read" ? (p(), E(F, { key: 0 }, [
55
+ R(M(o(u) ? o(i)(o(u)).format(l.value) : t.emptyText), 1)
56
+ ], 64)) : (p(), D(o(U), S({ key: 1 }, h.value, {
57
+ value: O.value,
58
+ format: l.value,
59
+ "onUpdate:value": y,
60
+ onChange: T,
61
+ onOk: A,
62
+ picker: g.value
63
+ }), V({ _: 2 }, [
64
+ x(t.$slots, (m, a) => ({
65
+ name: a,
66
+ fn: j((f) => [
67
+ B(t.$slots, a, I(N(f || {})))
68
+ ])
69
+ }))
70
+ ]), 1040, ["value", "format", "picker"]));
71
+ }
72
+ });
73
+ export {
74
+ X as default
75
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,59 @@
1
+ import { ApFieldDateRangeProps, FieldMode } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+ import { RangePickerProps } from 'ant-design-vue/es/date-picker';
4
+
5
+ type ApFieldDateRangeSlots = {
6
+ suffixIcon?: any;
7
+ prevIcon?: any;
8
+ nextIcon?: any;
9
+ superPrevIcon?: any;
10
+ superNextIcon?: any;
11
+ dateRender?: any;
12
+ renderExtraFooter?: any;
13
+ default?: any;
14
+ separator?: any;
15
+ clearIcon?: any;
16
+ };
17
+ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldDateRangeProps>, {
18
+ emptyText: string;
19
+ mode: string;
20
+ format: string;
21
+ fieldProps: () => {};
22
+ }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
23
+ "update:value": (...args: any[]) => void;
24
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldDateRangeProps>, {
25
+ emptyText: string;
26
+ mode: string;
27
+ format: string;
28
+ fieldProps: () => {};
29
+ }>>> & {
30
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
31
+ }, {
32
+ mode: FieldMode;
33
+ format: string;
34
+ emptyText: string;
35
+ fieldProps: Omit< RangePickerProps, "value" | "defaultValue" | "onChange" | "renderExtraFooter" | "onPanelChange" | "onOk">;
36
+ }, {}>, Readonly<ApFieldDateRangeSlots> & ApFieldDateRangeSlots>;
37
+ export default _default;
38
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
39
+ type __VLS_TypePropsToRuntimeProps<T> = {
40
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
41
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
42
+ } : {
43
+ type: PropType<T[K]>;
44
+ required: true;
45
+ };
46
+ };
47
+ type __VLS_WithDefaults<P, D> = {
48
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
49
+ default: D[K];
50
+ }> : P[K];
51
+ };
52
+ type __VLS_Prettify<T> = {
53
+ [K in keyof T]: T[K];
54
+ } & {};
55
+ type __VLS_WithTemplateSlots<T, S> = T & {
56
+ new (): {
57
+ $slots: S;
58
+ };
59
+ };