orion-design 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. package/dist/Throne/index.d.ts +18 -0
  2. package/dist/Throne/index.js +20 -0
  3. package/dist/Throne/index.js.map +1 -0
  4. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  5. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  6. package/dist/components/Button/index.d.ts +2 -4
  7. package/dist/components/Button/index.js +12 -12
  8. package/dist/components/Button/index.js.map +1 -1
  9. package/dist/components/Form/ButtonGroup/ButtonGroup.d.ts +5 -0
  10. package/dist/components/Form/ButtonGroup/ButtonGroup.js +2 -0
  11. package/dist/components/Form/ButtonGroup/ButtonGroup.js.map +1 -0
  12. package/dist/components/Form/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
  13. package/dist/components/Form/ButtonGroup/index.d.ts +1 -0
  14. package/dist/components/Form/ButtonGroup/index.js +2 -0
  15. package/dist/components/Form/ButtonGroup/index.js.map +1 -0
  16. package/dist/components/Form/Checkbox/Checkbox.d.ts +10 -0
  17. package/dist/components/Form/Checkbox/Checkbox.js +2 -0
  18. package/dist/components/Form/Checkbox/Checkbox.js.map +1 -0
  19. package/dist/components/Form/Checkbox/Checkbox.vue.d.ts +3 -0
  20. package/dist/components/Form/Checkbox/index.d.ts +1 -0
  21. package/dist/components/Form/Checkbox/index.js +2 -0
  22. package/dist/components/Form/Checkbox/index.js.map +1 -0
  23. package/dist/components/Form/CheckboxGroup/CheckboxGroup.d.ts +14 -0
  24. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +2 -0
  25. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js.map +1 -0
  26. package/dist/components/Form/CheckboxGroup/CheckboxGroup.vue.d.ts +3 -0
  27. package/dist/components/Form/CheckboxGroup/index.d.ts +1 -0
  28. package/dist/components/Form/CheckboxGroup/index.js +2 -0
  29. package/dist/components/Form/CheckboxGroup/index.js.map +1 -0
  30. package/dist/components/Form/DateInput/DateInput.d.ts +17 -0
  31. package/dist/components/Form/DateInput/DateInput.js +2 -0
  32. package/dist/components/Form/DateInput/DateInput.js.map +1 -0
  33. package/dist/components/Form/DateInput/DateInput.vue.d.ts +3 -0
  34. package/dist/components/Form/DateInput/index.d.ts +1 -0
  35. package/dist/components/Form/DateInput/index.js +2 -0
  36. package/dist/components/Form/DateInput/index.js.map +1 -0
  37. package/dist/components/Form/FileInput/FileInput.d.ts +10 -0
  38. package/dist/components/Form/FileInput/FileInput.js +2 -0
  39. package/dist/components/Form/FileInput/FileInput.js.map +1 -0
  40. package/dist/components/Form/FileInput/FileInput.vue.d.ts +451 -0
  41. package/dist/components/Form/FileInput/index.d.ts +1 -0
  42. package/dist/components/Form/FileInput/index.js +2 -0
  43. package/dist/components/Form/FileInput/index.js.map +1 -0
  44. package/dist/components/Form/Form.vue.d.ts +10 -10
  45. package/dist/components/Form/MultiSelect/MultiSelect.d.ts +15 -0
  46. package/dist/components/Form/MultiSelect/MultiSelect.js +2 -0
  47. package/dist/components/Form/MultiSelect/MultiSelect.js.map +1 -0
  48. package/dist/components/Form/MultiSelect/MultiSelect.vue.d.ts +3 -0
  49. package/dist/components/Form/MultiSelect/index.d.ts +1 -0
  50. package/dist/components/Form/MultiSelect/index.js +2 -0
  51. package/dist/components/Form/MultiSelect/index.js.map +1 -0
  52. package/dist/components/Form/PasswordInput/PasswordInput.d.ts +0 -2
  53. package/dist/components/Form/RadioGroup/RadioGroup.d.ts +14 -0
  54. package/dist/components/Form/RadioGroup/RadioGroup.js +2 -0
  55. package/dist/components/Form/RadioGroup/RadioGroup.js.map +1 -0
  56. package/dist/components/Form/RadioGroup/RadioGroup.vue.d.ts +3 -0
  57. package/dist/components/Form/RadioGroup/index.d.ts +1 -0
  58. package/dist/components/Form/RadioGroup/index.js +2 -0
  59. package/dist/components/Form/RadioGroup/index.js.map +1 -0
  60. package/dist/components/Form/SingleSelect/SingleSelect.d.ts +17 -0
  61. package/dist/components/Form/SingleSelect/SingleSelect.js +2 -0
  62. package/dist/components/Form/SingleSelect/SingleSelect.js.map +1 -0
  63. package/dist/components/Form/SingleSelect/SingleSelect.vue.d.ts +3 -0
  64. package/dist/components/Form/SingleSelect/index.d.ts +1 -0
  65. package/dist/components/Form/SingleSelect/index.js +2 -0
  66. package/dist/components/Form/SingleSelect/index.js.map +1 -0
  67. package/dist/components/Form/StringInput/StringInput.d.ts +0 -2
  68. package/dist/components/Form/Switch/Switch.d.ts +10 -0
  69. package/dist/components/Form/Switch/Switch.js +2 -0
  70. package/dist/components/Form/Switch/Switch.js.map +1 -0
  71. package/dist/components/Form/Switch/Switch.vue.d.ts +3 -0
  72. package/dist/components/Form/Switch/index.d.ts +1 -0
  73. package/dist/components/Form/Switch/index.js +2 -0
  74. package/dist/components/Form/Switch/index.js.map +1 -0
  75. package/dist/components/Form/Textarea/Textarea.d.ts +0 -2
  76. package/dist/components/Form/hooks/useForm.d.ts +6 -3
  77. package/dist/components/Form/hooks/useForm.js +40 -17
  78. package/dist/components/Form/hooks/useForm.js.map +1 -1
  79. package/dist/components/Form/index.d.ts +34 -6
  80. package/dist/components/Form/index.js +554 -88
  81. package/dist/components/Form/index.js.map +1 -1
  82. package/dist/components/Form/utils/index.d.ts +8 -0
  83. package/dist/components/Form/utils/index.js +26 -0
  84. package/dist/components/Form/utils/index.js.map +1 -0
  85. package/dist/components/Modal/index.d.ts +1 -1
  86. package/dist/components/Pagetable/Pagetable.d.ts +29 -17
  87. package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +24 -0
  88. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +78 -0
  89. package/dist/components/Pagetable/columns/{PagetableDatecolumn.d.ts → PagetableColumnDate.d.ts} +17 -4
  90. package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +78 -0
  91. package/dist/components/Pagetable/columns/PagetableColumnIndex.d.ts +5 -0
  92. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +109 -0
  93. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +114 -0
  94. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +109 -0
  95. package/dist/components/Pagetable/columns/{PagetableStringcolumn.d.ts → PagetableColumnString.d.ts} +17 -4
  96. package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +35 -0
  97. package/dist/components/Pagetable/hooks/useColumns.d.ts +1 -0
  98. package/dist/components/Pagetable/hooks/useColumns.js +96 -0
  99. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -0
  100. package/dist/components/Pagetable/index.d.ts +42 -17
  101. package/dist/components/Pagetable/index.js +496 -119
  102. package/dist/components/Pagetable/index.js.map +1 -1
  103. package/dist/components/Pagetable/utils/index.d.ts +15 -0
  104. package/dist/components/Pagetable/utils/index.js +169 -0
  105. package/dist/components/Pagetable/utils/index.js.map +1 -0
  106. package/dist/components/Space/index.d.ts +3 -3
  107. package/dist/components/_util/type.d.ts +4 -0
  108. package/dist/components/_util/type.js +8 -4
  109. package/dist/components/_util/type.js.map +1 -1
  110. package/dist/components/_util/vue/size.d.ts +1 -1
  111. package/dist/components/components.js +15 -14
  112. package/dist/components/components.js.map +1 -1
  113. package/dist/components/index.js +20 -19
  114. package/dist/components/index.js.map +1 -1
  115. package/dist/components-CutWiB7Q.js +68 -0
  116. package/dist/components-CutWiB7Q.js.map +1 -0
  117. package/dist/index-BbsXWo7C.js +44 -0
  118. package/dist/index-BbsXWo7C.js.map +1 -0
  119. package/dist/index.css +1 -1
  120. package/dist/index.d.ts +1 -0
  121. package/dist/index.js +22 -19
  122. package/dist/index.js.map +1 -1
  123. package/dist/utils/md5.js +77 -79
  124. package/dist/utils/md5.js.map +1 -1
  125. package/dist/version/version.d.ts +1 -1
  126. package/dist/version/version.js +1 -1
  127. package/dist/version/version.js.map +1 -1
  128. package/package.json +2 -1
  129. package/dist/components-BZukhWDk.js +0 -106
  130. package/dist/components-BZukhWDk.js.map +0 -1
  131. package/dist/utils/vue/install.d.ts +0 -6
  132. package/dist/utils/vue/install.js +0 -21
  133. package/dist/utils/vue/install.js.map +0 -1
  134. package/dist/utils/vue/typescript.d.ts +0 -5
  135. package/dist/utils/vue/typescript.js +0 -2
  136. package/dist/utils/vue/typescript.js.map +0 -1
