@katlux/toolkit 0.1.1-alpha.122 → 0.1.1-alpha.124

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 (55) hide show
  1. package/bin/cli.mjs +0 -0
  2. package/bin/create-preset.d.ts +17 -0
  3. package/bin/create-preset.mjs +0 -0
  4. package/dist/compiled/composables/useDataProvider.mjs +6 -6
  5. package/dist/compiled/composables/useKatluxForm.mjs +23 -4
  6. package/dist/compiled/composables/usePresetComponent.mjs +1 -1
  7. package/dist/compiled/composables/useVirtualScroll.mjs +24 -11
  8. package/dist/compiled/utils/sanitize.mjs +39 -0
  9. package/dist/module.json +1 -1
  10. package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +2 -0
  11. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +3 -1
  12. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +2 -0
  13. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +1 -0
  14. package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +1 -1
  15. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +11 -0
  16. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue +4 -3
  17. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +11 -0
  18. package/dist/runtime/components/KCheckbox/KCheckbox.logic.d.ts +5 -0
  19. package/dist/runtime/components/KCheckbox/KCheckbox.logic.js +4 -0
  20. package/dist/runtime/components/KCombobox/KCombobox.logic.js +3 -1
  21. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +1 -1
  22. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +2 -0
  23. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue +1 -1
  24. package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue +1 -1
  25. package/dist/runtime/components/KSlider/KSlider.global.vue +1 -1
  26. package/dist/runtime/components/KTextarea/KTextarea.global.vue +1 -1
  27. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +1 -1
  28. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +1 -1
  29. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
  30. package/dist/runtime/components/KTree/KTree.global.vue +2 -0
  31. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
  32. package/dist/runtime/components/KTree/KTree.logic.js +38 -12
  33. package/dist/runtime/composables/useDataProvider.d.ts +1 -1
  34. package/dist/runtime/composables/useDataProvider.js +6 -6
  35. package/dist/runtime/composables/useKatluxForm.js +23 -4
  36. package/dist/runtime/composables/usePresetComponent.js +1 -1
  37. package/dist/runtime/composables/useVirtualScroll.js +24 -11
  38. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +1 -0
  39. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +2 -1
  40. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +1 -0
  41. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +9 -3
  42. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue +35 -12
  43. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +9 -3
  44. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +111 -21
  45. package/dist/runtime/presets/default/components/KIcon/KIcon.vue +5 -2
  46. package/dist/runtime/presets/default/components/KRadiobox/KRadiobox.vue +1 -0
  47. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +3 -3
  48. package/dist/runtime/presets/default/components/KTree/KTree.vue +245 -115
  49. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +3 -3
  50. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.d.vue.ts +27 -0
  51. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue +179 -0
  52. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue.d.ts +27 -0
  53. package/dist/runtime/utils/sanitize.d.ts +5 -0
  54. package/dist/runtime/utils/sanitize.js +39 -0
  55. package/package.json +17 -4
