ll-plus 1.0.0 → 1.0.3
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/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs.map +1 -0
- package/es/component.mjs +8 -0
- package/es/component.mjs.map +1 -0
- package/es/components/icon/index.d.ts +55 -10
- package/es/components/icon/index.mjs +10 -0
- package/es/components/icon/index.mjs.map +1 -0
- package/es/components/icon/src/icon.d.ts +27 -3
- package/es/components/icon/src/icon.mjs +34 -0
- package/es/components/icon/src/icon.mjs.map +1 -0
- package/es/components/icon/src/icon.vue.d.ts +56 -10
- package/es/components/icon/src/icon.vue.mjs +8 -0
- package/es/components/icon/src/icon.vue.mjs.map +1 -0
- package/es/components/icon/src/icon.vue2.mjs +59 -0
- package/es/components/icon/src/icon.vue2.mjs.map +1 -0
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +7 -0
- package/es/components/index.mjs.map +1 -0
- package/es/components/table/index.d.ts +592 -0
- package/es/components/table/index.mjs +10 -0
- package/es/components/table/index.mjs.map +1 -0
- package/es/components/table/src/components/header-search.vue.d.ts +110 -0
- package/es/components/table/src/components/header-search.vue.mjs +8 -0
- package/es/components/table/src/components/header-search.vue.mjs.map +1 -0
- package/es/components/table/src/components/header-search.vue2.mjs +125 -0
- package/es/components/table/src/components/header-search.vue2.mjs.map +1 -0
- package/es/components/table/src/components/main-table.vue.d.ts +254 -0
- package/es/components/table/src/components/main-table.vue.mjs +8 -0
- package/es/components/table/src/components/main-table.vue.mjs.map +1 -0
- package/es/components/table/src/components/main-table.vue2.mjs +549 -0
- package/es/components/table/src/components/main-table.vue2.mjs.map +1 -0
- package/es/components/table/src/components/pagination.vue.d.ts +65 -0
- package/es/components/table/src/components/pagination.vue.mjs +8 -0
- package/es/components/table/src/components/pagination.vue.mjs.map +1 -0
- package/es/components/table/src/components/pagination.vue2.mjs +37 -0
- package/es/components/table/src/components/pagination.vue2.mjs.map +1 -0
- package/es/components/table/src/table.d.ts +148 -0
- package/es/components/table/src/table.mjs +196 -0
- package/es/components/table/src/table.mjs.map +1 -0
- package/es/components/table/src/table.vue.d.ts +586 -0
- package/es/components/table/src/table.vue.mjs +8 -0
- package/es/components/table/src/table.vue.mjs.map +1 -0
- package/es/components/table/src/table.vue2.mjs +134 -0
- package/es/components/table/src/table.vue2.mjs.map +1 -0
- package/es/defaults.d.ts +4 -0
- package/es/defaults.mjs +8 -0
- package/es/defaults.mjs.map +1 -0
- package/es/index.d.ts +4 -6
- package/es/index.mjs +12 -0
- package/es/index.mjs.map +1 -0
- package/es/ll-plus/defaults.d.ts +4 -0
- package/es/ll-plus/index.d.ts +4 -0
- package/es/ll-plus/make-installer.d.ts +4 -0
- package/es/locale/index.d.ts +10 -0
- package/es/locale/index.mjs +6 -0
- package/es/locale/index.mjs.map +1 -0
- package/es/locale/lang/en_US.d.ts +144 -0
- package/es/locale/lang/en_US.mjs +147 -0
- package/es/locale/lang/en_US.mjs.map +1 -0
- package/es/locale/lang/zh_CN.d.ts +169 -0
- package/es/locale/lang/zh_CN.mjs +172 -0
- package/es/locale/lang/zh_CN.mjs.map +1 -0
- package/es/locale/lang/zh_TW.d.ts +125 -0
- package/es/locale/lang/zh_TW.mjs +128 -0
- package/es/locale/lang/zh_TW.mjs.map +1 -0
- package/es/make-installer.d.ts +4 -0
- package/es/make-installer.mjs +12 -0
- package/es/make-installer.mjs.map +1 -0
- package/es/utils/add-unit.mjs +7 -0
- package/es/utils/add-unit.mjs.map +1 -0
- package/es/utils/create-namespace.mjs +40 -0
- package/es/utils/create-namespace.mjs.map +1 -0
- package/es/utils/index.d.ts +2 -1
- package/es/utils/index.mjs +8 -0
- package/es/utils/index.mjs.map +1 -0
- package/es/utils/props/index.d.ts +3 -0
- package/es/utils/props/index.mjs +6 -0
- package/es/utils/props/index.mjs.map +1 -0
- package/es/utils/props/runtime.d.ts +29 -0
- package/es/utils/props/runtime.mjs +53 -0
- package/es/utils/props/runtime.mjs.map +1 -0
- package/es/utils/props/types.d.ts +120 -0
- package/es/utils/props/types.mjs +2 -0
- package/es/utils/props/types.mjs.map +1 -0
- package/es/utils/props/util.d.ts +8 -0
- package/es/utils/props/util.mjs +2 -0
- package/es/utils/props/util.mjs.map +1 -0
- package/es/utils/types.d.ts +10 -0
- package/es/utils/types.mjs +30 -0
- package/es/utils/types.mjs.map +1 -0
- package/es/utils/with-install.mjs +10 -0
- package/es/utils/with-install.mjs.map +1 -0
- package/global.d.ts +11 -0
- package/index.full.js +8305 -0
- package/index.full.min.js +25 -0
- package/index.full.min.js.map +1 -0
- package/index.full.min.mjs +25 -0
- package/index.full.min.mjs.map +1 -0
- package/index.full.mjs +8288 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +14 -0
- package/lib/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/lib/component.js +12 -0
- package/lib/component.js.map +1 -0
- package/lib/components/icon/index.d.ts +55 -10
- package/lib/components/icon/index.js +8 -31
- package/lib/components/icon/index.js.map +1 -0
- package/lib/components/icon/src/icon.d.ts +27 -3
- package/lib/components/icon/src/icon.js +36 -0
- package/lib/components/icon/src/icon.js.map +1 -0
- package/lib/components/icon/src/icon.vue.d.ts +56 -10
- package/lib/components/icon/src/icon.vue.js +12 -0
- package/lib/components/icon/src/icon.vue.js.map +1 -0
- package/lib/components/icon/src/icon.vue2.js +63 -0
- package/lib/components/icon/src/icon.vue2.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +15 -8
- package/lib/components/index.js.map +1 -0
- package/lib/components/table/index.d.ts +592 -0
- package/lib/components/table/index.js +21 -0
- package/lib/components/table/index.js.map +1 -0
- package/lib/components/table/src/components/header-search.vue.d.ts +110 -0
- package/lib/components/table/src/components/header-search.vue.js +12 -0
- package/lib/components/table/src/components/header-search.vue.js.map +1 -0
- package/lib/components/table/src/components/header-search.vue2.js +129 -0
- package/lib/components/table/src/components/header-search.vue2.js.map +1 -0
- package/lib/components/table/src/components/main-table.vue.d.ts +254 -0
- package/lib/components/table/src/components/main-table.vue.js +12 -0
- package/lib/components/table/src/components/main-table.vue.js.map +1 -0
- package/lib/components/table/src/components/main-table.vue2.js +553 -0
- package/lib/components/table/src/components/main-table.vue2.js.map +1 -0
- package/lib/components/table/src/components/pagination.vue.d.ts +65 -0
- package/lib/components/table/src/components/pagination.vue.js +12 -0
- package/lib/components/table/src/components/pagination.vue.js.map +1 -0
- package/lib/components/table/src/components/pagination.vue2.js +41 -0
- package/lib/components/table/src/components/pagination.vue2.js.map +1 -0
- package/lib/components/table/src/table.d.ts +148 -0
- package/lib/components/table/src/table.js +203 -0
- package/lib/components/table/src/table.js.map +1 -0
- package/lib/components/table/src/table.vue.d.ts +586 -0
- package/lib/components/table/src/table.vue.js +12 -0
- package/lib/components/table/src/table.vue.js.map +1 -0
- package/lib/components/table/src/table.vue2.js +138 -0
- package/lib/components/table/src/table.vue2.js.map +1 -0
- package/lib/defaults.d.ts +4 -0
- package/lib/defaults.js +12 -0
- package/lib/defaults.js.map +1 -0
- package/lib/index.d.ts +4 -6
- package/lib/index.js +20 -15
- package/lib/index.js.map +1 -0
- package/lib/ll-plus/component.d.ts +3 -0
- package/lib/ll-plus/defaults.d.ts +4 -0
- package/lib/ll-plus/index.d.ts +4 -0
- package/lib/ll-plus/make-installer.d.ts +4 -0
- package/lib/locale/index.d.ts +10 -0
- package/lib/locale/index.js +12 -0
- package/lib/locale/index.js.map +1 -0
- package/lib/locale/lang/en_US.d.ts +144 -0
- package/lib/locale/lang/en_US.js +151 -0
- package/lib/locale/lang/en_US.js.map +1 -0
- package/lib/locale/lang/zh_CN.d.ts +169 -0
- package/lib/locale/lang/zh_CN.js +176 -0
- package/lib/locale/lang/zh_CN.js.map +1 -0
- package/lib/locale/lang/zh_TW.d.ts +125 -0
- package/lib/locale/lang/zh_TW.js +132 -0
- package/lib/locale/lang/zh_TW.js.map +1 -0
- package/lib/make-installer.d.ts +4 -0
- package/lib/make-installer.js +14 -0
- package/lib/make-installer.js.map +1 -0
- package/lib/utils/add-unit.js +9 -0
- package/lib/utils/add-unit.js.map +1 -0
- package/lib/utils/create-namespace.js +34 -34
- package/lib/utils/create-namespace.js.map +1 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +18 -18
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/props/index.d.ts +3 -0
- package/lib/utils/props/index.js +14 -0
- package/lib/utils/props/index.js.map +1 -0
- package/lib/utils/props/runtime.d.ts +29 -0
- package/lib/utils/props/runtime.js +59 -0
- package/lib/utils/props/runtime.js.map +1 -0
- package/lib/utils/props/types.d.ts +120 -0
- package/lib/utils/props/types.js +4 -0
- package/lib/utils/props/types.js.map +1 -0
- package/lib/utils/props/util.d.ts +8 -0
- package/lib/utils/props/util.js +4 -0
- package/lib/utils/props/util.js.map +1 -0
- package/lib/utils/types.d.ts +10 -0
- package/lib/utils/types.js +70 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils/with-install.js +8 -6
- package/lib/utils/with-install.js.map +1 -0
- package/package.json +37 -3
- package/theme-chalk/css/icon.css +1 -1
- package/theme-chalk/css/index.css +5 -1
- package/theme-chalk/css/table.css +5 -0
- package/theme-chalk/fonts/iconfont.js +1 -0
- package/theme-chalk/fonts/iconfont.json +1262 -0
- package/types/packages/component.d.ts +3 -0
- package/types/packages/components/icon/index.d.ts +79 -0
- package/types/packages/components/icon/src/icon.d.ts +30 -0
- package/types/packages/components/icon/src/icon.vue.d.ts +73 -0
- package/types/packages/components/index.d.ts +2 -0
- package/types/packages/components/table/index.d.ts +592 -0
- package/types/packages/components/table/src/components/header-search.vue.d.ts +110 -0
- package/types/packages/components/table/src/components/main-table.vue.d.ts +254 -0
- package/types/packages/components/table/src/components/pagination.vue.d.ts +65 -0
- package/types/packages/components/table/src/table.d.ts +148 -0
- package/types/packages/components/table/src/table.vue.d.ts +586 -0
- package/types/packages/defaults.d.ts +4 -0
- package/types/packages/index.d.ts +4 -0
- package/types/packages/ll-plus/component.d.ts +3 -0
- package/types/packages/ll-plus/defaults.d.ts +4 -0
- package/types/packages/ll-plus/index.d.ts +4 -0
- package/types/packages/ll-plus/make-installer.d.ts +4 -0
- package/types/packages/locale/index.d.ts +10 -0
- package/types/packages/locale/lang/en_US.d.ts +144 -0
- package/types/packages/locale/lang/zh_CN.d.ts +169 -0
- package/types/packages/locale/lang/zh_TW.d.ts +125 -0
- package/types/packages/make-installer.d.ts +4 -0
- package/types/{utils → packages/utils}/index.d.ts +2 -1
- package/types/packages/utils/props/index.d.ts +3 -0
- package/types/packages/utils/props/runtime.d.ts +29 -0
- package/types/packages/utils/props/types.d.ts +120 -0
- package/types/packages/utils/props/util.d.ts +8 -0
- package/types/packages/utils/types.d.ts +10 -0
- package/types/tsconfig.web.tsbuildinfo +1 -0
- package/entry/types/index.d.ts +0 -6
- package/es/components/icon/index.js +0 -33
- package/es/components/index.js +0 -1
- package/es/components.js +0 -5
- package/es/index.js +0 -11
- package/es/utils/add-util.js +0 -3
- package/es/utils/create-namespace.js +0 -38
- package/es/utils/index.js +0 -3
- package/es/utils/with-install.js +0 -6
- package/index.esm.js +0 -91
- package/index.js +0 -101
- package/lib/components.js +0 -9
- package/lib/utils/add-util.js +0 -7
- package/theme-chalk/fonts/iconfont.ttf +0 -0
- package/theme-chalk/fonts/iconfont.woff +0 -0
- package/theme-chalk/fonts/iconfont.woff2 +0 -0
- package/types/components/icon/index.d.ts +0 -34
- package/types/components/icon/src/icon.d.ts +0 -6
- package/types/components/icon/src/icon.vue.d.ts +0 -27
- package/types/components/index.d.ts +0 -1
- /package/{entry/types/components.d.ts → es/component.d.ts} +0 -0
- /package/es/{components.d.ts → ll-plus/component.d.ts} +0 -0
- /package/es/utils/{add-util.d.ts → add-unit.d.ts} +0 -0
- /package/lib/{components.d.ts → component.d.ts} +0 -0
- /package/lib/utils/{add-util.d.ts → add-unit.d.ts} +0 -0
- /package/types/{utils/add-util.d.ts → packages/utils/add-unit.d.ts} +0 -0
- /package/types/{utils → packages/utils}/create-namespace.d.ts +0 -0
- /package/types/{utils → packages/utils}/with-install.d.ts +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _bem = (prefixedName, blockSuffix, element, modifier) => {
|
|
3
|
+
if (blockSuffix) {
|
|
4
|
+
prefixedName += `-${blockSuffix}`;
|
|
5
|
+
}
|
|
6
|
+
if (element) {
|
|
7
|
+
prefixedName += `__${element}`;
|
|
8
|
+
}
|
|
9
|
+
if (modifier) {
|
|
10
|
+
prefixedName += `--${modifier}`;
|
|
11
|
+
}
|
|
12
|
+
return prefixedName;
|
|
13
|
+
};
|
|
14
|
+
function createBEM(prefixedName) {
|
|
15
|
+
const b = (blockSuffix = "") => _bem(prefixedName, blockSuffix, "", "");
|
|
16
|
+
const e = (element = "") => element ? _bem(prefixedName, "", element, "") : "";
|
|
17
|
+
const m = (modifier = "") => modifier ? _bem(prefixedName, "", "", modifier) : "";
|
|
18
|
+
const be = (blockSuffix = "", element = "") => blockSuffix && element ? _bem(prefixedName, blockSuffix, element, "") : "";
|
|
19
|
+
const em = (element, modifier) => element && modifier ? _bem(prefixedName, "", element, modifier) : "";
|
|
20
|
+
const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(prefixedName, blockSuffix, "", modifier) : "";
|
|
21
|
+
const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(prefixedName, blockSuffix, element, modifier) : "";
|
|
22
|
+
const is = (name = "") => name ? `is-${name}` : "";
|
|
23
|
+
return {
|
|
24
|
+
b,
|
|
25
|
+
e,
|
|
26
|
+
m,
|
|
27
|
+
be,
|
|
28
|
+
em,
|
|
29
|
+
bm,
|
|
30
|
+
bem,
|
|
31
|
+
is
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function createNamespace(name) {
|
|
35
|
+
const prefixedName = `ll-${name}`;
|
|
36
|
+
return createBEM(prefixedName);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { createNamespace };
|
|
40
|
+
//# sourceMappingURL=create-namespace.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-namespace.mjs","sources":["../../../packages/utils/create-namespace.ts"],"sourcesContent":["const _bem = (\n prefixedName: string,\n blockSuffix: string,\n element: string,\n modifier: string\n) => {\n if (blockSuffix) {\n prefixedName += `-${blockSuffix}`\n }\n if (element) {\n prefixedName += `__${element}`\n }\n if (modifier) {\n prefixedName += `--${modifier}`\n }\n return prefixedName\n}\nfunction createBEM(prefixedName: string) {\n const b = (blockSuffix = '') => _bem(prefixedName, blockSuffix, '', '')\n const e = (element = '') =>\n element ? _bem(prefixedName, '', element, '') : ''\n const m = (modifier = '') =>\n modifier ? _bem(prefixedName, '', '', modifier) : ''\n const be = (blockSuffix = '', element = '') =>\n blockSuffix && element ? _bem(prefixedName, blockSuffix, element, '') : ''\n const em = (element: string, modifier: string) =>\n element && modifier ? _bem(prefixedName, '', element, modifier) : ''\n const bm = (blockSuffix: string, modifier: string) =>\n blockSuffix && modifier ? _bem(prefixedName, blockSuffix, '', modifier) : ''\n const bem = (blockSuffix: string, element: string, modifier: string) =>\n blockSuffix && element && modifier\n ? _bem(prefixedName, blockSuffix, element, modifier)\n : ''\n const is = (name = '') => (name ? `is-${name}` : '')\n return {\n b,\n e,\n m,\n be,\n em,\n bm,\n bem,\n is\n }\n}\nexport function createNamespace(name: string) {\n const prefixedName = `ll-${name}`\n return createBEM(prefixedName)\n}\n// const bem = createNamespace('button')\n// a-button\n// a-button-box\n// a-button__element\n// a-button--disabled\n// console.log(bem.b());\n// console.log(bem.b(\"box\"));\n// console.log(bem.e(\"element\"));\n// console.log(bem.m(\"disabled\"));\n// console.log(bem.is(\"checked\"));\n// console.log(bem.bem(\"box\", \"element\", \"disabled\"));\n"],"names":[],"mappings":";AAAA,MAAM,IAAO,GAAA,CACX,YACA,EAAA,WAAA,EACA,SACA,QACG,KAAA;AACH,EAAA,IAAI,WAAa,EAAA;AACf,IAAA,YAAA,IAAgB,IAAI,WAAW,CAAA,CAAA,CAAA;AAAA,GACjC;AACA,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,YAAA,IAAgB,KAAK,OAAO,CAAA,CAAA,CAAA;AAAA,GAC9B;AACA,EAAA,IAAI,QAAU,EAAA;AACZ,IAAA,YAAA,IAAgB,KAAK,QAAQ,CAAA,CAAA,CAAA;AAAA,GAC/B;AACA,EAAO,OAAA,YAAA,CAAA;AACT,CAAA,CAAA;AACA,SAAS,UAAU,YAAsB,EAAA;AACvC,EAAM,MAAA,CAAA,GAAI,CAAC,WAAc,GAAA,EAAA,KAAO,KAAK,YAAc,EAAA,WAAA,EAAa,IAAI,EAAE,CAAA,CAAA;AACtE,EAAM,MAAA,CAAA,GAAI,CAAC,OAAA,GAAU,EACnB,KAAA,OAAA,GAAU,KAAK,YAAc,EAAA,EAAA,EAAI,OAAS,EAAA,EAAE,CAAI,GAAA,EAAA,CAAA;AAClD,EAAM,MAAA,CAAA,GAAI,CAAC,QAAA,GAAW,EACpB,KAAA,QAAA,GAAW,KAAK,YAAc,EAAA,EAAA,EAAI,EAAI,EAAA,QAAQ,CAAI,GAAA,EAAA,CAAA;AACpD,EAAA,MAAM,EAAK,GAAA,CAAC,WAAc,GAAA,EAAA,EAAI,OAAU,GAAA,EAAA,KACtC,WAAe,IAAA,OAAA,GAAU,IAAK,CAAA,YAAA,EAAc,WAAa,EAAA,OAAA,EAAS,EAAE,CAAI,GAAA,EAAA,CAAA;AAC1E,EAAM,MAAA,EAAA,GAAK,CAAC,OAAA,EAAiB,QAC3B,KAAA,OAAA,IAAW,QAAW,GAAA,IAAA,CAAK,YAAc,EAAA,EAAA,EAAI,OAAS,EAAA,QAAQ,CAAI,GAAA,EAAA,CAAA;AACpE,EAAM,MAAA,EAAA,GAAK,CAAC,WAAA,EAAqB,QAC/B,KAAA,WAAA,IAAe,QAAW,GAAA,IAAA,CAAK,YAAc,EAAA,WAAA,EAAa,EAAI,EAAA,QAAQ,CAAI,GAAA,EAAA,CAAA;AAC5E,EAAA,MAAM,GAAM,GAAA,CAAC,WAAqB,EAAA,OAAA,EAAiB,QACjD,KAAA,WAAA,IAAe,OAAW,IAAA,QAAA,GACtB,IAAK,CAAA,YAAA,EAAc,WAAa,EAAA,OAAA,EAAS,QAAQ,CACjD,GAAA,EAAA,CAAA;AACN,EAAA,MAAM,KAAK,CAAC,IAAA,GAAO,OAAQ,IAAO,GAAA,CAAA,GAAA,EAAM,IAAI,CAAK,CAAA,GAAA,EAAA,CAAA;AACjD,EAAO,OAAA;AAAA,IACL,CAAA;AAAA,IACA,CAAA;AAAA,IACA,CAAA;AAAA,IACA,EAAA;AAAA,IACA,EAAA;AAAA,IACA,EAAA;AAAA,IACA,GAAA;AAAA,IACA,EAAA;AAAA,GACF,CAAA;AACF,CAAA;AACO,SAAS,gBAAgB,IAAc,EAAA;AAC5C,EAAM,MAAA,YAAA,GAAe,MAAM,IAAI,CAAA,CAAA,CAAA;AAC/B,EAAA,OAAO,UAAU,YAAY,CAAA,CAAA;AAC/B;;;;"}
|
package/es/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './props/index.mjs';
|
|
2
|
+
export { addUnit } from './add-unit.mjs';
|
|
3
|
+
export { createNamespace } from './create-namespace.mjs';
|
|
4
|
+
export { withInstall } from './with-install.mjs';
|
|
5
|
+
export { buildProp, buildProps, definePropType, epPropKey, isEpProp } from './props/runtime.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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,29 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { EpProp, EpPropConvert, EpPropFinalized, EpPropInput, EpPropMergeType, IfEpProp, IfNativePropType, NativePropType } from './types';
|
|
3
|
+
export declare const epPropKey = "__epPropKey";
|
|
4
|
+
export declare const definePropType: <T>(val: any) => PropType<T>;
|
|
5
|
+
export declare const isEpProp: (val: unknown) => val is EpProp<any, any, any>;
|
|
6
|
+
/**
|
|
7
|
+
* @description Build prop. It can better optimize prop types
|
|
8
|
+
* @description 生成 prop,能更好地优化类型
|
|
9
|
+
* @example
|
|
10
|
+
// limited options
|
|
11
|
+
// the type will be PropType<'light' | 'dark'>
|
|
12
|
+
buildProp({
|
|
13
|
+
type: String,
|
|
14
|
+
values: ['light', 'dark'],
|
|
15
|
+
} as const)
|
|
16
|
+
* @example
|
|
17
|
+
// limited options and other types
|
|
18
|
+
// the type will be PropType<'small' | 'large' | number>
|
|
19
|
+
buildProp({
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
values: ['small', 'large'],
|
|
22
|
+
validator: (val: unknown): val is number => typeof val === 'number',
|
|
23
|
+
} as const)
|
|
24
|
+
@link see more: https://github.com/element-plus/element-plus/pull/3341
|
|
25
|
+
*/
|
|
26
|
+
export declare const buildProp: <Type = never, Value = never, Validator = never, Default extends EpPropMergeType<Type, Value, Validator> = never, Required extends boolean = false>(prop: EpPropInput<Type, Value, Validator, Default, Required>, key?: string) => EpPropFinalized<Type, Value, Validator, Default, Required>;
|
|
27
|
+
export declare const buildProps: <Props extends Record<string, {
|
|
28
|
+
__epPropKey: true;
|
|
29
|
+
} | NativePropType | EpPropInput<any, any, any, any, any>>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>>; };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { warn } from 'vue';
|
|
2
|
+
import { fromPairs } from 'lodash-unified';
|
|
3
|
+
import { isObject, hasOwn } from '@vue/shared';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const epPropKey = "__epPropKey";
|
|
7
|
+
const definePropType = (val) => val;
|
|
8
|
+
const isEpProp = (val) => isObject(val) && !!val[epPropKey];
|
|
9
|
+
const buildProp = (prop, key) => {
|
|
10
|
+
if (!isObject(prop) || isEpProp(prop))
|
|
11
|
+
return prop;
|
|
12
|
+
const { values, required, default: defaultValue, type, validator } = prop;
|
|
13
|
+
const _validator = values || validator ? (val) => {
|
|
14
|
+
let valid = false;
|
|
15
|
+
let allowedValues = [];
|
|
16
|
+
if (values) {
|
|
17
|
+
allowedValues = Array.from(values);
|
|
18
|
+
if (hasOwn(prop, "default")) {
|
|
19
|
+
allowedValues.push(defaultValue);
|
|
20
|
+
}
|
|
21
|
+
valid || (valid = allowedValues.includes(val));
|
|
22
|
+
}
|
|
23
|
+
if (validator)
|
|
24
|
+
valid || (valid = validator(val));
|
|
25
|
+
if (!valid && allowedValues.length > 0) {
|
|
26
|
+
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
|
|
27
|
+
warn(
|
|
28
|
+
`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(
|
|
29
|
+
val
|
|
30
|
+
)}.`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return valid;
|
|
34
|
+
} : void 0;
|
|
35
|
+
const epProp = {
|
|
36
|
+
type,
|
|
37
|
+
required: !!required,
|
|
38
|
+
validator: _validator,
|
|
39
|
+
[epPropKey]: true
|
|
40
|
+
};
|
|
41
|
+
if (hasOwn(prop, "default"))
|
|
42
|
+
epProp.default = defaultValue;
|
|
43
|
+
return epProp;
|
|
44
|
+
};
|
|
45
|
+
const buildProps = (props) => fromPairs(
|
|
46
|
+
Object.entries(props).map(([key, option]) => [
|
|
47
|
+
key,
|
|
48
|
+
buildProp(option, key)
|
|
49
|
+
])
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export { buildProp, buildProps, definePropType, epPropKey, isEpProp };
|
|
53
|
+
//# sourceMappingURL=runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.mjs","sources":["../../../../packages/utils/props/runtime.ts"],"sourcesContent":["import { warn } from 'vue'\nimport { fromPairs } from 'lodash-unified'\nimport { isObject, hasOwn } from '@vue/shared'\n\nimport type { PropType } from 'vue'\nimport type {\n EpProp,\n EpPropConvert,\n EpPropFinalized,\n EpPropInput,\n EpPropMergeType,\n IfEpProp,\n IfNativePropType,\n NativePropType\n} from './types'\n\nexport const epPropKey = '__epPropKey'\n\nexport const definePropType = <T>(val: any): PropType<T> => val\n\nexport const isEpProp = (val: unknown): val is EpProp<any, any, any> =>\n isObject(val) && !!(val as any)[epPropKey]\n\n/**\n * @description Build prop. It can better optimize prop types\n * @description 生成 prop,能更好地优化类型\n * @example\n // limited options\n // the type will be PropType<'light' | 'dark'>\n buildProp({\n type: String,\n values: ['light', 'dark'],\n } as const)\n * @example\n // limited options and other types\n // the type will be PropType<'small' | 'large' | number>\n buildProp({\n type: [String, Number],\n values: ['small', 'large'],\n validator: (val: unknown): val is number => typeof val === 'number',\n } as const)\n @link see more: https://github.com/element-plus/element-plus/pull/3341\n */\nexport const buildProp = <\n Type = never,\n Value = never,\n Validator = never,\n Default extends EpPropMergeType<Type, Value, Validator> = never,\n Required extends boolean = false\n>(\n prop: EpPropInput<Type, Value, Validator, Default, Required>,\n key?: string\n): EpPropFinalized<Type, Value, Validator, Default, Required> => {\n // filter native prop type and nested prop, e.g `null`, `undefined` (from `buildProps`)\n if (!isObject(prop) || isEpProp(prop)) return prop as any\n\n const { values, required, default: defaultValue, type, validator } = prop\n\n const _validator =\n values || validator\n ? (val: unknown) => {\n let valid = false\n let allowedValues: unknown[] = []\n\n if (values) {\n allowedValues = Array.from(values)\n if (hasOwn(prop, 'default')) {\n allowedValues.push(defaultValue)\n }\n valid ||= allowedValues.includes(val)\n }\n if (validator) valid ||= validator(val)\n\n if (!valid && allowedValues.length > 0) {\n const allowValuesText = [...new Set(allowedValues)]\n .map(value => JSON.stringify(value))\n .join(', ')\n warn(\n `Invalid prop: validation failed${\n key ? ` for prop \"${key}\"` : ''\n }. Expected one of [${allowValuesText}], got value ${JSON.stringify(\n val\n )}.`\n )\n }\n return valid\n }\n : undefined\n\n const epProp: any = {\n type,\n required: !!required,\n validator: _validator,\n [epPropKey]: true\n }\n if (hasOwn(prop, 'default')) epProp.default = defaultValue\n return epProp\n}\n\nexport const buildProps = <\n Props extends Record<\n string,\n | { [epPropKey]: true }\n | NativePropType\n | EpPropInput<any, any, any, any, any>\n >\n>(\n props: Props\n): {\n [K in keyof Props]: IfEpProp<\n Props[K],\n Props[K],\n IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>\n >\n} =>\n fromPairs(\n Object.entries(props).map(([key, option]) => [\n key,\n buildProp(option as any, key)\n ])\n ) as any\n"],"names":[],"mappings":";;;;;AAgBO,MAAM,SAAY,GAAA,cAAA;AAEZ,MAAA,cAAA,GAAiB,CAAI,GAA0B,KAAA,IAAA;AAE/C,MAAA,QAAA,GAAW,CAAC,GACvB,KAAA,QAAA,CAAS,GAAG,CAAK,IAAA,CAAC,CAAE,GAAA,CAAY,SAAS,EAAA;AAsB9B,MAAA,SAAA,GAAY,CAOvB,IAAA,EACA,GAC+D,KAAA;AAE/D,EAAA,IAAI,CAAC,QAAA,CAAS,IAAI,CAAA,IAAK,SAAS,IAAI,CAAA;AAAG,IAAO,OAAA,IAAA,CAAA;AAE9C,EAAA,MAAM,EAAE,MAAQ,EAAA,QAAA,EAAU,SAAS,YAAc,EAAA,IAAA,EAAM,WAAc,GAAA,IAAA,CAAA;AAErE,EAAA,MAAM,UACJ,GAAA,MAAA,IAAU,SACN,GAAA,CAAC,GAAiB,KAAA;AAChB,IAAA,IAAI,KAAQ,GAAA,KAAA,CAAA;AACZ,IAAA,IAAI,gBAA2B,EAAC,CAAA;AAEhC,IAAA,IAAI,MAAQ,EAAA;AACV,MAAgB,aAAA,GAAA,KAAA,CAAM,KAAK,MAAM,CAAA,CAAA;AACjC,MAAI,IAAA,MAAA,CAAO,IAAM,EAAA,SAAS,CAAG,EAAA;AAC3B,QAAA,aAAA,CAAc,KAAK,YAAY,CAAA,CAAA;AAAA,OACjC;AACA,MAAU,KAAA,KAAA,KAAA,GAAA,aAAA,CAAc,SAAS,GAAG,CAAA,CAAA,CAAA;AAAA,KACtC;AACA,IAAI,IAAA,SAAA;AAAW,MAAA,KAAA,KAAA,KAAA,GAAU,UAAU,GAAG,CAAA,CAAA,CAAA;AAEtC,IAAA,IAAI,CAAC,KAAA,IAAS,aAAc,CAAA,MAAA,GAAS,CAAG,EAAA;AACtC,MAAA,MAAM,kBAAkB,CAAC,GAAG,IAAI,GAAA,CAAI,aAAa,CAAC,CAAA,CAC/C,GAAI,CAAA,CAAA,KAAA,KAAS,KAAK,SAAU,CAAA,KAAK,CAAC,CAAA,CAClC,KAAK,IAAI,CAAA,CAAA;AACZ,MAAA,IAAA;AAAA,QACE,CAAA,+BAAA,EACE,MAAM,CAAc,WAAA,EAAA,GAAG,MAAM,EAC/B,CAAA,mBAAA,EAAsB,eAAe,CAAA,aAAA,EAAgB,IAAK,CAAA,SAAA;AAAA,UACxD,GAAA;AAAA,SACD,CAAA,CAAA,CAAA;AAAA,OACH,CAAA;AAAA,KACF;AACA,IAAO,OAAA,KAAA,CAAA;AAAA,GAET,GAAA,KAAA,CAAA,CAAA;AAEN,EAAA,MAAM,MAAc,GAAA;AAAA,IAClB,IAAA;AAAA,IACA,QAAA,EAAU,CAAC,CAAC,QAAA;AAAA,IACZ,SAAW,EAAA,UAAA;AAAA,IACX,CAAC,SAAS,GAAG,IAAA;AAAA,GACf,CAAA;AACA,EAAI,IAAA,MAAA,CAAO,MAAM,SAAS,CAAA;AAAG,IAAA,MAAA,CAAO,OAAU,GAAA,YAAA,CAAA;AAC9C,EAAO,OAAA,MAAA,CAAA;AACT,EAAA;AAEa,MAAA,UAAA,GAAa,CAQxB,KAQA,KAAA,SAAA;AAAA,EACE,MAAA,CAAO,QAAQ,KAAK,CAAA,CAAE,IAAI,CAAC,CAAC,GAAK,EAAA,MAAM,CAAM,KAAA;AAAA,IAC3C,GAAA;AAAA,IACA,SAAA,CAAU,QAAe,GAAG,CAAA;AAAA,GAC7B,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { epPropKey } from './runtime';
|
|
2
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import type { IfNever, UnknownToNever, WritableArray } from './util';
|
|
4
|
+
type Value<T> = T[keyof T];
|
|
5
|
+
/**
|
|
6
|
+
* Extract the type of a single prop
|
|
7
|
+
*
|
|
8
|
+
* 提取单个 prop 的参数类型
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ExtractPropType<{ type: StringConstructor }> => string | undefined
|
|
12
|
+
* ExtractPropType<{ type: StringConstructor, required: true }> => string
|
|
13
|
+
* ExtractPropType<{ type: BooleanConstructor }> => boolean
|
|
14
|
+
*/
|
|
15
|
+
export type ExtractPropType<T extends object> = Value<ExtractPropTypes<{
|
|
16
|
+
key: T;
|
|
17
|
+
}>>;
|
|
18
|
+
/**
|
|
19
|
+
* Extracts types via `ExtractPropTypes`, accepting `PropType<T>`, `XXXConstructor`, `never`...
|
|
20
|
+
*
|
|
21
|
+
* 通过 `ExtractPropTypes` 提取类型,接受 `PropType<T>`、`XXXConstructor`、`never`...
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ResolvePropType<BooleanConstructor> => boolean
|
|
25
|
+
* ResolvePropType<PropType<T>> => T
|
|
26
|
+
**/
|
|
27
|
+
export type ResolvePropType<T> = IfNever<T, never, ExtractPropType<{
|
|
28
|
+
type: WritableArray<T>;
|
|
29
|
+
required: true;
|
|
30
|
+
}>>;
|
|
31
|
+
/**
|
|
32
|
+
* Merge Type, Value, Validator types
|
|
33
|
+
* 合并 Type、Value、Validator 的类型
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* EpPropMergeType<StringConstructor, '1', 1> => 1 | "1" // ignores StringConstructor
|
|
37
|
+
* EpPropMergeType<StringConstructor, never, number> => string | number
|
|
38
|
+
*/
|
|
39
|
+
export type EpPropMergeType<Type, Value, Validator> = IfNever<UnknownToNever<Value>, ResolvePropType<Type>, never> | UnknownToNever<Value> | UnknownToNever<Validator>;
|
|
40
|
+
/**
|
|
41
|
+
* Handling default values for input (constraints)
|
|
42
|
+
*
|
|
43
|
+
* 处理输入参数的默认值(约束)
|
|
44
|
+
*/
|
|
45
|
+
export type EpPropInputDefault<Required extends boolean, Default> = Required extends true ? never : Default extends Record<string, unknown> | Array<any> ? () => Default : (() => Default) | Default;
|
|
46
|
+
/**
|
|
47
|
+
* Native prop types, e.g: `BooleanConstructor`, `StringConstructor`, `null`, `undefined`, etc.
|
|
48
|
+
*
|
|
49
|
+
* 原生 prop `类型,BooleanConstructor`、`StringConstructor`、`null`、`undefined` 等
|
|
50
|
+
*/
|
|
51
|
+
export type NativePropType = ((...args: any) => any) | {
|
|
52
|
+
new (...args: any): any;
|
|
53
|
+
} | undefined | null;
|
|
54
|
+
export type IfNativePropType<T, Y, N> = [T] extends [NativePropType] ? Y : N;
|
|
55
|
+
/**
|
|
56
|
+
* input prop `buildProp` or `buildProps` (constraints)
|
|
57
|
+
*
|
|
58
|
+
* prop 输入参数(约束)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* EpPropInput<StringConstructor, 'a', never, never, true>
|
|
62
|
+
* ⬇️
|
|
63
|
+
* {
|
|
64
|
+
type?: StringConstructor | undefined;
|
|
65
|
+
required?: true | undefined;
|
|
66
|
+
values?: readonly "a"[] | undefined;
|
|
67
|
+
validator?: ((val: any) => boolean) | ((val: any) => val is never) | undefined;
|
|
68
|
+
default?: undefined;
|
|
69
|
+
}
|
|
70
|
+
*/
|
|
71
|
+
export type EpPropInput<Type, Value, Validator, Default extends EpPropMergeType<Type, Value, Validator>, Required extends boolean> = {
|
|
72
|
+
type?: Type;
|
|
73
|
+
required?: Required;
|
|
74
|
+
values?: readonly Value[];
|
|
75
|
+
validator?: ((val: any) => val is Validator) | ((val: any) => boolean);
|
|
76
|
+
default?: EpPropInputDefault<Required, Default>;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* output prop `buildProp` or `buildProps`.
|
|
80
|
+
*
|
|
81
|
+
* prop 输出参数。
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* EpProp<'a', 'b', true>
|
|
85
|
+
* ⬇️
|
|
86
|
+
* {
|
|
87
|
+
readonly type: PropType<"a">;
|
|
88
|
+
readonly required: true;
|
|
89
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
90
|
+
readonly default: "b";
|
|
91
|
+
__epPropKey: true;
|
|
92
|
+
}
|
|
93
|
+
*/
|
|
94
|
+
export type EpProp<Type, Default, Required> = {
|
|
95
|
+
readonly type: PropType<Type>;
|
|
96
|
+
readonly required: [Required] extends [true] ? true : false;
|
|
97
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
98
|
+
[epPropKey]: true;
|
|
99
|
+
} & IfNever<Default, unknown, {
|
|
100
|
+
readonly default: Default;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* Determine if it is `EpProp`
|
|
104
|
+
*/
|
|
105
|
+
export type IfEpProp<T, Y, N> = T extends {
|
|
106
|
+
[epPropKey]: true;
|
|
107
|
+
} ? Y : N;
|
|
108
|
+
/**
|
|
109
|
+
* Converting input to output.
|
|
110
|
+
*
|
|
111
|
+
* 将输入转换为输出
|
|
112
|
+
*/
|
|
113
|
+
export type EpPropConvert<Input> = Input extends EpPropInput<infer Type, infer Value, infer Validator, any, infer Required> ? EpPropFinalized<Type, Value, Validator, Input['default'], Required> : never;
|
|
114
|
+
/**
|
|
115
|
+
* Finalized conversion output
|
|
116
|
+
*
|
|
117
|
+
* 最终转换 EpProp
|
|
118
|
+
*/
|
|
119
|
+
export type EpPropFinalized<Type, Value, Validator, Default, Required> = EpProp<EpPropMergeType<Type, Value, Validator>, UnknownToNever<Default>, Required>;
|
|
120
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type Writable<T> = {
|
|
2
|
+
-readonly [P in keyof T]: T[P];
|
|
3
|
+
};
|
|
4
|
+
export type WritableArray<T> = T extends readonly any[] ? Writable<T> : T;
|
|
5
|
+
export type IfNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
|
|
6
|
+
export type IfUnknown<T, Y, N> = [unknown] extends [T] ? Y : N;
|
|
7
|
+
export type UnknownToNever<T> = IfUnknown<T, never, T>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { isArray, isFunction, isObject, isString, isDate, isPromise, isSymbol } from '@vue/shared';
|
|
2
|
+
export { isVNode } from 'vue';
|
|
3
|
+
export declare const isUndefined: (val: any) => val is undefined;
|
|
4
|
+
export declare const isBoolean: (val: any) => val is boolean;
|
|
5
|
+
export declare const isNumber: (val: any) => val is number;
|
|
6
|
+
export declare const isEmpty: (val: unknown) => boolean;
|
|
7
|
+
export declare const isElement: (e: unknown) => e is Element;
|
|
8
|
+
export declare const isPropAbsent: (prop: unknown) => prop is null | undefined;
|
|
9
|
+
export declare const isStringNumber: (val: string) => boolean;
|
|
10
|
+
export declare const isWindow: (val: unknown) => val is Window;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isArray, isObject, isString } from '@vue/shared';
|
|
2
|
+
export { isArray, isDate, isFunction, isObject, isPromise, isString, isSymbol } from '@vue/shared';
|
|
3
|
+
import { isNil } from 'lodash-unified';
|
|
4
|
+
export { isVNode } from 'vue';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const isUndefined = (val) => val === void 0;
|
|
8
|
+
const isBoolean = (val) => typeof val === "boolean";
|
|
9
|
+
const isNumber = (val) => typeof val === "number";
|
|
10
|
+
const isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject(val) && !Object.keys(val).length;
|
|
11
|
+
const isElement = (e) => {
|
|
12
|
+
if (typeof Element === "undefined")
|
|
13
|
+
return false;
|
|
14
|
+
return e instanceof Element;
|
|
15
|
+
};
|
|
16
|
+
const isPropAbsent = (prop) => {
|
|
17
|
+
return isNil(prop);
|
|
18
|
+
};
|
|
19
|
+
const isStringNumber = (val) => {
|
|
20
|
+
if (!isString(val)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return !Number.isNaN(Number(val));
|
|
24
|
+
};
|
|
25
|
+
const isWindow = (val) => {
|
|
26
|
+
return val === window;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { isBoolean, isElement, isEmpty, isNumber, isPropAbsent, isStringNumber, isUndefined, isWindow };
|
|
30
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject, isString } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol\n} from '@vue/shared'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\nexport const isBoolean = (val: any): val is boolean => typeof val === 'boolean'\nexport const isNumber = (val: any): val is number => typeof val === 'number'\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => {\n if (typeof Element === 'undefined') return false\n return e instanceof Element\n}\n\nexport const isPropAbsent = (prop: unknown): prop is null | undefined => {\n return isNil(prop)\n}\n\nexport const isStringNumber = (val: string): boolean => {\n if (!isString(val)) {\n return false\n }\n return !Number.isNaN(Number(val))\n}\n\nexport const isWindow = (val: unknown): val is Window => {\n return val === window\n}\n"],"names":[],"mappings":";;;;;;AAca,MAAA,WAAA,GAAc,CAAC,GAAA,KAA+B,GAAQ,KAAA,KAAA,EAAA;AAC5D,MAAM,SAAY,GAAA,CAAC,GAA6B,KAAA,OAAO,GAAQ,KAAA,UAAA;AAC/D,MAAM,QAAW,GAAA,CAAC,GAA4B,KAAA,OAAO,GAAQ,KAAA,SAAA;AAEvD,MAAA,OAAA,GAAU,CAAC,GACrB,KAAA,CAAC,OAAO,GAAQ,KAAA,CAAA,IAChB,QAAQ,GAAG,CAAA,IAAK,IAAI,MAAW,KAAA,CAAA,IAC/B,SAAS,GAAG,CAAA,IAAK,CAAC,MAAO,CAAA,IAAA,CAAK,GAAG,CAAE,CAAA,OAAA;AAEzB,MAAA,SAAA,GAAY,CAAC,CAA6B,KAAA;AACrD,EAAA,IAAI,OAAO,OAAY,KAAA,WAAA;AAAa,IAAO,OAAA,KAAA,CAAA;AAC3C,EAAA,OAAO,CAAa,YAAA,OAAA,CAAA;AACtB,EAAA;AAEa,MAAA,YAAA,GAAe,CAAC,IAA4C,KAAA;AACvE,EAAA,OAAO,MAAM,IAAI,CAAA,CAAA;AACnB,EAAA;AAEa,MAAA,cAAA,GAAiB,CAAC,GAAyB,KAAA;AACtD,EAAI,IAAA,CAAC,QAAS,CAAA,GAAG,CAAG,EAAA;AAClB,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AACA,EAAA,OAAO,CAAC,MAAA,CAAO,KAAM,CAAA,MAAA,CAAO,GAAG,CAAC,CAAA,CAAA;AAClC,EAAA;AAEa,MAAA,QAAA,GAAW,CAAC,GAAgC,KAAA;AACvD,EAAA,OAAO,GAAQ,KAAA,MAAA,CAAA;AACjB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-install.mjs","sources":["../../../packages/utils/with-install.ts"],"sourcesContent":["import type { App, Plugin } from \"vue\"; // 只导入类型 而不是导入值\n\n// 类型必须导出否则生成不了.d.ts文件\nexport type SFCWithInstall<T> = T & Plugin;\n\nexport const withInstall = <T>(comp: T) => {\n (comp as SFCWithInstall<T>).install = function (app: App) {\n app.component((comp as any).name, comp!);\n };\n return comp as SFCWithInstall<T>;\n};"],"names":[],"mappings":";AAKa,MAAA,WAAA,GAAc,CAAI,IAAY,KAAA;AACzC,EAAC,IAAA,CAA2B,OAAU,GAAA,SAAU,GAAU,EAAA;AACxD,IAAI,GAAA,CAAA,SAAA,CAAW,IAAa,CAAA,IAAA,EAAM,IAAK,CAAA,CAAA;AAAA,GACzC,CAAA;AACA,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
|
package/global.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// GlobalComponents for Volar
|
|
2
|
+
// 让Volar有代理提示
|
|
3
|
+
declare module '@vue/runtime-core' {
|
|
4
|
+
// GlobalComponents for Volar
|
|
5
|
+
export interface GlobalComponents {
|
|
6
|
+
LlIcon: typeof import('ll-plus')['LlIcon']
|
|
7
|
+
LlTable: typeof import('ll-plus')['LlTable']
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {}
|