@katlux/toolkit 0.1.0-beta.70 → 0.1.0-beta.72

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
3
  "configKey": "katluxToolkit",
4
- "version": "0.1.0-beta.70",
4
+ "version": "0.1.0-beta.72",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -9,6 +9,8 @@ interface Props {
9
9
  headerSlots?: Record<string, any>;
10
10
  columnHeaders?: Record<string, string>;
11
11
  columnWidths?: Record<string, string>;
12
+ emptyStateText?: string;
13
+ emptyFilterStateText?: string;
12
14
  }
13
15
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
16
  bulkActions: Array<IKDatatableAction>;
@@ -18,6 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
18
20
  headerSlots: Record<string, any>;
19
21
  columnHeaders: Record<string, string>;
20
22
  columnWidths: Record<string, string>;
23
+ emptyStateText: string;
24
+ emptyFilterStateText: string;
21
25
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
26
  declare const _default: typeof __VLS_export;
23
27
  export default _default;
@@ -12,7 +12,9 @@ const props = defineProps({
12
12
  cellSlots: { type: Object, required: false, default: void 0 },
13
13
  headerSlots: { type: Object, required: false, default: void 0 },
14
14
  columnHeaders: { type: Object, required: false, default: void 0 },
15
- columnWidths: { type: Object, required: false, default: void 0 }
15
+ columnWidths: { type: Object, required: false, default: void 0 },
16
+ emptyStateText: { type: String, required: false, default: "no result" },
17
+ emptyFilterStateText: { type: String, required: false, default: "no result found for filter" }
16
18
  });
17
19
  const { selectedRows, selectAll } = useKDatatableLogic(props);
18
20
  const presetComponent = usePresetComponent("KDatatable", DatatableDefault);
@@ -31,7 +33,9 @@ const templateProps = computed(() => ({
31
33
  cellSlots: mergedCellSlots.value,
32
34
  headerSlots: props.headerSlots,
33
35
  columnHeaders: props.columnHeaders,
34
- columnWidths: props.columnWidths
36
+ columnWidths: props.columnWidths,
37
+ emptyStateText: props.emptyStateText,
38
+ emptyFilterStateText: props.emptyFilterStateText
35
39
  }));
