g-ui-core 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "g-ui-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "G-UI Web Components built with Stencil",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -12,8 +12,21 @@
12
12
  "unpkg": "dist/g-ui/g-ui.esm.js",
13
13
  "files": [
14
14
  "dist/",
15
- "loader/"
15
+ "loader/",
16
+ "vue/"
16
17
  ],
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.cjs.js",
22
+ "types": "./dist/types/index.d.ts"
23
+ },
24
+ "./vue": {
25
+ "types": "./vue/global.d.ts",
26
+ "import": "./vue/index.ts",
27
+ "default": "./vue/index.ts"
28
+ }
29
+ },
17
30
  "scripts": {
18
31
  "dev": "stencil build --dev --watch --serve",
19
32
  "build": "stencil build",
@@ -0,0 +1,35 @@
1
+ /* eslint-disable */
2
+ import type {
3
+ ButtonType,
4
+ ButtonSize,
5
+ NativeButtonType
6
+ } from '../dist/types/components/my-button/my-button'
7
+
8
+ declare module '@vue/runtime-core' {
9
+ export interface GlobalComponents {
10
+ GButton: {
11
+ type?: ButtonType
12
+ size?: ButtonSize
13
+ plain?: boolean | string
14
+ text?: boolean | string
15
+ bg?: boolean | string
16
+ link?: boolean | string
17
+ round?: boolean | string
18
+ circle?: boolean | string
19
+ dashed?: boolean | string
20
+ loading?: boolean | string
21
+ loadingIcon?: string
22
+ disabled?: boolean | string
23
+ icon?: string
24
+ autofocus?: boolean | string
25
+ nativeType?: NativeButtonType
26
+ autoInsertSpace?: boolean | string
27
+ color?: string
28
+ dark?: boolean | string
29
+ tag?: string
30
+ label?: string
31
+ }
32
+ }
33
+ }
34
+
35
+ export {}
package/vue/index.ts ADDED
@@ -0,0 +1,12 @@
1
+ import type { App } from 'vue'
2
+
3
+ // 导入 Stencil 组件(auto-define 会自动注册)
4
+ import '../dist/components/g-button.js'
5
+
6
+ export default {
7
+ install(app: App) {
8
+ const original = app.config.compilerOptions.isCustomElement
9
+ app.config.compilerOptions.isCustomElement = (tag: string) =>
10
+ tag.startsWith('g-') || (typeof original === 'function' && original(tag))
11
+ }
12
+ }