hzzt-plus 0.0.1-dev-01 → 0.0.1-dev-02
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/index.full.js +291 -55
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +287 -57
- package/dist/locale/en.js +7 -2
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.js.map +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.min.mjs.map +1 -1
- package/dist/locale/en.mjs +7 -2
- package/dist/locale/zh-cn.js +7 -2
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.js.map +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.min.mjs.map +1 -1
- package/dist/locale/zh-cn.mjs +7 -2
- package/es/component.mjs +5 -1
- package/es/component.mjs.map +1 -1
- package/es/components/collapse/index.d.ts +55 -0
- package/es/components/collapse/src/index.vue.d.ts +55 -0
- package/es/components/collapse/style/css.d.ts +2 -0
- package/es/components/collapse/style/index.d.ts +2 -0
- package/es/components/config-provider/index.d.ts +41 -0
- package/es/components/config-provider/src/config-provider-props.d.ts +19 -0
- package/es/components/config-provider/src/config-provider.d.ts +38 -0
- package/es/components/config-provider/src/constants.d.ts +4 -0
- package/es/components/config-provider/src/hooks/use-global-config.d.ts +6 -0
- package/es/components/config-provider/style/css.d.ts +2 -0
- package/es/components/config-provider/style/index.d.ts +2 -0
- package/es/components/dropdown/index.d.ts +1 -0
- package/es/components/dropdown/src/index.vue.d.ts +1 -0
- package/es/components/index.d.ts +2 -0
- package/es/defaults.d.ts +1 -1
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/use-locale/index.d.ts +15 -0
- package/es/hooks/use-size/index.d.ts +21 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +5 -0
- package/es/index.mjs.map +1 -1
- package/es/locale/index.d.ts +1 -1
- package/es/locale/lang/en.d.ts +6 -1
- package/es/locale/lang/zh-cn.d.ts +6 -1
- package/es/make-installer.d.ts +1 -1
- package/es/make-installer.mjs +5 -1
- package/es/make-installer.mjs.map +1 -1
- package/es/packages/components/collapse/index.mjs +8 -0
- package/es/packages/components/collapse/index.mjs.map +1 -0
- package/es/packages/components/collapse/src/index.mjs +69 -0
- package/es/packages/components/collapse/src/index.mjs.map +1 -0
- package/es/packages/components/collapse/style/css.mjs +3 -0
- package/es/packages/components/collapse/style/css.mjs.map +1 -0
- package/es/packages/components/collapse/style/index.mjs +3 -0
- package/es/packages/components/collapse/style/index.mjs.map +1 -0
- package/es/packages/components/config-provider/index.mjs +11 -0
- package/es/packages/components/config-provider/index.mjs.map +1 -0
- package/es/packages/components/config-provider/src/config-provider-props.mjs +22 -0
- package/es/packages/components/config-provider/src/config-provider-props.mjs.map +1 -0
- package/es/packages/components/config-provider/src/config-provider.mjs +15 -0
- package/es/packages/components/config-provider/src/config-provider.mjs.map +1 -0
- package/es/packages/components/config-provider/src/constants.mjs +4 -0
- package/es/packages/components/config-provider/src/constants.mjs.map +1 -0
- package/es/packages/components/config-provider/src/hooks/use-global-config.mjs +57 -0
- package/es/packages/components/config-provider/src/hooks/use-global-config.mjs.map +1 -0
- package/es/packages/components/config-provider/style/css.mjs +3 -0
- package/es/packages/components/config-provider/style/css.mjs.map +1 -0
- package/es/packages/components/config-provider/style/index.mjs +3 -0
- package/es/packages/components/config-provider/style/index.mjs.map +1 -0
- package/es/packages/components/dropdown/src/index.mjs +4 -2
- package/es/packages/components/dropdown/src/index.mjs.map +1 -1
- package/es/packages/components/index.mjs +5 -0
- package/es/packages/components/index.mjs.map +1 -1
- package/es/packages/hooks/index.mjs +3 -0
- package/es/packages/hooks/index.mjs.map +1 -0
- package/es/packages/hooks/use-locale/index.mjs +26 -0
- package/es/packages/hooks/use-locale/index.mjs.map +1 -0
- package/es/packages/hooks/use-size/index.mjs +24 -0
- package/es/packages/hooks/use-size/index.mjs.map +1 -0
- package/es/packages/locale/lang/en.mjs +8 -3
- package/es/packages/locale/lang/en.mjs.map +1 -1
- package/es/packages/locale/lang/zh-cn.mjs +6 -1
- package/es/packages/locale/lang/zh-cn.mjs.map +1 -1
- package/es/utils/vue/vnode.d.ts +6 -6
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/global.d.ts +2 -0
- package/lib/component.js +8 -4
- package/lib/component.js.map +1 -1
- package/lib/components/collapse/index.d.ts +55 -0
- package/lib/components/collapse/src/index.vue.d.ts +55 -0
- package/lib/components/collapse/style/css.d.ts +2 -0
- package/lib/components/collapse/style/index.d.ts +2 -0
- package/lib/components/config-provider/index.d.ts +41 -0
- package/lib/components/config-provider/src/config-provider-props.d.ts +19 -0
- package/lib/components/config-provider/src/config-provider.d.ts +38 -0
- package/lib/components/config-provider/src/constants.d.ts +4 -0
- package/lib/components/config-provider/src/hooks/use-global-config.d.ts +6 -0
- package/lib/components/config-provider/style/css.d.ts +2 -0
- package/lib/components/config-provider/style/index.d.ts +2 -0
- package/lib/components/dropdown/index.d.ts +1 -0
- package/lib/components/dropdown/src/index.vue.d.ts +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/defaults.d.ts +1 -1
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/use-locale/index.d.ts +15 -0
- package/lib/hooks/use-size/index.d.ts +21 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -1
- package/lib/locale/index.d.ts +1 -1
- package/lib/locale/lang/en.d.ts +6 -1
- package/lib/locale/lang/zh-cn.d.ts +6 -1
- package/lib/make-installer.d.ts +1 -1
- package/lib/make-installer.js +5 -1
- package/lib/make-installer.js.map +1 -1
- package/lib/packages/components/collapse/index.js +13 -0
- package/lib/packages/components/collapse/index.js.map +1 -0
- package/lib/packages/components/collapse/src/index.js +73 -0
- package/lib/packages/components/collapse/src/index.js.map +1 -0
- package/lib/packages/components/collapse/style/css.js +6 -0
- package/lib/packages/components/collapse/style/css.js.map +1 -0
- package/lib/packages/components/collapse/style/index.js +6 -0
- package/lib/packages/components/collapse/style/index.js.map +1 -0
- package/lib/packages/components/config-provider/index.js +20 -0
- package/lib/packages/components/config-provider/index.js.map +1 -0
- package/lib/packages/components/config-provider/src/config-provider-props.js +26 -0
- package/lib/packages/components/config-provider/src/config-provider-props.js.map +1 -0
- package/lib/packages/components/config-provider/src/config-provider.js +19 -0
- package/lib/packages/components/config-provider/src/config-provider.js.map +1 -0
- package/lib/packages/components/config-provider/src/constants.js +8 -0
- package/lib/packages/components/config-provider/src/constants.js.map +1 -0
- package/lib/packages/components/config-provider/src/hooks/use-global-config.js +62 -0
- package/lib/packages/components/config-provider/src/hooks/use-global-config.js.map +1 -0
- package/lib/packages/components/config-provider/style/css.js +6 -0
- package/lib/packages/components/config-provider/style/css.js.map +1 -0
- package/lib/packages/components/config-provider/style/index.js +6 -0
- package/lib/packages/components/config-provider/style/index.js.map +1 -0
- package/lib/packages/components/dropdown/src/index.js +3 -1
- package/lib/packages/components/dropdown/src/index.js.map +1 -1
- package/lib/packages/components/index.js +11 -0
- package/lib/packages/components/index.js.map +1 -1
- package/lib/packages/hooks/index.js +19 -0
- package/lib/packages/hooks/index.js.map +1 -0
- package/lib/packages/hooks/use-locale/index.js +34 -0
- package/lib/packages/hooks/use-locale/index.js.map +1 -0
- package/lib/packages/hooks/use-size/index.js +31 -0
- package/lib/packages/hooks/use-size/index.js.map +1 -0
- package/lib/packages/locale/lang/en.js +8 -3
- package/lib/packages/locale/lang/en.js.map +1 -1
- package/lib/packages/locale/lang/zh-cn.js +6 -1
- package/lib/packages/locale/lang/zh-cn.js.map +1 -1
- package/lib/utils/vue/vnode.d.ts +6 -6
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/theme/hzzt-collapse.css +1 -0
- package/theme/hzzt-config-provider.css +0 -0
- package/theme/src/collapse.scss +56 -0
- package/theme/src/config-provider.scss +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ref, getCurrentInstance, inject, computed, provide, unref } from 'vue';
|
|
2
|
+
import '../../../../utils/index.mjs';
|
|
3
|
+
import '../../../../hooks/index.mjs';
|
|
4
|
+
import { configProviderContextKey } from '../constants.mjs';
|
|
5
|
+
import { debugWarn } from '../../../../utils/error.mjs';
|
|
6
|
+
import { localeContextKey } from '../../../../hooks/use-locale/index.mjs';
|
|
7
|
+
import { SIZE_INJECTION_KEY } from '../../../../hooks/use-size/index.mjs';
|
|
8
|
+
import { keysOf } from '../../../../utils/objects.mjs';
|
|
9
|
+
|
|
10
|
+
const globalConfig = ref();
|
|
11
|
+
function useGlobalConfig(key, defaultValue = void 0) {
|
|
12
|
+
const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
|
|
13
|
+
if (key) {
|
|
14
|
+
return computed(() => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
return config;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const provideGlobalConfig = (config, app, global = false) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const inSetup = !!getCurrentInstance();
|
|
25
|
+
const oldConfig = inSetup ? useGlobalConfig() : void 0;
|
|
26
|
+
const provideFn = (_a = app == null ? void 0 : app.provide) != null ? _a : inSetup ? provide : void 0;
|
|
27
|
+
if (!provideFn) {
|
|
28
|
+
debugWarn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const context = computed(() => {
|
|
32
|
+
const cfg = unref(config);
|
|
33
|
+
if (!(oldConfig == null ? void 0 : oldConfig.value))
|
|
34
|
+
return cfg;
|
|
35
|
+
return mergeConfig(oldConfig.value, cfg);
|
|
36
|
+
});
|
|
37
|
+
provideFn(configProviderContextKey, context);
|
|
38
|
+
provideFn(localeContextKey, computed(() => context.value.locale));
|
|
39
|
+
provideFn(SIZE_INJECTION_KEY, {
|
|
40
|
+
size: computed(() => context.value.size || "")
|
|
41
|
+
});
|
|
42
|
+
if (global || !globalConfig.value) {
|
|
43
|
+
globalConfig.value = context.value;
|
|
44
|
+
}
|
|
45
|
+
return context;
|
|
46
|
+
};
|
|
47
|
+
const mergeConfig = (a, b) => {
|
|
48
|
+
const keys = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];
|
|
49
|
+
const obj = {};
|
|
50
|
+
for (const key of keys) {
|
|
51
|
+
obj[key] = b[key] !== void 0 ? b[key] : a[key];
|
|
52
|
+
}
|
|
53
|
+
return obj;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { provideGlobalConfig, useGlobalConfig };
|
|
57
|
+
//# sourceMappingURL=use-global-config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-global-config.mjs","sources":["../../../../../../../../packages/components/config-provider/src/hooks/use-global-config.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\nimport { debugWarn, keysOf } from '@hzzt-plus/utils'\nimport {\n SIZE_INJECTION_KEY,\n localeContextKey,\n} from '@hzzt-plus/hooks'\nimport { configProviderContextKey } from '../constants'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { App, Ref } from 'vue'\nimport type { ConfigProviderContext } from '../constants'\n\n// this is meant to fix global methods like `ElMessage(opts)`, this way we can inject current locale\n// into the component as default injection value.\n// refer to: https://github.com/element-plus/element-plus/issues/2610#issuecomment-887965266\nconst globalConfig = ref<ConfigProviderContext>()\n\nexport function useGlobalConfig<\n K extends keyof ConfigProviderContext,\n D extends ConfigProviderContext[K]\n>(\n key: K,\n defaultValue?: D\n): Ref<Exclude<ConfigProviderContext[K], undefined> | D>\nexport function useGlobalConfig(): Ref<ConfigProviderContext>\nexport function useGlobalConfig(\n key?: keyof ConfigProviderContext,\n defaultValue = undefined\n) {\n const config = getCurrentInstance()\n ? inject(configProviderContextKey, globalConfig)\n : globalConfig\n if (key) {\n return computed(() => config.value?.[key] ?? defaultValue)\n } else {\n return config\n }\n}\n\nexport const provideGlobalConfig = (\n config: MaybeRef<ConfigProviderContext>,\n app?: App,\n global = false\n) => {\n const inSetup = !!getCurrentInstance()\n const oldConfig = inSetup ? useGlobalConfig() : undefined\n\n const provideFn = app?.provide ?? (inSetup ? provide : undefined)\n if (!provideFn) {\n debugWarn(\n 'provideGlobalConfig',\n 'provideGlobalConfig() can only be used inside setup().'\n )\n return\n }\n\n const context = computed(() => {\n const cfg = unref(config)\n if (!oldConfig?.value) return cfg\n return mergeConfig(oldConfig.value, cfg)\n })\n provideFn(configProviderContextKey, context)\n provideFn(\n localeContextKey,\n computed(() => context.value.locale)\n )\n provideFn(SIZE_INJECTION_KEY, {\n size: computed(() => context.value.size || ''),\n })\n\n if (global || !globalConfig.value) {\n globalConfig.value = context.value\n }\n return context\n}\n\nconst mergeConfig = (\n a: ConfigProviderContext,\n b: ConfigProviderContext\n): ConfigProviderContext => {\n const keys = [...new Set([...keysOf(a), ...keysOf(b)])]\n const obj: Record<string, any> = {}\n for (const key of keys) {\n obj[key] = b[key] !== undefined ? b[key] : a[key]\n }\n return obj\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { createElementVNode, defineComponent, ref, withDirectives, openBlock, createElementBlock, withModifiers, normalizeClass, toDisplayString, Fragment, renderList,
|
|
1
|
+
import { createElementVNode, defineComponent, ref, withDirectives, openBlock, createElementBlock, withModifiers, normalizeClass, toDisplayString, Fragment, renderList, unref, createCommentVNode } from 'vue';
|
|
2
2
|
import '../../../../node_modules/.pnpm/element-plus@2.7.8_vue@3.2.37/node_modules/element-plus/es/index.mjs';
|
|
3
|
+
import '../../../utils/index.mjs';
|
|
3
4
|
import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
+
import { isEmpty } from '../../../utils/types.mjs';
|
|
4
6
|
import ClickOutside from '../../../../node_modules/.pnpm/element-plus@2.7.8_vue@3.2.37/node_modules/element-plus/es/directives/click-outside/index.mjs';
|
|
5
7
|
|
|
6
8
|
const _hoisted_1 = ["onClick"];
|
|
@@ -74,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
76
|
createElementVNode("ul", _hoisted_4, [
|
|
75
77
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
|
|
76
78
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
77
|
-
option[__props.props.children]
|
|
79
|
+
unref(isEmpty)(option[__props.props.children]) ? (openBlock(), createElementBlock("li", {
|
|
78
80
|
class: normalizeClass({ "hzzt-dropdown-menu-item": true, selected: __props.defaultValue.includes(option[__props.props.value]) }),
|
|
79
81
|
key: index
|
|
80
82
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul @click.stop=\"dropToggle\" class=\"hzzt-dropdown\"\n v-click-outside=\"close\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\"></span>\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(option[props.value]) }\"\n v-if=\"option[props.children]
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../../packages/components/dropdown/src/index.vue"],"sourcesContent":["<template>\n <ul @click.stop=\"dropToggle\" class=\"hzzt-dropdown\"\n v-click-outside=\"close\">\n <li :class=\"{ 'hzzt-dropdown-li': true, 'hzzt-dropdown-li-show': toggle }\">\n <span class=\"hzzt-dropdown-name\">{{ label }}</span>\n <span class=\"caret\"></span>\n <ul class=\"hzzt-dropdown-menu\">\n <template v-for=\"(option, index) in options\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(option[props.value]) }\"\n v-if=\"isEmpty(option[props.children])\" :key=\"index\">\n <a @click=\"selectValue([option[props.value]])\" class=\"hzzt-dropdown-menu-item-label\">{{ option[props.label] }}</a>\n </li>\n <li :key=\"index+'submenu'\" class=\"hzzt-dropdown-menu-item hzzt-dropdown-submenu\" v-else>\n <a class=\"submenu\">{{ option[props.label] }}</a>\n <ul :class=\"['pull-'+position]\" class=\"hzzt-dropdown-menu\">\n <li :class=\"{ 'hzzt-dropdown-menu-item': true, selected: defaultValue.includes(child[props.value]) }\"\n :key=\"cIndex\" v-for=\"(child, cIndex) in option.children\">\n <a @click=\"selectValue([option[props.value], child[props.value]])\"\n class=\"hzzt-dropdown-menu-item-label\">{{ child[props.label] }}</a>\n </li>\n </ul>\n </li>\n <li class=\"divider\" v-if=\"option.divider\" :key=\"index+'divider'\"></li>\n </template>\n </ul>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import {ref} from 'vue';\n import {ClickOutside as vClickOutside} from 'element-plus';\n import {isEmpty} from '@hzzt-plus/utils';\n\n const dProps = defineProps({\n options: {\n type: Array,\n default: () => [],\n },\n label: String,\n value: String,\n defaultValue: {\n type: Array,\n default: () => [],\n },\n position: {\n type: String,\n default: 'right',\n },\n props: {\n type: Object,\n default: () => ({\n children: 'children',\n label: 'label',\n value: 'value',\n }),\n },\n returnType: {\n type: String,\n default: 'Array',\n },\n });\n\n const emits = defineEmits(['change']);\n\n defineOptions({\n name: 'HzztDropDown',\n });\n\n const toggle = ref(false);\n\n function dropToggle() {\n toggle.value = !toggle.value;\n }\n\n function close() {\n toggle.value = false;\n }\n\n function selectValue(val) {\n if (dProps.returnType === 'Array') {\n emits('change', val);\n }\n if (dProps.returnType === 'String') {\n emits('change', val.last);\n }\n }\n\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;mCAiEgB,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,MAAA,MAAA,GAAS,IAAI,KAAK,CAAA,CAAA;AAExB,IAAsB,SAAA,UAAA,GAAA;AACpB,MAAO,MAAA,CAAA,KAAA,GAAQ,CAAC,MAAO,CAAA,KAAA,CAAA;AAAA,KACzB;AAEA,IAAiB,SAAA,KAAA,GAAA;AACf,MAAA,MAAA,CAAO,KAAQ,GAAA,KAAA,CAAA;AAAA,KACjB;AAEA,IAAA,SAAA,WAAA,CAAqB,GAAK,EAAA;AACxB,MAAI,IAAA,MAAA,CAAO,eAAe,OAAS,EAAA;AACjC,QAAA,KAAA,CAAM,UAAU,GAAG,CAAA,CAAA;AAAA,OACrB;AACA,MAAI,IAAA,MAAA,CAAO,eAAe,QAAU,EAAA;AAClC,QAAM,KAAA,CAAA,QAAA,EAAU,IAAI,IAAI,CAAA,CAAA;AAAA,OAC1B;AAAA,KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export { HzztTitle } from './title/index.mjs';
|
|
2
2
|
export { HzztDropdown } from './dropdown/index.mjs';
|
|
3
|
+
export { HzztCollapse } from './collapse/index.mjs';
|
|
4
|
+
export { HzztConfigProvider } from './config-provider/index.mjs';
|
|
5
|
+
export { configProviderProps } from './config-provider/src/config-provider-props.mjs';
|
|
6
|
+
export { configProviderContextKey } from './config-provider/src/constants.mjs';
|
|
7
|
+
export { provideGlobalConfig, useGlobalConfig } from './config-provider/src/hooks/use-global-config.mjs';
|
|
3
8
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { unref, computed, isRef, ref, inject } from 'vue';
|
|
2
|
+
import { get } from 'lodash-unified';
|
|
3
|
+
import English from '../../locale/lang/en.mjs';
|
|
4
|
+
|
|
5
|
+
const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
|
|
6
|
+
const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
|
|
7
|
+
var _a;
|
|
8
|
+
return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
|
|
9
|
+
});
|
|
10
|
+
const buildLocaleContext = (locale) => {
|
|
11
|
+
const lang = computed(() => unref(locale).name);
|
|
12
|
+
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
13
|
+
return {
|
|
14
|
+
lang,
|
|
15
|
+
locale: localeRef,
|
|
16
|
+
t: buildTranslator(locale)
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const localeContextKey = Symbol("localeContextKey");
|
|
20
|
+
const useLocale = (localeOverrides) => {
|
|
21
|
+
const locale = localeOverrides || inject(localeContextKey, ref());
|
|
22
|
+
return buildLocaleContext(computed(() => locale.value || English));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { buildLocaleContext, buildTranslator, localeContextKey, translate, useLocale };
|
|
26
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/hooks/use-locale/index.ts"],"sourcesContent":["import { computed, inject, isRef, ref, unref } from 'vue'\nimport { get } from 'lodash-unified'\nimport English from '@hzzt-plus/locale/lang/en'\n\nimport type { MaybeRef } from '@vueuse/core'\nimport type { InjectionKey, Ref } from 'vue'\nimport type { Language } from '@hzzt-plus/locale'\n\nexport type TranslatorOption = Record<string, string | number>\nexport type Translator = (path: string, option?: TranslatorOption) => string\nexport type LocaleContext = {\n locale: Ref<Language>\n lang: Ref<string>\n t: Translator\n}\n\nexport const buildTranslator =\n (locale: MaybeRef<Language>): Translator =>\n (path, option) =>\n translate(path, option, unref(locale))\n\nexport const translate = (\n path: string,\n option: undefined | TranslatorOption,\n locale: Language\n): string =>\n (get(locale, path, path) as string).replace(\n /\\{(\\w+)\\}/g,\n (_, key) => `${option?.[key] ?? `{${key}}`}`\n )\n\nexport const buildLocaleContext = (\n locale: MaybeRef<Language>\n): LocaleContext => {\n const lang = computed(() => unref(locale).name)\n const localeRef = isRef(locale) ? locale : ref(locale)\n return {\n lang,\n locale: localeRef,\n t: buildTranslator(locale),\n }\n}\n\nexport const localeContextKey: InjectionKey<Ref<Language | undefined>> =\n Symbol('localeContextKey')\n\nexport const useLocale = (localeOverrides?: Ref<Language | undefined>) => {\n const locale = localeOverrides || inject(localeContextKey, ref())!\n return buildLocaleContext(computed(() => locale.value || English))\n}\n"],"names":[],"mappings":";;;;AAGY,MAAC,eAAe,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE;AACxF,MAAC,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK;AAC7G,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG,CAAC,MAAM,KAAK;AAC9C,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAClD,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;AACzD,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC;AAC9B,GAAG,CAAC;AACJ,EAAE;AACU,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE;AAC/C,MAAC,SAAS,GAAG,CAAC,eAAe,KAAK;AAC9C,EAAE,MAAM,MAAM,GAAG,eAAe,IAAI,MAAM,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;AACpE,EAAE,OAAO,kBAAkB,CAAC,QAAQ,CAAC,MAAM,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC;AACrE;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { inject, computed, unref } from 'vue';
|
|
2
|
+
import '../../utils/index.mjs';
|
|
3
|
+
import '../../constants/index.mjs';
|
|
4
|
+
import { buildProp } from '../../utils/vue/props/runtime.mjs';
|
|
5
|
+
import { componentSizes } from '../../constants/size.mjs';
|
|
6
|
+
|
|
7
|
+
const useSizeProp = buildProp({
|
|
8
|
+
type: String,
|
|
9
|
+
values: componentSizes,
|
|
10
|
+
required: false
|
|
11
|
+
});
|
|
12
|
+
const useSizeProps = {
|
|
13
|
+
size: useSizeProp
|
|
14
|
+
};
|
|
15
|
+
const SIZE_INJECTION_KEY = Symbol("size");
|
|
16
|
+
const useGlobalSize = () => {
|
|
17
|
+
const injectedSize = inject(SIZE_INJECTION_KEY, {});
|
|
18
|
+
return computed(() => {
|
|
19
|
+
return unref(injectedSize.size) || "";
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { SIZE_INJECTION_KEY, useGlobalSize, useSizeProp, useSizeProps };
|
|
24
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/hooks/use-size/index.ts"],"sourcesContent":["import { computed, inject, unref } from 'vue'\nimport { buildProp } from '@hzzt-plus/utils'\nimport { componentSizes } from '@hzzt-plus/constants'\n\nimport type { InjectionKey, Ref } from 'vue'\nimport type { ComponentSize } from '@hzzt-plus/constants'\n\nexport const useSizeProp = buildProp({\n type: String,\n values: componentSizes,\n required: false,\n} as const)\n\nexport const useSizeProps = {\n size: useSizeProp,\n}\n\nexport interface SizeContext {\n size: Ref<ComponentSize>\n}\n\nexport const SIZE_INJECTION_KEY: InjectionKey<SizeContext> = Symbol('size')\n\nexport const useGlobalSize = () => {\n const injectedSize = inject(SIZE_INJECTION_KEY, {} as SizeContext)\n\n return computed<ComponentSize>(() => {\n return unref(injectedSize.size) || ''\n })\n}\n"],"names":[],"mappings":";;;;;;AAGY,MAAC,WAAW,GAAG,SAAS,CAAC;AACrC,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,MAAM,EAAE,cAAc;AACxB,EAAE,QAAQ,EAAE,KAAK;AACjB,CAAC,EAAE;AACS,MAAC,YAAY,GAAG;AAC5B,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE;AACU,MAAC,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE;AACrC,MAAC,aAAa,GAAG,MAAM;AACnC,EAAE,MAAM,YAAY,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;AACtD,EAAE,OAAO,QAAQ,CAAC,MAAM;AACxB,IAAI,OAAO,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAC1C,GAAG,CAAC,CAAC;AACL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.mjs","sources":["../../../../../../packages/locale/lang/en.ts"],"sourcesContent":["export default {\n name: 'en',\n hzzt: {\n },\n}\n"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"en.mjs","sources":["../../../../../../packages/locale/lang/en.ts"],"sourcesContent":["export default {\n name: 'en',\n hzzt: {\n collapse: {\n expand: 'expand',\n retract: 'retract',\n }\n },\n}\n"],"names":[],"mappings":"AAAA,cAAe;AACf,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,IAAI,EAAE;AACR,IAAI,QAAQ,EAAE;AACd,MAAM,MAAM,EAAE,QAAQ;AACtB,MAAM,OAAO,EAAE,SAAS;AACxB,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh-cn.mjs","sources":["../../../../../../packages/locale/lang/zh-cn.ts"],"sourcesContent":["export default {\n name: 'zh-cn',\n hzzt: {\n },\n}\n"],"names":[],"mappings":"AAAA,WAAe;AACf,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,IAAI,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"zh-cn.mjs","sources":["../../../../../../packages/locale/lang/zh-cn.ts"],"sourcesContent":["export default {\n name: 'zh-cn',\n hzzt: {\n collapse: {\n expand: '展开',\n retract: '收起',\n }\n },\n}\n"],"names":[],"mappings":"AAAA,WAAe;AACf,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,IAAI,EAAE;AACR,IAAI,QAAQ,EAAE;AACd,MAAM,MAAM,EAAE,cAAc;AAC5B,MAAM,OAAO,EAAE,cAAc;AAC7B,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
|
package/es/utils/vue/vnode.d.ts
CHANGED
|
@@ -31,12 +31,12 @@ export declare function isTemplate(node: unknown): node is VNode;
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function isValidElementNode(node: VNode): boolean;
|
|
33
33
|
export declare function isValidElementNode(node: unknown): node is VNode;
|
|
34
|
-
export declare const getFirstValidNode: (nodes: VNodeNormalizedChildren, maxDepth?: number) => string | number | boolean | void |
|
|
34
|
+
export declare const getFirstValidNode: (nodes: VNodeNormalizedChildren, maxDepth?: number) => string | number | boolean | void | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}> | VNodeArrayChildren | {
|
|
35
37
|
[name: string]: unknown;
|
|
36
38
|
$stable?: boolean | undefined;
|
|
37
|
-
} |
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
}> | null | undefined;
|
|
39
|
+
} | null | undefined;
|
|
40
40
|
export declare function renderIf(condition: boolean, ...args: Parameters<typeof createBlock>): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
41
41
|
[key: string]: any;
|
|
42
42
|
}>;
|
|
@@ -44,8 +44,8 @@ export declare function renderBlock(...args: Parameters<typeof createBlock>): VN
|
|
|
44
44
|
[key: string]: any;
|
|
45
45
|
}>;
|
|
46
46
|
export declare const getNormalizedProps: (node: VNode) => Record<string, any>;
|
|
47
|
-
export declare const ensureOnlyChild: (children: VNodeArrayChildren | undefined) =>
|
|
47
|
+
export declare const ensureOnlyChild: (children: VNodeArrayChildren | undefined) => (string | number | boolean | void | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
|
-
}> | null | undefined);
|
|
49
|
+
}> | null | undefined) | VNodeArrayChildren;
|
|
50
50
|
export declare type FlattenVNodes = Array<VNodeChildAtom | RawSlots>;
|
|
51
51
|
export declare const flattedChildren: (children: FlattenVNodes | VNode | VNodeNormalizedChildren) => FlattenVNodes;
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.1";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/hzzt-plus/version.ts"],"sourcesContent":["export const version = '0.0.1'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
package/global.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ declare module 'vue' {
|
|
|
3
3
|
export interface GlobalComponents {
|
|
4
4
|
HzztTitle: typeof import('hzzt-plus')['HzztTitle']
|
|
5
5
|
HzztDropdown: typeof import('hzzt-plus')['HzztDropdown']
|
|
6
|
+
HzztCollapse: typeof import('hzzt-plus')['HzztCollapse']
|
|
7
|
+
HzztConfigProvider: typeof import('hzzt-plus')['HzztConfigProvider']
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
10
|
|
package/lib/component.js
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./packages/components/title/index.js');
|
|
6
|
-
var index$
|
|
5
|
+
var index$1 = require('./packages/components/title/index.js');
|
|
6
|
+
var index$2 = require('./packages/components/dropdown/index.js');
|
|
7
|
+
var index$3 = require('./packages/components/collapse/index.js');
|
|
8
|
+
var index = require('./packages/components/config-provider/index.js');
|
|
7
9
|
|
|
8
10
|
var Components = [
|
|
9
|
-
index.
|
|
10
|
-
index$1.
|
|
11
|
+
index.HzztConfigProvider,
|
|
12
|
+
index$1.HzztTitle,
|
|
13
|
+
index$2.HzztDropdown,
|
|
14
|
+
index$3.HzztCollapse
|
|
11
15
|
];
|
|
12
16
|
|
|
13
17
|
exports["default"] = Components;
|
package/lib/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import { HzztTitle } from '@hzzt-plus/components/title'\nimport { HzztDropdown } from '@hzzt-plus/components/dropdown'\n\nimport type { Plugin } from 'vue'\n\nexport default [\n HzztTitle,\n HzztDropdown,\n] as Plugin[]\n"],"names":["HzztTitle","HzztDropdown"],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../packages/hzzt-plus/component.ts"],"sourcesContent":["import { HzztTitle } from '@hzzt-plus/components/title'\nimport { HzztDropdown } from '@hzzt-plus/components/dropdown'\nimport { HzztCollapse } from '@hzzt-plus/components/collapse'\nimport { HzztConfigProvider } from '@hzzt-plus/components/config-provider'\n\nimport type { Plugin } from 'vue'\n\nexport default [\n HzztConfigProvider,\n HzztTitle,\n HzztDropdown,\n HzztCollapse,\n] as Plugin[]\n"],"names":["HzztConfigProvider","HzztTitle","HzztDropdown","HzztCollapse"],"mappings":";;;;;;;;;AAIA,iBAAe;AACf,EAAEA,wBAAkB;AACpB,EAAEC,iBAAS;AACX,EAAEC,oBAAY;AACd,EAAEC,oBAAY;AACd,CAAC;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const HzztCollapse: import("hzzt-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
defaultActive: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
title: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
expand: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
t: import("../../hooks").Translator;
|
|
16
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
defaultActive: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
title: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
expand: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
}>> & {
|
|
30
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
31
|
+
}>>;
|
|
32
|
+
active: import("vue").Ref<boolean>;
|
|
33
|
+
slots: Readonly<{
|
|
34
|
+
[name: string]: import("vue").Slot | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
toggle: () => void;
|
|
37
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
defaultActive: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
title: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
expand: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
}>>, {
|
|
51
|
+
defaultActive: boolean;
|
|
52
|
+
title: string;
|
|
53
|
+
expand: boolean;
|
|
54
|
+
}>> & Record<string, any>;
|
|
55
|
+
export default HzztCollapse;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
defaultActive: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
title: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
expand: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
t: import("hzzt-plus/es/hooks").Translator;
|
|
16
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
defaultActive: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
title: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
expand: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
}>> & {
|
|
30
|
+
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
31
|
+
}>>;
|
|
32
|
+
active: import("vue").Ref<boolean>;
|
|
33
|
+
slots: Readonly<{
|
|
34
|
+
[name: string]: import("vue").Slot | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
toggle: () => void;
|
|
37
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
defaultActive: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
title: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
expand: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
}>>, {
|
|
51
|
+
defaultActive: boolean;
|
|
52
|
+
title: string;
|
|
53
|
+
expand: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const HzztConfigProvider: import("hzzt-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
readonly a11y: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
3
|
+
readonly locale: {
|
|
4
|
+
readonly type: import("vue").PropType<import("../../locale").Language>;
|
|
5
|
+
readonly required: false;
|
|
6
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
7
|
+
__epPropKey: true;
|
|
8
|
+
};
|
|
9
|
+
readonly size: {
|
|
10
|
+
readonly type: import("vue").PropType<import("hzzt-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
11
|
+
readonly required: false;
|
|
12
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
|
+
__epPropKey: true;
|
|
14
|
+
};
|
|
15
|
+
readonly keyboardNavigation: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
16
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
readonly a11y: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
20
|
+
readonly locale: {
|
|
21
|
+
readonly type: import("vue").PropType<import("../../locale").Language>;
|
|
22
|
+
readonly required: false;
|
|
23
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
24
|
+
__epPropKey: true;
|
|
25
|
+
};
|
|
26
|
+
readonly size: {
|
|
27
|
+
readonly type: import("vue").PropType<import("hzzt-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
28
|
+
readonly required: false;
|
|
29
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
30
|
+
__epPropKey: true;
|
|
31
|
+
};
|
|
32
|
+
readonly keyboardNavigation: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
33
|
+
}>>, {
|
|
34
|
+
readonly a11y: import("hzzt-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
35
|
+
readonly keyboardNavigation: import("hzzt-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
36
|
+
}>> & Record<string, any>;
|
|
37
|
+
export default HzztConfigProvider;
|
|
38
|
+
export * from './src/config-provider';
|
|
39
|
+
export * from './src/config-provider-props';
|
|
40
|
+
export * from './src/constants';
|
|
41
|
+
export * from './src/hooks/use-global-config';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue';
|
|
2
|
+
import type { Language } from 'hzzt-plus/es/locale';
|
|
3
|
+
export declare const configProviderProps: {
|
|
4
|
+
readonly a11y: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
5
|
+
readonly locale: {
|
|
6
|
+
readonly type: import("vue").PropType<Language>;
|
|
7
|
+
readonly required: false;
|
|
8
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
9
|
+
__epPropKey: true;
|
|
10
|
+
};
|
|
11
|
+
readonly size: {
|
|
12
|
+
readonly type: import("vue").PropType<import("hzzt-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
13
|
+
readonly required: false;
|
|
14
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
15
|
+
__epPropKey: true;
|
|
16
|
+
};
|
|
17
|
+
readonly keyboardNavigation: import("hzzt-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
18
|
+
};
|
|
19
|
+
export declare type ConfigProviderProps = ExtractPropTypes<typeof configProviderProps>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare const ConfigProvider: import("vue").DefineComponent<{
|
|
2
|
+
readonly a11y: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
3
|
+
readonly locale: {
|
|
4
|
+
readonly type: import("vue").PropType<import("../../../locale").Language>;
|
|
5
|
+
readonly required: false;
|
|
6
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
7
|
+
__epPropKey: true;
|
|
8
|
+
};
|
|
9
|
+
readonly size: {
|
|
10
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
11
|
+
readonly required: false;
|
|
12
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
|
+
__epPropKey: true;
|
|
14
|
+
};
|
|
15
|
+
readonly keyboardNavigation: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
16
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
readonly a11y: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
20
|
+
readonly locale: {
|
|
21
|
+
readonly type: import("vue").PropType<import("../../../locale").Language>;
|
|
22
|
+
readonly required: false;
|
|
23
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
24
|
+
__epPropKey: true;
|
|
25
|
+
};
|
|
26
|
+
readonly size: {
|
|
27
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
28
|
+
readonly required: false;
|
|
29
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
30
|
+
__epPropKey: true;
|
|
31
|
+
};
|
|
32
|
+
readonly keyboardNavigation: import("../../../utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
33
|
+
}>>, {
|
|
34
|
+
readonly a11y: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
35
|
+
readonly keyboardNavigation: import("../../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
36
|
+
}>;
|
|
37
|
+
export declare type ConfigProviderInstance = InstanceType<typeof ConfigProvider>;
|
|
38
|
+
export default ConfigProvider;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ConfigProviderProps } from './config-provider-props';
|
|
2
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
3
|
+
export declare type ConfigProviderContext = Partial<ConfigProviderProps>;
|
|
4
|
+
export declare const configProviderContextKey: InjectionKey<Ref<ConfigProviderContext>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { MaybeRef } from '@vueuse/core';
|
|
2
|
+
import type { App, Ref } from 'vue';
|
|
3
|
+
import type { ConfigProviderContext } from '../constants';
|
|
4
|
+
export declare function useGlobalConfig<K extends keyof ConfigProviderContext, D extends ConfigProviderContext[K]>(key: K, defaultValue?: D): Ref<Exclude<ConfigProviderContext[K], undefined> | D>;
|
|
5
|
+
export declare function useGlobalConfig(): Ref<ConfigProviderContext>;
|
|
6
|
+
export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContext>, app?: App<any> | undefined, global?: boolean) => import("vue").ComputedRef<Partial<import("../config-provider-props").ConfigProviderProps>> | undefined;
|
|
@@ -62,6 +62,7 @@ export declare const HzztDropdown: import("hzzt-plus/es/utils").SFCWithInstall<i
|
|
|
62
62
|
close: () => void;
|
|
63
63
|
selectValue: (val: any) => void;
|
|
64
64
|
vClickOutside: import("vue").ObjectDirective<any, any>;
|
|
65
|
+
isEmpty: (val: unknown) => boolean;
|
|
65
66
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
67
|
options: {
|
|
67
68
|
type: ArrayConstructor;
|
|
@@ -62,6 +62,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
62
62
|
close: () => void;
|
|
63
63
|
selectValue: (val: any) => void;
|
|
64
64
|
vClickOutside: import("vue").ObjectDirective<any, any>;
|
|
65
|
+
isEmpty: (val: unknown) => boolean;
|
|
65
66
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
67
|
options: {
|
|
67
68
|
type: ArrayConstructor;
|