36
40
  const updateSelectedRows = (val) => {
37
41
  selectedRows.value = val;
@@ -9,6 +9,8 @@ interface Props {
9
9
  headerSlots?: Record<string, any>;
10
10
  columnHeaders?: Record<string, string>;
11
11
  columnWidths?: Record<string, string>;
12
+ emptyStateText?: string;
13
+ emptyFilterStateText?: string;
12
14
  }
13
15
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
16
  bulkActions: Array<IKDatatableAction>;
@@ -18,6 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
18
20
  headerSlots: Record<string, any>;
19
21
  columnHeaders: Record<string, string>;
20
22
  columnWidths: Record<string, string>;
23
+ emptyStateText: string;
24
+ emptyFilterStateText: string;
21
25
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
26
  declare const _default: typeof __VLS_export;
23
27
  export default _default;
@@ -2,9 +2,13 @@ import { ADataProvider } from '@katlux/providers';
2
2
  export interface KDatatableProps {
3
3
  dataProvider: ADataProvider;
4
4
  visibleFields?: Array<string> | null;
5
+ emptyStateText?: string;
6
+ emptyFilterStateText?: string;
5
7
  }
6
8
  export declare const KDatatableDefaultProps: {
7
9
  visibleFields: null;
10
+ emptyStateText: string;
11
+ emptyFilterStateText: string;
8
12
  };
9
13
  export declare function useKDatatableLogic(props: KDatatableProps): {
10
14
  selectedRows: import("vue").Ref<any[], any[]>;
@@ -1,6 +1,8 @@
1
1
  import { watch } from "vue";
2
2
  export const KDatatableDefaultProps = {
3
- visibleFields: null
3
+ visibleFields: null,
4
+ emptyStateText: "no result",
5
+ emptyFilterStateText: "no result found for filter"
4
6
  };
5
7
  export function useKDatatableLogic(props) {
6
8
  const selectedRows = props.dataProvider.selectedRows;
@@ -11,6 +11,8 @@ type __VLS_Props = {
11
11
  headerSlots?: Record<string, any>;
12
12
  columnHeaders?: Record<string, string>;
13
13
  columnWidths?: Record<string, string>;
14
+ emptyStateText?: string;
15
+ emptyFilterStateText?: string;
14
16
  };
15
17
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
18
  "update:selectedRows": (value: any[]) => any;
@@ -19,6 +19,10 @@
19
19
  th(v-if="props.rowActions && props.rowActions.length>0")
20
20
 
21
21
  tbody
22
+ tr.empty-row(v-if="!isLoading && (!props.dataProvider.pageData.value || props.dataProvider.pageData.value.length === 0)")
23
+ td.empty-state(:colspan="(visibleFields || props.dataProvider.fields || []).length + (props.bulkActions && props.bulkActions.length > 0 ? 1 : 0) + (props.rowActions && props.rowActions.length > 0 ? 1 : 0)")
24
+ span(v-if="props.dataProvider.filter.value?.active") {{ props.emptyFilterStateText || 'no result found for filter' }}
25
+ span(v-else) {{ props.emptyStateText || 'no result' }}
22
26
  tr(v-for="(row, index) in props.dataProvider.pageData.value" :key="index")
23
27
  td.check(v-if="props.bulkActions && props.bulkActions.length>0")
24
28
  KCheckbox(:value="row" v-model="selectedRows")
@@ -53,6 +57,8 @@ const props = defineProps<{
53
57
  headerSlots?: Record<string, any>
54
58
  columnHeaders?: Record<string, string>
55
59
  columnWidths?: Record<string, string>
60
+ emptyStateText?: string
61
+ emptyFilterStateText?: string
56
62
  }>()
57
63
 
58
64
  const emit = defineEmits<{
@@ -131,6 +137,11 @@ const isLoading = computed(() => {
131
137
  td {
132
138
  padding: 5px;
133
139
  }
140
+ td.empty-state {
141
+ text-align: center;
142
+ padding: 20px;
143
+ color: #666;
144
+ }
134
145
  }
135
146
  }
136
147
  }
@@ -11,6 +11,8 @@ type __VLS_Props = {
11
11
  headerSlots?: Record<string, any>;
12
12
  columnHeaders?: Record<string, string>;
13
13
  columnWidths?: Record<string, string>;
14
+ emptyStateText?: string;
15
+ emptyFilterStateText?: string;
14
16
  };
15
17
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
18
  "update:selectedRows": (value: any[]) => any;
@@ -4,8 +4,10 @@
4
4
  input(type="radio" v-model="model" :disabled="disabled" :value="value")
5
5
  .icon-container(:class="validation ? `is-${validation}` : ''")
6
6
  KIcon.icon(iconname="check")
7
- span
8
- slot
7
+ span(v-if="$slots.label || $slots.default || label")
8
+ slot(name="label")
9
+ slot
10
+ | {{ label }}
9
11
  span.validation-text(v-if="validation && ['success', 'warning', 'error'].includes(validation) && validationText" :class="`is-${validation}`") {{ validationText }}
10
12
  </template>
11
13
 
@@ -26,6 +28,7 @@ const model = defineModel()
26
28
  .KRadiobox {
27
29
  display: flex;
28
30
  gap: 5px;
31
+ cursor: pointer;
29
32
  input {
30
33
  display: none;
31
34
  }
@@ -35,8 +38,11 @@ const model = defineModel()
35
38
  height: var(--box-padding);
36
39
  text-align: center;
37
40
  line-height: var(--box-padding);
38
- border-radius: var(--input-border-radius);
41
+ border-radius: var(--checkbox-border-radius, var(--input-border-radius));
39
42
  background-color: var(--checkbox-bg);
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
40
46
  }
41
47
  .icon {
42
48
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.0-beta.70",
3
+ "version": "0.1.0-beta.72",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "MIT",