@cynnie/ui-antd 0.1.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 (54) hide show
  1. package/README.md +35 -0
  2. package/dist/ProButton-CqnwsC_1.js +53 -0
  3. package/dist/ProButton-CqnwsC_1.js.map +1 -0
  4. package/dist/ProCheckboxGroup-Cgi80joE.js +48 -0
  5. package/dist/ProCheckboxGroup-Cgi80joE.js.map +1 -0
  6. package/dist/ProConfirmButton-BwTUXN3q.js +44 -0
  7. package/dist/ProConfirmButton-BwTUXN3q.js.map +1 -0
  8. package/dist/ProDescriptions-Bt7-Bj8s.js +46 -0
  9. package/dist/ProDescriptions-Bt7-Bj8s.js.map +1 -0
  10. package/dist/ProFormBuilder-C4qUATw1.js +1078 -0
  11. package/dist/ProFormBuilder-C4qUATw1.js.map +1 -0
  12. package/dist/ProInput-5zs6KNEY.js +40 -0
  13. package/dist/ProInput-5zs6KNEY.js.map +1 -0
  14. package/dist/ProModal-DJ5mCAGT.js +51 -0
  15. package/dist/ProModal-DJ5mCAGT.js.map +1 -0
  16. package/dist/ProRadioGroup-DQhMJA70.js +48 -0
  17. package/dist/ProRadioGroup-DQhMJA70.js.map +1 -0
  18. package/dist/ProSelect-9bs8QyA-.js +64 -0
  19. package/dist/ProSelect-9bs8QyA-.js.map +1 -0
  20. package/dist/ProTable-DW3gXtOc.js +165 -0
  21. package/dist/ProTable-DW3gXtOc.js.map +1 -0
  22. package/dist/components/ProButton/ProCountdownButton.vue.d.ts +28 -0
  23. package/dist/components/ProButton/index.js +2 -0
  24. package/dist/components/ProButton/index.vue.d.ts +25 -0
  25. package/dist/components/ProCheckboxGroup/index.js +2 -0
  26. package/dist/components/ProCheckboxGroup/index.vue.d.ts +31 -0
  27. package/dist/components/ProConfirmButton/index.js +2 -0
  28. package/dist/components/ProConfirmButton/index.vue.d.ts +25 -0
  29. package/dist/components/ProDescriptions/index.js +2 -0
  30. package/dist/components/ProDescriptions/index.vue.d.ts +36 -0
  31. package/dist/components/ProFormBuilder/index.js +2 -0
  32. package/dist/components/ProFormBuilder/index.vue.d.ts +54 -0
  33. package/dist/components/ProInput/index.js +2 -0
  34. package/dist/components/ProInput/index.vue.d.ts +28 -0
  35. package/dist/components/ProModal/index.js +2 -0
  36. package/dist/components/ProModal/index.vue.d.ts +30 -0
  37. package/dist/components/ProRadioGroup/index.js +2 -0
  38. package/dist/components/ProRadioGroup/index.vue.d.ts +31 -0
  39. package/dist/components/ProSelect/index.js +2 -0
  40. package/dist/components/ProSelect/index.vue.d.ts +33 -0
  41. package/dist/components/ProTable/index.js +2 -0
  42. package/dist/components/ProTable/index.vue.d.ts +41 -0
  43. package/dist/components/index.d.ts +12 -0
  44. package/dist/composables/index.d.ts +1 -0
  45. package/dist/index.d.ts +7 -0
  46. package/dist/index.js +66 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/openDialog-Bc1V5It3.js +75 -0
  49. package/dist/openDialog-Bc1V5It3.js.map +1 -0
  50. package/dist/utils/index.d.ts +1 -0
  51. package/dist/utils/openDialog.d.ts +18 -0
  52. package/dist/utils/openDialog.js +2 -0
  53. package/dist/utils/uiMessage.d.ts +9 -0
  54. package/package.json +96 -0
