Skip to content

Commit 9a5de8b

Browse files
Fix TS in demos (DevExpress#29088)
Co-authored-by: alexlavrov <[email protected]>
1 parent caae00e commit 9a5de8b

File tree

447 files changed

+1601
-1041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

447 files changed

+1601
-1041
lines changed

.github/workflows/demos_visual_tests_frameworks.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,64 @@ jobs:
175175
path: apps/demos/changed-files.json
176176
retention-days: 1
177177

178+
check-ts:
179+
name: Check TS
180+
needs: build-devextreme
181+
runs-on: devextreme-shr2
182+
timeout-minutes: 20
183+
184+
steps:
185+
- name: Get sources
186+
uses: actions/checkout@v4
187+
188+
- name: Download devextreme packages
189+
uses: actions/download-artifact@v4
190+
with:
191+
name: devextreme-sources
192+
193+
- name: Use Node.js
194+
uses: actions/setup-node@v4
195+
with:
196+
node-version: '20'
197+
198+
- uses: pnpm/action-setup@v3
199+
with:
200+
version: 9
201+
run_install: false
202+
203+
- name: Get pnpm store directory
204+
shell: bash
205+
run: |
206+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
207+
208+
- uses: actions/cache@v4
209+
name: Setup pnpm cache
210+
with:
211+
path: |
212+
${{ env.STORE_PATH }}
213+
.nx/cache
214+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
215+
restore-keys: |
216+
${{ runner.os }}-pnpm-store
217+
218+
- name: Install dependencies
219+
run: pnpm install
220+
221+
- name: Install tgz
222+
run: pnpm add -w ./devextreme-installer.tgz ./devextreme-dist-installer.tgz ./devextreme-react-installer.tgz ./devextreme-vue-installer.tgz ./devextreme-angular-installer.tgz
223+
224+
- name: Run check TS for Vue
225+
working-directory: apps/demos
226+
run: pnpm run ts-check-vue
227+
228+
# - name: Run check TS for Angular
229+
# working-directory: apps/demos
230+
# run: pnpm run ts-check-ng
231+
232+
# - name: Run check TS for React
233+
# working-directory: apps/demos
234+
# run: pnpm run ts-check-react
235+
178236
lint:
179237
name: ${{ matrix.name }}
180238
needs:

apps/demos/Demos/Accordion/Overview/React/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useCallback, useState } from 'react';
2-
import Accordion, { AccordionTypes } from 'devextreme-react/accordion';
3-
import CheckBox, { CheckBoxTypes } from 'devextreme-react/check-box';
4-
import TagBox, { TagBoxTypes } from 'devextreme-react/tag-box';
5-
import Slider, { Tooltip, Label, SliderTypes } from 'devextreme-react/slider';
2+
import Accordion, { type AccordionTypes } from 'devextreme-react/accordion';
3+
import CheckBox, { type CheckBoxTypes } from 'devextreme-react/check-box';
4+
import TagBox, { type TagBoxTypes } from 'devextreme-react/tag-box';
5+
import Slider, { Tooltip, Label, type SliderTypes } from 'devextreme-react/slider';
66

77
import service from './data.ts';
88
import CustomTitle from './CustomTitle.tsx';

apps/demos/Demos/Accordion/Overview/Vue/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import DxCheckBox from 'devextreme-vue/check-box';
6666
import DxSlider, { DxTooltip, DxLabel } from 'devextreme-vue/slider';
6767
import CustomTitle from './CustomTitle.vue';
6868
import CustomItem from './CustomItem.vue';
69-
import service from './data.js';
69+
import service from './data.ts';
7070
7171
const companies = service.getCompanies();
7272
const selectedItems = ref([companies[0]]);

