unplugin-vue-components 0.17.8 → 0.17.9

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.
@@ -53,6 +53,7 @@ function resolveOptions(options, root) {
53
53
  resolved.extensions = toArray(resolved.extensions);
54
54
  if (resolved.globs) {
55
55
  resolved.globs = toArray(resolved.globs).map((glob) => slash(resolve(root, glob)));
56
+ resolved.resolvedDirs = [];
56
57
  } else {
57
58
  const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
58
59
  resolved.dirs = toArray(resolved.dirs);
@@ -53,6 +53,7 @@ function resolveOptions(options, root) {
53
53
  resolved.extensions = _utils.toArray.call(void 0, resolved.extensions);
54
54
  if (resolved.globs) {
55
55
  resolved.globs = _utils.toArray.call(void 0, resolved.globs).map((glob) => _utils.slash.call(void 0, _path.resolve.call(void 0, root, glob)));
56
+ resolved.resolvedDirs = [];
56
57
  } else {
57
58
  const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
58
59
  resolved.dirs = _utils.toArray.call(void 0, resolved.dirs);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTFMUKG5Vjs = require('./chunk-TFMUKG5V.js');
3
+ var _chunkCB6M22NEjs = require('./chunk-CB6M22NE.js');
4
4
 
5
5
 
6
6
 
@@ -13,4 +13,4 @@ require('./chunk-HIJQIC5V.js');
13
13
 
14
14
 
15
15
 
16
- exports.camelCase = _chunkVGL64D3Tjs.camelCase; exports.default = _chunkTFMUKG5Vjs.unplugin_default; exports.kebabCase = _chunkVGL64D3Tjs.kebabCase; exports.pascalCase = _chunkVGL64D3Tjs.pascalCase;
16
+ exports.camelCase = _chunkVGL64D3Tjs.camelCase; exports.default = _chunkCB6M22NEjs.unplugin_default; exports.kebabCase = _chunkVGL64D3Tjs.kebabCase; exports.pascalCase = _chunkVGL64D3Tjs.pascalCase;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-OF6KPWRN.mjs";
3
+ } from "./chunk-BPS23YOY.mjs";
4
4
  import {
5
5
  camelCase,
6
6
  kebabCase,
package/dist/nuxt.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTFMUKG5Vjs = require('./chunk-TFMUKG5V.js');
3
+ var _chunkCB6M22NEjs = require('./chunk-CB6M22NE.js');
4
4
  require('./chunk-VGL64D3T.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
@@ -9,11 +9,11 @@ require('./chunk-HIJQIC5V.js');
9
9
  function nuxt_default(options) {
10
10
  this.extendBuild((config) => {
11
11
  config.plugins = config.plugins || [];
12
- config.plugins.unshift(_chunkTFMUKG5Vjs.unplugin_default.webpack(options));
12
+ config.plugins.unshift(_chunkCB6M22NEjs.unplugin_default.webpack(options));
13
13
  });
14
14
  this.nuxt.hook("vite:extend", async (vite) => {
15
15
  vite.config.plugins = vite.config.plugins || [];
16
- vite.config.plugins.push(_chunkTFMUKG5Vjs.unplugin_default.vite(options));
16
+ vite.config.plugins.push(_chunkCB6M22NEjs.unplugin_default.vite(options));
17
17
  });
18
18
  }
19
19
 
package/dist/nuxt.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-OF6KPWRN.mjs";
3
+ } from "./chunk-BPS23YOY.mjs";
4
4
  import "./chunk-IDYWJDFZ.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
@@ -109,13 +109,19 @@ declare function ElementUiResolver(options?: ElementUiResolverOptions): Componen
109
109
  declare function HeadlessUiResolver(): ComponentResolver;
110
110
 
111
111
  interface IduxResolverOptions {
112
+ /**
113
+ * exclude components that do not require automatic import
114
+ *
115
+ * @default []
116
+ */
117
+ exclude?: string[];
112
118
  /**
113
119
  * import style along with components
114
120
  */
115
121
  importStyle?: 'css' | 'less';
116
122
  }
117
123
  /**
118
- * Resolver for `@idux/cdk` and `@idux/components`
124
+ * Resolver for `@idux/cdk`, `@idux/components` and ``@idux/pro``
119
125
  *
120
126
  * @link https://idux.site
121
127
  */
package/dist/resolvers.js CHANGED
@@ -1621,46 +1621,54 @@ function HeadlessUiResolver() {
1621
1621
  }
1622
1622
 
1623
1623
  // src/core/resolvers/idux.ts
1624
- var cdkNames = [
1625
- "portal",
1626
- "resizable",
1627
- "virtual-list"
1628
- ];
1629
- var kebabCaseDirnames = [
1630
- "virtual-list",
1631
- "auto-complete",
1632
- "back-top",
1633
- "date-picker",
1634
- "input-number",
1635
- "time-picker",
1636
- "tree-select"
1637
- ];
1624
+ var specialComponents = {
1625
+ CdkVirtualScroll: "scroll",
1626
+ IxAutoComplete: "auto-complete",
1627
+ IxBackTop: "back-top",
1628
+ IxDatePicker: "date-picker",
1629
+ IxCol: "grid",
1630
+ IxRow: "grid",
1631
+ IxInputNumber: "input-number",
1632
+ IxTab: "tabs",
1633
+ IxTreeSelect: "tree-select",
1634
+ IxTimePicker: "time-picker"
1635
+ };
1638
1636
  function IduxResolver(options = {}) {
1639
1637
  return {
1640
1638
  type: "component",
1641
1639
  resolve: (name) => {
1642
- if (name.match(/^Ix[A-Z]/)) {
1643
- const { importStyle } = options;
1644
- const compName = name.slice(2);
1645
- const kebabCaseName = _chunkVGL64D3Tjs.kebabCase.call(void 0, compName);
1646
- const isCdk = cdkNames.includes(kebabCaseName);
1647
- const packageName = isCdk ? "cdk" : "components";
1648
- const dirname = getDirname(kebabCaseName);
1649
- const path = `@idux/${packageName}/${dirname}`;
1650
- const sideEffects = isCdk || !importStyle ? void 0 : `${path}/style/${importStyle === "css" ? "css" : "index"}`;
1651
- return { importName: name, path, sideEffects };
1640
+ const { importStyle, exclude = [] } = options;
1641
+ if (exclude.includes(name)) {
1642
+ return;
1652
1643
  }
1644
+ const packageName = getPackageName(name);
1645
+ if (!packageName) {
1646
+ return;
1647
+ }
1648
+ let dirname = specialComponents[name];
1649
+ if (!dirname) {
1650
+ const nameIndex = packageName === "pro" ? 2 : 1;
1651
+ dirname = _chunkVGL64D3Tjs.kebabCase.call(void 0, name).split("-")[nameIndex];
1652
+ }
1653
+ const path = `@idux/${packageName}/${dirname}`;
1654
+ let sideEffects;
1655
+ if (packageName !== "cdk" && importStyle) {
1656
+ sideEffects = `${path}/style/themes/${importStyle === "css" ? "default_css" : "default"}`;
1657
+ }
1658
+ return { importName: name, path, sideEffects };
1653
1659
  }
1654
1660
  };
1655
1661
  }
1656
- function getDirname(compName) {
1657
- const dirname = kebabCaseDirnames.find((name) => compName.startsWith(name));
1658
- if (dirname)
1659
- return dirname;
1660
- const [first] = compName.split("-");
1661
- if (first === "row" || first === "col")
1662
- return "grid";
1663
- return first;
1662
+ function getPackageName(name) {
1663
+ let packageName;
1664
+ if (name.match(/^Cdk[A-Z]/)) {
1665
+ packageName = "cdk";
1666
+ } else if (name.match(/^IxPro[A-Z]/)) {
1667
+ packageName = "pro";
1668
+ } else if (name.match(/^Ix[A-Z]/)) {
1669
+ packageName = "components";
1670
+ }
1671
+ return packageName;
1664
1672
  }
1665
1673
 
1666
1674
  // src/core/resolvers/naive-ui.ts
@@ -1621,46 +1621,54 @@ function HeadlessUiResolver() {
1621
1621
  }
1622
1622
 
1623
1623
  // src/core/resolvers/idux.ts
1624
- var cdkNames = [
1625
- "portal",
1626
- "resizable",
1627
- "virtual-list"
1628
- ];
1629
- var kebabCaseDirnames = [
1630
- "virtual-list",
1631
- "auto-complete",
1632
- "back-top",
1633
- "date-picker",
1634
- "input-number",
1635
- "time-picker",
1636
- "tree-select"
1637
- ];
1624
+ var specialComponents = {
1625
+ CdkVirtualScroll: "scroll",
1626
+ IxAutoComplete: "auto-complete",
1627
+ IxBackTop: "back-top",
1628
+ IxDatePicker: "date-picker",
1629
+ IxCol: "grid",
1630
+ IxRow: "grid",
1631
+ IxInputNumber: "input-number",
1632
+ IxTab: "tabs",
1633
+ IxTreeSelect: "tree-select",
1634
+ IxTimePicker: "time-picker"
1635
+ };
1638
1636
  function IduxResolver(options = {}) {
1639
1637
  return {
1640
1638
  type: "component",
1641
1639
  resolve: (name) => {
1642
- if (name.match(/^Ix[A-Z]/)) {
1643
- const { importStyle } = options;
1644
- const compName = name.slice(2);
1645
- const kebabCaseName = kebabCase(compName);
1646
- const isCdk = cdkNames.includes(kebabCaseName);
1647
- const packageName = isCdk ? "cdk" : "components";
1648
- const dirname = getDirname(kebabCaseName);
1649
- const path = `@idux/${packageName}/${dirname}`;
1650
- const sideEffects = isCdk || !importStyle ? void 0 : `${path}/style/${importStyle === "css" ? "css" : "index"}`;
1651
- return { importName: name, path, sideEffects };
1640
+ const { importStyle, exclude = [] } = options;
1641
+ if (exclude.includes(name)) {
1642
+ return;
1652
1643
  }
1644
+ const packageName = getPackageName(name);
1645
+ if (!packageName) {
1646
+ return;
1647
+ }
1648
+ let dirname = specialComponents[name];
1649
+ if (!dirname) {
1650
+ const nameIndex = packageName === "pro" ? 2 : 1;
1651
+ dirname = kebabCase(name).split("-")[nameIndex];
1652
+ }
1653
+ const path = `@idux/${packageName}/${dirname}`;
1654
+ let sideEffects;
1655
+ if (packageName !== "cdk" && importStyle) {
1656
+ sideEffects = `${path}/style/themes/${importStyle === "css" ? "default_css" : "default"}`;
1657
+ }
1658
+ return { importName: name, path, sideEffects };
1653
1659
  }
1654
1660
  };
1655
1661
  }
1656
- function getDirname(compName) {
1657
- const dirname = kebabCaseDirnames.find((name) => compName.startsWith(name));
1658
- if (dirname)
1659
- return dirname;
1660
- const [first] = compName.split("-");
1661
- if (first === "row" || first === "col")
1662
- return "grid";
1663
- return first;
1662
+ function getPackageName(name) {
1663
+ let packageName;
1664
+ if (name.match(/^Cdk[A-Z]/)) {
1665
+ packageName = "cdk";
1666
+ } else if (name.match(/^IxPro[A-Z]/)) {
1667
+ packageName = "pro";
1668
+ } else if (name.match(/^Ix[A-Z]/)) {
1669
+ packageName = "components";
1670
+ }
1671
+ return packageName;
1664
1672
  }
1665
1673
 
1666
1674
  // src/core/resolvers/naive-ui.ts
package/dist/rollup.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTFMUKG5Vjs = require('./chunk-TFMUKG5V.js');
3
+ var _chunkCB6M22NEjs = require('./chunk-CB6M22NE.js');
4
4
  require('./chunk-VGL64D3T.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
8
8
  // src/rollup.ts
9
- var rollup_default = _chunkTFMUKG5Vjs.unplugin_default.rollup;
9
+ var rollup_default = _chunkCB6M22NEjs.unplugin_default.rollup;
10
10
 
11
11
 
12
12
  module.exports = rollup_default;
package/dist/rollup.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-OF6KPWRN.mjs";
3
+ } from "./chunk-BPS23YOY.mjs";
4
4
  import "./chunk-IDYWJDFZ.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
package/dist/vite.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTFMUKG5Vjs = require('./chunk-TFMUKG5V.js');
3
+ var _chunkCB6M22NEjs = require('./chunk-CB6M22NE.js');
4
4
  require('./chunk-VGL64D3T.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
8
8
  // src/vite.ts
9
- var vite_default = _chunkTFMUKG5Vjs.unplugin_default.vite;
9
+ var vite_default = _chunkCB6M22NEjs.unplugin_default.vite;
10
10
 
11
11
 
12
12
  module.exports = vite_default;
package/dist/vite.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-OF6KPWRN.mjs";
3
+ } from "./chunk-BPS23YOY.mjs";
4
4
  import "./chunk-IDYWJDFZ.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
package/dist/webpack.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTFMUKG5Vjs = require('./chunk-TFMUKG5V.js');
3
+ var _chunkCB6M22NEjs = require('./chunk-CB6M22NE.js');
4
4
  require('./chunk-VGL64D3T.js');
5
5
  require('./chunk-GGNOJ77I.js');
6
6
  require('./chunk-HIJQIC5V.js');
7
7
 
8
8
  // src/webpack.ts
9
- var webpack_default = _chunkTFMUKG5Vjs.unplugin_default.webpack;
9
+ var webpack_default = _chunkCB6M22NEjs.unplugin_default.webpack;
10
10
 
11
11
 
12
12
  module.exports = webpack_default;
package/dist/webpack.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-OF6KPWRN.mjs";
3
+ } from "./chunk-BPS23YOY.mjs";
4
4
  import "./chunk-IDYWJDFZ.mjs";
5
5
  import "./chunk-WBQAMGXK.mjs";
6
6
  import "./chunk-EKXJN6YJ.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-vue-components",
3
- "version": "0.17.8",
3
+ "version": "0.17.9",
4
4
  "description": "Components auto importing for Vue",
5
5
  "homepage": "https://github.com/antfu/unplugin-vue-components",
6
6
  "bugs": "https://github.com/antfu/unplugin-vue-components/issues",