@@ -0,0 +1,41 @@
1
+ type PromiseFn = (...args: any[]) => Promise<any>;
2
+ type __VLS_Props = {
3
+ apis: {
4
+ get: PromiseFn;
5
+ create: PromiseFn;
6
+ update: PromiseFn;
7
+ remove: PromiseFn;
8
+ };
9
+ rowKey?: string;
10
+ beforeCreate?: () => Promise<Record<string, any>>;
11
+ columns: any[];
12
+ formItems: any[];
13
+ rules?: any;
14
+ };
15
+ declare function loadData(): void;
16
+ type __VLS_PublicProps = {
17
+ "queryParams"?: any;
18
+ } & __VLS_Props;
19
+ declare function __VLS_template(): {
20
+ attrs: Partial<{}>;
21
+ slots: {
22
+ search?(_: {}): any;
23
+ };
24
+ refs: {};
25
+ rootEl: HTMLDivElement;
26
+ };
27
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
28
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
29
+ refresh: typeof loadData;
30
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
31
+ "update:queryParams": (value: any) => any;
32
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
33
+ "onUpdate:queryParams"?: (value: any) => any;
34
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
35
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
36
+ export default _default;
37
+ type __VLS_WithTemplateSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,12 @@
1
+ export { default as ProTable } from './ProTable/index.vue';
2
+ export { default as ProTableForm } from './ProTable/ProTableForm.vue';
3
+ export { default as ProFormBuilder } from './ProFormBuilder/index.vue';
4
+ export { default as ProButton } from './ProButton/index.vue';
5
+ export { default as ProCountdownButton } from './ProButton/ProCountdownButton.vue';
6
+ export { default as ProInput } from './ProInput/index.vue';
7
+ export { default as ProSelect } from './ProSelect/index.vue';
8
+ export { default as ProCheckboxGroup } from './ProCheckboxGroup/index.vue';
9
+ export { default as ProRadioGroup } from './ProRadioGroup/index.vue';
10
+ export { default as ProModal } from './ProModal/index.vue';
11
+ export { default as ProConfirmButton } from './ProConfirmButton/index.vue';
12
+ export { default as ProDescriptions } from './ProDescriptions/index.vue';
@@ -0,0 +1 @@
1
+ export * from '@cynnie/ui-core';
@@ -0,0 +1,7 @@
1
+ export { openDialog, renderDialogForm } from './utils/openDialog.js';
2
+ export { uiMessage } from './utils/uiMessage.js';
3
+ export { useOptions, useDebounce, useThrottle, useAsyncLoading } from '@cynnie/ui-core';
4
+ export { createApis } from '@cynnie/ui-core';
5
+ export type { DictOption, UseOptionsOptions, PageApis, PromiseFn, CreateApisOptions, FormItem, FormRules, TableColumn, DialogOptions, DialogHandle, } from '@cynnie/ui-core';
6
+ export type { DescriptionItem } from './components/ProDescriptions/index.vue';
7
+ export { ProTable, ProTableForm, ProFormBuilder, ProButton, ProCountdownButton, ProInput, ProSelect, ProCheckboxGroup, ProRadioGroup, ProModal, ProConfirmButton, ProDescriptions, } from './components/index.js';
package/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ import { t as ProFormBuilder_default } from "./ProFormBuilder-C4qUATw1.js";
2
+ import { n as renderDialogForm, t as openDialog } from "./openDialog-Bc1V5It3.js";
3
+ import { n as ProTableForm_default, t as ProTable_default } from "./ProTable-DW3gXtOc.js";
4
+ import { t as ProButton_default } from "./ProButton-CqnwsC_1.js";
5
+ import { t as ProInput_default } from "./ProInput-5zs6KNEY.js";
6
+ import { t as ProSelect_default } from "./ProSelect-9bs8QyA-.js";
7
+ import { t as ProCheckboxGroup_default } from "./ProCheckboxGroup-Cgi80joE.js";
8
+ import { t as ProRadioGroup_default } from "./ProRadioGroup-DQhMJA70.js";
9
+ import { t as ProModal_default } from "./ProModal-DJ5mCAGT.js";
10
+ import { t as ProConfirmButton_default } from "./ProConfirmButton-BwTUXN3q.js";
11
+ import { t as ProDescriptions_default } from "./ProDescriptions-Bt7-Bj8s.js";
12
+ import { Fragment, createBlock, createElementBlock, createTextVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, resolveComponent, toDisplayString, withCtx } from "vue";
13
+ import { message } from "ant-design-vue";
14
+ import { createApis, useAsyncLoading, useDebounce, useOptions, useThrottle } from "@cynnie/ui-core";
15
+ const uiMessage = {
16
+ success: (content) => message.success(content),
17
+ info: (content) => message.info(content),
18
+ error: (content) => message.error(content),
19
+ warning: (content) => message.warning(content)
20
+ };
21
+ var ProCountdownButton_default = /* @__PURE__ */ defineComponent({
22
+ name: "ProCountdownButton",
23
+ inheritAttrs: false,
24
+ __name: "ProCountdownButton",
25
+ props: {
26
+ seconds: { default: 60 },
27
+ countingText: { default: "{n}s 后重发" },
28
+ onClick: {}
29
+ },
30
+ setup(__props) {
31
+ const props = __props;
32
+ const remaining = ref(0);
33
+ let timer;
34
+ function stopTimer() {
35
+ if (timer) {
36
+ clearInterval(timer);
37
+ timer = void 0;
38
+ }
39
+ }
40
+ async function handleClick(...args) {
41
+ if (remaining.value > 0) return;
42
+ if (props.onClick) {
43
+ const result = props.onClick(...args);
44
+ if (result instanceof Promise) await result;
45
+ }
46
+ remaining.value = props.seconds;
47
+ timer = setInterval(() => {
48
+ remaining.value -= 1;
49
+ if (remaining.value <= 0) stopTimer();
50
+ }, 1e3);
51
+ }
52
+ return (_ctx, _cache) => {
53
+ const _component_a_button = resolveComponent("a-button");
54
+ return openBlock(), createBlock(_component_a_button, mergeProps(_ctx.$attrs, {
55
+ disabled: remaining.value > 0 || void 0,
56
+ onClick: handleClick
57
+ }), {
58
+ default: withCtx(() => [remaining.value > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(props.countingText.replace("{n}", String(remaining.value))), 1)], 64)) : renderSlot(_ctx.$slots, "default", { key: 1 })]),
59
+ _: 3
60
+ }, 16, ["disabled"]);
61
+ };
62
+ }
63
+ });
64
+ export { ProButton_default as ProButton, ProCheckboxGroup_default as ProCheckboxGroup, ProConfirmButton_default as ProConfirmButton, ProCountdownButton_default as ProCountdownButton, ProDescriptions_default as ProDescriptions, ProFormBuilder_default as ProFormBuilder, ProInput_default as ProInput, ProModal_default as ProModal, ProRadioGroup_default as ProRadioGroup, ProSelect_default as ProSelect, ProTable_default as ProTable, ProTableForm_default as ProTableForm, createApis, openDialog, renderDialogForm, uiMessage, useAsyncLoading, useDebounce, useOptions, useThrottle };
65
+
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["$attrs"],"sources":["../src/utils/uiMessage.ts","../src/components/ProButton/ProCountdownButton.vue","../src/components/ProButton/ProCountdownButton.vue"],"sourcesContent":["import { message as AntdMessage } from \"ant-design-vue\";\n\n/**\n * 全局提示的统一抽象:两套实现包导出同名方法,调用方无需关心底层 UI 库。\n */\nexport const uiMessage = {\n success: (content: string) => AntdMessage.success(content),\n info: (content: string) => AntdMessage.info(content),\n error: (content: string) => AntdMessage.error(content),\n warning: (content: string) => AntdMessage.warning(content),\n};\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\n\ndefineOptions({\n name: \"ProCountdownButton\",\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n /** 倒计时秒数 */\n seconds?: number;\n /** 倒计时期间按钮文案,{} 会替换为剩余秒数 */\n countingText?: string;\n /** 点击处理函数:返回 Promise 且 resolve 后才开始倒计时(适合发验证码接口) */\n onClick?: (...args: any[]) => any;\n }>(),\n {\n seconds: 60,\n countingText: \"{n}s 后重发\",\n },\n);\n\nconst remaining = ref(0);\nlet timer: ReturnType<typeof setInterval> | undefined;\n\nfunction stopTimer() {\n if (timer) {\n clearInterval(timer);\n timer = undefined;\n }\n}\n\nasync function handleClick(...args: any[]) {\n if (remaining.value > 0) return;\n\n if (props.onClick) {\n const result = props.onClick(...args);\n if (result instanceof Promise) await result;\n }\n\n remaining.value = props.seconds;\n timer = setInterval(() => {\n remaining.value -= 1;\n if (remaining.value <= 0) stopTimer();\n }, 1000);\n}\n</script>\n\n<template>\n <a-button v-bind=\"$attrs\" :disabled=\"remaining > 0 || undefined\" @click=\"handleClick\">\n <template v-if=\"remaining > 0\">{{\n props.countingText.replace(\"{n}\", String(remaining))\n }}</template>\n <slot v-else></slot>\n </a-button>\n</template>\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\n\ndefineOptions({\n name: \"ProCountdownButton\",\n inheritAttrs: false,\n});\n\nconst props = withDefaults(\n defineProps<{\n /** 倒计时秒数 */\n seconds?: number;\n /** 倒计时期间按钮文案,{} 会替换为剩余秒数 */\n countingText?: string;\n /** 点击处理函数:返回 Promise 且 resolve 后才开始倒计时(适合发验证码接口) */\n onClick?: (...args: any[]) => any;\n }>(),\n {\n seconds: 60,\n countingText: \"{n}s 后重发\",\n },\n);\n\nconst remaining = ref(0);\nlet timer: ReturnType<typeof setInterval> | undefined;\n\nfunction stopTimer() {\n if (timer) {\n clearInterval(timer);\n timer = undefined;\n }\n}\n\nasync function handleClick(...args: any[]) {\n if (remaining.value > 0) return;\n\n if (props.onClick) {\n const result = props.onClick(...args);\n if (result instanceof Promise) await result;\n }\n\n remaining.value = props.seconds;\n timer = setInterval(() => {\n remaining.value -= 1;\n if (remaining.value <= 0) stopTimer();\n }, 1000);\n}\n</script>\n\n<template>\n <a-button v-bind=\"$attrs\" :disabled=\"remaining > 0 || undefined\" @click=\"handleClick\">\n <template v-if=\"remaining > 0\">{{\n props.countingText.replace(\"{n}\", String(remaining))\n }}</template>\n <slot v-else></slot>\n </a-button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;AAKA,MAAa,YAAY;CACvB,UAAU,YAAoB,QAAY,QAAQ,QAAQ;CAC1D,OAAO,YAAoB,QAAY,KAAK,QAAQ;CACpD,QAAQ,YAAoB,QAAY,MAAM,QAAQ;CACtD,UAAU,YAAoB,QAAY,QAAQ,QAAQ;CAC3D;;;;;;;;;;;EEFD,MAAM,QAAQ;EAed,MAAM,YAAY,IAAI,EAAE;EACxB,IAAI;EAEJ,SAAS,YAAY;AACnB,OAAI,OAAO;AACT,kBAAc,MAAM;AACpB,YAAQ,KAAA;;;EAIZ,eAAe,YAAY,GAAG,MAAa;AACzC,OAAI,UAAU,QAAQ,EAAG;AAEzB,OAAI,MAAM,SAAS;IACjB,MAAM,SAAS,MAAM,QAAQ,GAAG,KAAK;AACrC,QAAI,kBAAkB,QAAS,OAAM;;AAGvC,aAAU,QAAQ,MAAM;AACxB,WAAQ,kBAAkB;AACxB,cAAU,SAAS;AACnB,QAAI,UAAU,SAAS,EAAG,YAAW;MACpC,IAAK;;;;uBAKR,YAKW,qBALX,WAAkBA,KAKP,QALa;IAAG,UAAU,UAAA,QAAS,KAAQ,KAAA;IAAY,SAAO;;2BAG1D,CAFG,UAAA,QAAS,KAAA,WAAA,EAAzB,mBAEa,UAAA,EAAA,KAAA,GAAA,EAAA,CAAA,gBAAA,gBADX,MAAM,aAAa,QAAO,OAAQ,OAAO,UAAA,MAAS,CAAA,CAAA,EAAA,EAAA,CAAA,EAAA,GAAA,IAEpD,WAAoB,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,75 @@
1
+ import { t as ProFormBuilder_default } from "./ProFormBuilder-C4qUATw1.js";
2
+ import { createApp, h, reactive, ref } from "vue";
3
+ import Antd, { Modal } from "ant-design-vue";
4
+ var EMPTY_OBJ = Object.freeze({});
5
+ function openDialog(component, props = EMPTY_OBJ, modelProps = EMPTY_OBJ) {
6
+ const { methodKey = "submit", onSubmit, ...restProps } = props;
7
+ const open = ref(true);
8
+ const instance = ref();
9
+ const container = document.createElement("div");
10
+ const loading = ref(false);
11
+ document.body.appendChild(container);
12
+ const reactiveModalProps = reactive(modelProps);
13
+ const dialog = () => {
14
+ const title = typeof reactiveModalProps.title === "function" ? reactiveModalProps.title() : reactiveModalProps.title;
15
+ return h(Modal, {
16
+ ...reactiveModalProps,
17
+ title,
18
+ confirmLoading: loading.value,
19
+ open: open.value,
20
+ async onOk(e) {
21
+ loading.value = true;
22
+ try {
23
+ let result;
24
+ if (onSubmit) result = await onSubmit(instance.value);
25
+ else if (instance.value?.[methodKey]) result = await instance.value[methodKey]();
26
+ open.value = false;
27
+ reactiveModalProps.onOk?.(result ?? e);
28
+ } finally {
29
+ loading.value = false;
30
+ }
31
+ },
32
+ afterClose: () => {
33
+ unmount();
34
+ },
35
+ onCancel: (e) => {
36
+ open.value = false;
37
+ reactiveModalProps.onCancel?.(e);
38
+ }
39
+ }, () => {
40
+ return h(component, {
41
+ ...restProps,
42
+ ref: instance
43
+ });
44
+ });
45
+ };
46
+ function unmount() {
47
+ app.unmount();
48
+ document.body.removeChild(container);
49
+ }
50
+ const app = createApp(dialog);
51
+ app.use(Antd);
52
+ app.mount(container);
53
+ function close() {
54
+ open.value = false;
55
+ }
56
+ return { close };
57
+ }
58
+ function renderDialogForm(formProps, modelProps = EMPTY_OBJ) {
59
+ const reactiveFormProps = reactive(formProps);
60
+ return openDialog({ setup(_, { expose }) {
61
+ const formInstance = ref();
62
+ expose({ async submit() {
63
+ await formInstance.value?.validate?.();
64
+ return reactiveFormProps.modelValue;
65
+ } });
66
+ const FormComp = ProFormBuilder_default;
67
+ return () => h(FormComp, {
68
+ ...reactiveFormProps,
69
+ ref: formInstance
70
+ });
71
+ } }, {}, modelProps);
72
+ }
73
+ export { renderDialogForm as n, openDialog as t };
74
+
75
+ //# sourceMappingURL=openDialog-Bc1V5It3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openDialog-Bc1V5It3.js","names":["result: any"],"sources":["../src/utils/openDialog.ts"],"sourcesContent":["import { type Component, h, createApp, reactive, ref } from \"vue\";\nimport { type ModalProps, Modal } from \"ant-design-vue\";\nimport Antd from \"ant-design-vue\";\nimport ProFormBuilder from \"../components/ProFormBuilder/index.vue\";\nimport type { DialogHandle } from \"@cynnie/ui-core\";\n\n// 避免每次调用都创建新空对象\nconst EMPTY_OBJ = Object.freeze({});\n\nexport function openDialog(\n component: Component,\n props: Record<string, any> = EMPTY_OBJ,\n modelProps: ModalProps = EMPTY_OBJ,\n): DialogHandle {\n // 调用方可通过 props 传 methodKey / onSubmit 自定义确定按钮的行为:\n // - methodKey:内容组件暴露的方法名,默认 'submit'\n // - onSubmit:直接传函数(拿到内容组件实例),优先级高于 methodKey\n const { methodKey = \"submit\", onSubmit, ...restProps } = props;\n const open = ref(true);\n const instance = ref<Record<string, any>>();\n const container = document.createElement(\"div\");\n const loading = ref(false);\n document.body.appendChild(container);\n\n // reactive 包一层:外部传 ref 的 title 等配置可动态响应\n const reactiveModalProps = reactive(modelProps);\n const dialog = () => {\n const title =\n typeof reactiveModalProps.title === \"function\" ? (reactiveModalProps.title as any)() : reactiveModalProps.title;\n return h(\n Modal,\n {\n ...reactiveModalProps,\n title,\n confirmLoading: loading.value,\n open: open.value,\n async onOk(e) {\n loading.value = true;\n try {\n let result: any;\n if (onSubmit) {\n result = await onSubmit(instance.value);\n } else if (instance.value?.[methodKey]) {\n result = await instance.value[methodKey]();\n }\n open.value = false;\n // 内容组件提交方法(或 onSubmit)的返回值交给 onOk;\n // 普通组件没写提交方法时 result 为 undefined,onOk 退回拿 Modal 事件\n reactiveModalProps.onOk?.(result ?? e);\n } finally {\n loading.value = false;\n }\n },\n afterClose: () => {\n unmount();\n },\n onCancel: (e?: any) => {\n open.value = false;\n reactiveModalProps.onCancel?.(e);\n },\n },\n () => {\n return h(component, { ...restProps, ref: instance });\n },\n );\n };\n function unmount() {\n app.unmount();\n document.body.removeChild(container);\n }\n const app = createApp(dialog);\n app.use(Antd);\n app.mount(container);\n\n // 返回 close 方法,调用方可编程式关闭弹窗\n function close() {\n open.value = false;\n }\n return { close };\n}\n\n/**\n * 命令式弹窗表单:一行代码弹出一个「确定时自动校验」的表单弹窗。\n *\n * @param formProps ProFormBuilder 的配置:formItems / rules / modelValue 等\n * @param modelProps a-modal 的配置(title / width / onOk 等)\n * @returns { close } 关闭弹窗\n *\n * @example\n * const { close } = renderDialogForm(\n * { formItems: [{ label: '姓名', key: 'name' }], rules: { name: [{ required: true }] } },\n * { title: '新增用户', onOk: (data) => console.log('提交', data) },\n * );\n */\nexport function renderDialogForm(formProps: Record<string, any>, modelProps: ModalProps = EMPTY_OBJ): DialogHandle {\n const reactiveFormProps = reactive(formProps);\n return openDialog(\n {\n setup(_: any, { expose }: any) {\n const formInstance = ref();\n expose({\n // 点确定时先跑表单校验,通过后把表单数据交给 onOk\n async submit() {\n await formInstance.value?.validate?.();\n return reactiveFormProps.modelValue;\n },\n });\n // formProps 是运行时动态对象,断言绕开 h() 对 .vue 组件的严格 props 推断\n const FormComp = ProFormBuilder as unknown as Component;\n return () => h(FormComp, { ...reactiveFormProps, ref: formInstance });\n },\n },\n {},\n modelProps,\n );\n}\n"],"mappings":";;;AAOA,IAAM,YAAY,OAAO,OAAO,EAAE,CAAC;AAEnC,SAAgB,WACd,WACA,QAA6B,WAC7B,aAAyB,WACX;CAId,MAAM,EAAE,YAAY,UAAU,UAAU,GAAG,cAAc;CACzD,MAAM,OAAO,IAAI,KAAK;CACtB,MAAM,WAAW,KAA0B;CAC3C,MAAM,YAAY,SAAS,cAAc,MAAM;CAC/C,MAAM,UAAU,IAAI,MAAM;AAC1B,UAAS,KAAK,YAAY,UAAU;CAGpC,MAAM,qBAAqB,SAAS,WAAW;CAC/C,MAAM,eAAe;EACnB,MAAM,QACJ,OAAO,mBAAmB,UAAU,aAAc,mBAAmB,OAAe,GAAG,mBAAmB;AAC5G,SAAO,EACL,OACA;GACE,GAAG;GACH;GACA,gBAAgB,QAAQ;GACxB,MAAM,KAAK;GACX,MAAM,KAAK,GAAG;AACZ,YAAQ,QAAQ;AAChB,QAAI;KACF,IAAIA;AACJ,SAAI,SACF,UAAS,MAAM,SAAS,SAAS,MAAM;cAC9B,SAAS,QAAQ,WAC1B,UAAS,MAAM,SAAS,MAAM,YAAY;AAE5C,UAAK,QAAQ;AAGb,wBAAmB,OAAO,UAAU,EAAE;cAC9B;AACR,aAAQ,QAAQ;;;GAGpB,kBAAkB;AAChB,aAAS;;GAEX,WAAW,MAAY;AACrB,SAAK,QAAQ;AACb,uBAAmB,WAAW,EAAE;;GAEnC,QACK;AACJ,UAAO,EAAE,WAAW;IAAE,GAAG;IAAW,KAAK;IAAU,CAAC;IAEvD;;CAEH,SAAS,UAAU;AACjB,MAAI,SAAS;AACb,WAAS,KAAK,YAAY,UAAU;;CAEtC,MAAM,MAAM,UAAU,OAAO;AAC7B,KAAI,IAAI,KAAK;AACb,KAAI,MAAM,UAAU;CAGpB,SAAS,QAAQ;AACf,OAAK,QAAQ;;AAEf,QAAO,EAAE,OAAO;;AAgBlB,SAAgB,iBAAiB,WAAgC,aAAyB,WAAyB;CACjH,MAAM,oBAAoB,SAAS,UAAU;AAC7C,QAAO,WACL,EACE,MAAM,GAAQ,EAAE,UAAe;EAC7B,MAAM,eAAe,KAAK;AAC1B,SAAO,EAEL,MAAM,SAAS;AACb,SAAM,aAAa,OAAO,YAAY;AACtC,UAAO,kBAAkB;KAE5B,CAAC;EAEF,MAAM,WAAW;AACjB,eAAa,EAAE,UAAU;GAAE,GAAG;GAAmB,KAAK;GAAc,CAAC;IAExE,EACD,EAAE,EACF,WACD"}
@@ -0,0 +1 @@
1
+ export * from './openDialog.js';
@@ -0,0 +1,18 @@
1
+ import { Component } from 'vue';
2
+ import { ModalProps } from 'ant-design-vue';
3
+ import { DialogHandle } from '@cynnie/ui-core';
4
+ export declare function openDialog(component: Component, props?: Record<string, any>, modelProps?: ModalProps): DialogHandle;
5
+ /**
6
+ * 命令式弹窗表单:一行代码弹出一个「确定时自动校验」的表单弹窗。
7
+ *
8
+ * @param formProps ProFormBuilder 的配置:formItems / rules / modelValue 等
9
+ * @param modelProps a-modal 的配置(title / width / onOk 等)
10
+ * @returns { close } 关闭弹窗
11
+ *
12
+ * @example
13
+ * const { close } = renderDialogForm(
14
+ * { formItems: [{ label: '姓名', key: 'name' }], rules: { name: [{ required: true }] } },
15
+ * { title: '新增用户', onOk: (data) => console.log('提交', data) },
16
+ * );
17
+ */
18
+ export declare function renderDialogForm(formProps: Record<string, any>, modelProps?: ModalProps): DialogHandle;
@@ -0,0 +1,2 @@
1
+ import { n as renderDialogForm, t as openDialog } from "../openDialog-Bc1V5It3.js";
2
+ export { openDialog, renderDialogForm };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 全局提示的统一抽象:两套实现包导出同名方法,调用方无需关心底层 UI 库。
3
+ */
4
+ export declare const uiMessage: {
5
+ success: (content: string) => import('ant-design-vue/es/message').MessageType;
6
+ info: (content: string) => import('ant-design-vue/es/message').MessageType;
7
+ error: (content: string) => import('ant-design-vue/es/message').MessageType;
8
+ warning: (content: string) => import('ant-design-vue/es/message').MessageType;
9
+ };
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@cynnie/ui-antd",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "基于 ant-design-vue 的 SnowUI 二次封装组件库",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/snowbitx/ui.git",
10
+ "directory": "packages/ui-antd"
11
+ },
12
+ "main": "./dist/index.js",
13
+ "module": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./components/ProTable": {
21
+ "types": "./dist/components/ProTable/index.vue.d.ts",
22
+ "import": "./dist/components/ProTable/index.js"
23
+ },
24
+ "./components/ProFormBuilder": {
25
+ "types": "./dist/components/ProFormBuilder/index.vue.d.ts",
26
+ "import": "./dist/components/ProFormBuilder/index.js"
27
+ },
28
+ "./utils/openDialog": {
29
+ "types": "./dist/utils/openDialog.d.ts",
30
+ "import": "./dist/utils/openDialog.js"
31
+ },
32
+ "./components/ProButton": {
33
+ "types": "./dist/components/ProButton/index.vue.d.ts",
34
+ "import": "./dist/components/ProButton/index.js"
35
+ },
36
+ "./components/ProInput": {
37
+ "types": "./dist/components/ProInput/index.vue.d.ts",
38
+ "import": "./dist/components/ProInput/index.js"
39
+ },
40
+ "./components/ProSelect": {
41
+ "types": "./dist/components/ProSelect/index.vue.d.ts",
42
+ "import": "./dist/components/ProSelect/index.js"
43
+ },
44
+ "./components/ProCheckboxGroup": {
45
+ "types": "./dist/components/ProCheckboxGroup/index.vue.d.ts",
46
+ "import": "./dist/components/ProCheckboxGroup/index.js"
47
+ },
48
+ "./components/ProRadioGroup": {
49
+ "types": "./dist/components/ProRadioGroup/index.vue.d.ts",
50
+ "import": "./dist/components/ProRadioGroup/index.js"
51
+ },
52
+ "./components/ProModal": {
53
+ "types": "./dist/components/ProModal/index.vue.d.ts",
54
+ "import": "./dist/components/ProModal/index.js"
55
+ },
56
+ "./components/ProConfirmButton": {
57
+ "types": "./dist/components/ProConfirmButton/index.vue.d.ts",
58
+ "import": "./dist/components/ProConfirmButton/index.js"
59
+ },
60
+ "./components/ProDescriptions": {
61
+ "types": "./dist/components/ProDescriptions/index.vue.d.ts",
62
+ "import": "./dist/components/ProDescriptions/index.js"
63
+ },
64
+ "./package.json": "./package.json"
65
+ },
66
+ "files": [
67
+ "dist"
68
+ ],
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "sideEffects": false,
73
+ "peerDependencies": {
74
+ "ant-design-vue": "^4.2.6",
75
+ "vue": "^3.5.17"
76
+ },
77
+ "dependencies": {
78
+ "lodash-es": "^4.17.21",
79
+ "@cynnie/ui-core": "^0.1.0"
80
+ },
81
+ "devDependencies": {
82
+ "@types/lodash-es": "^4.17.12",
83
+ "@vitejs/plugin-vue": "^6.0.0",
84
+ "@vitejs/plugin-vue-jsx": "^5.0.0",
85
+ "@vue/tsconfig": "^0.7.0",
86
+ "ant-design-vue": "^4.2.6",
87
+ "vite": "npm:rolldown-vite@^7.3.1",
88
+ "vite-plugin-dts": "^4.5.4",
89
+ "vue-tsc": "^2.2.10"
90
+ },
91
+ "scripts": {
92
+ "build": "vite build",
93
+ "format": "prettier --write src/",
94
+ "type-check": "vue-tsc --noEmit -p tsconfig.json"
95
+ }
96
+ }