Skip to content

Commit

Permalink
refactor devextreme-vue for TS in IDE
Browse files Browse the repository at this point in the history
new generated wrappers
  • Loading branch information
GoodDayForSurf committed Sep 10, 2024
1 parent 8f6e0c5 commit b37e6fd
Show file tree
Hide file tree
Showing 81 changed files with 8,979 additions and 2,359 deletions.
24 changes: 18 additions & 6 deletions packages/devextreme-vue/src/accordion.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { ExplicitTypes } from "devextreme/ui/accordion";
import Accordion, { Properties } from "devextreme/ui/accordion";
import { createComponent } from "./core/index";
import { createConfigurationComponent } from "./core/index";
import { defineComponent } from "vue";
import { prepareComponentConfig, prepareConfigurationComponentConfig } from "./core/strategy/vue3";

type AccessibleOptions = Pick<Properties,
"accessKey" |
Expand Down Expand Up @@ -47,7 +47,8 @@ type AccessibleOptions = Pick<Properties,
interface DxAccordion extends AccessibleOptions {
readonly instance?: Accordion;
}
const DxAccordion = createComponent({

const componentConfig = {
props: {
accessKey: String,
activeStateEnabled: Boolean,
Expand Down Expand Up @@ -142,9 +143,14 @@ const DxAccordion = createComponent({
item: { isCollectionItem: true, optionName: "items" }
};
}
});
};

prepareComponentConfig(componentConfig);

const DxAccordion = defineComponent(componentConfig);


const DxItem = createConfigurationComponent({
const DxItemConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
Expand All @@ -167,10 +173,16 @@ const DxItem = createConfigurationComponent({
titleTemplate: {},
visible: Boolean
}
});
};

prepareConfigurationComponentConfig(DxItemConfig);

const DxItem = defineComponent(DxItemConfig);

(DxItem as any).$_optionName = "items";
(DxItem as any).$_isCollectionItem = true;


export default DxAccordion;
export {
DxAccordion,
Expand Down
24 changes: 18 additions & 6 deletions packages/devextreme-vue/src/action-sheet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { ExplicitTypes } from "devextreme/ui/action_sheet";
import ActionSheet, { Properties } from "devextreme/ui/action_sheet";
import { createComponent } from "./core/index";
import { createConfigurationComponent } from "./core/index";
import { defineComponent } from "vue";
import { prepareComponentConfig, prepareConfigurationComponentConfig } from "./core/strategy/vue3";

type AccessibleOptions = Pick<Properties,
"cancelText" |
Expand Down Expand Up @@ -36,7 +36,8 @@ type AccessibleOptions = Pick<Properties,
interface DxActionSheet extends AccessibleOptions {
readonly instance?: ActionSheet;
}
const DxActionSheet = createComponent({

const componentConfig = {
props: {
cancelText: String,
dataSource: {},
Expand Down Expand Up @@ -109,9 +110,14 @@ const DxActionSheet = createComponent({
item: { isCollectionItem: true, optionName: "items" }
};
}
});
};

prepareComponentConfig(componentConfig);

const DxActionSheet = defineComponent(componentConfig);


const DxItem = createConfigurationComponent({
const DxItemConfig = {
emits: {
"update:isActive": null,
"update:hoveredElement": null,
Expand All @@ -132,10 +138,16 @@ const DxItem = createConfigurationComponent({
text: String,
type: String
}
});
};

prepareConfigurationComponentConfig(DxItemConfig);

const DxItem = defineComponent(DxItemConfig);

(DxItem as any).$_optionName = "items";
(DxItem as any).$_isCollectionItem = true;


export default DxActionSheet;
export {
DxActionSheet,
Expand Down
Loading

0 comments on commit b37e6fd

Please sign in to comment.