Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15,797 changes: 7,478 additions & 8,319 deletions package-lock.json

Large diffs are not rendered by default.

35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@
"type": "module",
"exports": {
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
"types": "./dist/types.d.mts",
"import": "./dist/module.mjs"
}
},
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"scripts": {
"prepack": "nuxt-module-build build",
"prepare": "nuxt-module-build build --failOnWarn=false",
"prepack": "nuxt-module-build build --failOnWarn=false",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
Expand All @@ -28,18 +26,19 @@
"test:watch": "vitest watch"
},
"dependencies": {
"@nuxt/kit": "^3.13.0"
"@nuxt/kit": "^4.2.1"
},
"devDependencies": {
"@nuxt/devtools": "^1.4.1",
"@nuxt/eslint-config": "^0.2.0",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.13.0",
"@nuxt/test-utils": "^3.14.1",
"@types/node": "^20.16.2",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"nuxt": "^3.13.0",
"vitest": "^1.6.0"
"nuxt": "^4.2.1",
"vue-tsc": "^3.1.5",
"@nuxt/devtools": "^3.1.0",
"@nuxt/eslint-config": "^1.10.0",
"@nuxt/module-builder": "^1.0.2",
"@nuxt/schema": "^4.2.1",
"@nuxt/test-utils": "^3.20.1",
"vitest": "^3.2.0",
"eslint": "^9.39.1",
"@types/node": "^24.10.1",
"changelogen": "^0.6.2"
}
}
}
76 changes: 66 additions & 10 deletions playground/app.vue → playground/app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@
{{ f.title }} - {{ formatValue(d, f) }}
</p> </span
>{{ selected }} -->
<n-button @click="filter()">
filter
</n-button>
<v-col
v-for="f in filters"
:key="f.label"
:cols="12"
:sm="f.sm ? f.sm : ''"
:xl="f.xl ? f.xl : 2"
>
<d-input
v-bind="f"
>
</d-input>
</v-col>

<n-button @click="filter()"> filter </n-button>
<d-data-table
ref="table"
v-model="selected"
Expand All @@ -19,10 +30,9 @@
return-object
:row-key="(row) => row.id"
selected-class="selected"
/>{{ data[0] }}
<n-button @click="reset()">
clear
</n-button>
@put="updateData($event)"
/>
<n-button @click="reset()"> clear </n-button>
<!-- <d-input
v-for="f in fields"
:key="f.key"
Expand All @@ -39,7 +49,7 @@ const reset = () => {
table.value.resetFilters();
};
const filter = () => {
table.value.cols[1].setFilter("1616")
table.value.cols[1].setFilter("1616");
selected.value = "0asdlakmdllmlkmlkamlmdsduo";
};
const selected = ref();
Expand All @@ -57,13 +67,13 @@ const data = ref([
number: 2.53432,
datetime: "2025-02-26 11:55:14.000",
lista: ["1", "2", "3"],

},
{
id: "9999999",
text: null,
currency: 2343.56,
date: "2032-12-12",
datetime: "2025-02-26 11:55:14",
bool: false,
category: "ok",
percent: 80,
Expand All @@ -72,6 +82,7 @@ const data = ref([
lista: ["1", "2", "7"],
children: [
{
id: "child99999",
text: "vvvvvvvvvvvvvvvv",
currency: 2343.56,
date: "2022-12-12",
Expand All @@ -82,6 +93,7 @@ const data = ref([
year: "2024",
},
],
lista: ["1", "2", "7"],
},
{
id: "9999989999",
Expand All @@ -90,9 +102,11 @@ const data = ref([
date: "2022-12-12",
bool: true,
category: "pending",
datetime: "2025-02-26 11:55:14",
percent: 45,
int: 4,
year: "2024",
lista: ["1", "2", "7"],
},
]);

Expand All @@ -108,10 +122,29 @@ for (let i = 0; i < 10000; i++) {
int: 4,
year: "2024",
number: 2.53432,
datetime: "2004-02-26 11:55:14.000",
lista: [i, i + 1, i + 2],
});
}

const updateData = (editedRow) => {
const index = data.value.findIndex((d) => d.id === editedRow.id);
if (index >= 0) {
data.value[index] = editedRow;
}
};

const getOptions = () => {
return new Promise((resolve) => {
setTimeout(() => {
const options = [];
for (let i = 0; i < 100; i++) {
options.push({ label: `Option ${i}`, value: `option_${i}` });
}
resolve({ options });
}, 10000);
});
};

const fields = ref([
{ type: "selection" },
{ title: "lista", key: "lista", type: "list" },
Expand Down Expand Up @@ -154,6 +187,29 @@ const fields = ref([
// format: "dd/MM/yyyy HH:mm:ss.SSS",
// },
]);

const filters = [
{
label: "Options Cascader",
type: "cascader",
asyncProps: getOptions,
checkStrategy: "child",
},
{
label: "Options Select Single",
type: "select",
asyncProps: getOptions,
},
{
label: "Options Select Multiple",
sm: "6",
xl: "10",
cols: "12",
type: "select",
asyncProps: getOptions,
multiple: true,
},
];
</script>
<style scoped>
:deep(.selected td) {
Expand Down
File renamed without changes.
File renamed without changes.
Loading