package/bin/cli.mjs CHANGED
File without changes
@@ -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
File without changes
@@ -19,10 +19,10 @@ export function useDataProvider(provider, options) {
19
19
  if (!activeProvider) return [];
20
20
  if (Array.isArray(activeProvider.allVisibleRows) && activeProvider.allVisibleRows.length > 0) return activeProvider.allVisibleRows;
21
21
  if (Array.isArray(activeProvider.allVisibleRows?.value) && activeProvider.allVisibleRows.value.length > 0) return activeProvider.allVisibleRows.value;
22
- if (Array.isArray(activeProvider.rowMap) && activeProvider.rowMap.length > 0) return activeProvider.rowMap;
23
- if (Array.isArray(activeProvider.rowMap?.value) && activeProvider.rowMap.value.length > 0) return activeProvider.rowMap.value;
24
- if (Array.isArray(activeProvider.allVisibleNodes) && activeProvider.allVisibleNodes.length > 0) return activeProvider.allVisibleNodes;
25
- if (Array.isArray(activeProvider.allVisibleNodes?.value) && activeProvider.allVisibleNodes.value.length > 0) return activeProvider.allVisibleNodes.value;
22
+ if (Array.isArray(activeProvider.rowMap)) return activeProvider.rowMap;
23
+ if (Array.isArray(activeProvider.rowMap?.value)) return activeProvider.rowMap.value;
24
+ if (Array.isArray(activeProvider.allVisibleNodes)) return activeProvider.allVisibleNodes;
25
+ if (Array.isArray(activeProvider.allVisibleNodes?.value)) return activeProvider.allVisibleNodes.value;
26
26
  if (Array.isArray(activeProvider.allData) && activeProvider.allData.length > 0) return activeProvider.allData;
27
27
  if (Array.isArray(activeProvider.allData?.value) && activeProvider.allData.value.length > 0) return activeProvider.allData.value;
28
28
  if (Array.isArray(activeProvider.data) && activeProvider.data.length > 0) return activeProvider.data;
@@ -164,10 +164,10 @@ export function useDataProvider(provider, options) {
164
164
  }
165
165
  pageSize.value = size;
166
166
  };
