@katlux/toolkit 0.1.1-alpha.122 → 0.1.1-alpha.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-preset.d.ts +17 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +2 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +3 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +2 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +1 -0
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +1 -1
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +1 -0
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +2 -1
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +1 -0
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +2 -2
- package/package.json +13 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ICreatePresetParams {
|
|
2
|
+
name: string
|
|
3
|
+
base?: string | null
|
|
4
|
+
cwd?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ICreatePresetResult {
|
|
8
|
+
presetName: string
|
|
9
|
+
basePreset: string | null
|
|
10
|
+
targetDir: string
|
|
11
|
+
assetsDir: string
|
|
12
|
+
componentsDir: string
|
|
13
|
+
cssVarsFile: string
|
|
14
|
+
hasAppDir: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function createPreset(params: ICreatePresetParams): ICreatePresetResult
|
package/dist/module.json
CHANGED
|
@@ -3,8 +3,10 @@ interface Props {
|
|
|
3
3
|
bulkActions?: IKDatatableAction[];
|
|
4
4
|
selectedRows?: TDataRow[];
|
|
5
5
|
selectAll?: boolean;
|
|
6
|
+
filter?: any;
|
|
6
7
|
}
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
filter: any;
|
|
8
10
|
bulkActions: IKDatatableAction[];
|
|
9
11
|
selectedRows: TDataRow[];
|
|
10
12
|
selectAll: boolean;
|
|
@@ -6,7 +6,8 @@ import KBulkActionsDefault from "../../presets/default/components/KBulkActions/K
|
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
bulkActions: { type: Array, required: false, default: () => [] },
|
|
8
8
|
selectedRows: { type: Array, required: false, default: () => [] },
|
|
9
|
-
selectAll: { type: Boolean, required: false, default: false }
|
|
9
|
+
selectAll: { type: Boolean, required: false, default: false },
|
|
10
|
+
filter: { type: null, required: false, default: void 0 }
|
|
10
11
|
});
|
|
11
12
|
const { selected, dp, doAction, visibleBulkActions } = useKBulkActionsLogic(props);
|
|
12
13
|
const presetComponent = usePresetComponent("KBulkActions", KBulkActionsDefault);
|
|
@@ -14,6 +15,7 @@ const templateProps = computed(() => ({
|
|
|
14
15
|
bulkActions: visibleBulkActions.value,
|
|
15
16
|
selectedRows: props.selectedRows,
|
|
16
17
|
selectAll: props.selectAll,
|
|
18
|
+
filter: props.filter,
|
|
17
19
|
selected: selected.value,
|
|
18
20
|
dp,
|
|
19
21
|
doAction
|
|
@@ -3,8 +3,10 @@ interface Props {
|
|
|
3
3
|
bulkActions?: IKDatatableAction[];
|
|
4
4
|
selectedRows?: TDataRow[];
|
|
5
5
|
selectAll?: boolean;
|
|
6
|
+
filter?: any;
|
|
6
7
|
}
|
|
7
8
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
filter: any;
|
|
8
10
|
bulkActions: IKDatatableAction[];
|
|
9
11
|
selectedRows: TDataRow[];
|
|
10
12
|
selectAll: boolean;
|
|
@@ -4,6 +4,7 @@ export interface KBulkActionsProps {
|
|
|
4
4
|
bulkActions: IKDatatableAction[];
|
|
5
5
|
selectedRows: TDataRow[];
|
|
6
6
|
selectAll: boolean;
|
|
7
|
+
filter?: any;
|
|
7
8
|
}
|
|
8
9
|
export declare const KBulkActionsDefaultProps: {};
|
|
9
10
|
export declare function getApplicableRows(action: IKDatatableAction, selectedRows: TDataRow[], selectAll: boolean): TDataRow[];
|
|
@@ -79,7 +79,7 @@ export function useKBulkActionsLogic(props) {
|
|
|
79
79
|
const act = action;
|
|
80
80
|
if (act && act.action) {
|
|
81
81
|
const applicableRows = getApplicableRows(act, props.selectedRows, props.selectAll);
|
|
82
|
-
act.action(applicableRows, props.selectAll);
|
|
82
|
+
act.action(applicableRows, props.selectAll, props.filter);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
template(#icon v-if="action.icon")
|
|
20
20
|
KIcon(:iconname="action.icon" :width="16" :height="16")
|
|
21
21
|
template(#default v-if="!action.iconOnly && !action.icon") {{action.label}}
|
|
22
|
-
.info {{ props.selectAll ? t('All items selected') : t('Selected {count} items').replace('{count}', props.selectedRows.length.toString()) }}
|
|
22
|
+
.info {{ props.selectAll ? (props.filter?.active ? t('All filtered items selected') : t('All items selected')) : t('Selected {count} items').replace('{count}', props.selectedRows.length.toString()) }}
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script setup lang="ts">
|
|
@@ -34,6 +34,7 @@ const props = defineProps<{
|
|
|
34
34
|
bulkActions: IKDatatableAction[]
|
|
35
35
|
selectedRows: any[]
|
|
36
36
|
selectAll: boolean
|
|
37
|
+
filter?: any
|
|
37
38
|
selected: any
|
|
38
39
|
dp: CFlatClientDataProvider
|
|
39
40
|
doAction: (action: any) => void
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
)
|
|
79
79
|
td(:colspan="totalColspan")
|
|
80
80
|
.footer(v-if="!props.virtualScroll")
|
|
81
|
-
KBulkActions.bulk-actions(v-if="props.bulkActions && props.bulkActions.length > 0" :bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll")
|
|
81
|
+
KBulkActions.bulk-actions(v-if="props.bulkActions && props.bulkActions.length > 0" :bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :filter="props.dataProvider.filter")
|
|
82
82
|
KPagination.pagination(:dataProvider="props.dataProvider" @update:currentPage="emit('update:currentPage', $event)" @update:pageSize="emit('update:pageSize', $event)")
|
|
83
83
|
.footer.virtual-footer(v-else-if="props.bulkActions && props.bulkActions.length > 0")
|
|
84
|
-
KBulkActions.bulk-actions(:bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll")
|
|
84
|
+
KBulkActions.bulk-actions(:bulkActions="props.bulkActions" :selectedRows="selectedRows" :selectAll="selectAll" :filter="props.dataProvider.filter")
|
|
85
85
|
</template>
|
|
86
86
|
|
|
87
87
|
<script setup lang="ts">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@katlux/toolkit",
|
|
3
|
-
"version": "0.1.1-alpha.
|
|
3
|
+
"version": "0.1.1-alpha.123",
|
|
4
4
|
"description": "Core UI toolkit and utilities for the Katlux ecosystem",
|
|
5
5
|
"author": "Katlux",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,10 +38,20 @@
|
|
|
38
38
|
"default": "./dist/compiled/utils/*.mjs"
|
|
39
39
|
},
|
|
40
40
|
"./presets/*": "./dist/runtime/presets/*",
|
|
41
|
-
"./dist/runtime/presets/*": "./dist/runtime/presets/*"
|
|
41
|
+
"./dist/runtime/presets/*": "./dist/runtime/presets/*",
|
|
42
|
+
"./cli": {
|
|
43
|
+
"types": "./bin/create-preset.d.ts",
|
|
44
|
+
"import": "./bin/create-preset.mjs",
|
|
45
|
+
"default": "./bin/create-preset.mjs"
|
|
46
|
+
}
|
|
42
47
|
},
|
|
48
|
+
"sideEffects": [
|
|
49
|
+
"**/*.css",
|
|
50
|
+
"**/*.scss",
|
|
51
|
+
"**/*.sass"
|
|
52
|
+
],
|
|
43
53
|
"dependencies": {
|
|
44
|
-
"@katlux/providers": "^0.1.1-alpha.
|
|
54
|
+
"@katlux/providers": "^0.1.1-alpha.111",
|
|
45
55
|
"@nuxt/kit": "^3.12.0",
|
|
46
56
|
"@nuxtjs/i18n": "^10.4.0",
|
|
47
57
|
"pug": "^3.0.0",
|