@katlux/toolkit 0.1.1-alpha.121 → 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.
Files changed (21) hide show
  1. package/bin/add-ai-reference.mjs +1 -1
  2. package/bin/create-preset.d.ts +17 -0
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +2 -0
  5. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +3 -1
  6. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +2 -0
  7. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +1 -0
  8. package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +1 -1
  9. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +2 -2
  10. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +2 -2
  11. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
  12. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
  13. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +1 -1
  14. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +1 -1
  15. package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
  16. package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
  17. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +1 -0
  18. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +2 -1
  19. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +1 -0
  20. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +2 -2
  21. package/package.json +13 -3
@@ -66,7 +66,7 @@ if (!existsSync(rulesDir)) mkdirSync(rulesDir, { recursive: true })
66
66
  process.stdout.write(` ${DIM}Fetching index...${RESET}`)
67
67
  let indexContent
68
68
  try {
69
- indexContent = await fetchText(`${BASE_URL}/index`)
69
+ indexContent = await fetchText(BASE_URL).catch(() => fetchText(`${BASE_URL}/index`))
70
70
  process.stdout.write(` ${GREEN}✔${RESET}\n`)
71
71
  } catch (err) {
72
72
  process.stdout.write(` ${RED}✖${RESET}\n`)
@@ -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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
3
  "configKey": "katluxToolkit",
4
- "version": "0.1.1-alpha.121",
4
+ "version": "0.1.1-alpha.123",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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 {
@@ -127,11 +127,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
127
127
  modelValue: string | Date;
128
128
  isOpen: boolean;
129
129
  label: string;
130
- validation: "error" | "success" | "warning" | null | undefined;
131
- validationText: string;
132
130
  definedDays: import("../KCalendar/types.js").IDefinedDay[];
133
131
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
134
132
  day: string | Date;
133
+ validation: "error" | "success" | "warning" | null | undefined;
134
+ validationText: string;
135
135
  placeholder: string;
136
136
  teleportTo: string;
137
137
  showClear: boolean;
@@ -127,11 +127,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
127
127
  modelValue: string | Date;
128
128
  isOpen: boolean;
129
129
  label: string;
130
- validation: "error" | "success" | "warning" | null | undefined;
131
- validationText: string;
132
130
  definedDays: import("../KCalendar/types.js").IDefinedDay[];
133
131
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
134
132
  day: string | Date;
133
+ validation: "error" | "success" | "warning" | null | undefined;
134
+ validationText: string;
135
135
  placeholder: string;
136
136
  teleportTo: string;
137
137
  showClear: boolean;
@@ -129,11 +129,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
129
129
  modelValue: string | Date;
130
130
  isOpen: boolean;
131
131
  label: string;
132
- validation: "error" | "success" | "warning" | null | undefined;
133
- validationText: string;
134
132
  definedDays: import("../KCalendar/types.js").IDefinedDay[];
135
133
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
136
134
  day: string | Date;
135
+ validation: "error" | "success" | "warning" | null | undefined;
136
+ validationText: string;
137
137
  placeholder: string;
138
138
  teleportTo: string;
139
139
  showClear: boolean;
@@ -129,11 +129,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
129
129
  modelValue: string | Date;
130
130
  isOpen: boolean;
131
131
  label: string;
132
- validation: "error" | "success" | "warning" | null | undefined;
133
- validationText: string;
134
132
  definedDays: import("../KCalendar/types.js").IDefinedDay[];
135
133
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
136
134
  day: string | Date;
135
+ validation: "error" | "success" | "warning" | null | undefined;
136
+ validationText: string;
137
137
  placeholder: string;
138
138
  teleportTo: string;
139
139
  showClear: boolean;
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  teleportTo: string;
67
67
  fullWidth: boolean;
68
68
  maxHeight: number;
69
- anchorEl: HTMLElement;
70
69
  align: import("./KDropdown.logic.js").KDropdownAlign;
70
+ anchorEl: HTMLElement;
71
71
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
72
72
  declare const _default: typeof __VLS_export;
73
73
  export default _default;
@@ -66,8 +66,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
66
66
  teleportTo: string;
67
67
  fullWidth: boolean;
68
68
  maxHeight: number;
69
- anchorEl: HTMLElement;
70
69
  align: import("./KDropdown.logic.js").KDropdownAlign;
70
+ anchorEl: HTMLElement;
71
71
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
72
72
  declare const _default: typeof __VLS_export;
73
73
  export default _default;
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
27
27
  }>> & Readonly<{}>, {
28
28
  disabled: boolean;
29
29
  text: string;
30
- position: "top" | "left" | "right" | "bottom";
30
+ position: "left" | "right" | "top" | "bottom";
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
32
  declare const _default: typeof __VLS_export;
33
33
  export default _default;
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
27
27
  }>> & Readonly<{}>, {
28
28
  disabled: boolean;
29
29
  text: string;
30
- position: "top" | "left" | "right" | "bottom";
30
+ position: "left" | "right" | "top" | "bottom";
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
32
  declare const _default: typeof __VLS_export;
33
33
  export default _default;
@@ -4,6 +4,7 @@ type __VLS_Props = {
4
4
  bulkActions: IKDatatableAction[];
5
5
  selectedRows: any[];
6
6
  selectAll: boolean;
7
+ filter?: any;
7
8
  selected: any;
8
9
  dp: CFlatClientDataProvider;
9
10
  doAction: (action: any) => void;
@@ -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
@@ -4,6 +4,7 @@ type __VLS_Props = {
4
4
  bulkActions: IKDatatableAction[];
5
5
  selectedRows: any[];
6
6
  selectAll: boolean;
7
+ filter?: any;
7
8
  selected: any;
8
9
  dp: CFlatClientDataProvider;
9
10
  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.121",
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.109",
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",