@mtn-ui/components 0.0.5 → 0.0.7
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/dist/button/index.js +1 -1
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-CfbO8ovs.js → Button.vue_vue_type_script_setup_true_lang-C2Vc6-OE.js} +965 -927
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-CfbO8ovs.js.map → Button.vue_vue_type_script_setup_true_lang-C2Vc6-OE.js.map} +1 -1
- package/dist/index/index.js +33344 -9150
- package/dist/index/index.js.map +1 -1
- package/dist/index/style.css +1 -1
- package/dist/resolver/index.js +33 -20
- package/dist/resolver/index.js.map +1 -1
- package/dist/types/auto-tooltip/AutoTooltip.d.ts +61 -0
- package/dist/types/auto-tooltip/index.d.ts +2 -0
- package/dist/types/auto-tooltip/types.d.ts +14 -0
- package/dist/types/color-picker/ColorPicker.d.ts +48 -0
- package/dist/types/color-picker/index.d.ts +2 -0
- package/dist/types/color-picker/types.d.ts +33 -0
- package/dist/types/content-container/ContentContainer.d.ts +48 -0
- package/dist/types/content-container/index.d.ts +2 -0
- package/dist/types/content-container/types.d.ts +12 -0
- package/dist/types/dict-badge/DictBadge.d.ts +48 -0
- package/dist/types/dict-badge/index.d.ts +2 -0
- package/dist/types/dict-badge/types.d.ts +23 -0
- package/dist/types/dict-checkbox/DictCheckbox.d.ts +54 -0
- package/dist/types/dict-checkbox/index.d.ts +2 -0
- package/dist/types/dict-checkbox/types.d.ts +23 -0
- package/dist/types/dict-radio/DictRadio.d.ts +57 -0
- package/dist/types/dict-radio/index.d.ts +2 -0
- package/dist/types/dict-radio/types.d.ts +25 -0
- package/dist/types/dict-select/DictSelect.d.ts +61 -0
- package/dist/types/dict-select/index.d.ts +2 -0
- package/dist/types/dict-select/types.d.ts +22 -0
- package/dist/types/dict-tag/DictTag.d.ts +48 -0
- package/dist/types/dict-tag/index.d.ts +2 -0
- package/dist/types/dict-tag/types.d.ts +23 -0
- package/dist/types/form-item/FormItem.d.ts +39 -0
- package/dist/types/form-item/constants.d.ts +9 -0
- package/dist/types/form-item/index.d.ts +4 -0
- package/dist/types/form-item/types.d.ts +46 -0
- package/dist/types/form-item/validator.d.ts +1 -0
- package/dist/types/form-renderer/FormRenderer.d.ts +37 -0
- package/dist/types/form-renderer/helpers.d.ts +9 -0
- package/dist/types/form-renderer/index.d.ts +3 -0
- package/dist/types/form-renderer/types.d.ts +13 -0
- package/dist/types/form-row/FormRow.d.ts +33 -0
- package/dist/types/form-row/index.d.ts +2 -0
- package/dist/types/form-row/types.d.ts +11 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/search-bar/SearchBar.d.ts +60 -0
- package/dist/types/search-bar/index.d.ts +2 -0
- package/dist/types/search-bar/types.d.ts +58 -0
- package/package.json +2 -2
package/dist/index/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@source "./**/*.{vue,ts,js,tsx,jsx}";.mtn-action-group-wrapper[data-v-6a4e52d6]{width:100%;position:relative;display:inline-block}.mtn-action-group-measure[data-v-6a4e52d6]{position:absolute;top:0;left:0;visibility:hidden;pointer-events:none;display:flex;white-space:nowrap}.measure-item[data-v-6a4e52d6]{padding:0 16px;font-size:14px}.mtn-action-group-container[data-v-6a4e52d6]{display:flex;align-items:center}.mtn-color-picker[data-v-95fc5ac1]{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.mtn-color-picker__trigger[data-v-95fc5ac1]{position:relative;display:inline-block;border-radius:4px;overflow:hidden;border:1px solid var(--color-border-base, #dcdfe6);cursor:pointer}.mtn-color-picker--small .mtn-color-picker__trigger[data-v-95fc5ac1]{width:24px;height:24px}.mtn-color-picker--middle .mtn-color-picker__trigger[data-v-95fc5ac1]{width:32px;height:32px}.mtn-color-picker--large .mtn-color-picker__trigger[data-v-95fc5ac1]{width:40px;height:40px}.mtn-color-picker__native[data-v-95fc5ac1]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer;border:none;padding:0}.mtn-color-picker__native[data-v-95fc5ac1]:disabled{cursor:not-allowed}.mtn-color-picker__swatch[data-v-95fc5ac1]{display:block;width:100%;height:100%;border-radius:2px}.mtn-color-picker__hex[data-v-95fc5ac1]{width:90px;padding:4px 8px;font-size:12px;font-family:ui-monospace,monospace;border:1px solid var(--color-border-base, #dcdfe6);border-radius:4px;outline:none}.mtn-color-picker__hex[data-v-95fc5ac1]:focus{border-color:var(--color-primary, #409eff);box-shadow:0 0 0 2px #409eff33}.mtn-color-picker__hex[data-v-95fc5ac1]:disabled{background:var(--color-bg-base, #f5f7fa);cursor:not-allowed}.mtn-color-picker--small .mtn-color-picker__hex[data-v-95fc5ac1]{padding:2px 6px;font-size:11px;width:72px}.mtn-color-picker--large .mtn-color-picker__hex[data-v-95fc5ac1]{padding:6px 10px;font-size:14px;width:100px}.mtn-color-picker__apply[data-v-95fc5ac1]{padding:4px 12px;font-size:12px;color:var(--color-primary, #409eff);background:transparent;border:1px solid var(--color-primary, #409eff);border-radius:4px;cursor:pointer;transition:all .2s}.mtn-color-picker__apply[data-v-95fc5ac1]:hover:not(:disabled){color:#fff;background:var(--color-primary, #409eff)}.mtn-color-picker__apply[data-v-95fc5ac1]:disabled{opacity:.5;cursor:not-allowed}.mtn-color-picker--small .mtn-color-picker__apply[data-v-95fc5ac1]{padding:2px 8px;font-size:11px}.mtn-color-picker--large .mtn-color-picker__apply[data-v-95fc5ac1]{padding:6px 16px;font-size:14px}.mtn-form-item__label-icon[data-v-bd63853e]{margin-bottom:2px}.mtn-content-container[data-v-0d6736e8]{box-sizing:border-box;background:#fff}.mtn-content-container.mtn-content-container--dark[data-v-0d6736e8]{background:#141414}.mtn-auto-tooltip__text[data-v-9de4908e]{display:inline-block;max-width:100%;vertical-align:middle}.mtn-auto-tooltip__text--single[data-v-9de4908e]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mtn-auto-tooltip__text--multiline[data-v-9de4908e]{overflow:hidden;white-space:normal}.mtn-dict-radio--vertical[data-v-b1285642],.mtn-dict-checkbox--vertical[data-v-736ed517]{display:flex;flex-direction:column;gap:8px}.mtn-search-bar[data-v-0b796aff]{margin-bottom:16px}.mtn-search-bar__row[data-v-0b796aff]{margin-bottom:0}.mtn-search-bar__actions[data-v-0b796aff]{display:flex;align-items:center;gap:8px;margin-top:16px}.mtn-search-bar--config .mtn-search-bar__form-inline[data-v-0b796aff]{display:flex;flex-wrap:wrap;gap:0 4px;align-items:flex-start}.mtn-search-bar--config .mtn-search-bar__form-item[data-v-0b796aff]{margin-bottom:16px;margin-inline-end:8px}.mtn-search-bar--config .mtn-search-bar__form-item--expand[data-v-0b796aff]{margin-inline-start:8px}.mtn-search-bar__expand-btn[data-v-0b796aff]{padding-inline:0}.mtn-search-bar__advanced[data-v-0b796aff]{margin-top:4px;padding:24px 16px 8px;background:#00000005;border-radius:8px}.mtn-search-bar__advanced-form[data-v-0b796aff],.mtn-search-bar__advanced-row[data-v-0b796aff]{margin-bottom:0}.mtn-search-bar__advanced-item[data-v-0b796aff]{margin-bottom:16px}
|
package/dist/resolver/index.js
CHANGED
|
@@ -1,35 +1,48 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(t) {
|
|
2
2
|
return t.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
|
|
3
3
|
}
|
|
4
|
-
|
|
4
|
+
const r = /* @__PURE__ */ new Set([
|
|
5
|
+
"Button",
|
|
6
|
+
"ConfirmButton",
|
|
7
|
+
"DeleteButton",
|
|
8
|
+
"ActionGroup",
|
|
9
|
+
"ColorPicker",
|
|
10
|
+
"FormItem",
|
|
11
|
+
"FormRow",
|
|
12
|
+
"FormRenderer",
|
|
13
|
+
"ContentContainer",
|
|
14
|
+
"DictSelect",
|
|
15
|
+
"DictRadio",
|
|
16
|
+
"DictCheckbox",
|
|
17
|
+
"DictBadge",
|
|
18
|
+
"DictTag",
|
|
19
|
+
"SearchBar",
|
|
20
|
+
"AutoTooltip"
|
|
21
|
+
]);
|
|
22
|
+
function c() {
|
|
5
23
|
return {
|
|
6
24
|
type: "component",
|
|
7
25
|
resolve: (t) => {
|
|
8
26
|
if (t.startsWith("Mtn")) {
|
|
9
|
-
const
|
|
27
|
+
const o = t.slice(3), n = e(o);
|
|
10
28
|
return {
|
|
11
|
-
name:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
29
|
+
name: o,
|
|
30
|
+
from: `@mtn-ui/components/${n}`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (r.has(t)) {
|
|
34
|
+
const o = e(t);
|
|
35
|
+
return {
|
|
36
|
+
name: t,
|
|
37
|
+
from: `@mtn-ui/components/${o}`
|
|
17
38
|
};
|
|
18
39
|
}
|
|
19
|
-
const n = o(t);
|
|
20
|
-
return {
|
|
21
|
-
name: t,
|
|
22
|
-
// 导出名称(如 Button)
|
|
23
|
-
from: `@mtn-ui/components/${n}`
|
|
24
|
-
// 路径(如 button)
|
|
25
|
-
// sideEffects: `@mtn-ui/components/${path}/style`,
|
|
26
|
-
};
|
|
27
40
|
}
|
|
28
41
|
};
|
|
29
42
|
}
|
|
30
|
-
const
|
|
43
|
+
const i = c();
|
|
31
44
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
c as MtnUIResolver,
|
|
46
|
+
i as default
|
|
34
47
|
};
|
|
35
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/resolver.ts"],"sourcesContent":["import type { ComponentResolver } from 'unplugin-vue-components/types'\n\n/**\n * MTN UI Components Resolver\n * \n * 用于 unplugin-vue-components 的组件解析器\n * 当在模板中使用 <MtnButton /> 时,自动解析组件和样式路径\n * \n * @example\n * ```ts\n * // vite.config.ts\n * import Components from 'unplugin-vue-components/vite'\n * import { MtnUIResolver } from '@mtn-ui/components/resolver'\n * \n * export default defineConfig({\n * plugins: [\n * Components({\n * resolvers: [MtnUIResolver()]\n * })\n * ]\n * })\n * ```\n */\n/**\n * 将 PascalCase 转换为 kebab-case\n * @example\n * PascalCaseToKebabCase('ConfirmButton') => 'confirm-button'\n * PascalCaseToKebabCase('Button') => 'button'\n */\nfunction pascalCaseToKebabCase(str: string): string {\n return str\n .replace(/([A-Z])/g, '-$1') // 在大写字母前添加连字符\n .toLowerCase() // 转为小写\n .replace(/^-/, '') // 移除开头的连字符\n}\n\nexport function MtnUIResolver(): ComponentResolver {\n return {\n type: 'component',\n resolve: (name: string) => {\n // 支持的组件名格式:\n // -
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/resolver.ts"],"sourcesContent":["import type { ComponentResolver } from 'unplugin-vue-components/types'\n\n/**\n * MTN UI Components Resolver\n * \n * 用于 unplugin-vue-components 的组件解析器\n * 当在模板中使用 <MtnButton /> 时,自动解析组件和样式路径\n * \n * @example\n * ```ts\n * // vite.config.ts\n * import Components from 'unplugin-vue-components/vite'\n * import { MtnUIResolver } from '@mtn-ui/components/resolver'\n * \n * export default defineConfig({\n * plugins: [\n * Components({\n * resolvers: [MtnUIResolver()]\n * })\n * ]\n * })\n * ```\n */\n/**\n * 将 PascalCase 转换为 kebab-case\n * @example\n * PascalCaseToKebabCase('ConfirmButton') => 'confirm-button'\n * PascalCaseToKebabCase('Button') => 'button'\n */\nfunction pascalCaseToKebabCase(str: string): string {\n return str\n .replace(/([A-Z])/g, '-$1') // 在大写字母前添加连字符\n .toLowerCase() // 转为小写\n .replace(/^-/, '') // 移除开头的连字符\n}\n\n/** 仅解析以 Mtn 开头或在此白名单内的组件,避免把 AForm、ALayout 等 Ant Design Vue 组件误解析到 @mtn-ui/components */\nconst MTN_COMPONENT_NAMES = new Set([\n 'Button',\n 'ConfirmButton',\n 'DeleteButton',\n 'ActionGroup',\n 'ColorPicker',\n 'FormItem',\n 'FormRow',\n 'FormRenderer',\n 'ContentContainer',\n 'DictSelect',\n 'DictRadio',\n 'DictCheckbox',\n 'DictBadge',\n 'DictTag',\n 'SearchBar',\n 'AutoTooltip'\n])\n\nexport function MtnUIResolver(): ComponentResolver {\n return {\n type: 'component',\n resolve: (name: string) => {\n // 支持的组件名格式:\n // - MtnButton (PascalCase,移除 Mtn 前缀) → 解析\n // - Button(在白名单内)→ 解析\n // - AForm、ALayout 等非 Mtn 且不在白名单 → 不解析(return undefined),由其他 resolver 或用户手动从 ant-design-vue 导入\n\n if (name.startsWith('Mtn')) {\n const componentName = name.slice(3)\n const path = pascalCaseToKebabCase(componentName)\n return {\n name: componentName,\n from: `@mtn-ui/components/${path}`,\n }\n }\n\n if (MTN_COMPONENT_NAMES.has(name)) {\n const path = pascalCaseToKebabCase(name)\n return {\n name: name,\n from: `@mtn-ui/components/${path}`,\n }\n }\n\n return undefined\n },\n }\n}\n\n/**\n * 默认导出的 Resolver\n */\nexport default MtnUIResolver()\n"],"names":["pascalCaseToKebabCase","str","MTN_COMPONENT_NAMES","MtnUIResolver","name","componentName","path","resolver"],"mappings":"AA6BA,SAASA,EAAsBC,GAAqB;AAClD,SAAOA,EACJ,QAAQ,YAAY,KAAK,EACzB,cACA,QAAQ,MAAM,EAAE;AACrB;AAGA,MAAMC,wBAA0B,IAAI;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAASC,IAAmC;AACjD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS,CAACC,MAAiB;AAMzB,UAAIA,EAAK,WAAW,KAAK,GAAG;AAC1B,cAAMC,IAAgBD,EAAK,MAAM,CAAC,GAC5BE,IAAON,EAAsBK,CAAa;AAChD,eAAO;AAAA,UACL,MAAMA;AAAA,UACN,MAAM,sBAAsBC,CAAI;AAAA,QAAA;AAAA,MAEpC;AAEA,UAAIJ,EAAoB,IAAIE,CAAI,GAAG;AACjC,cAAME,IAAON,EAAsBI,CAAI;AACvC,eAAO;AAAA,UACL,MAAAA;AAAA,UACA,MAAM,sBAAsBE,CAAI;AAAA,QAAA;AAAA,MAEpC;AAAA,IAGF;AAAA,EAAA;AAEJ;AAKA,MAAAC,IAAeJ,EAAA;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** 要展示的内容(未传时优先使用默认插槽) */
|
|
3
|
+
content?: string | number;
|
|
4
|
+
/** 文本最大宽度,数值为 px,也可传 CSS 值 */
|
|
5
|
+
maxWidth?: number | string;
|
|
6
|
+
/** 多行省略的行数,1 表示单行,>1 表示多行 */
|
|
7
|
+
lineClamp?: number;
|
|
8
|
+
/** 文本额外类名 */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** 文本额外内联样式 */
|
|
11
|
+
style?: Record<string, any>;
|
|
12
|
+
/** 透传给 ant-design-vue Tooltip 的属性 */
|
|
13
|
+
tooltipProps?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
declare function __VLS_template(): {
|
|
16
|
+
tooltip?(_: {}): any;
|
|
17
|
+
default?(_: {}): any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
20
|
+
content: undefined;
|
|
21
|
+
lineClamp: number;
|
|
22
|
+
class: undefined;
|
|
23
|
+
style: undefined;
|
|
24
|
+
tooltipProps: () => {};
|
|
25
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
26
|
+
content: undefined;
|
|
27
|
+
lineClamp: number;
|
|
28
|
+
class: undefined;
|
|
29
|
+
style: undefined;
|
|
30
|
+
tooltipProps: () => {};
|
|
31
|
+
}>>> & Readonly<{}>, {
|
|
32
|
+
class: string;
|
|
33
|
+
style: Record<string, any>;
|
|
34
|
+
content: string | number;
|
|
35
|
+
lineClamp: number;
|
|
36
|
+
tooltipProps: Record<string, any>;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
39
|
+
export default _default;
|
|
40
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
41
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
42
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
43
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
44
|
+
} : {
|
|
45
|
+
type: import('vue').PropType<T[K]>;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type __VLS_WithDefaults<P, D> = {
|
|
50
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
51
|
+
default: D[K];
|
|
52
|
+
}> : P[K];
|
|
53
|
+
};
|
|
54
|
+
type __VLS_Prettify<T> = {
|
|
55
|
+
[K in keyof T]: T[K];
|
|
56
|
+
} & {};
|
|
57
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AutoTooltipProps {
|
|
2
|
+
/** 要展示的内容(未传时优先使用默认插槽) */
|
|
3
|
+
content?: string | number;
|
|
4
|
+
/** 文本最大宽度,数值为 px,也可传 CSS 值 */
|
|
5
|
+
maxWidth?: number | string;
|
|
6
|
+
/** 多行省略的行数,1 表示单行,>1 表示多行 */
|
|
7
|
+
lineClamp?: number;
|
|
8
|
+
/** 文本额外类名 */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** 文本额外内联样式 */
|
|
11
|
+
style?: Record<string, any>;
|
|
12
|
+
/** 透传给 ant-design-vue Tooltip 的属性 */
|
|
13
|
+
tooltipProps?: Record<string, any>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ColorPickerProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ColorPickerProps>, {
|
|
4
|
+
modelValue: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
showHexInput: boolean;
|
|
7
|
+
showThemeApply: boolean;
|
|
8
|
+
size: string;
|
|
9
|
+
debounceMs: number;
|
|
10
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: string) => void;
|
|
12
|
+
change: (value: string) => void;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ColorPickerProps>, {
|
|
14
|
+
modelValue: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
showHexInput: boolean;
|
|
17
|
+
showThemeApply: boolean;
|
|
18
|
+
size: string;
|
|
19
|
+
debounceMs: number;
|
|
20
|
+
}>>> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
22
|
+
onChange?: ((value: string) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
size: "small" | "middle" | "large";
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
debounceMs: number;
|
|
27
|
+
modelValue: string;
|
|
28
|
+
showHexInput: boolean;
|
|
29
|
+
showThemeApply: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithDefaults<P, D> = {
|
|
42
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
43
|
+
default: D[K];
|
|
44
|
+
}> : P[K];
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Prettify<T> = {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} & {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 择色器组件属性
|
|
3
|
+
*/
|
|
4
|
+
export interface ColorPickerProps {
|
|
5
|
+
/**
|
|
6
|
+
* 当前颜色(受控,hex 如 #409eff)
|
|
7
|
+
*/
|
|
8
|
+
modelValue?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 是否禁用
|
|
11
|
+
*/
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 是否显示十六进制输入框
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
showHexInput?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 是否显示「应用到主题」按钮(需配合 @mtn-ui/utils 的 setThemePrimary)
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
showThemeApply?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 尺寸
|
|
25
|
+
* @default 'middle'
|
|
26
|
+
*/
|
|
27
|
+
size?: 'small' | 'middle' | 'large';
|
|
28
|
+
/**
|
|
29
|
+
* 原生选色条/取色盘变更时的防抖延迟(毫秒),仅对拖拽选色生效,hex 输入框不受影响
|
|
30
|
+
* @default 150
|
|
31
|
+
*/
|
|
32
|
+
debounceMs?: number;
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ContentContainerProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
default?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ContentContainerProps>, {
|
|
7
|
+
class: undefined;
|
|
8
|
+
style: undefined;
|
|
9
|
+
padding: number;
|
|
10
|
+
margin: number;
|
|
11
|
+
minHeight: undefined;
|
|
12
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ContentContainerProps>, {
|
|
13
|
+
class: undefined;
|
|
14
|
+
style: undefined;
|
|
15
|
+
padding: number;
|
|
16
|
+
margin: number;
|
|
17
|
+
minHeight: undefined;
|
|
18
|
+
}>>> & Readonly<{}>, {
|
|
19
|
+
class: string;
|
|
20
|
+
style: string | Record<string, string | number>;
|
|
21
|
+
padding: number | string;
|
|
22
|
+
margin: number | string;
|
|
23
|
+
minHeight: number | string;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
29
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
30
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
31
|
+
} : {
|
|
32
|
+
type: import('vue').PropType<T[K]>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type __VLS_WithDefaults<P, D> = {
|
|
37
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
38
|
+
default: D[K];
|
|
39
|
+
}> : P[K];
|
|
40
|
+
};
|
|
41
|
+
type __VLS_Prettify<T> = {
|
|
42
|
+
[K in keyof T]: T[K];
|
|
43
|
+
} & {};
|
|
44
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ContentContainerProps {
|
|
2
|
+
/** 额外 class */
|
|
3
|
+
class?: string;
|
|
4
|
+
/** 额外内联样式 */
|
|
5
|
+
style?: string | Record<string, string | number>;
|
|
6
|
+
/** 内边距,数字为 px,也可传 CSS 值如 '24px'、'1rem' */
|
|
7
|
+
padding?: number | string;
|
|
8
|
+
/** 外边距,数字为 px,也可传 CSS 值 */
|
|
9
|
+
margin?: number | string;
|
|
10
|
+
/** 最小高度,数字为 px,也可传 CSS 值如 '100vh'、'80%',不传则不设 */
|
|
11
|
+
minHeight?: number | string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DictItem, DictBadgeProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictBadgeProps>, {
|
|
4
|
+
value: undefined;
|
|
5
|
+
options: undefined;
|
|
6
|
+
dictType: undefined;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
valueKey: string;
|
|
9
|
+
colorKey: string;
|
|
10
|
+
storageKeyPrefix: string;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictBadgeProps>, {
|
|
13
|
+
value: undefined;
|
|
14
|
+
options: undefined;
|
|
15
|
+
dictType: undefined;
|
|
16
|
+
labelKey: string;
|
|
17
|
+
valueKey: string;
|
|
18
|
+
colorKey: string;
|
|
19
|
+
storageKeyPrefix: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
}>>> & Readonly<{}>, {
|
|
22
|
+
value: string | number;
|
|
23
|
+
options: DictItem[];
|
|
24
|
+
placeholder: string;
|
|
25
|
+
dictType: string;
|
|
26
|
+
labelKey: string;
|
|
27
|
+
valueKey: string;
|
|
28
|
+
colorKey: string;
|
|
29
|
+
storageKeyPrefix: string;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithDefaults<P, D> = {
|
|
42
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
43
|
+
default: D[K];
|
|
44
|
+
}> : P[K];
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Prettify<T> = {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} & {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DictItem } from '@mtn-ui/utils';
|
|
2
|
+
|
|
3
|
+
export type { DictItem };
|
|
4
|
+
export interface DictBadgeProps {
|
|
5
|
+
/** 要展示的字典值(dictValue),根据此值在字典中查找 label 与 color */
|
|
6
|
+
value?: string | number;
|
|
7
|
+
/** 字典列表,优先级高于 dictType */
|
|
8
|
+
options?: DictItem[];
|
|
9
|
+
/** 字典类型,从 localStorage 读取(key = storageKeyPrefix + dictType) */
|
|
10
|
+
dictType?: string;
|
|
11
|
+
/** 展示字段名 */
|
|
12
|
+
labelKey?: string;
|
|
13
|
+
/** 值字段名 */
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
/** 颜色字段名,用于 Badge 的 color */
|
|
16
|
+
colorKey?: string;
|
|
17
|
+
/** localStorage 的 key 前缀 */
|
|
18
|
+
storageKeyPrefix?: string;
|
|
19
|
+
/** 未匹配到字典项时展示的占位文案 */
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
/** 自定义类名 */
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DictItem, DictCheckboxProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictCheckboxProps>, {
|
|
4
|
+
modelValue: () => never[];
|
|
5
|
+
options: undefined;
|
|
6
|
+
dictType: undefined;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
valueKey: string;
|
|
9
|
+
storageKeyPrefix: string;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
direction: string;
|
|
12
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: (string | number)[]) => void;
|
|
14
|
+
change: (value: (string | number)[]) => void;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictCheckboxProps>, {
|
|
16
|
+
modelValue: () => never[];
|
|
17
|
+
options: undefined;
|
|
18
|
+
dictType: undefined;
|
|
19
|
+
labelKey: string;
|
|
20
|
+
valueKey: string;
|
|
21
|
+
storageKeyPrefix: string;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
direction: string;
|
|
24
|
+
}>>> & Readonly<{
|
|
25
|
+
"onUpdate:modelValue"?: ((value: (string | number)[]) => any) | undefined;
|
|
26
|
+
onChange?: ((value: (string | number)[]) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
options: DictItem[];
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
direction: "horizontal" | "vertical";
|
|
31
|
+
modelValue: (string | number)[];
|
|
32
|
+
dictType: string;
|
|
33
|
+
labelKey: string;
|
|
34
|
+
valueKey: string;
|
|
35
|
+
storageKeyPrefix: string;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
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: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
42
|
+
} : {
|
|
43
|
+
type: import('vue').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
|
+
} & {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DictItem } from '@mtn-ui/utils';
|
|
2
|
+
|
|
3
|
+
export type { DictItem };
|
|
4
|
+
export interface DictCheckboxProps {
|
|
5
|
+
/** 选中的值数组(对应 dictValue) */
|
|
6
|
+
modelValue?: (string | number)[];
|
|
7
|
+
/** 前端传入的字典列表,优先级高于 dictType */
|
|
8
|
+
options?: DictItem[];
|
|
9
|
+
/** 字典类型,从 localStorage 读取(key = storageKeyPrefix + dictType) */
|
|
10
|
+
dictType?: string;
|
|
11
|
+
/** 展示字段名 */
|
|
12
|
+
labelKey?: string;
|
|
13
|
+
/** 值字段名 */
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
/** localStorage 的 key 前缀 */
|
|
16
|
+
storageKeyPrefix?: string;
|
|
17
|
+
/** 是否禁用 */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 排列方向 */
|
|
20
|
+
direction?: 'horizontal' | 'vertical';
|
|
21
|
+
/** 自定义类名 */
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DictItem, DictRadioProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictRadioProps>, {
|
|
4
|
+
modelValue: undefined;
|
|
5
|
+
options: undefined;
|
|
6
|
+
dictType: undefined;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
valueKey: string;
|
|
9
|
+
storageKeyPrefix: string;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
optionType: string;
|
|
12
|
+
direction: string;
|
|
13
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: string | number | undefined) => void;
|
|
15
|
+
change: (value: string | number | undefined) => void;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictRadioProps>, {
|
|
17
|
+
modelValue: undefined;
|
|
18
|
+
options: undefined;
|
|
19
|
+
dictType: undefined;
|
|
20
|
+
labelKey: string;
|
|
21
|
+
valueKey: string;
|
|
22
|
+
storageKeyPrefix: string;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
optionType: string;
|
|
25
|
+
direction: string;
|
|
26
|
+
}>>> & Readonly<{
|
|
27
|
+
"onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
|
|
28
|
+
onChange?: ((value: string | number | undefined) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
options: DictItem[];
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
direction: "horizontal" | "vertical";
|
|
33
|
+
modelValue: string | number;
|
|
34
|
+
dictType: string;
|
|
35
|
+
labelKey: string;
|
|
36
|
+
valueKey: string;
|
|
37
|
+
storageKeyPrefix: string;
|
|
38
|
+
optionType: "default" | "button";
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
42
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
43
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
44
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
45
|
+
} : {
|
|
46
|
+
type: import('vue').PropType<T[K]>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
type __VLS_WithDefaults<P, D> = {
|
|
51
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
52
|
+
default: D[K];
|
|
53
|
+
}> : P[K];
|
|
54
|
+
};
|
|
55
|
+
type __VLS_Prettify<T> = {
|
|
56
|
+
[K in keyof T]: T[K];
|
|
57
|
+
} & {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DictItem } from '@mtn-ui/utils';
|
|
2
|
+
|
|
3
|
+
export type { DictItem };
|
|
4
|
+
export interface DictRadioProps {
|
|
5
|
+
/** 选中的值(对应 dictValue) */
|
|
6
|
+
modelValue?: string | number;
|
|
7
|
+
/** 前端传入的字典列表,优先级高于 dictType */
|
|
8
|
+
options?: DictItem[];
|
|
9
|
+
/** 字典类型,从 localStorage 读取(key = storageKeyPrefix + dictType) */
|
|
10
|
+
dictType?: string;
|
|
11
|
+
/** 展示字段名 */
|
|
12
|
+
labelKey?: string;
|
|
13
|
+
/** 值字段名 */
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
/** localStorage 的 key 前缀 */
|
|
16
|
+
storageKeyPrefix?: string;
|
|
17
|
+
/** 是否禁用 */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 展示形式:默认圆点 或 按钮样式 */
|
|
20
|
+
optionType?: 'default' | 'button';
|
|
21
|
+
/** 排列方向 */
|
|
22
|
+
direction?: 'horizontal' | 'vertical';
|
|
23
|
+
/** 自定义类名 */
|
|
24
|
+
class?: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DictItem, DictSelectProps } from './types';
|
|
2
|
+
|
|
3
|
+
type ModelValue = string | number | string[] | number[] | undefined;
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictSelectProps>, {
|
|
5
|
+
modelValue: undefined;
|
|
6
|
+
options: undefined;
|
|
7
|
+
dictType: undefined;
|
|
8
|
+
labelKey: string;
|
|
9
|
+
valueKey: string;
|
|
10
|
+
storageKeyPrefix: string;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
allowClear: boolean;
|
|
14
|
+
multiple: boolean;
|
|
15
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: ModelValue) => void;
|
|
17
|
+
change: (value: ModelValue) => void;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DictSelectProps>, {
|
|
19
|
+
modelValue: undefined;
|
|
20
|
+
options: undefined;
|
|
21
|
+
dictType: undefined;
|
|
22
|
+
labelKey: string;
|
|
23
|
+
valueKey: string;
|
|
24
|
+
storageKeyPrefix: string;
|
|
25
|
+
placeholder: string;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
allowClear: boolean;
|
|
28
|
+
multiple: boolean;
|
|
29
|
+
}>>> & Readonly<{
|
|
30
|
+
"onUpdate:modelValue"?: ((value: ModelValue) => any) | undefined;
|
|
31
|
+
onChange?: ((value: ModelValue) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
options: DictItem[];
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
placeholder: string;
|
|
36
|
+
multiple: boolean;
|
|
37
|
+
modelValue: string | number | (string | number)[];
|
|
38
|
+
dictType: string;
|
|
39
|
+
labelKey: string;
|
|
40
|
+
valueKey: string;
|
|
41
|
+
storageKeyPrefix: string;
|
|
42
|
+
allowClear: boolean;
|
|
43
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
46
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
47
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
48
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
49
|
+
} : {
|
|
50
|
+
type: import('vue').PropType<T[K]>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
type __VLS_WithDefaults<P, D> = {
|
|
55
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
56
|
+
default: D[K];
|
|
57
|
+
}> : P[K];
|
|
58
|
+
};
|
|
59
|
+
type __VLS_Prettify<T> = {
|
|
60
|
+
[K in keyof T]: T[K];
|
|
61
|
+
} & {};
|