apps/demos/Demos/Accordion/Overview/Vue/CustomItem.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
</div>
3131
</template>
3232
<script setup lang="ts">
33-
withDefaults(defineProps<{
34-
itemData?: Record<string, any>
35-
}>(), {
36-
itemData: () => ({}),
37-
});
33+
import { type CompanyData } from './data';
34+
35+
defineProps<{
36+
itemData?: CompanyData
37+
}>();
3838
</script>

apps/demos/Demos/Accordion/Overview/Vue/CustomTitle.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<div class="header">{{ itemData.CompanyName }}</div>
33
</template>
44
<script setup lang="ts">
5-
withDefaults(defineProps<{
6-
itemData?: Record<string, any>
7-
}>(), {
8-
itemData: () => ({}),
9-
});
5+
import { type CompanyData } from './data';
6+
7+
defineProps<{
8+
itemData?: CompanyData
9+
}>();
1010
</script>

apps/demos/Demos/Accordion/Overview/Vue/data.js renamed to apps/demos/Demos/Accordion/Overview/Vue/data.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
export type CompanyData = {
2+
CompanyName: string,
3+
Address: string,
4+
City: string,
5+
State: string,
6+
Zipcode: number,
7+
Phone: string,
8+
Fax: string,
9+
Website: string,
10+
}
11+
112
const companies = [{
213
ID: 1,
314
CompanyName: 'Super Mart of the West',

apps/demos/Demos/ActionSheet/Basics/React/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useCallback, useState } from 'react';
2-
import ActionSheet, { ActionSheetTypes } from 'devextreme-react/action-sheet';
2+
import ActionSheet, { type ActionSheetTypes } from 'devextreme-react/action-sheet';
33
import Button from 'devextreme-react/button';
4-
import Switch, { SwitchTypes } from 'devextreme-react/switch';
4+
import Switch, { type SwitchTypes } from 'devextreme-react/switch';
55
import notify from 'devextreme/ui/notify';
66
import { actionSheetItems } from './data.ts';
77

apps/demos/Demos/ActionSheet/Basics/Vue/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const showCancelButton = ref(true);
4545
function showActionSheet() {
4646
isActionSheetVisible.value = true;
4747
}
48-
function showClickNotification(buttonName) {
48+
function showClickNotification(buttonName: string) {
4949
notify(`The "${buttonName}" button is clicked.`);
5050
}
5151
</script>

apps/demos/Demos/ActionSheet/PopoverMode/React/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useCallback, useState } from 'react';
2-
import ActionSheet, { ActionSheetTypes } from 'devextreme-react/action-sheet';
3-
import List, { ListTypes } from 'devextreme-react/list';
2+
import ActionSheet, { type ActionSheetTypes } from 'devextreme-react/action-sheet';
3+
import List, { type ListTypes } from 'devextreme-react/list';
44

55
import notify from 'devextreme/ui/notify';
66

apps/demos/Demos/ActionSheet/PopoverMode/Vue/App.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,20 @@
2222
<script setup lang="ts">
2323
import { ref } from 'vue';
2424
import DxActionSheet from 'devextreme-vue/action-sheet';
25-
import DxList from 'devextreme-vue/list';
25+
import DxList, { type DxListTypes } from 'devextreme-vue/list';
2626
import notify from 'devextreme/ui/notify';
2727
import { actionSheetItems, contacts } from './data.ts';
2828
import ContactItem from './ContactItem.vue';
29+
import { type DxElement } from "devextreme/core/element";
2930
3031
const isActionSheetVisible = ref(false);
31-
const actionSheetTarget = ref('');
32+
const actionSheetTarget = ref<DxElement>();
3233
33-
function showActionSheet(e) {
34+
function showActionSheet(e: DxListTypes.ItemClickEvent) {
3435
actionSheetTarget.value = e.itemElement;
3536
isActionSheetVisible.value = true;
3637
}
37-
function showClickNotification(buttonName) {
38+
function showClickNotification(buttonName: string) {
3839
notify(`The "${buttonName}" button is clicked.`);
3940
}
4041
</script>

0 commit comments

Comments
 (0)