Skip to content

Commit

Permalink
build: fix gen script bug (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek committed Jun 3, 2024
1 parent 0b0bdca commit c09c176
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .scripts/gen-comp-types.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The file is not designed to run directly. `cwd` should be project root.
import fs from 'fs'
import path from 'path'
import process from 'process'
import fs from 'fs';
import path from 'path';
import process from 'process';

import { createChecker } from "vue-component-meta";

Expand Down
6 changes: 4 additions & 2 deletions .scripts/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ export function exist (path) {
return fs.existsSync(path)
}

const filter = f => !f.includes("tests") && !f.includes("utils") && !f.includes(".ts") && !f.includes("examples")

export function getFolders(dir) {
const folders = fs.readdirSync(dir)
// remove test and util files
.filter(f => !f.includes("tests") && !f.includes("utils") && !f.includes(".ts"));
.filter(filter);
return folders;
}

export function getComponents(dir) {
const files = fs.readdirSync(dir, { recursive: true });
return files
// filter only vue files and remove test and util files
.filter(f => f.includes(".vue") && !f.includes("tests") && !f.includes("utils"))
.filter(filter)
// remove path
.map(f => path.basename(f))
// remove .vue suffix
Expand Down
17 changes: 10 additions & 7 deletions packages/oruga/src/components/table/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ const props = defineProps({
/** Add a native event to filter */
filtersEvent: { type: String, default: "" },
/** Filtering debounce time (in milliseconds) */
debounceSearch: {
type: Number,
debounceSearch: {
type: Number,
default: () => getOption("table.debounceSearch", undefined),
},
/** Show header */
Expand Down Expand Up @@ -931,7 +931,10 @@ watch(
filters.value,
(value) => {
if (props.debounceSearch)
useDebounce(() => handleFiltersChange(value), props.debounceSearch)();
useDebounce(
() => handleFiltersChange(value),
props.debounceSearch,
)();
else handleFiltersChange(value);
},
{ deep: true },
Expand Down Expand Up @@ -1939,25 +1942,25 @@ function tdClasses(row: unknown, column: TableColumnComponent): ClassBind[] {
<td :colspan="columnCount">
<!--
@slot Place row detail content here
@binding {unknown} row - row conent
@binding {unknown} row - row content
@binding {number} index - row index
-->
<slot
name="detail"
:row="row"
:row="row as any"
:index="index" />
</td>
</tr>
</transition>
<!--
@slot Place row detail content here
@binding {unknown} row - row conent
@binding {unknown} row - row content
@binding {number} index - row index
-->
<slot
v-if="isActiveCustomDetailRow(row)"
name="detail"
:row="row"
:row="row as any"
:index="index" />
</template>
Expand Down
12 changes: 8 additions & 4 deletions packages/oruga/src/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ declare module "../index" {
Set `true` to append the component to the body.
In addition, any CSS selector string or an actual DOM node can be used. */
teleport: string | boolean | Record<string, any>;
/** Array of keys (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values) which will add a tag when typing (default tab and enter) */
confirmKeys: string[];
/** Class of the menu empty placeholder item */
itemEmptyClass: ClassDefinition;
/** Class of the menu footer item */
Expand Down Expand Up @@ -481,6 +483,8 @@ Use menuitem only in situations where your dropdown is related to a navigation m
}>;
field?: ComponentConfigBase &
Partial<{
/** */
messageTag: DynamicComponent;
/** "Class for field body when horizontal */
bodyHorizontalClass: ClassDefinition;
/** Class for components automatically attached together when inside a field */
Expand Down Expand Up @@ -677,7 +681,7 @@ In addition, any CSS selector string or an actual DOM node can be used. */
closeIcon: string;
/** Custom animation (transition name) */
animation: string;
/** Destroy modal on hide */
/** Destroy modal on hide - default `true` for programmatic usage */
destroyOnHide: boolean;
/** DOM element where the modal component will be created on (for programmatic usage) */
container: string | HTMLElement;
Expand Down Expand Up @@ -1083,7 +1087,7 @@ but will set body to position fixed, might break some layouts. */
itemTag: DynamicComponent;
/** Step navigation is animated */
animated: boolean;
/** Tab size */
/** Step size */
size: string;
/** Transition animation name */
animation: string[];
Expand Down Expand Up @@ -1221,6 +1225,8 @@ but will set body to position fixed, might break some layouts. */
isRowCheckable: (row: unknown) => boolean;
/** Enable simple style pagination if paginated */
paginationSimple: boolean;
/** Filtering debounce time (in milliseconds) */
debounceSearch: number;
/** How many rows per page (if paginated) */
perPage: string | number;
/** Icon name of detail action */
Expand Down Expand Up @@ -1263,8 +1269,6 @@ but will set body to position fixed, might break some layouts. */
detailKey: string;
/** Whether table is striped */
striped: boolean;
/** Filtering debounce time (in milliseconds) */
debounceSearch: number;
}>;
tabs?: ComponentConfigBase &
Partial<{
Expand Down

0 comments on commit c09c176

Please sign in to comment.