Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor devextreme-vue for support TS in IDE #27993

Merged
merged 20 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0446d3c
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 10, 2024
6716299
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 10, 2024
d298bbd
remake devextreme-vue generator for TS type inference
GoodDayForSurf Sep 10, 2024
a638bb5
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 10, 2024
abe5145
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 11, 2024
82fcafc
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 11, 2024
b09a1f1
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 11, 2024
1d4dbc4
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 11, 2024
769d634
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 11, 2024
93d13f8
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 11, 2024
f83ae6b
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 11, 2024
8e02e89
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 12, 2024
ab39f2a
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 12, 2024
9a11fc4
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 12, 2024
66a564c
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 12, 2024
f093076
refactor devextreme-vue for TS in IDE
GoodDayForSurf Sep 12, 2024
74c30e3
remake devextreme-vue generator for TS type inference
GoodDayForSurf Sep 12, 2024
e00ce21
remake devextreme-vue generator for TS type inference
GoodDayForSurf Sep 23, 2024
a74d9dc
remake devextreme-vue generator for TS type inference
GoodDayForSurf Sep 25, 2024
62d63bf
remake devextreme-vue generator for TS type inference
GoodDayForSurf Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"axe-core": "4.10.0",
"cheerio": "1.0.0-rc.10",
"codelyzer": "6.0.2",
"devextreme-internal-tools": "16.0.0-beta.3",
"devextreme-internal-tools": "16.0.0-beta.4",
"http-server": "14.1.1",
"husky": "8.0.3",
"jest": "29.7.0",
Expand Down
20 changes: 18 additions & 2 deletions packages/devextreme-vue/build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,23 @@ module.exports = {
generatedComponentsDir: './src',
coreComponentsDir: './src/core',
indexFileName: './src/index.ts',
baseComponent: './core/index',
configComponent: './core/index',
componentGeneratorTplConfig: {
createComponentFn: {
name: 'defineComponent',
path: 'vue',
},
prepareComponentConfigFn: {
name: 'prepareComponentConfig',
path: './core/index',
},
prepareExtensionComponentConfigFn: {
name: 'prepareExtensionComponentConfig',
path: './core/index',
},
prepareConfigurationComponentConfigFn: {
name: 'prepareConfigurationComponentConfig',
path: './core/index',
},
},
widgetsPackage: 'devextreme'
};
3 changes: 1 addition & 2 deletions packages/devextreme-vue/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ gulp.task(GENERATE,
(done) => {
generateVueComponents(
JSON.parse(fs.readFileSync(config.metadataPath).toString()),
config.baseComponent,
config.configComponent,
config.componentGeneratorTplConfig,
{
componentsDir: config.generatedComponentsDir,
indexFileName: config.indexFileName
Expand Down
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,8 @@
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 } from "./core/index";
import { prepareConfigurationComponentConfig } from "./core/index";

type AccessibleOptions = Pick<Properties,
"accessKey" |
Expand Down Expand Up @@ -47,7 +48,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 +144,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,7 +174,12 @@ const DxItem = createConfigurationComponent({
titleTemplate: {},
visible: Boolean
}
});
};

prepareConfigurationComponentConfig(DxItemConfig);

const DxItem = defineComponent(DxItemConfig);

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

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,8 @@
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 } from "./core/index";
import { prepareConfigurationComponentConfig } from "./core/index";

type AccessibleOptions = Pick<Properties,
"cancelText" |
Expand Down Expand Up @@ -36,7 +37,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 +111,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,7 +139,12 @@ const DxItem = createConfigurationComponent({
text: String,
type: String
}
});
};

prepareConfigurationComponentConfig(DxItemConfig);

const DxItem = defineComponent(DxItemConfig);

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

Expand Down
Loading
Loading