@fbkworks/adapter-element-plus 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +35 -2
- package/dist/dark.css +1 -0
- package/dist/feedback.d.ts +2 -0
- package/dist/feedback.mjs +34 -0
- package/dist/feedback.mjs.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.mjs +76 -0
- package/dist/index.mjs.map +1 -0
- package/dist/primitives/Button.d.ts +53 -0
- package/dist/primitives/Button.mjs +74 -0
- package/dist/primitives/Button.mjs.map +1 -0
- package/dist/primitives/Checkbox.d.ts +32 -0
- package/dist/primitives/Checkbox.mjs +40 -0
- package/dist/primitives/Checkbox.mjs.map +1 -0
- package/dist/primitives/DataGrid.d.ts +93 -0
- package/dist/primitives/DataGrid.mjs +107 -0
- package/dist/primitives/DataGrid.mjs.map +1 -0
- package/dist/primitives/DatePicker.d.ts +66 -0
- package/dist/primitives/DatePicker.mjs +69 -0
- package/dist/primitives/DatePicker.mjs.map +1 -0
- package/dist/primitives/Dialog.d.ts +58 -0
- package/dist/primitives/Dialog.mjs +60 -0
- package/dist/primitives/Dialog.mjs.map +1 -0
- package/dist/primitives/Drawer.d.ts +61 -0
- package/dist/primitives/Drawer.mjs +57 -0
- package/dist/primitives/Drawer.mjs.map +1 -0
- package/dist/primitives/Empty.d.ts +13 -0
- package/dist/primitives/Empty.mjs +26 -0
- package/dist/primitives/Empty.mjs.map +1 -0
- package/dist/primitives/Form.d.ts +95 -0
- package/dist/primitives/Form.mjs +127 -0
- package/dist/primitives/Form.mjs.map +1 -0
- package/dist/primitives/Input.d.ts +57 -0
- package/dist/primitives/Input.mjs +55 -0
- package/dist/primitives/Input.mjs.map +1 -0
- package/dist/primitives/Pagination.d.ts +63 -0
- package/dist/primitives/Pagination.mjs +56 -0
- package/dist/primitives/Pagination.mjs.map +1 -0
- package/dist/primitives/Radio.d.ts +40 -0
- package/dist/primitives/Radio.mjs +56 -0
- package/dist/primitives/Radio.mjs.map +1 -0
- package/dist/primitives/Select.d.ts +61 -0
- package/dist/primitives/Select.mjs +66 -0
- package/dist/primitives/Select.mjs.map +1 -0
- package/dist/primitives/Spin.d.ts +21 -0
- package/dist/primitives/Spin.mjs +32 -0
- package/dist/primitives/Spin.mjs.map +1 -0
- package/dist/primitives/Tag.d.ts +32 -0
- package/dist/primitives/Tag.mjs +48 -0
- package/dist/primitives/Tag.mjs.map +1 -0
- package/dist/root-provider.d.ts +50 -0
- package/dist/root-provider.mjs +45 -0
- package/dist/root-provider.mjs.map +1 -0
- package/dist/size.d.ts +2 -0
- package/dist/size.mjs +9 -0
- package/dist/size.mjs.map +1 -0
- package/dist/style.css +326 -0
- package/dist/theme.d.ts +3 -0
- package/dist/theme.mjs +77 -0
- package/dist/theme.mjs.map +1 -0
- package/package.json +56 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.mjs","sources":["../../src/primitives/Form.tsx"],"sourcesContent":["import { computed, defineComponent, ref, type PropType } from 'vue'\nimport { ElForm, ElFormItem, type FormInstance } from 'element-plus'\nimport type { FormProps, FbkRule, Size } from '@fbkworks/adapter-core'\nimport { toElementSize } from '../size'\n\nfunction toElementRules(rules: FbkRule[] | undefined) {\n if (!rules?.length) return undefined\n return rules.map((rule) => ({\n required: rule.required,\n type: rule.type,\n min: rule.min,\n max: rule.max,\n len: rule.len,\n pattern: rule.pattern,\n message: rule.message,\n trigger: rule.trigger === 'submit' ? undefined : (rule.trigger ?? 'change'),\n validator:\n rule.validator &&\n ((_r: unknown, value: unknown, callback: (error?: Error) => void) => {\n const result = rule.validator!(value, {})\n if (result instanceof Promise) {\n result.then((message) => (message === true || !message ? callback() : callback(new Error(message))))\n return\n }\n if (result === true || result === undefined) callback()\n else callback(new Error(result))\n }),\n }))\n}\n\nexport const Form = defineComponent({\n name: 'FbkElForm',\n props: {\n model: { type: Object as PropType<Record<string, any>>, required: true },\n rules: { type: Object as PropType<FormProps['rules']>, default: undefined },\n labelWidth: { type: [String, Number] as PropType<string | number>, default: undefined },\n labelPosition: { type: String as PropType<FormProps['labelPosition']>, default: 'right' },\n disabled: Boolean,\n size: { type: String as PropType<Size>, default: 'md' },\n scrollToError: { type: Boolean, default: true },\n },\n setup(props, { expose, slots }) {\n const formRef = ref<FormInstance>()\n const elementRules = computed(() => {\n if (!props.rules) return undefined\n return Object.fromEntries(\n Object.entries(props.rules).map(([key, rules]) => [key, toElementRules(rules)]),\n )\n })\n\n expose({\n validate: async () => {\n const result = await formRef.value?.validate()\n return (result ?? true) as true\n },\n validateField: async (prop: string | string[]) => {\n await formRef.value?.validateField(prop)\n return true as const\n },\n resetFields: () => formRef.value?.resetFields(),\n clearValidate: (props?: string | string[]) => formRef.value?.clearValidate(props),\n })\n\n return () => (\n <ElForm\n ref={formRef}\n model={props.model}\n rules={elementRules.value}\n labelWidth={props.labelWidth}\n labelPosition={props.labelPosition}\n disabled={props.disabled}\n size={toElementSize(props.size)}\n scrollToError={props.scrollToError}\n >\n {slots.default?.()}\n </ElForm>\n )\n },\n})\n\nexport const FormItem = defineComponent({\n name: 'FbkElFormItem',\n props: {\n label: String,\n prop: String,\n required: Boolean,\n rules: { type: Array as PropType<FbkRule[]>, default: undefined },\n help: String,\n labelWidth: { type: [String, Number] as PropType<string | number>, default: undefined },\n span: Number,\n },\n setup(props, { slots }) {\n return () => (\n <ElFormItem\n label={props.label}\n prop={props.prop}\n required={props.required}\n rules={toElementRules(props.rules)}\n labelWidth={props.labelWidth}\n >\n {slots.default?.()}\n {props.help ? <div class=\"fbk-form-item__help\">{props.help}</div> : null}\n </ElFormItem>\n )\n },\n})\n"],"names":["toElementRules","rules","length","undefined","map","rule","required","type","min","max","len","pattern","message","trigger","validator","_r","value","callback","result","Promise","then","Error","Form","defineComponent","name","props","model","Object","default","labelWidth","String","Number","labelPosition","disabled","Boolean","size","scrollToError","setup","expose","slots","formRef","ref","elementRules","computed","fromEntries","entries","key","validate","validateField","prop","resetFields","clearValidate","_createVNode","ElForm","toElementSize","FormItem","label","Array","help","span","ElFormItem"],"mappings":"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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { InputProps, Size } from '@fbkworks/adapter-core';
|
|
3
|
+
export declare const Input: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: PropType<string | number>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
type: {
|
|
9
|
+
type: PropType<InputProps["type"]>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
placeholder: StringConstructor;
|
|
13
|
+
disabled: BooleanConstructor;
|
|
14
|
+
readonly: BooleanConstructor;
|
|
15
|
+
clearable: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
rows: NumberConstructor;
|
|
20
|
+
size: {
|
|
21
|
+
type: PropType<Size>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("change" | "blur" | "focus" | "update:modelValue")[], "change" | "blur" | "focus" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: PropType<string | number>;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
type: {
|
|
30
|
+
type: PropType<InputProps["type"]>;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
placeholder: StringConstructor;
|
|
34
|
+
disabled: BooleanConstructor;
|
|
35
|
+
readonly: BooleanConstructor;
|
|
36
|
+
clearable: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
rows: NumberConstructor;
|
|
41
|
+
size: {
|
|
42
|
+
type: PropType<Size>;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
}>> & Readonly<{
|
|
46
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
47
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
48
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
49
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
size: Size;
|
|
52
|
+
type: "number" | "text" | "email" | "textarea" | "password" | "tel" | undefined;
|
|
53
|
+
disabled: boolean;
|
|
54
|
+
readonly: boolean;
|
|
55
|
+
modelValue: string | number;
|
|
56
|
+
clearable: boolean;
|
|
57
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode, mergeProps } from "vue";
|
|
2
|
+
import { ElInput } from "element-plus";
|
|
3
|
+
import { toElementSize } from "../size.mjs";
|
|
4
|
+
const Input = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "FbkElInput",
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: [String, Number],
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
type: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "text"
|
|
15
|
+
},
|
|
16
|
+
placeholder: String,
|
|
17
|
+
disabled: Boolean,
|
|
18
|
+
readonly: Boolean,
|
|
19
|
+
clearable: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
},
|
|
23
|
+
rows: Number,
|
|
24
|
+
size: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "md"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["update:modelValue", "change", "blur", "focus"],
|
|
30
|
+
setup(props, {
|
|
31
|
+
attrs,
|
|
32
|
+
emit,
|
|
33
|
+
slots
|
|
34
|
+
}) {
|
|
35
|
+
const size = computed(() => toElementSize(props.size));
|
|
36
|
+
return () => createVNode(ElInput, mergeProps(attrs, {
|
|
37
|
+
"modelValue": props.modelValue,
|
|
38
|
+
"type": props.type === "textarea" ? "textarea" : props.type,
|
|
39
|
+
"size": size.value,
|
|
40
|
+
"rows": props.rows,
|
|
41
|
+
"clearable": props.clearable,
|
|
42
|
+
"disabled": props.disabled,
|
|
43
|
+
"readonly": props.readonly,
|
|
44
|
+
"placeholder": props.placeholder,
|
|
45
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
46
|
+
"onChange": (value) => emit("change", value),
|
|
47
|
+
"onBlur": (event) => emit("blur", event),
|
|
48
|
+
"onFocus": (event) => emit("focus", event)
|
|
49
|
+
}), slots);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
Input
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=Input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.mjs","sources":["../../src/primitives/Input.tsx"],"sourcesContent":["import { computed, defineComponent, type PropType } from 'vue'\nimport { ElInput } from 'element-plus'\nimport type { InputProps, Size } from '@fbkworks/adapter-core'\nimport { toElementSize } from '../size'\n\nexport const Input = defineComponent({\n name: 'FbkElInput',\n inheritAttrs: false,\n props: {\n modelValue: { type: [String, Number] as PropType<string | number>, default: '' },\n type: { type: String as PropType<InputProps['type']>, default: 'text' },\n placeholder: String,\n disabled: Boolean,\n readonly: Boolean,\n clearable: { type: Boolean, default: true },\n rows: Number,\n size: { type: String as PropType<Size>, default: 'md' },\n },\n emits: ['update:modelValue', 'change', 'blur', 'focus'],\n setup(props, { attrs, emit, slots }) {\n const size = computed(() => toElementSize(props.size))\n return () => (\n <ElInput\n {...attrs}\n modelValue={props.modelValue}\n type={props.type === 'textarea' ? 'textarea' : props.type}\n size={size.value}\n rows={props.rows}\n clearable={props.clearable}\n disabled={props.disabled}\n readonly={props.readonly}\n placeholder={props.placeholder}\n onUpdate:modelValue={(value: string) => emit('update:modelValue', value)}\n onChange={(value: string) => emit('change', value)}\n onBlur={(event: FocusEvent) => emit('blur', event)}\n onFocus={(event: FocusEvent) => emit('focus', event)}\n v-slots={slots}\n />\n )\n },\n})\n"],"names":["Input","defineComponent","name","inheritAttrs","props","modelValue","type","String","Number","default","placeholder","disabled","Boolean","readonly","clearable","rows","size","emits","setup","attrs","emit","slots","computed","toElementSize","_createVNode","ElInput","_mergeProps","value","event"],"mappings":";;;AAKO,MAAMA,QAAQC,gCAAgB;AAAA,EACnCC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAO;AAAA,IACLC,YAAY;AAAA,MAAEC,MAAM,CAACC,QAAQC,MAAM;AAAA,MAAgCC,SAAS;AAAA;IAC5EH,MAAM;AAAA,MAAEA,MAAMC;AAAAA,MAAwCE,SAAS;AAAA;IAC/DC,aAAaH;AAAAA,IACbI,UAAUC;AAAAA,IACVC,UAAUD;AAAAA,IACVE,WAAW;AAAA,MAAER,MAAMM;AAAAA,MAASH,SAAS;AAAA;IACrCM,MAAMP;AAAAA,IACNQ,MAAM;AAAA,MAAEV,MAAMC;AAAAA,MAA0BE,SAAS;AAAA,IAAK;AAAA;EAExDQ,OAAO,CAAC,qBAAqB,UAAU,QAAQ,OAAO;AAAA,EACtDC,MAAMd,OAAO;AAAA,IAAEe;AAAAA,IAAOC;AAAAA,IAAMC;AAAAA,EAAM,GAAG;AACnC,UAAML,OAAOM,SAAS,MAAMC,cAAcnB,MAAMY,IAAI,CAAC;AACrD,WAAO,MAAAQ,YAAAC,SAAAC,WAECP,OAAK;AAAA,MAAA,cACGf,MAAMC;AAAAA,MAAU,QACtBD,MAAME,SAAS,aAAa,aAAaF,MAAME;AAAAA,MAAI,QACnDU,KAAKW;AAAAA,MAAK,QACVvB,MAAMW;AAAAA,MAAI,aACLX,MAAMU;AAAAA,MAAS,YAChBV,MAAMO;AAAAA,MAAQ,YACdP,MAAMS;AAAAA,MAAQ,eACXT,MAAMM;AAAAA,MAAW,uBACRiB,WAAkBP,KAAK,qBAAqBO,KAAK;AAAA,MAAC,YAC7DA,WAAkBP,KAAK,UAAUO,KAAK;AAAA,MAAC,UACzCC,WAAsBR,KAAK,QAAQQ,KAAK;AAAA,MAAC,WACxCA,WAAsBR,KAAK,SAASQ,KAAK;AAAA,IAAC,CAAA,GAC3CP,KAAK;AAAA,EAGpB;AACF,CAAC;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { PaginationProps } from '@fbkworks/adapter-core';
|
|
3
|
+
export declare const Pagination: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
page: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
default: number;
|
|
7
|
+
};
|
|
8
|
+
pageSize: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
default: number;
|
|
11
|
+
};
|
|
12
|
+
total: {
|
|
13
|
+
type: NumberConstructor;
|
|
14
|
+
default: number;
|
|
15
|
+
};
|
|
16
|
+
pageSizes: {
|
|
17
|
+
type: PropType<number[]>;
|
|
18
|
+
default: () => number[];
|
|
19
|
+
};
|
|
20
|
+
showTotal: BooleanConstructor;
|
|
21
|
+
showJumper: BooleanConstructor;
|
|
22
|
+
size: {
|
|
23
|
+
type: PropType<PaginationProps["size"]>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
disabled: BooleanConstructor;
|
|
27
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:page" | "update:pageSize")[], "update:page" | "update:pageSize", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
28
|
+
page: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
pageSize: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: number;
|
|
35
|
+
};
|
|
36
|
+
total: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: number;
|
|
39
|
+
};
|
|
40
|
+
pageSizes: {
|
|
41
|
+
type: PropType<number[]>;
|
|
42
|
+
default: () => number[];
|
|
43
|
+
};
|
|
44
|
+
showTotal: BooleanConstructor;
|
|
45
|
+
showJumper: BooleanConstructor;
|
|
46
|
+
size: {
|
|
47
|
+
type: PropType<PaginationProps["size"]>;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
disabled: BooleanConstructor;
|
|
51
|
+
}>> & Readonly<{
|
|
52
|
+
"onUpdate:page"?: ((...args: any[]) => any) | undefined;
|
|
53
|
+
"onUpdate:pageSize"?: ((...args: any[]) => any) | undefined;
|
|
54
|
+
}>, {
|
|
55
|
+
size: import('@fbkworks/adapter-core').Size | undefined;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
page: number;
|
|
58
|
+
showTotal: boolean;
|
|
59
|
+
showJumper: boolean;
|
|
60
|
+
pageSize: number;
|
|
61
|
+
total: number;
|
|
62
|
+
pageSizes: number[];
|
|
63
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode, mergeProps } from "vue";
|
|
2
|
+
import { ElPagination } from "element-plus";
|
|
3
|
+
const Pagination = /* @__PURE__ */ defineComponent({
|
|
4
|
+
name: "FbkElPagination",
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
props: {
|
|
7
|
+
page: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 1
|
|
10
|
+
},
|
|
11
|
+
pageSize: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 20
|
|
14
|
+
},
|
|
15
|
+
total: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 0
|
|
18
|
+
},
|
|
19
|
+
pageSizes: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => [10, 20, 50, 100]
|
|
22
|
+
},
|
|
23
|
+
showTotal: Boolean,
|
|
24
|
+
showJumper: Boolean,
|
|
25
|
+
size: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "md"
|
|
28
|
+
},
|
|
29
|
+
disabled: Boolean
|
|
30
|
+
},
|
|
31
|
+
emits: ["update:page", "update:pageSize"],
|
|
32
|
+
setup(props, {
|
|
33
|
+
attrs,
|
|
34
|
+
emit
|
|
35
|
+
}) {
|
|
36
|
+
const layout = computed(() => {
|
|
37
|
+
const parts = ["total", "sizes", "prev", "pager", "next"];
|
|
38
|
+
if (props.showJumper) parts.push("jumper");
|
|
39
|
+
return parts.join(", ");
|
|
40
|
+
});
|
|
41
|
+
return () => createVNode(ElPagination, mergeProps(attrs, {
|
|
42
|
+
"currentPage": props.page,
|
|
43
|
+
"pageSize": props.pageSize,
|
|
44
|
+
"total": props.total,
|
|
45
|
+
"pageSizes": props.pageSizes,
|
|
46
|
+
"layout": layout.value,
|
|
47
|
+
"disabled": props.disabled,
|
|
48
|
+
"onUpdate:current-page": (page) => emit("update:page", page),
|
|
49
|
+
"onUpdate:page-size": (size) => emit("update:pageSize", size)
|
|
50
|
+
}), null);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
Pagination
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=Pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.mjs","sources":["../../src/primitives/Pagination.tsx"],"sourcesContent":["import { computed, defineComponent, type PropType } from 'vue'\nimport { ElPagination } from 'element-plus'\nimport type { PaginationProps } from '@fbkworks/adapter-core'\n\nexport const Pagination = defineComponent({\n name: 'FbkElPagination',\n inheritAttrs: false,\n props: {\n page: { type: Number, default: 1 },\n pageSize: { type: Number, default: 20 },\n total: { type: Number, default: 0 },\n pageSizes: { type: Array as PropType<number[]>, default: () => [10, 20, 50, 100] },\n showTotal: Boolean,\n showJumper: Boolean,\n size: { type: String as PropType<PaginationProps['size']>, default: 'md' },\n disabled: Boolean,\n },\n emits: ['update:page', 'update:pageSize'],\n setup(props, { attrs, emit }) {\n const layout = computed(() => {\n const parts = ['total', 'sizes', 'prev', 'pager', 'next']\n if (props.showJumper) parts.push('jumper')\n return parts.join(', ')\n })\n return () => (\n <ElPagination\n {...attrs}\n currentPage={props.page}\n pageSize={props.pageSize}\n total={props.total}\n pageSizes={props.pageSizes}\n layout={layout.value}\n disabled={props.disabled}\n onUpdate:current-page={(page: number) => emit('update:page', page)}\n onUpdate:page-size={(size: number) => emit('update:pageSize', size)}\n />\n )\n },\n})\n"],"names":["Pagination","defineComponent","name","inheritAttrs","props","page","type","Number","default","pageSize","total","pageSizes","Array","showTotal","Boolean","showJumper","size","String","disabled","emits","setup","attrs","emit","layout","computed","parts","push","join","_createVNode","ElPagination","_mergeProps","value"],"mappings":";;AAIO,MAAMA,aAAaC,gCAAgB;AAAA,EACxCC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAO;AAAA,IACLC,MAAM;AAAA,MAAEC,MAAMC;AAAAA,MAAQC,SAAS;AAAA;IAC/BC,UAAU;AAAA,MAAEH,MAAMC;AAAAA,MAAQC,SAAS;AAAA;IACnCE,OAAO;AAAA,MAAEJ,MAAMC;AAAAA,MAAQC,SAAS;AAAA;IAChCG,WAAW;AAAA,MAAEL,MAAMM;AAAAA,MAA6BJ,SAASA,MAAM,CAAC,IAAI,IAAI,IAAI,GAAG;AAAA;IAC/EK,WAAWC;AAAAA,IACXC,YAAYD;AAAAA,IACZE,MAAM;AAAA,MAAEV,MAAMW;AAAAA,MAA6CT,SAAS;AAAA;IACpEU,UAAUJ;AAAAA;EAEZK,OAAO,CAAC,eAAe,iBAAiB;AAAA,EACxCC,MAAMhB,OAAO;AAAA,IAAEiB;AAAAA,IAAOC;AAAAA,EAAK,GAAG;AAC5B,UAAMC,SAASC,SAAS,MAAM;AAC5B,YAAMC,QAAQ,CAAC,SAAS,SAAS,QAAQ,SAAS,MAAM;AACxD,UAAIrB,MAAMW,WAAYU,OAAMC,KAAK,QAAQ;AACzC,aAAOD,MAAME,KAAK,IAAI;AAAA,IACxB,CAAC;AACD,WAAO,MAAAC,YAAAC,cAAAC,WAECT,OAAK;AAAA,MAAA,eACIjB,MAAMC;AAAAA,MAAI,YACbD,MAAMK;AAAAA,MAAQ,SACjBL,MAAMM;AAAAA,MAAK,aACPN,MAAMO;AAAAA,MAAS,UAClBY,OAAOQ;AAAAA,MAAK,YACV3B,MAAMc;AAAAA,MAAQ,yBACAb,UAAiBiB,KAAK,eAAejB,IAAI;AAAA,MAAC,sBAC7CW,UAAiBM,KAAK,mBAAmBN,IAAI;AAAA,KAAC,GAAA,IAAA;AAAA,EAGzE;AACF,CAAC;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { RadioProps, Size } from '@fbkworks/adapter-core';
|
|
3
|
+
/** 单选组。与 Select 的区别是选项全部可见,适合 2-4 个枚举值。 */
|
|
4
|
+
export declare const Radio: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: PropType<string | number | null>;
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
9
|
+
options: {
|
|
10
|
+
type: PropType<RadioProps["options"]>;
|
|
11
|
+
default: () => never[];
|
|
12
|
+
};
|
|
13
|
+
disabled: BooleanConstructor;
|
|
14
|
+
size: {
|
|
15
|
+
type: PropType<Size>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: PropType<string | number | null>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
options: {
|
|
24
|
+
type: PropType<RadioProps["options"]>;
|
|
25
|
+
default: () => never[];
|
|
26
|
+
};
|
|
27
|
+
disabled: BooleanConstructor;
|
|
28
|
+
size: {
|
|
29
|
+
type: PropType<Size>;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
}>> & Readonly<{
|
|
33
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
}>, {
|
|
36
|
+
size: Size;
|
|
37
|
+
disabled: boolean;
|
|
38
|
+
modelValue: string | number | null;
|
|
39
|
+
options: import('@fbkworks/adapter-core').RadioOption<string | number>[];
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineComponent, createVNode, mergeProps, isVNode } from "vue";
|
|
2
|
+
import { ElRadioGroup, ElRadio } from "element-plus";
|
|
3
|
+
import { toElementSize } from "../size.mjs";
|
|
4
|
+
function _isSlot(s) {
|
|
5
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
6
|
+
}
|
|
7
|
+
const Radio = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "FbkElRadio",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: [String, Number],
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
options: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
disabled: Boolean,
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "md"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:modelValue", "change"],
|
|
26
|
+
setup(props, {
|
|
27
|
+
attrs,
|
|
28
|
+
emit
|
|
29
|
+
}) {
|
|
30
|
+
return () => {
|
|
31
|
+
let _slot;
|
|
32
|
+
return createVNode(ElRadioGroup, mergeProps(attrs, {
|
|
33
|
+
"modelValue": props.modelValue ?? void 0,
|
|
34
|
+
"disabled": props.disabled,
|
|
35
|
+
"size": toElementSize(props.size),
|
|
36
|
+
"onUpdate:modelValue": (value) => {
|
|
37
|
+
const next = value === void 0 ? null : value;
|
|
38
|
+
emit("update:modelValue", next);
|
|
39
|
+
emit("change", next);
|
|
40
|
+
}
|
|
41
|
+
}), _isSlot(_slot = props.options.map((option) => createVNode(ElRadio, {
|
|
42
|
+
"key": String(option.value),
|
|
43
|
+
"value": option.value,
|
|
44
|
+
"disabled": option.disabled
|
|
45
|
+
}, {
|
|
46
|
+
default: () => [option.label]
|
|
47
|
+
}))) ? _slot : {
|
|
48
|
+
default: () => [_slot]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
Radio
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=Radio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.mjs","sources":["../../src/primitives/Radio.tsx"],"sourcesContent":["import { defineComponent, type PropType } from 'vue'\nimport { ElRadioGroup, ElRadio } from 'element-plus'\nimport type { RadioProps, Size } from '@fbkworks/adapter-core'\nimport { toElementSize } from '../size'\n\n/** 单选组。与 Select 的区别是选项全部可见,适合 2-4 个枚举值。 */\nexport const Radio = defineComponent({\n name: 'FbkElRadio',\n inheritAttrs: false,\n props: {\n modelValue: { type: [String, Number] as PropType<string | number | null>, default: undefined },\n options: { type: Array as PropType<RadioProps['options']>, default: () => [] },\n disabled: Boolean,\n size: { type: String as PropType<Size>, default: 'md' },\n },\n emits: ['update:modelValue', 'change'],\n setup(props, { attrs, emit }) {\n return () => (\n <ElRadioGroup\n {...attrs}\n modelValue={props.modelValue ?? undefined}\n disabled={props.disabled}\n size={toElementSize(props.size)}\n onUpdate:modelValue={(value: string | number | boolean | undefined) => {\n // 取消选中时 element 会传 undefined,契约里用 null 表示空\n const next = value === undefined ? null : (value as string | number)\n emit('update:modelValue', next)\n emit('change', next)\n }}\n >\n {props.options.map((option) => (\n <ElRadio key={String(option.value)} value={option.value} disabled={option.disabled}>\n {option.label}\n </ElRadio>\n ))}\n </ElRadioGroup>\n )\n },\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","Radio","defineComponent","name","inheritAttrs","props","modelValue","type","String","Number","default","undefined","options","Array","disabled","Boolean","size","emits","setup","attrs","emit","_slot","_createVNode","ElRadioGroup","_mergeProps","toElementSize","value","next","map","option","ElRadio","label"],"mappings":";;;AAKA,SAAAA,QAAAC,GAAA;AAAA,SAAA,OAAAA,MAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAA,qBAAA,CAAAK,QAAAL,CAAA;AAAA;AACO,MAAMM,QAAQC,gCAAgB;AAAA,EACnCC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAO;AAAA,IACLC,YAAY;AAAA,MAAEC,MAAM,CAACC,QAAQC,MAAM;AAAA,MAAuCC,SAASC;AAAAA;IACnFC,SAAS;AAAA,MAAEL,MAAMM;AAAAA,MAA0CH,SAASA,MAAM,CAAA;AAAA;IAC1EI,UAAUC;AAAAA,IACVC,MAAM;AAAA,MAAET,MAAMC;AAAAA,MAA0BE,SAAS;AAAA,IAAK;AAAA;EAExDO,OAAO,CAAC,qBAAqB,QAAQ;AAAA,EACrCC,MAAMb,OAAO;AAAA,IAAEc;AAAAA,IAAOC;AAAAA,EAAK,GAAG;AAC5B,WAAO,MAAA;AAAA,UAAAC;AAAA,aAAAC,YAAAC,cAAAC,WAECL,OAAK;AAAA,QAAA,cACGd,MAAMC,cAAcK;AAAAA,QAAS,YAC/BN,MAAMS;AAAAA,QAAQ,QAClBW,cAAcpB,MAAMW,IAAI;AAAA,QAAC,uBACTU,WAAiD;AAErE,gBAAMC,OAAOD,UAAUf,SAAY,OAAQe;AAC3CN,eAAK,qBAAqBO,IAAI;AAC9BP,eAAK,UAAUO,IAAI;AAAA,QACrB;AAAA,MAAC,CAAA,GAAAjC,QAAA2B,QAEAhB,MAAMO,QAAQgB,IAAKC,YAAMP,YAAAQ,SAAA;AAAA,QAAA,OACVtB,OAAOqB,OAAOH,KAAK;AAAA,QAAC,SAASG,OAAOH;AAAAA,QAAK,YAAYG,OAAOf;AAAAA,MAAQ,GAAA;AAAA,QAAAJ,SAAAA,MAAA,CAC/EmB,OAAOE,KAAK;AAAA,OAAA,CAEhB,CAAC,IAAAV,QAAA;AAAA,QAAAX,SAAAA,MAAA,CAAAW,KAAA;AAAA,MAAA,CAAA;AAAA,IAAA;AAAA,EAGR;AACF,CAAC;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { SelectOption, SelectProps, Size } from '@fbkworks/adapter-core';
|
|
3
|
+
export declare const Select: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: PropType<SelectProps["modelValue"]>;
|
|
6
|
+
default: undefined;
|
|
7
|
+
};
|
|
8
|
+
options: {
|
|
9
|
+
type: PropType<SelectOption[]>;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
12
|
+
multiple: BooleanConstructor;
|
|
13
|
+
filterable: BooleanConstructor;
|
|
14
|
+
clearable: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
placeholder: StringConstructor;
|
|
19
|
+
title: StringConstructor;
|
|
20
|
+
size: {
|
|
21
|
+
type: PropType<Size>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
disabled: BooleanConstructor;
|
|
25
|
+
loading: BooleanConstructor;
|
|
26
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: PropType<SelectProps["modelValue"]>;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
31
|
+
options: {
|
|
32
|
+
type: PropType<SelectOption[]>;
|
|
33
|
+
default: () => never[];
|
|
34
|
+
};
|
|
35
|
+
multiple: BooleanConstructor;
|
|
36
|
+
filterable: BooleanConstructor;
|
|
37
|
+
clearable: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
placeholder: StringConstructor;
|
|
42
|
+
title: StringConstructor;
|
|
43
|
+
size: {
|
|
44
|
+
type: PropType<Size>;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
disabled: BooleanConstructor;
|
|
48
|
+
loading: BooleanConstructor;
|
|
49
|
+
}>> & Readonly<{
|
|
50
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
51
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
52
|
+
}>, {
|
|
53
|
+
size: Size;
|
|
54
|
+
disabled: boolean;
|
|
55
|
+
loading: boolean;
|
|
56
|
+
multiple: boolean;
|
|
57
|
+
modelValue: string | number | (string | number)[] | null | undefined;
|
|
58
|
+
clearable: boolean;
|
|
59
|
+
filterable: boolean;
|
|
60
|
+
options: SelectOption<string | number>[];
|
|
61
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode, mergeProps, isVNode } from "vue";
|
|
2
|
+
import { ElSelect, ElOption } from "element-plus";
|
|
3
|
+
import { toElementSize } from "../size.mjs";
|
|
4
|
+
function _isSlot(s) {
|
|
5
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
6
|
+
}
|
|
7
|
+
const Select = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "FbkElSelect",
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: [String, Number, Array],
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
options: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
multiple: Boolean,
|
|
20
|
+
filterable: Boolean,
|
|
21
|
+
clearable: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
placeholder: String,
|
|
26
|
+
title: String,
|
|
27
|
+
size: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "md"
|
|
30
|
+
},
|
|
31
|
+
disabled: Boolean,
|
|
32
|
+
loading: Boolean
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:modelValue", "change"],
|
|
35
|
+
setup(props, {
|
|
36
|
+
attrs,
|
|
37
|
+
emit
|
|
38
|
+
}) {
|
|
39
|
+
const size = computed(() => toElementSize(props.size));
|
|
40
|
+
return () => {
|
|
41
|
+
let _slot;
|
|
42
|
+
return createVNode(ElSelect, mergeProps(attrs, {
|
|
43
|
+
"modelValue": props.modelValue ?? void 0,
|
|
44
|
+
"multiple": props.multiple,
|
|
45
|
+
"filterable": props.filterable,
|
|
46
|
+
"clearable": props.clearable,
|
|
47
|
+
"placeholder": props.placeholder,
|
|
48
|
+
"size": size.value,
|
|
49
|
+
"disabled": props.disabled || props.loading,
|
|
50
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
51
|
+
"onChange": (value) => emit("change", value)
|
|
52
|
+
}), _isSlot(_slot = props.options.map((option) => createVNode(ElOption, {
|
|
53
|
+
"key": String(option.value),
|
|
54
|
+
"label": option.label,
|
|
55
|
+
"value": option.value,
|
|
56
|
+
"disabled": option.disabled
|
|
57
|
+
}, null))) ? _slot : {
|
|
58
|
+
default: () => [_slot]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
Select
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=Select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.mjs","sources":["../../src/primitives/Select.tsx"],"sourcesContent":["import { computed, defineComponent, type PropType } from 'vue'\nimport { ElOption, ElSelect } from 'element-plus'\nimport type { SelectOption, SelectProps, Size } from '@fbkworks/adapter-core'\nimport { toElementSize } from '../size'\n\nexport const Select = defineComponent({\n name: 'FbkElSelect',\n inheritAttrs: false,\n props: {\n modelValue: { type: [String, Number, Array] as PropType<SelectProps['modelValue']>, default: undefined },\n options: { type: Array as PropType<SelectOption[]>, default: () => [] },\n multiple: Boolean,\n filterable: Boolean,\n clearable: { type: Boolean, default: true },\n placeholder: String,\n title: String,\n size: { type: String as PropType<Size>, default: 'md' },\n disabled: Boolean,\n loading: Boolean,\n },\n emits: ['update:modelValue', 'change'],\n setup(props, { attrs, emit }) {\n const size = computed(() => toElementSize(props.size))\n return () => (\n <ElSelect\n {...attrs}\n modelValue={props.modelValue ?? undefined}\n multiple={props.multiple}\n filterable={props.filterable}\n clearable={props.clearable}\n placeholder={props.placeholder}\n size={size.value}\n disabled={props.disabled || props.loading}\n onUpdate:modelValue={(value: unknown) => emit('update:modelValue', value)}\n onChange={(value: unknown) => emit('change', value)}\n >\n {props.options.map((option) => (\n <ElOption\n key={String(option.value)}\n label={option.label}\n value={option.value}\n disabled={option.disabled}\n />\n ))}\n </ElSelect>\n )\n },\n})\n"],"names":["_isSlot","s","Object","prototype","toString","call","_isVNode","Select","defineComponent","name","inheritAttrs","props","modelValue","type","String","Number","Array","default","undefined","options","multiple","Boolean","filterable","clearable","placeholder","title","size","disabled","loading","emits","setup","attrs","emit","computed","toElementSize","_slot","_createVNode","ElSelect","_mergeProps","value","map","option","ElOption","label"],"mappings":";;;AAGuC,SAAAA,QAAAC,GAAA;AAAA,SAAA,OAAAA,MAAA,cAAAC,OAAAC,UAAAC,SAAAC,KAAAJ,CAAA,MAAA,qBAAA,CAAAK,QAAAL,CAAA;AAAA;AAEhC,MAAMM,SAASC,gCAAgB;AAAA,EACpCC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAO;AAAA,IACLC,YAAY;AAAA,MAAEC,MAAM,CAACC,QAAQC,QAAQC,KAAK;AAAA,MAA0CC,SAASC;AAAAA;IAC7FC,SAAS;AAAA,MAAEN,MAAMG;AAAAA,MAAmCC,SAASA,MAAM,CAAA;AAAA;IACnEG,UAAUC;AAAAA,IACVC,YAAYD;AAAAA,IACZE,WAAW;AAAA,MAAEV,MAAMQ;AAAAA,MAASJ,SAAS;AAAA;IACrCO,aAAaV;AAAAA,IACbW,OAAOX;AAAAA,IACPY,MAAM;AAAA,MAAEb,MAAMC;AAAAA,MAA0BG,SAAS;AAAA;IACjDU,UAAUN;AAAAA,IACVO,SAASP;AAAAA;EAEXQ,OAAO,CAAC,qBAAqB,QAAQ;AAAA,EACrCC,MAAMnB,OAAO;AAAA,IAAEoB;AAAAA,IAAOC;AAAAA,EAAK,GAAG;AAC5B,UAAMN,OAAOO,SAAS,MAAMC,cAAcvB,MAAMe,IAAI,CAAC;AACrD,WAAO,MAAA;AAAA,UAAAS;AAAA,aAAAC,YAAAC,UAAAC,WAECP,OAAK;AAAA,QAAA,cACGpB,MAAMC,cAAcM;AAAAA,QAAS,YAC/BP,MAAMS;AAAAA,QAAQ,cACZT,MAAMW;AAAAA,QAAU,aACjBX,MAAMY;AAAAA,QAAS,eACbZ,MAAMa;AAAAA,QAAW,QACxBE,KAAKa;AAAAA,QAAK,YACN5B,MAAMgB,YAAYhB,MAAMiB;AAAAA,QAAO,uBACnBW,WAAmBP,KAAK,qBAAqBO,KAAK;AAAA,QAAC,YAC9DA,WAAmBP,KAAK,UAAUO,KAAK;AAAA,MAAC,CAAA,GAAAvC,QAAAmC,QAElDxB,MAAMQ,QAAQqB,IAAKC,YAAML,YAAAM,UAAA;AAAA,QAAA,OAEjB5B,OAAO2B,OAAOF,KAAK;AAAA,QAAC,SAClBE,OAAOE;AAAAA,QAAK,SACZF,OAAOF;AAAAA,QAAK,YACTE,OAAOd;AAAAA,SAAQ,IAAA,CAE5B,CAAC,IAAAQ,QAAA;AAAA,QAAAlB,SAAAA,MAAA,CAAAkB,KAAA;AAAA,MAAA,CAAA;AAAA,IAAA;AAAA,EAGR;AACF,CAAC;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* element-plus 没有独立的 Spin 组件(只有 v-loading 指令)。
|
|
3
|
+
* 这里用 tokens 驱动的纯 CSS 指示器,避免为了一个加载态引入指令注册要求。
|
|
4
|
+
*/
|
|
5
|
+
export declare const Spin: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
loading: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
description: StringConstructor;
|
|
11
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
14
|
+
loading: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
description: StringConstructor;
|
|
19
|
+
}>> & Readonly<{}>, {
|
|
20
|
+
loading: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent, h } from "vue";
|
|
2
|
+
const Spin = /* @__PURE__ */ defineComponent({
|
|
3
|
+
name: "FbkElSpin",
|
|
4
|
+
inheritAttrs: false,
|
|
5
|
+
props: {
|
|
6
|
+
loading: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: true
|
|
9
|
+
},
|
|
10
|
+
description: String
|
|
11
|
+
},
|
|
12
|
+
setup(props, {
|
|
13
|
+
attrs,
|
|
14
|
+
slots
|
|
15
|
+
}) {
|
|
16
|
+
return () => h("div", {
|
|
17
|
+
...attrs,
|
|
18
|
+
class: "fbk-spin"
|
|
19
|
+
}, [props.loading ? h("div", {
|
|
20
|
+
class: "fbk-spin__indicator",
|
|
21
|
+
"data-fbk-part": "spin"
|
|
22
|
+
}, [h("span", {
|
|
23
|
+
class: "fbk-spin__dot"
|
|
24
|
+
}), props.description ? h("span", {
|
|
25
|
+
class: "fbk-spin__description"
|
|
26
|
+
}, props.description) : null]) : null, slots.default?.()]);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
Spin
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=Spin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spin.mjs","sources":["../../src/primitives/Spin.tsx"],"sourcesContent":["import { defineComponent, h } from 'vue'\n\n/**\n * element-plus 没有独立的 Spin 组件(只有 v-loading 指令)。\n * 这里用 tokens 驱动的纯 CSS 指示器,避免为了一个加载态引入指令注册要求。\n */\nexport const Spin = defineComponent({\n name: 'FbkElSpin',\n inheritAttrs: false,\n props: {\n loading: { type: Boolean, default: true },\n description: String,\n },\n setup(props, { attrs, slots }) {\n return () =>\n h('div', { ...attrs, class: 'fbk-spin' }, [\n props.loading\n ? h('div', { class: 'fbk-spin__indicator', 'data-fbk-part': 'spin' }, [\n h('span', { class: 'fbk-spin__dot' }),\n props.description ? h('span', { class: 'fbk-spin__description' }, props.description) : null,\n ])\n : null,\n slots.default?.(),\n ])\n },\n})\n"],"names":["Spin","defineComponent","name","inheritAttrs","props","loading","type","Boolean","default","description","String","setup","attrs","slots","h","class"],"mappings":";AAMO,MAAMA,OAAOC,gCAAgB;AAAA,EAClCC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAO;AAAA,IACLC,SAAS;AAAA,MAAEC,MAAMC;AAAAA,MAASC,SAAS;AAAA;IACnCC,aAAaC;AAAAA;EAEfC,MAAMP,OAAO;AAAA,IAAEQ;AAAAA,IAAOC;AAAAA,EAAM,GAAG;AAC7B,WAAO,MACLC,EAAE,OAAO;AAAA,MAAE,GAAGF;AAAAA,MAAOG,OAAO;AAAA,OAAc,CACxCX,MAAMC,UACFS,EAAE,OAAO;AAAA,MAAEC,OAAO;AAAA,MAAuB,iBAAiB;AAAA,IAAO,GAAG,CAClED,EAAE,QAAQ;AAAA,MAAEC,OAAO;AAAA,KAAiB,GACpCX,MAAMK,cAAcK,EAAE,QAAQ;AAAA,MAAEC,OAAO;AAAA,IAAwB,GAAGX,MAAMK,WAAW,IAAI,IAAI,CAC5F,IACD,MACJI,MAAML,UAAO,CAAI,CAClB;AAAA,EACL;AACF,CAAC;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { Size, Status } from '@fbkworks/adapter-core';
|
|
3
|
+
export declare const Tag: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
status: {
|
|
5
|
+
type: PropType<Status>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
size: {
|
|
9
|
+
type: PropType<Size>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
closable: BooleanConstructor;
|
|
13
|
+
bordered: BooleanConstructor;
|
|
14
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "close"[], "close", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
15
|
+
status: {
|
|
16
|
+
type: PropType<Status>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
type: PropType<Size>;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
closable: BooleanConstructor;
|
|
24
|
+
bordered: BooleanConstructor;
|
|
25
|
+
}>> & Readonly<{
|
|
26
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
size: Size;
|
|
29
|
+
status: Status;
|
|
30
|
+
closable: boolean;
|
|
31
|
+
bordered: boolean;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode, mergeProps } from "vue";
|
|
2
|
+
import { ElTag } from "element-plus";
|
|
3
|
+
import { toElementSize } from "../size.mjs";
|
|
4
|
+
const statusType = {
|
|
5
|
+
primary: "primary",
|
|
6
|
+
success: "success",
|
|
7
|
+
warning: "warning",
|
|
8
|
+
danger: "danger",
|
|
9
|
+
info: "info",
|
|
10
|
+
default: "info"
|
|
11
|
+
};
|
|
12
|
+
const Tag = /* @__PURE__ */ defineComponent({
|
|
13
|
+
name: "FbkElTag",
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
status: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "default"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "md"
|
|
23
|
+
},
|
|
24
|
+
closable: Boolean,
|
|
25
|
+
bordered: Boolean
|
|
26
|
+
},
|
|
27
|
+
emits: ["close"],
|
|
28
|
+
setup(props, {
|
|
29
|
+
attrs,
|
|
30
|
+
emit,
|
|
31
|
+
slots
|
|
32
|
+
}) {
|
|
33
|
+
const type = computed(() => statusType[props.status]);
|
|
34
|
+
return () => createVNode(ElTag, mergeProps(attrs, {
|
|
35
|
+
"type": type.value,
|
|
36
|
+
"size": toElementSize(props.size),
|
|
37
|
+
"closable": props.closable,
|
|
38
|
+
"effect": props.bordered ? "plain" : "light",
|
|
39
|
+
"onClose": () => emit("close")
|
|
40
|
+
}), {
|
|
41
|
+
default: () => [slots.default?.()]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
Tag
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=Tag.mjs.map
|