167
- const setFilter = (f) => {
167
+ const setFilter = (f, immediate = false) => {
168
168
  if (!activeProvider) return;
169
169
  if (typeof activeProvider.setFilter === "function") {
170
- activeProvider.setFilter(f);
170
+ activeProvider.setFilter(f, immediate);
171
171
  } else if ("filter" in activeProvider) {
172
172
  if (isRef(activeProvider.filter) || typeof activeProvider.filter === "object" && activeProvider.filter !== null && "value" in activeProvider.filter) {
173
173
  activeProvider.filter.value = f;
@@ -144,6 +144,7 @@ export function useKatluxForm(options = {}) {
144
144
  }
145
145
  }
146
146
  let validationSeq = 0;
147
+ let submitSeq = 0;
147
148
  function validate(targetPath) {
148
149
  const seq = ++validationSeq;
149
150
  const result = runValidation(values);
@@ -195,6 +196,8 @@ export function useKatluxForm(options = {}) {
195
196
  dirtyFields.value = {};
196
197
  submitCount.value = 0;
197
198
  isSubmitting.value = false;
199
+ submitSeq++;
200
+ validationSeq++;
198
201
  }
199
202
  function register(path, regOptions = {}) {
200
203
  return {
@@ -267,25 +270,41 @@ export function useKatluxForm(options = {}) {
267
270
  if (event && typeof event.preventDefault === "function") {
268
271
  event.preventDefault();
269
272
  }
273
+ const currentSubmitId = ++submitSeq;
270
274
  submitCount.value += 1;
271
275
  isSubmitting.value = true;
272
276
  try {
273
- const res = await runValidation(values);
277
+ const snapshotValues = deepClone(values);
278
+ const res = await runValidation(snapshotValues);
279
+ if (currentSubmitId !== submitSeq) {
280
+ return;
281
+ }
274
282
  const { valid, output, errors: newErrors } = res;
275
- errors.value = newErrors;
276
283
  if (!valid) {
284
+ const errorsToApply = {};
285
+ for (const [errPath, errMsg] of Object.entries(newErrors)) {
286
+ const currentVal = getByPath(values, errPath);
287
+ const snapVal = getByPath(snapshotValues, errPath);
288
+ if (JSON.stringify(currentVal) === JSON.stringify(snapVal)) {
289
+ errorsToApply[errPath] = errMsg;
290
+ }
291
+ }
292
+ errors.value = errorsToApply;
277
293
  const firstErrorKey = Object.keys(newErrors)[0];
278
294
  if (focusOnError && firstErrorKey) {
279
295
  focusFirstInvalid(firstErrorKey);
280
296
  }
281
297
  if (onInvalid) {
282
- await onInvalid(newErrors, values);
298
+ await onInvalid(newErrors, snapshotValues);
283
299
  }
284
300
  return;
285
301
  }
302
+ errors.value = {};
286
303
  await onValid(output, event);
287
304
  } finally {
288
- isSubmitting.value = false;
305
+ if (currentSubmitId === submitSeq) {
306
+ isSubmitting.value = false;
307
+ }
289
308
  }
290
309
  };
291
310
  }
@@ -48,7 +48,7 @@ export function usePresetComponent(componentBaseName, defaultComponent) {
48
48
  const externalLoaders = _loadersRegistry[presetName];
49
49
  if (externalLoaders) {
50
50
  const key = `./components/${componentBaseName}/${componentBaseName}.vue`;
51
- const candidate = externalLoaders[key];
51
+ const candidate = externalLoaders[key] || externalLoaders[componentBaseName] || externalLoaders[`${componentBaseName}.vue`];
52
52
  if (candidate) {
53
53
  if (isDirectComponent(candidate)) {
54
54
  return candidate;
@@ -179,9 +179,10 @@ export function useVirtualScroll(options) {
179
179
  const remainingRows = Math.max(0, totalRows.value - endRowIndex.value);
180
180
  return remainingRows * baseItemHeight.value;
181
181
  });
182
- watch(totalHeight, (newTotal) => {
183
- if (scrollTop.value > newTotal) {
184
- scrollTop.value = Math.max(0, newTotal - viewportHeight.value);
182
+ watch([totalHeight, viewportHeight], ([newTotal, newVp]) => {
183
+ const maxScroll = Math.max(0, newTotal - newVp);
184
+ if (scrollTop.value > maxScroll) {
185
+ scrollTop.value = maxScroll;
185
186
  if (containerRef.value) {
186
187
  containerRef.value.scrollTop = scrollTop.value;
187
188
  }
@@ -212,10 +213,16 @@ export function useVirtualScroll(options) {
212
213
  const targetScrollTop2 = Math.max(0, (rowOffsets.value[index] || 0) - offset);
213
214
  scrollTop.value = targetScrollTop2;
214
215
  if (containerRef.value) {
215
- containerRef.value.scrollTo({
216
- top: targetScrollTop2,
217
- behavior
218
- });
216
+ containerRef.value.scrollTop = targetScrollTop2;
217
+ if (typeof containerRef.value.scrollTo === "function") {
218
+ try {
219
+ containerRef.value.scrollTo({
220
+ top: targetScrollTop2,
221
+ behavior
222
+ });
223
+ } catch {
224
+ }
225
+ }
219
226
  }
220
227
  return;
221
228
  }
@@ -223,10 +230,16 @@ export function useVirtualScroll(options) {
223
230
  const targetScrollTop = Math.max(0, targetRow * baseItemHeight.value - offset);
224
231
  scrollTop.value = targetScrollTop;
225
232
  if (containerRef.value) {
226
- containerRef.value.scrollTo({
227
- top: targetScrollTop,
228
- behavior
229
- });
233
+ containerRef.value.scrollTop = targetScrollTop;
234
+ if (typeof containerRef.value.scrollTo === "function") {
235
+ try {
236
+ containerRef.value.scrollTo({
237
+ top: targetScrollTop,
238
+ behavior
239
+ });
240
+ } catch {
241
+ }
242
+ }
230
243
  }
231
244
  };
232
245
  return {
@@ -0,0 +1,39 @@
1
+ function decodeHtmlEntities(str) {
2
+ return str.replace(/&#x([0-9a-f]+);?/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))).replace(/&#([0-9]+);?/g, (_, dec) => String.fromCharCode(parseInt(dec, 10))).replace(/&tab;/gi, " ").replace(/&newline;/gi, "\n").replace(/:/gi, ":");
3
+ }
4
+ export function sanitizeHtml(input) {
5
+ if (!input || typeof input !== "string") return "";
6
+ let sanitized = input;
7
+ const dangerousTags = [
8
+ "script",
9
+ "iframe",
10
+ "object",
11
+ "embed",
12
+ "applet",
13
+ "meta",
14
+ "link",
15
+ "base",
16
+ "style",
17
+ "form",
18
+ "input",
19
+ "button",
20
+ "textarea"
21
+ ];
22
+ for (const tag of dangerousTags) {
23
+ const tagRegex = new RegExp(`<${tag}\\b[\\s\\S]*?<\\/${tag}>|<${tag}\\b[^>]*\\/?>`, "gi");
24
+ sanitized = sanitized.replace(tagRegex, "");
25
+ }
26
+ sanitized = sanitized.replace(/[\s/]+on[a-zA-Z0-9_-]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "");
27
+ sanitized = sanitized.replace(
28
+ /[\s/]+(?:href|xlink:href|src|action|data|formaction)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi,
29
+ (match, qDouble, qSingle, unquoted) => {
30
+ const rawVal = qDouble ?? qSingle ?? unquoted ?? "";
31
+ const normalized = decodeHtmlEntities(rawVal).replace(/[\u0000-\u001F\u007F-\u009F\s]/g, "").toLowerCase();
32
+ if (normalized.startsWith("javascript:") || normalized.startsWith("vbscript:") || normalized.startsWith("data:text/html") || normalized.startsWith("data:image/svg+xml")) {
33
+ return "";
34
+ }
35
+ return match;
36
+ }
37
+ );
38
+ return sanitized;
39
+ }
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.122",
4
+ "version": "0.1.1-alpha.124",
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 {
@@ -25,6 +25,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
25
25
  type: StringConstructor;
26
26
  default: undefined;
27
27
  };
28
+ indeterminate: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
28
32
  modelValue: {
29
33
  type: import("vue").PropType<any>;
30
34
  };
@@ -32,6 +36,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
32
36
  "update:modelValue": (value: any) => any;
33
37
  } & {
34
38
  blur: (event: FocusEvent) => any;
39
+ "update:indeterminate": (value: boolean) => any;
35
40
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
36
41
  disabled: {
37
42
  type: BooleanConstructor;
@@ -58,18 +63,24 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
58
63
  type: StringConstructor;
59
64
  default: undefined;
60
65
  };
66
+ indeterminate: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
61
70
  modelValue: {
62
71
  type: import("vue").PropType<any>;
63
72
  };
64
73
  }>> & Readonly<{
65
74
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
66
75
  onBlur?: ((event: FocusEvent) => any) | undefined;
76
+ "onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
67
77
  }>, {
68
78
  label: string;
69
79
  disabled: boolean;
70
80
  validation: "error" | "success" | "warning" | null | undefined;
71
81
  validationText: string;
72
82
  idKey: string;
83
+ indeterminate: boolean;
73
84
  value: any;
74
85
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
75
86
  declare const _default: typeof __VLS_export;
@@ -7,7 +7,7 @@ const props = defineProps(KCheckboxDefaultProps);
7
7
  const model = defineModel();
8
8
  const { isDisabled, checkboxValue } = useKCheckboxLogic(props, model);
9
9
  const presetComponent = usePresetComponent("KCheckbox", KCheckboxDefault);
10
- defineEmits(["blur"]);
10
+ const emit = defineEmits(["blur", "update:indeterminate"]);
11
11
  const templateProps = computed(() => ({
12
12
  model: model.value,
13
13
  checkboxValue: checkboxValue.value,
@@ -15,12 +15,13 @@ const templateProps = computed(() => ({
15
15
  validation: props.validation,
16
16
  validationText: props.validationText,
17
17
  label: props.label,
18
- idKey: props.idKey
18
+ idKey: props.idKey,
19
+ indeterminate: props.indeterminate
19
20
  }));
20
21
  </script>
21
22
 
22
23
  <template lang="pug">
23
- component(:is="presetComponent" v-bind="templateProps" @update:model="model = $event" @blur="$emit('blur', $event)")
24
+ component(:is="presetComponent" v-bind="{ ...templateProps, ...$attrs }" @update:model="model = $event" @update:indeterminate="emit('update:indeterminate', $event)" @blur="emit('blur', $event)")
24
25
  template(v-for="(_, slot) in $slots" #[slot]="scope")
25
26
  slot(:name="slot" v-bind="scope")
26
27
  </template>
@@ -25,6 +25,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
25
25
  type: StringConstructor;
26
26
  default: undefined;
27
27
  };
28
+ indeterminate: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
28
32
  modelValue: {
29
33
  type: import("vue").PropType<any>;
30
34
  };
@@ -32,6 +36,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
32
36
  "update:modelValue": (value: any) => any;
33
37
  } & {
34
38
  blur: (event: FocusEvent) => any;
39
+ "update:indeterminate": (value: boolean) => any;
35
40
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
36
41
  disabled: {
37
42
  type: BooleanConstructor;
@@ -58,18 +63,24 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
58
63
  type: StringConstructor;
59
64
  default: undefined;
60
65
  };
66
+ indeterminate: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
61
70
  modelValue: {
62
71
  type: import("vue").PropType<any>;
63
72
  };
64
73
  }>> & Readonly<{
65
74
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
66
75
  onBlur?: ((event: FocusEvent) => any) | undefined;
76
+ "onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
67
77
  }>, {
68
78
  label: string;
69
79
  disabled: boolean;
70
80
  validation: "error" | "success" | "warning" | null | undefined;
71
81
  validationText: string;
72
82
  idKey: string;
83
+ indeterminate: boolean;
73
84
  value: any;
74
85
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
75
86
  declare const _default: typeof __VLS_export;
@@ -6,6 +6,7 @@ export interface KCheckboxProps {
6
6
  validationText?: string;
7
7
  label?: string;
8
8
  idKey?: string;
9
+ indeterminate?: boolean;
9
10
  }
10
11
  /**
11
12
  * KCheckbox Logic Composable
@@ -47,4 +48,8 @@ export declare const KCheckboxDefaultProps: {
47
48
  type: StringConstructor;
48
49
  default: undefined;
49
50
  };
51
+ indeterminate: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
50
55
  };
@@ -35,5 +35,9 @@ export const KCheckboxDefaultProps = {
35
35
  idKey: {
36
36
  type: String,
37
37
  default: void 0
38
+ },
39
+ indeterminate: {
40
+ type: Boolean,
41
+ default: false
38
42
  }
39
43
  };
@@ -473,7 +473,7 @@ export function useKComboboxLogic(props, emit) {
473
473
  }
474
474
  }
475
475
  function resolveSelectedFromValue() {
476
- if (props.modelValue === void 0 || props.modelValue === null) {
476
+ if (props.modelValue === void 0 || props.modelValue === null || props.modelValue === "") {
477
477
  selectedItems.value = null;
478
478
  return;
479
479
  }
@@ -490,6 +490,8 @@ export function useKComboboxLogic(props, emit) {
490
490
  selectedItems.value = matchedItems;
491
491
  } else if (typeof props.modelValue === "object") {
492
492
  selectedItems.value = Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
493
+ } else {
494
+ selectedItems.value = null;
493
495
  }
494
496
  }
495
497
  resolveSelectedFromValue();
@@ -46,7 +46,7 @@ export declare function useKDatatableLogic(props: KDatatableProps, emit?: KDatat
46
46
  setCurrentPage: (page: number) => void;
47
47
  setPageSize: (size: number) => void;
48
48
  setSortList: (sortList: IDataSort[]) => void;
49
- setFilter: (filter: IDataFilter | null) => void;
49
+ setFilter: (filter: IDataFilter | null, immediate?: boolean) => void;
50
50
  getRowKey: (row: any, index: number) => string | number;
51
51
  pageData: import("vue").ComputedRef<any[]>;
52
52
  };
@@ -71,6 +71,7 @@ function getMaskPatternDef(mask, position) {
71
71
  const char = mask[position];
72
72
  switch (char) {
73
73
  case "9":
74
+ case "#":
74
75
  return { pattern: /[0-9]/, length: 1 };
75
76
  case "A":
76
77
  return {
@@ -100,6 +101,7 @@ function getPatternLength(mask, position) {
100
101
  return def ? def.length : 1;
101
102
  }
102
103
  export function applyMask(rawValue, mask) {
104
+ if (!rawValue) return "";
103
105
  let result = "";
104
106
  let valueIndex = 0;
105
107
  let maskIndex = 0;
@@ -18,7 +18,7 @@ const templateProps = computed(() => ({
18
18
  </script>
19
19
 
20
20
  <template lang="pug">
21
- component(:is="presetComponent" v-bind="templateProps" v-model="model")
21
+ component(:is="presetComponent" v-bind="{ ...templateProps, ...$attrs }" v-model="model")
22
22
  template(v-for="(_, slot) in $slots" #[slot]="scope")
23
23
  slot(:name="slot" v-bind="scope")
24
24
  </template>
@@ -46,7 +46,7 @@ const handleUpdateMax = (val) => {
46
46
  <template lang="pug">
47
47
  component(
48
48
  :is="presetComponent"
49
- v-bind="templateProps"
49
+ v-bind="{ ...templateProps, ...$attrs }"
50
50
  @update:minValue="handleUpdateMin"
51
51
  @update:maxValue="handleUpdateMax"
52
52
  )
@@ -32,7 +32,7 @@ const handleUpdateValue = (val) => {
32
32
  </script>
33
33
 
34
34
  <template lang="pug">
35
- component(:is="presetComponent" v-bind="templateProps" @update:value="handleUpdateValue")
35
+ component(:is="presetComponent" v-bind="{ ...templateProps, ...$attrs }" @update:value="handleUpdateValue")
36
36
  template(v-for="(_, slot) in $slots" #[slot]="scope")
37
37
  slot(:name="slot" v-bind="scope")
38
38
  </template>
@@ -18,5 +18,5 @@ const templateProps = computed(() => ({
18
18
  </script>
19
19
 
20
20
  <template lang="pug">
21
- component(:is="presetComponent" v-bind="templateProps" @update:text="text = $event")
21
+ component(:is="presetComponent" v-bind="{ ...templateProps, ...$attrs }" @update:text="text = $event")
22
22
  </template>
@@ -73,8 +73,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
73
73
  title: string;
74
74
  text: string;
75
75
  timeout: number;
76
- teleport: boolean;
77
76
  pauseOnHover: boolean;
77
+ teleport: boolean;
78
78
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
79
  declare const _default: typeof __VLS_export;
80
80
  export default _default;
@@ -73,8 +73,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
73
73
  title: string;
74
74
  text: string;
75
75
  timeout: number;
76
- teleport: boolean;
77
76
  pauseOnHover: boolean;
77
+ teleport: boolean;
78
78
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
79
  declare const _default: typeof __VLS_export;
80
80
  export default _default;
@@ -162,8 +162,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
162
162
  viewportHeight: number;
163
163
  expandedNodes: (string | number)[] | Set<string | number>;
164
164
  iconField: string;
165
- isNodeSelected: (node: any) => boolean;
166
165
  selectable: boolean;
166
+ isNodeSelected: (node: any) => boolean;
167
167
  selectedNode: any;
168
168
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
169
169
  declare const _default: typeof __VLS_export;
@@ -23,6 +23,8 @@ const templateProps = computed(() => ({
23
23
  isNodeSelected: props.isNodeSelected,
24
24
  selectable: props.selectable,
25
25
  searchtext: props.searchtext,
26
+ modelValue: props.modelValue,
27
+ selectedNode: props.selectedNode,
26
28
  toggleNode,
27
29
  selectNode,
28
30
  dataProvider: props.dataProvider,
@@ -162,8 +162,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
162
162
  viewportHeight: number;
163
163
  expandedNodes: (string | number)[] | Set<string | number>;
164
164
  iconField: string;
165
- isNodeSelected: (node: any) => boolean;
166
165
  selectable: boolean;
166
+ isNodeSelected: (node: any) => boolean;
167
167
  selectedNode: any;
168
168
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
169
169
  declare const _default: typeof __VLS_export;