@@ -1,106 +0,0 @@
1
- import { OButton as x } from "./components/Button/index.js";
2
- import { defineComponent as w, computed as O, createVNode as c, ref as l, shallowRef as _, provide as M, Fragment as P } from "vue";
3
- import { filterEmpty as b } from "./components/_util/props-util/index.js";
4
- import { withInstall as S, anyType as g } from "./components/_util/type.js";
5
- import { Colflex as $, Flexitem as j, Rowflex as E } from "./components/Flex/index.js";
6
- import F from "./components/Pagetable/index.js";
7
- import { ElDialog as I } from "element-plus";
8
- import "lodash-es";
9
- import { addUnit as B } from "./components/_util/dom/style.js";
10
- import { withInstall as R } from "./components/_util/vue/install.js";
11
- import T from "./components/Modal/useModal.js";
12
- import V from "./components/Form/index.js";
13
- const k = () => ({
14
- gutter: g(),
15
- vertical: g()
16
- }), z = /* @__PURE__ */ w({
17
- name: "OSpace",
18
- inheritAttrs: !1,
19
- props: k(),
20
- slots: Object,
21
- setup(s, {
22
- slots: d,
23
- attrs: f,
24
- emit: y,
25
- expose: p
26
- }) {
27
- const o = O(() => {
28
- const {
29
- vertical: t
30
- } = s;
31
- return ["orion-space", {
32
- vertical: t === !0 || t === ""
33
- }];
34
- });
35
- return () => {
36
- var r;
37
- const t = (r = d.default) == null ? void 0 : r.call(d), n = b(t);
38
- if (n.length === 0)
39
- return null;
40
- const a = {};
41
- return typeof s.gutter == "string" && s.gutter && (a.gap = s.gutter), c("div", {
42
- class: [o.value, f.class],
43
- style: [a, f.style]
44
- }, [n.map((i) => c("div", {
45
- class: ["orion-space-item"]
46
- }, [i]))]);
47
- };
48
- }
49
- }), A = S(z), D = /* @__PURE__ */ w({
50
- name: "OModal",
51
- setup(s, {
52
- slots: d,
53
- attrs: f,
54
- emit: y,
55
- expose: p
56
- }) {
57
- const o = l(!1), t = l(), n = _(), u = l(), a = l(), r = l(), i = l(), m = l(!0);
58
- p({
59
- open: async (e) => (o.value = !0, t.value = e.title, n.value = e.content, e.contentProps ? u.value = e.contentProps : u.value = {}, e.width && (a.value = e.width), e.height && (r.value = B(e.height)), e.showClose != null && e.showClose == !1 && (m.value = !1), new Promise((C, q) => {
60
- i.value = C;
61
- }))
62
- });
63
- const h = (e) => {
64
- const v = i.value;
65
- o.value = !1, t.value = void 0, n.value = void 0, u.value = void 0, a.value = void 0, r.value = void 0, i.value = void 0, m.value = !0, v && v(e);
66
- };
67
- return M("$$Modal", {
68
- close: h
69
- }), () => {
70
- const e = n.value;
71
- return o.value ? c(I, {
72
- title: t.value,
73
- width: a.value,
74
- modelValue: o.value,
75
- beforeClose: h,
76
- draggable: !0,
77
- closeOnClickModal: !1,
78
- closeOnPressEscape: !1,
79
- showClose: m.value,
80
- alignCenter: !0,
81
- style: {
82
- height: r.value
83
- }
84
- }, {
85
- default: () => [c(e, u.value, null)]
86
- }) : c(P, null, null);
87
- };
88
- }
89
- }), N = R(D), le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
90
- __proto__: null,
91
- Button: x,
92
- Colflex: $,
93
- Flexitem: j,
94
- Form: V,
95
- Modal: N,
96
- Pagetable: F,
97
- Rowflex: E,
98
- Space: A,
99
- useOModal: T
100
- }, Symbol.toStringTag, { value: "Module" }));
101
- export {
102
- N as a,
103
- le as c,
104
- A as i
105
- };
106
- //# sourceMappingURL=components-BZukhWDk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components-BZukhWDk.js","sources":["../src/components/Space/index.tsx","../src/components/Modal/index.tsx"],"sourcesContent":["import { computed, defineComponent } from 'vue'\r\nimport type { PropType, ExtractPropTypes, CSSProperties, Plugin, App } from 'vue'\r\nimport PropTypes from '../_util/vue-types'\r\nimport { flattenChildren, initDefaultProps } from '../_util/props-util'\r\nimport { filterEmpty } from '../_util/props-util'\r\nimport type { CustomSlotsType } from '../_util/type'\r\nimport classNames from '../_util/classNames'\r\nimport { anyType, booleanType, functionType, objectType, someType, stringType, tuple } from '../_util/type'\r\nimport { withInstall } from '../_util/type'\r\n\r\nexport const spaceProps = () => ({\r\n gutter: anyType<boolean | string>(),\r\n vertical: anyType<boolean | string>(),\r\n})\r\n\r\nexport type SpaceProps = Partial<ExtractPropTypes<ReturnType<typeof spaceProps>>>\r\n\r\nconst Space = defineComponent({\r\n name: 'OSpace',\r\n inheritAttrs: false,\r\n props: spaceProps(),\r\n slots: Object as CustomSlotsType<{\r\n default?: any\r\n }>,\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const classes = computed(() => {\r\n const { vertical } = props\r\n\r\n return ['orion-space', { [`vertical`]: vertical === true || vertical === '' }]\r\n })\r\n\r\n return () => {\r\n const children = slots.default?.()\r\n const items = filterEmpty(children)\r\n const len = items.length\r\n\r\n if (len === 0) {\r\n return null\r\n }\r\n\r\n const gapStyle: CSSProperties = {}\r\n if (typeof props.gutter == 'string' && props.gutter) {\r\n gapStyle.gap = props.gutter\r\n }\r\n\r\n return (\r\n <div class={[classes.value, attrs.class]} style={[gapStyle, attrs.style as CSSProperties]}>\r\n {items.map((child) => {\r\n return <div class={['orion-space-item']}>{child}</div>\r\n })}\r\n </div>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport default withInstall(Space)\r\n","import { defineComponent, provide, ref, shallowRef } from 'vue'\r\nimport type { VNode } from 'vue'\r\nimport { ElDialog } from 'element-plus'\r\nimport { addUnit, withInstall } from '../_util'\r\n\r\ninterface ModalOptions {\r\n title: string\r\n content: VNode\r\n contentProps?: Record<string, any>\r\n width?: number | string\r\n height?: number | string\r\n showClose?: boolean\r\n}\r\n\r\nconst Modal = defineComponent({\r\n name: 'OModal',\r\n setup(props, { slots, attrs, emit, expose }) {\r\n const show = ref(false)\r\n const title = ref<string>()\r\n const content = shallowRef()\r\n const contentProps = ref<Record<string, any>>()\r\n const width = ref<number | string>()\r\n const height = ref<number | string>()\r\n const __resolve = ref<(value: Record<string, any> | PromiseLike<Record<string, any>>) => void>()\r\n const showClose = ref(true)\r\n\r\n const _open: (options: ModalOptions) => Promise<Record<string, any>> = async (options) => {\r\n show.value = true\r\n title.value = options.title\r\n content.value = options.content\r\n if (options.contentProps) {\r\n contentProps.value = options.contentProps\r\n } else {\r\n contentProps.value = {}\r\n }\r\n if (options.width) {\r\n width.value = options.width\r\n }\r\n if (options.height) {\r\n height.value = addUnit(options.height)\r\n }\r\n if (options.showClose != undefined && options.showClose == false) {\r\n showClose.value = false\r\n }\r\n\r\n const promise = new Promise<Record<string, any>>((resolve, reject) => {\r\n __resolve.value = resolve\r\n })\r\n\r\n return promise\r\n }\r\n expose({\r\n open: _open\r\n })\r\n\r\n const _close: (options: Record<string, any>) => void = (options) => {\r\n const resolve = __resolve.value\r\n\r\n show.value = false\r\n title.value = undefined\r\n content.value = undefined\r\n contentProps.value = undefined\r\n width.value = undefined\r\n height.value = undefined\r\n __resolve.value = undefined\r\n showClose.value = true\r\n\r\n resolve && resolve(options)\r\n }\r\n provide('$$Modal', { close: _close })\r\n\r\n return () => {\r\n const Children = content.value\r\n return show.value ? (\r\n <ElDialog\r\n title={title.value}\r\n width={width.value}\r\n modelValue={show.value}\r\n beforeClose={_close}\r\n draggable={true}\r\n closeOnClickModal={false}\r\n closeOnPressEscape={false}\r\n showClose={showClose.value}\r\n alignCenter={true}\r\n style={{ height: height.value }}\r\n >\r\n <Children {...contentProps.value}></Children>\r\n </ElDialog>\r\n ) : (\r\n <></>\r\n )\r\n }\r\n }\r\n})\r\n\r\nexport default withInstall(Modal)\r\n"],"names":["spaceProps","gutter","anyType","vertical","Space","defineComponent","name","inheritAttrs","props","slots","Object","setup","attrs","emit","expose","classes","computed","children","default","items","filterEmpty","length","gapStyle","gap","_createVNode","value","class","style","map","child","withInstall","Modal","show","ref","title","content","shallowRef","contentProps","width","height","__resolve","showClose","open","options","addUnit","undefined","Promise","resolve","reject","_close","provide","close","Children","ElDialog","_Fragment"],"mappings":";;;;;;;;;;;;AAUO,MAAMA,IAAaA,OAA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AK,oBACJ;AAAA,QAAK,WACdR,EAAUhB;AAAAA,QAAK,aACb;AAAA,QAAI,OACV;AAAA,UAAEc,QAAQA,EAAOd;AAAAA,QAAM;AAAA,MAAC,GAAA;AAAA,QAAAP,SAAAA,MAAAM,CAAAA,EAAA4B,GAEjBf,EAAaZ,OAAK,IAAA,CAAA;AAAA,MAAAD,CAAAA,IAAAA,EAAA8B,GAInC,MAAA,IAAA;AAAA;EAEL;AACF,CAAC,GAEcxB,IAAAA,EAAYC,CAAK;;;;;;;;;;;;"}
@@ -1,6 +0,0 @@
1
- import { Directive } from 'vue';
2
- import { SFCInstallWithContext, SFCWithInstall } from './typescript';
3
- export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
4
- export declare const withInstallFunction: <T>(fn: T, name: string) => SFCInstallWithContext<T>;
5
- export declare const withInstallDirective: <T extends Directive>(directive: T, name: string) => SFCWithInstall<T>;
6
- export declare const withNoopInstall: <T>(component: T) => SFCWithInstall<T>;
@@ -1,21 +0,0 @@
1
- import { N as s } from "../../functions-DzLqXvGt.js";
2
- const e = (t, l) => {
3
- if (t.install = (o) => {
4
- for (const n of [t, ...Object.values(l ?? {})])
5
- o.component(n.name, n);
6
- }, l)
7
- for (const [o, n] of Object.entries(l))
8
- t[o] = n;
9
- return t;
10
- }, r = (t, l) => (t.install = (o) => {
11
- t._context = o._context, o.config.globalProperties[l] = t;
12
- }, t), i = (t, l) => (t.install = (o) => {
13
- o.directive(l, t);
14
- }, t), a = (t) => (t.install = s, t);
15
- export {
16
- e as withInstall,
17
- i as withInstallDirective,
18
- r as withInstallFunction,
19
- a as withNoopInstall
20
- };
21
- //# sourceMappingURL=install.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.js","sources":["../../../src/utils/vue/install.ts"],"sourcesContent":["import { NOOP } from '../functions'\r\n\r\nimport type { App, Directive } from 'vue'\r\nimport type { SFCInstallWithContext, SFCWithInstall } from './typescript'\r\n\r\nexport const withInstall = <T, E extends Record<string, any>>(main: T, extra?: E) => {\r\n ;(main as SFCWithInstall<T>).install = (app): void => {\r\n for (const comp of [main, ...Object.values(extra ?? {})]) {\r\n app.component(comp.name, comp)\r\n }\r\n }\r\n\r\n if (extra) {\r\n for (const [key, comp] of Object.entries(extra)) {\r\n ;(main as any)[key] = comp\r\n }\r\n }\r\n return main as SFCWithInstall<T> & E\r\n}\r\n\r\nexport const withInstallFunction = <T>(fn: T, name: string) => {\r\n ;(fn as SFCWithInstall<T>).install = (app: App) => {\r\n ;(fn as SFCInstallWithContext<T>)._context = app._context\r\n app.config.globalProperties[name] = fn\r\n }\r\n\r\n return fn as SFCInstallWithContext<T>\r\n}\r\n\r\nexport const withInstallDirective = <T extends Directive>(directive: T, name: string) => {\r\n ;(directive as SFCWithInstall<T>).install = (app: App): void => {\r\n app.directive(name, directive)\r\n }\r\n\r\n return directive as SFCWithInstall<T>\r\n}\r\n\r\nexport const withNoopInstall = <T>(component: T) => {\r\n ;(component as SFCWithInstall<T>).install = NOOP\r\n\r\n return component as SFCWithInstall<T>\r\n}\r\n"],"names":["withInstall","main","extra","app","comp","key","withInstallFunction","fn","name","withInstallDirective","directive","withNoopInstall","component","NOOP"],"mappings":";AAKa,MAAAA,IAAc,CAAmCC,GAASC,MAAc;AAOnF,MANED,EAA2B,UAAU,CAACE,MAAc;AACzC,eAAAC,KAAQ,CAACH,GAAM,GAAG,OAAO,OAAOC,KAAS,CAAE,CAAA,CAAC;AACjD,MAAAC,EAAA,UAAUC,EAAK,MAAMA,CAAI;AAAA,EAC/B,GAGEF;AACF,eAAW,CAACG,GAAKD,CAAI,KAAK,OAAO,QAAQF,CAAK;AAC1C,MAAAD,EAAaI,CAAG,IAAID;AAGnB,SAAAH;AACT,GAEaK,IAAsB,CAAIC,GAAOC,OAC1CD,EAAyB,UAAU,CAACJ,MAAa;AAC/C,EAAAI,EAAgC,WAAWJ,EAAI,UAC7CA,EAAA,OAAO,iBAAiBK,CAAI,IAAID;AAAA,GAG/BA,IAGIE,IAAuB,CAAsBC,GAAcF,OACpEE,EAAgC,UAAU,CAACP,MAAmB;AAC1D,EAAAA,EAAA,UAAUK,GAAME,CAAS;AAAA,GAGxBA,IAGIC,IAAkB,CAAIC,OAC/BA,EAAgC,UAAUC,GAErCD;"}
@@ -1,5 +0,0 @@
1
- import { AppContext, Plugin } from 'vue';
2
- export type SFCWithInstall<T> = T & Plugin;
3
- export type SFCInstallWithContext<T> = SFCWithInstall<T> & {
4
- _context: AppContext | null;
5
- };
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=typescript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}