@ecsplico/editor 1.0.0 → 2.0.0

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 (94) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +3 -4
  3. package/dist/core/notify.d.ts +1 -1
  4. package/dist/core/notify.js.map +1 -1
  5. package/dist/i18n/de/common.js +1 -2
  6. package/dist/i18n/de/common.js.map +1 -1
  7. package/dist/i18n/de.d.ts +0 -1
  8. package/dist/i18n/en/common.js +1 -2
  9. package/dist/i18n/en/common.js.map +1 -1
  10. package/dist/nuxt/module.d.ts +0 -6
  11. package/dist/nuxt/module.js +3 -5
  12. package/dist/nuxt/module.js.map +1 -1
  13. package/dist/nuxt/runtime/install-context.d.ts +2 -3
  14. package/dist/nuxt/runtime/install-context.js +2 -3
  15. package/dist/nuxt/runtime/install-context.js.map +1 -1
  16. package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +1 -1
  17. package/dist/react/styles/ui-vars.css +2 -2
  18. package/dist/styles/ai.css +1 -1
  19. package/dist/styles/authors.css +1 -1
  20. package/dist/styles/block-ui.css +1 -1
  21. package/dist/styles/collab.css +1 -1
  22. package/dist/styles/comments.css +1 -1
  23. package/dist/styles/core.css +2 -2
  24. package/dist/styles/media.css +1 -1
  25. package/dist/styles/mentions.css +1 -1
  26. package/dist/styles/themes.css +1 -1
  27. package/dist/styles/transcript.css +1 -1
  28. package/dist/vue/context.d.ts +3 -3
  29. package/dist/vue/context.js +3 -2
  30. package/dist/vue/context.js.map +1 -1
  31. package/dist/vue/kit/types.d.ts +1 -1
  32. package/dist/vue/kit/use-ui-kit.d.ts +2 -2
  33. package/dist/vue/kit/use-ui-kit.js +3 -3
  34. package/dist/vue/kit/use-ui-kit.js.map +1 -1
  35. package/docs/integration.md +1 -1
  36. package/docs/llms.md +1 -1
  37. package/package.json +4 -19
  38. package/dist/nuxt/runtime/plugins/editor-context-primevue.client.ts +0 -8
  39. package/dist/vue/kit/primevue/Alert.js +0 -49
  40. package/dist/vue/kit/primevue/Alert.js.map +0 -1
  41. package/dist/vue/kit/primevue/Avatar.js +0 -54
  42. package/dist/vue/kit/primevue/Avatar.js.map +0 -1
  43. package/dist/vue/kit/primevue/Badge.js +0 -41
  44. package/dist/vue/kit/primevue/Badge.js.map +0 -1
  45. package/dist/vue/kit/primevue/Button.js +0 -112
  46. package/dist/vue/kit/primevue/Button.js.map +0 -1
  47. package/dist/vue/kit/primevue/Chip.js +0 -38
  48. package/dist/vue/kit/primevue/Chip.js.map +0 -1
  49. package/dist/vue/kit/primevue/DropdownMenu.js +0 -98
  50. package/dist/vue/kit/primevue/DropdownMenu.js.map +0 -1
  51. package/dist/vue/kit/primevue/FieldGroup.js +0 -22
  52. package/dist/vue/kit/primevue/FieldGroup.js.map +0 -1
  53. package/dist/vue/kit/primevue/FormField.js +0 -56
  54. package/dist/vue/kit/primevue/FormField.js.map +0 -1
  55. package/dist/vue/kit/primevue/Icon.js +0 -23
  56. package/dist/vue/kit/primevue/Icon.js.map +0 -1
  57. package/dist/vue/kit/primevue/Input.js +0 -96
  58. package/dist/vue/kit/primevue/Input.js.map +0 -1
  59. package/dist/vue/kit/primevue/InputMenu.js +0 -122
  60. package/dist/vue/kit/primevue/InputMenu.js.map +0 -1
  61. package/dist/vue/kit/primevue/Modal.js +0 -59
  62. package/dist/vue/kit/primevue/Modal.js.map +0 -1
  63. package/dist/vue/kit/primevue/Popover.js +0 -135
  64. package/dist/vue/kit/primevue/Popover.js.map +0 -1
  65. package/dist/vue/kit/primevue/RadioGroup.js +0 -58
  66. package/dist/vue/kit/primevue/RadioGroup.js.map +0 -1
  67. package/dist/vue/kit/primevue/Select.js +0 -68
  68. package/dist/vue/kit/primevue/Select.js.map +0 -1
  69. package/dist/vue/kit/primevue/SelectMenu.js +0 -94
  70. package/dist/vue/kit/primevue/SelectMenu.js.map +0 -1
  71. package/dist/vue/kit/primevue/Separator.js +0 -16
  72. package/dist/vue/kit/primevue/Separator.js.map +0 -1
  73. package/dist/vue/kit/primevue/Switch.js +0 -46
  74. package/dist/vue/kit/primevue/Switch.js.map +0 -1
  75. package/dist/vue/kit/primevue/Table.js +0 -54
  76. package/dist/vue/kit/primevue/Table.js.map +0 -1
  77. package/dist/vue/kit/primevue/Tabs.js +0 -49
  78. package/dist/vue/kit/primevue/Tabs.js.map +0 -1
  79. package/dist/vue/kit/primevue/Textarea.js +0 -55
  80. package/dist/vue/kit/primevue/Textarea.js.map +0 -1
  81. package/dist/vue/kit/primevue/Tooltip.js +0 -43
  82. package/dist/vue/kit/primevue/Tooltip.js.map +0 -1
  83. package/dist/vue/kit/primevue/Tree.js +0 -75
  84. package/dist/vue/kit/primevue/Tree.js.map +0 -1
  85. package/dist/vue/kit/primevue/select-options.js +0 -55
  86. package/dist/vue/kit/primevue/select-options.js.map +0 -1
  87. package/dist/vue/kit/primevue/shared.js +0 -49
  88. package/dist/vue/kit/primevue/shared.js.map +0 -1
  89. package/dist/vue/kit/primevue/trigger.js +0 -25
  90. package/dist/vue/kit/primevue/trigger.js.map +0 -1
  91. package/dist/vue/kit/primevue.css +0 -86
  92. package/dist/vue/kit/primevue.d.ts +0 -33
  93. package/dist/vue/kit/primevue.js +0 -96
  94. package/dist/vue/kit/primevue.js.map +0 -1
@@ -1,94 +0,0 @@
1
- import { sizeOf } from "./shared.js";
2
- import _sfc_main$1 from "./Icon.js";
3
- import { choiceOf, choicesOf } from "./select-options.js";
4
- import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, openBlock, toDisplayString, unref, useTemplateRef, watch, withCtx } from "vue";
5
- import PSelect from "primevue/select";
6
- //#region src/vue/kit/primevue/SelectMenu.vue
7
- const _hoisted_1 = { class: "inline-flex min-w-0 items-center gap-2" };
8
- const _hoisted_2 = { class: "truncate" };
9
- const _hoisted_3 = { class: "sk-select-option" };
10
- const _hoisted_4 = { class: "sk-select-option-text" };
11
- const _hoisted_5 = { class: "truncate" };
12
- const _hoisted_6 = {
13
- key: 0,
14
- class: "sk-select-option-description"
15
- };
16
- const _sfc_main = /*@__PURE__*/ defineComponent({
17
- __name: "SelectMenu",
18
- props: {
19
- modelValue: {},
20
- items: {},
21
- valueKey: {},
22
- searchInput: { type: Boolean },
23
- placeholder: {},
24
- icon: {},
25
- size: {},
26
- open: { type: Boolean },
27
- ui: {}
28
- },
29
- emits: ["update:modelValue", "update:open"],
30
- setup(__props, { emit: __emit }) {
31
- const props = __props;
32
- const emit = __emit;
33
- const select = useTemplateRef("select");
34
- const choices = computed(() => choicesOf(props.items));
35
- watch(() => props.open, (open) => {
36
- if (open === void 0 || !select.value) return;
37
- if (open && !select.value.overlayVisible) select.value.show();
38
- else if (!open && select.value.overlayVisible) select.value.hide();
39
- }, { flush: "post" });
40
- function onChange(value) {
41
- if (value === void 0) return;
42
- const choice = choiceOf(choices.value.options, value);
43
- if (choice?.onSelect) {
44
- const event = new Event("select", { cancelable: true });
45
- choice.onSelect(event);
46
- if (event.defaultPrevented) return;
47
- }
48
- emit("update:modelValue", value);
49
- }
50
- return (_ctx, _cache) => {
51
- return openBlock(), createBlock(unref(PSelect), {
52
- ref_key: "select",
53
- ref: select,
54
- "model-value": __props.modelValue,
55
- options: choices.value.options,
56
- "option-label": "label",
57
- "option-value": "value",
58
- "option-disabled": "disabled",
59
- "option-group-label": choices.value.grouped ? "label" : void 0,
60
- "option-group-children": choices.value.grouped ? "items" : void 0,
61
- filter: __props.searchInput !== false,
62
- placeholder: __props.placeholder,
63
- size: unref(sizeOf)(__props.size),
64
- "overlay-class": __props.ui?.content,
65
- "onUpdate:modelValue": onChange,
66
- onShow: _cache[0] || (_cache[0] = ($event) => emit("update:open", true)),
67
- onHide: _cache[1] || (_cache[1] = ($event) => emit("update:open", false))
68
- }, createSlots({
69
- option: withCtx(({ option }) => [createElementVNode("span", _hoisted_3, [option.icon ? (openBlock(), createBlock(_sfc_main$1, {
70
- key: 0,
71
- name: option.icon
72
- }, null, 8, ["name"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_4, [createElementVNode("span", _hoisted_5, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(option.description), 1)) : createCommentVNode("v-if", true)])])]),
73
- _: 2
74
- }, [__props.icon ? {
75
- name: "value",
76
- fn: withCtx(({ value, placeholder: hint }) => [createElementVNode("span", _hoisted_1, [createVNode(_sfc_main$1, { name: __props.icon }, null, 8, ["name"]), createElementVNode("span", _hoisted_2, toDisplayString(unref(choiceOf)(choices.value.options, value)?.label ?? hint), 1)])]),
77
- key: "0"
78
- } : void 0]), 1032, [
79
- "model-value",
80
- "options",
81
- "option-group-label",
82
- "option-group-children",
83
- "filter",
84
- "placeholder",
85
- "size",
86
- "overlay-class"
87
- ]);
88
- };
89
- }
90
- });
91
- //#endregion
92
- export { _sfc_main as default };
93
-
94
- //# sourceMappingURL=SelectMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectMenu.js","names":["_openBlock","_createBlock","_unref","_createSlots","_withCtx","_createElementVNode","Icon","_createCommentVNode","_toDisplayString","_createElementBlock","_createVNode"],"sources":["../../../../src/vue/kit/primevue/SelectMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PSelect from 'primevue/select'\nimport { computed, useTemplateRef, watch } from 'vue'\nimport type { SelectMenuProps } from '../types'\nimport Icon from './Icon.vue'\nimport { choiceOf, choicesOf } from './select-options'\nimport { sizeOf } from './shared'\n\nconst props = defineProps<SelectMenuProps>()\nconst emit = defineEmits<{ 'update:modelValue': [value: string | number], 'update:open': [open: boolean] }>()\n\nconst select = useTemplateRef<{ show: () => void, hide: () => void, overlayVisible?: boolean }>('select')\nconst choices = computed(() => choicesOf(props.items))\n\n// `open` is two-way: the host may open or close the list, the list reports its own changes.\nwatch(() => props.open, (open) => {\n if (open === undefined || !select.value) return\n if (open && !select.value.overlayVisible) select.value.show()\n else if (!open && select.value.overlayVisible) select.value.hide()\n}, { flush: 'post' })\n\nfunction onChange(value: string | number | undefined) {\n if (value === undefined) return\n const choice = choiceOf(choices.value.options, value)\n if (choice?.onSelect) {\n const event = new Event('select', { cancelable: true })\n choice.onSelect(event)\n if (event.defaultPrevented) return\n }\n emit('update:modelValue', value)\n}\n</script>\n\n<template>\n <PSelect\n ref=\"select\"\n :model-value=\"modelValue\"\n :options=\"choices.options\"\n option-label=\"label\"\n option-value=\"value\"\n option-disabled=\"disabled\"\n :option-group-label=\"choices.grouped ? 'label' : undefined\"\n :option-group-children=\"choices.grouped ? 'items' : undefined\"\n :filter=\"searchInput !== false\"\n :placeholder=\"placeholder\"\n :size=\"sizeOf(size)\"\n :overlay-class=\"ui?.content\"\n @update:model-value=\"onChange\"\n @show=\"emit('update:open', true)\"\n @hide=\"emit('update:open', false)\"\n >\n <template v-if=\"icon\" #value=\"{ value, placeholder: hint }\">\n <span class=\"inline-flex min-w-0 items-center gap-2\">\n <Icon :name=\"icon\" />\n <span class=\"truncate\">{{ choiceOf(choices.options, value)?.label ?? hint }}</span>\n </span>\n </template>\n <template #option=\"{ option }\">\n <span class=\"sk-select-option\">\n <Icon v-if=\"option.icon\" :name=\"option.icon\" />\n <span class=\"sk-select-option-text\">\n <span class=\"truncate\">{{ option.label }}</span>\n <span v-if=\"option.description\" class=\"sk-select-option-description\">{{ option.description }}</span>\n </span>\n </span>\n </template>\n </PSelect>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,SAAS,eAAiF,QAAQ;EACxG,MAAM,UAAU,eAAe,UAAU,MAAM,KAAK,CAAC;EAGrD,YAAY,MAAM,OAAO,SAAS;GAChC,IAAI,SAAS,KAAA,KAAa,CAAC,OAAO,OAAO;GACzC,IAAI,QAAQ,CAAC,OAAO,MAAM,gBAAgB,OAAO,MAAM,KAAK;QACvD,IAAI,CAAC,QAAQ,OAAO,MAAM,gBAAgB,OAAO,MAAM,KAAK;EACnE,GAAG,EAAE,OAAO,OAAO,CAAC;EAEpB,SAAS,SAAS,OAAoC;GACpD,IAAI,UAAU,KAAA,GAAW;GACzB,MAAM,SAAS,SAAS,QAAQ,MAAM,SAAS,KAAK;GACpD,IAAI,QAAQ,UAAU;IACpB,MAAM,QAAQ,IAAI,MAAM,UAAU,EAAE,YAAY,KAAK,CAAC;IACtD,OAAO,SAAS,KAAK;IACrB,IAAI,MAAM,kBAAkB;GAC9B;GACA,KAAK,qBAAqB,KAAK;EACjC;;GAIE,OAAAA,UAAA,GAAAC,YAgCUC,MAAA,OAAA,GAAA;IA/BJ,SAAA;IAAJ,KAAI;IACH,eAAa,QAAA;IACb,SAAS,QAAA,MAAQ;IAClB,gBAAa;IACb,gBAAa;IACb,mBAAgB;IACf,sBAAoB,QAAA,MAAQ,UAAO,UAAa,KAAA;IAChD,yBAAuB,QAAA,MAAQ,UAAO,UAAa,KAAA;IACnD,QAAQ,QAAA,gBAAW;IACnB,aAAa,QAAA;IACb,MAAMA,MAAA,MAAA,CAAM,CAAC,QAAA,IAAI;IACjB,iBAAe,QAAA,IAAI;IACnB,uBAAoB;IACpB,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,eAAA,IAAA;IACV,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,eAAA,KAAA;;IAQA,QAAME,SAOR,EAPY,aAAM,CACzBC,mBAMO,QANP,YAMO,CALO,OAAO,QAAnBL,UAAA,GAAAC,YAA+CK,aAAA;;KAArB,MAAM,OAAO;IACvC,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,GAAAF,mBAGO,QAHP,YAGO,CAFLA,mBAAgD,QAAhD,YAAgDG,gBAAtB,OAAO,KAAK,GAAA,CAAA,GAC1B,OAAO,eAAnBR,UAAA,GAAAS,mBAAoG,QAApG,YAAoGD,gBAA5B,OAAO,WAAW,GAAA,CAAA,KAAAD,mBAAA,QAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;GAXhF,GAAA,CAAA,QAAA,OAAA;IAAO,MAAA;IACrB,IAAAH,SAGO,EAJuB,OAAK,aAAe,WAAI,CACtDC,mBAGO,QAHP,YAGO,CAFLK,YAAqBJ,aAAA,EAAd,MAAM,QAAA,KAAI,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,GACjBD,mBAAmF,QAAnF,YAAmFG,gBAAzDN,MAAA,QAAA,CAAQ,CAAC,QAAA,MAAQ,SAAS,KAAK,CAAA,EAAG,SAAS,IAAI,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1,16 +0,0 @@
1
- import { createBlock, defineComponent, openBlock, unref } from "vue";
2
- import PDivider from "primevue/divider";
3
- //#region src/vue/kit/primevue/Separator.vue
4
- const _sfc_main = /*@__PURE__*/ defineComponent({
5
- __name: "Separator",
6
- props: { orientation: {} },
7
- setup(__props) {
8
- return (_ctx, _cache) => {
9
- return openBlock(), createBlock(unref(PDivider), { layout: __props.orientation === "vertical" ? "vertical" : "horizontal" }, null, 8, ["layout"]);
10
- };
11
- }
12
- });
13
- //#endregion
14
- export { _sfc_main as default };
15
-
16
- //# sourceMappingURL=Separator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Separator.js","names":["_openBlock","_createBlock","_unref"],"sources":["../../../../src/vue/kit/primevue/Separator.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PDivider from 'primevue/divider'\nimport type { SeparatorProps } from '../types'\n\ndefineProps<SeparatorProps>()\n</script>\n\n<template>\n <PDivider :layout=\"orientation === 'vertical' ? 'vertical' : 'horizontal'\" />\n</template>\n"],"mappings":";;;;;;;;GAQE,OAAAA,UAAA,GAAAC,YAA6EC,MAAA,QAAA,GAAA,EAAlE,QAAQ,QAAA,gBAAW,aAAA,aAAA,aAAA,GAAA,MAAA,GAAA,CAAA,QAAA,CAAA"}
@@ -1,46 +0,0 @@
1
- import { createCommentVNode, createElementBlock, createVNode, defineComponent, openBlock, toDisplayString, unref, useId } from "vue";
2
- import ToggleSwitch from "primevue/toggleswitch";
3
- //#region src/vue/kit/primevue/Switch.vue
4
- const _hoisted_1 = { class: "sk-switch" };
5
- const _hoisted_2 = ["for"];
6
- const _hoisted_3 = {
7
- key: 0,
8
- class: "sk-switch-label"
9
- };
10
- const _hoisted_4 = {
11
- key: 1,
12
- class: "sk-switch-description"
13
- };
14
- const _sfc_main = /*@__PURE__*/ defineComponent({
15
- __name: "Switch",
16
- props: {
17
- modelValue: { type: Boolean },
18
- label: {},
19
- description: {},
20
- disabled: { type: Boolean }
21
- },
22
- emits: ["update:modelValue"],
23
- setup(__props) {
24
- const id = useId();
25
- return (_ctx, _cache) => {
26
- return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ToggleSwitch), {
27
- "input-id": unref(id),
28
- "model-value": __props.modelValue,
29
- disabled: __props.disabled,
30
- "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => _ctx.$emit("update:modelValue", value))
31
- }, null, 8, [
32
- "input-id",
33
- "model-value",
34
- "disabled"
35
- ]), __props.label || __props.description ? (openBlock(), createElementBlock("label", {
36
- key: 0,
37
- for: unref(id),
38
- class: "sk-switch-text"
39
- }, [__props.label ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.label), 1)) : createCommentVNode("v-if", true), __props.description ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.description), 1)) : createCommentVNode("v-if", true)], 8, _hoisted_2)) : createCommentVNode("v-if", true)]);
40
- };
41
- }
42
- });
43
- //#endregion
44
- export { _sfc_main as default };
45
-
46
- //# sourceMappingURL=Switch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Switch.js","names":["$emit","_openBlock","_createElementBlock","_createVNode","_unref","_toDisplayString","_createCommentVNode"],"sources":["../../../../src/vue/kit/primevue/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport ToggleSwitch from 'primevue/toggleswitch'\nimport { useId } from 'vue'\nimport type { SwitchProps } from '../types'\n\ndefineProps<SwitchProps>()\ndefineEmits<{ 'update:modelValue': [value: boolean] }>()\nconst id = useId()\n</script>\n\n<template>\n <div class=\"sk-switch\">\n <ToggleSwitch :input-id=\"id\" :model-value=\"modelValue\" :disabled=\"disabled\" @update:model-value=\"(value: boolean) => $emit('update:modelValue', value)\" />\n <label v-if=\"label || description\" :for=\"id\" class=\"sk-switch-text\">\n <span v-if=\"label\" class=\"sk-switch-label\">{{ label }}</span>\n <span v-if=\"description\" class=\"sk-switch-description\">{{ description }}</span>\n </label>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAOA,MAAM,KAAK,MAAM;;GAIf,OAAAC,UAAA,GAAAC,mBAMM,OANN,YAMM,CALJC,YAA0JC,MAAA,YAAA,GAAA;IAA3I,YAAUA,MAAA,EAAA;IAAK,eAAa,QAAA;IAAa,UAAU,QAAA;IAAW,uBAAkB,OAAA,OAAA,OAAA,MAAG,UAAmBJ,KAAAA,MAAK,qBAAsB,KAAK;;;;;GACxI,CAAA,GAAA,QAAA,SAAS,QAAA,eAAtBC,UAAA,GAAAC,mBAGQ,SAAA;;IAH4B,KAAKE,MAAA,EAAA;IAAI,OAAM;GACrC,GAAA,CAAA,QAAA,SAAZH,UAAA,GAAAC,mBAA6D,QAA7D,YAA6DG,gBAAf,QAAA,KAAK,GAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,GACvC,QAAA,eAAZL,UAAA,GAAAC,mBAA+E,QAA/E,YAA+EG,gBAArB,QAAA,WAAW,GAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,CAAA,GAAA,GAAA,UAAA,KAAAA,mBAAA,QAAA,IAAA,CAAA,CAAA"}
@@ -1,54 +0,0 @@
1
- import { Fragment, createBlock, createElementBlock, createSlots, createTextVNode, defineComponent, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
2
- import Column from "primevue/column";
3
- import DataTable from "primevue/datatable";
4
- //#region src/vue/kit/primevue/Table.vue
5
- const _sfc_main = /*@__PURE__*/ defineComponent({
6
- __name: "Table",
7
- props: {
8
- data: {},
9
- columns: {},
10
- getRowId: { type: Function },
11
- sorting: {},
12
- sticky: { type: Boolean },
13
- ui: {}
14
- },
15
- emits: ["select"],
16
- setup(__props) {
17
- return (_ctx, _cache) => {
18
- return openBlock(), createBlock(unref(DataTable), {
19
- value: __props.data,
20
- scrollable: __props.sticky,
21
- "scroll-height": __props.sticky ? "flex" : void 0,
22
- size: "small",
23
- class: "sk-table",
24
- "row-hover": "",
25
- onRowClick: _cache[0] || (_cache[0] = (event) => _ctx.$emit("select", event.originalEvent, { original: event.data }))
26
- }, createSlots({
27
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
28
- return openBlock(), createBlock(unref(Column), {
29
- key: column.id,
30
- "header-class": [column.meta?.class?.th, __props.ui?.th],
31
- "body-class": [column.meta?.class?.td, __props.ui?.td]
32
- }, {
33
- header: withCtx(() => [renderSlot(_ctx.$slots, `${column.id}-header`, {}, () => [createTextVNode(toDisplayString(column.header), 1)])]),
34
- body: withCtx(({ data: row }) => [renderSlot(_ctx.$slots, `${column.id}-cell`, { row: { original: row } }, () => [createTextVNode(toDisplayString(column.accessorFn?.(row)), 1)])]),
35
- _: 2
36
- }, 1032, ["header-class", "body-class"]);
37
- }), 128))]),
38
- _: 2
39
- }, [_ctx.$slots.empty ? {
40
- name: "empty",
41
- fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
42
- key: "0"
43
- } : void 0]), 1032, [
44
- "value",
45
- "scrollable",
46
- "scroll-height"
47
- ]);
48
- };
49
- }
50
- });
51
- //#endregion
52
- export { _sfc_main as default };
53
-
54
- //# sourceMappingURL=Table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Table.js","names":["$emit","$slots","_openBlock","_createBlock","_unref","_createSlots","_withCtx","_createElementBlock","_Fragment","_renderList","_renderSlot","_createTextVNode","_toDisplayString"],"sources":["../../../../src/vue/kit/primevue/Table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport Column from 'primevue/column'\nimport DataTable from 'primevue/datatable'\nimport type { TableProps } from '../types'\n\n// `getRowId`, `sorting` and `ui` are accepted for contract parity: PrimeVue's table does not sort by itself here (the\n// host orders `data`) and has no use for row ids without selection.\ndefineProps<TableProps<any>>()\ndefineEmits<{ select: [event: Event, row: { original: any }] }>()\n</script>\n\n<template>\n <DataTable\n :value=\"data\"\n :scrollable=\"sticky\"\n :scroll-height=\"sticky ? 'flex' : undefined\"\n size=\"small\"\n class=\"sk-table\"\n row-hover\n @row-click=\"(event: { originalEvent: Event, data: unknown }) => $emit('select', event.originalEvent, { original: event.data })\"\n >\n <Column\n v-for=\"column in columns\"\n :key=\"column.id\"\n :header-class=\"[column.meta?.class?.th, ui?.th]\"\n :body-class=\"[column.meta?.class?.td, ui?.td]\"\n >\n <template #header>\n <slot :name=\"`${column.id}-header`\">{{ column.header }}</slot>\n </template>\n <template #body=\"{ data: row }\">\n <slot :name=\"`${column.id}-cell`\" :row=\"{ original: row }\">{{ column.accessorFn?.(row) }}</slot>\n </template>\n </Column>\n <template v-if=\"$slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n </DataTable>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;GAYE,OAAAE,UAAA,GAAAC,YAyBYC,MAAA,SAAA,GAAA;IAxBT,OAAO,QAAA;IACP,YAAY,QAAA;IACZ,iBAAe,QAAA,SAAM,SAAY,KAAA;IAClC,MAAK;IACL,OAAM;IACN,aAAA;IACC,YAAS,OAAA,OAAA,OAAA,MAAG,UAAmDJ,KAAAA,MAAK,UAAW,MAAM,eAAa,EAAA,UAAc,MAAM,KAAI,CAAA;;IAGzH,SAAAM,cAAyB,EAD3BJ,UAAA,IAAA,GAAAK,mBAYSC,UAAA,MAAAC,WAXU,QAAA,UAAV,WAAM;KADf,OAAAP,UAAA,GAAAC,YAYSC,MAAA,MAAA,GAAA;MAVN,KAAK,OAAO;MACZ,gBAAY,CAAG,OAAO,MAAM,OAAO,IAAI,QAAA,IAAI,EAAE;MAC7C,cAAU,CAAG,OAAO,MAAM,OAAO,IAAI,QAAA,IAAI,EAAE;;MAEjC,QAAME,cAC+C,CAA9DI,WAA8D,KAAA,QAAA,GAA9C,OAAO,GAAE,UAAA,CAAA,SAAqC,CAAvBC,gBAAAC,gBAAA,OAAO,MAAM,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MAE3C,MAAIN,SACmF,EAAA,MADzE,UAAG,CAC1BI,WAAgG,KAAA,QAAA,GAAhF,OAAO,GAAE,QAAA,EAAU,KAAG,EAAA,UAAc,IAAG,EAAvD,SAAgG,CAAlCC,gBAAAC,gBAAA,OAAO,aAAa,GAAG,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;GAGzEX,GAAAA,CAAAA,KAAAA,OAAO,QAAA;IAAQ,MAAA;IAC7B,IAAAK,cAAqB,CAArBI,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA"}
@@ -1,49 +0,0 @@
1
- import _sfc_main$1 from "./Icon.js";
2
- import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
3
- import Tab from "primevue/tab";
4
- import TabList from "primevue/tablist";
5
- import Tabs from "primevue/tabs";
6
- //#region src/vue/kit/primevue/Tabs.vue
7
- const _hoisted_1 = { class: "inline-flex items-center gap-1.5" };
8
- const _sfc_main = /*@__PURE__*/ defineComponent({
9
- __name: "Tabs",
10
- props: {
11
- modelValue: {},
12
- items: {},
13
- orientation: {},
14
- variant: {},
15
- content: { type: Boolean }
16
- },
17
- emits: ["update:modelValue"],
18
- setup(__props) {
19
- return (_ctx, _cache) => {
20
- return openBlock(), createBlock(unref(Tabs), {
21
- value: __props.modelValue ?? "",
22
- class: normalizeClass(__props.orientation === "vertical" ? "sk-tabs-vertical" : void 0),
23
- "onUpdate:value": _cache[0] || (_cache[0] = (value) => _ctx.$emit("update:modelValue", String(value)))
24
- }, {
25
- default: withCtx(() => [createVNode(unref(TabList), null, {
26
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
27
- return openBlock(), createBlock(unref(Tab), {
28
- key: item.value,
29
- value: item.value,
30
- disabled: item.disabled
31
- }, {
32
- default: withCtx(() => [createElementVNode("span", _hoisted_1, [item.icon ? (openBlock(), createBlock(_sfc_main$1, {
33
- key: 0,
34
- name: item.icon
35
- }, null, 8, ["name"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(item.label), 1)])]),
36
- _: 2
37
- }, 1032, ["value", "disabled"]);
38
- }), 128))]),
39
- _: 1
40
- })]),
41
- _: 1
42
- }, 8, ["value", "class"]);
43
- };
44
- }
45
- });
46
- //#endregion
47
- export { _sfc_main as default };
48
-
49
- //# sourceMappingURL=Tabs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs.js","names":["$emit","_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_createVNode","_createElementBlock","_Fragment","_renderList","_createElementVNode","Icon","_createCommentVNode","_createTextVNode","_toDisplayString"],"sources":["../../../../src/vue/kit/primevue/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport Tab from 'primevue/tab'\nimport TabList from 'primevue/tablist'\nimport Tabs from 'primevue/tabs'\nimport type { TabsProps } from '../types'\nimport Icon from './Icon.vue'\n\ndefineProps<TabsProps>()\ndefineEmits<{ 'update:modelValue': [value: string] }>()\n</script>\n\n<template>\n <Tabs :value=\"modelValue ?? ''\" :class=\"orientation === 'vertical' ? 'sk-tabs-vertical' : undefined\" @update:value=\"(value: string | number) => $emit('update:modelValue', String(value))\">\n <TabList>\n <Tab v-for=\"item in items\" :key=\"item.value\" :value=\"item.value\" :disabled=\"item.disabled\">\n <span class=\"inline-flex items-center gap-1.5\">\n <Icon v-if=\"item.icon\" :name=\"item.icon\" />\n {{ item.label }}\n </span>\n </Tab>\n </TabList>\n </Tabs>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;GAYE,OAAAC,UAAA,GAAAC,YASOC,MAAA,IAAA,GAAA;IATA,OAAO,QAAA,cAAU;IAAS,OAAKC,eAAE,QAAA,gBAAW,aAAA,qBAAuC,KAAA,CAAS;IAAG,kBAAY,OAAA,OAAA,OAAA,MAAG,UAA2BJ,KAAAA,MAAK,qBAAsB,OAAO,KAAK,CAAA;;IACrL,SAAAK,cAOU,CAPVC,YAOUH,MAAA,OAAA,GAAA,MAAA;KANH,SAAAE,cAAqB,EAA1BJ,UAAA,IAAA,GAAAM,mBAKMC,UAAA,MAAAC,WALc,QAAA,QAAR,SAAI;MAAhB,OAAAR,UAAA,GAAAC,YAKMC,MAAA,GAAA,GAAA;OALsB,KAAK,KAAK;OAAQ,OAAO,KAAK;OAAQ,UAAU,KAAK;;OAC/E,SAAAE,cAGO,CAHPK,mBAGO,QAHP,YAGO,CAFO,KAAK,QAAjBT,UAAA,GAAAC,YAA2CS,aAAA;;QAAnB,MAAM,KAAK;OAAQ,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,GAAAC,gBAAA,MAC3CC,gBAAG,KAAK,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1,55 +0,0 @@
1
- import { computed, createBlock, defineComponent, normalizeStyle, openBlock, unref } from "vue";
2
- import PTextarea from "primevue/textarea";
3
- //#region src/vue/kit/primevue/Textarea.vue
4
- const _sfc_main = /*@__PURE__*/ defineComponent({
5
- __name: "Textarea",
6
- props: {
7
- modelValue: {},
8
- rows: {},
9
- maxrows: {},
10
- autoresize: { type: Boolean },
11
- size: {},
12
- placeholder: {},
13
- disabled: { type: Boolean },
14
- readonly: { type: Boolean },
15
- maxlength: {},
16
- autofocus: { type: Boolean }
17
- },
18
- emits: ["update:modelValue"],
19
- setup(__props) {
20
- const props = __props;
21
- const style = computed(() => props.maxrows ? {
22
- maxHeight: `${props.maxrows * 1.5 + 1}em`,
23
- overflowY: "auto"
24
- } : void 0);
25
- return (_ctx, _cache) => {
26
- return openBlock(), createBlock(unref(PTextarea), {
27
- "model-value": __props.modelValue,
28
- rows: __props.rows,
29
- "auto-resize": __props.autoresize,
30
- style: normalizeStyle(style.value),
31
- placeholder: __props.placeholder,
32
- disabled: __props.disabled,
33
- readonly: __props.readonly,
34
- maxlength: __props.maxlength === void 0 ? void 0 : Number(__props.maxlength),
35
- autofocus: __props.autofocus,
36
- fluid: "",
37
- "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => _ctx.$emit("update:modelValue", value ?? ""))
38
- }, null, 8, [
39
- "model-value",
40
- "rows",
41
- "auto-resize",
42
- "style",
43
- "placeholder",
44
- "disabled",
45
- "readonly",
46
- "maxlength",
47
- "autofocus"
48
- ]);
49
- };
50
- }
51
- });
52
- //#endregion
53
- export { _sfc_main as default };
54
-
55
- //# sourceMappingURL=Textarea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Textarea.js","names":["$emit","_openBlock","_createBlock","_unref","_normalizeStyle"],"sources":["../../../../src/vue/kit/primevue/Textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PTextarea from 'primevue/textarea'\nimport { computed } from 'vue'\nimport type { TextareaProps } from '../types'\n\nconst props = defineProps<TextareaProps>()\ndefineEmits<{ 'update:modelValue': [value: string] }>()\nconst style = computed(() => (props.maxrows ? { maxHeight: `${props.maxrows * 1.5 + 1}em`, overflowY: 'auto' as const } : undefined))\n</script>\n\n<template>\n <PTextarea\n :model-value=\"modelValue\"\n :rows=\"rows\"\n :auto-resize=\"autoresize\"\n :style=\"style\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :maxlength=\"maxlength === undefined ? undefined : Number(maxlength)\"\n :autofocus=\"autofocus\"\n fluid\n @update:model-value=\"(value: string | undefined) => $emit('update:modelValue', value ?? '')\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAEd,MAAM,QAAQ,eAAgB,MAAM,UAAU;GAAE,WAAW,GAAG,MAAM,UAAU,MAAM,EAAE;GAAK,WAAW;EAAgB,IAAI,KAAA,CAAU;;GAIlI,OAAAC,UAAA,GAAAC,YAYEC,MAAA,SAAA,GAAA;IAXC,eAAa,QAAA;IACb,MAAM,QAAA;IACN,eAAa,QAAA;IACb,OAAKC,eAAE,MAAA,KAAK;IACZ,aAAa,QAAA;IACb,UAAU,QAAA;IACV,UAAU,QAAA;IACV,WAAW,QAAA,cAAc,KAAA,IAAY,KAAA,IAAY,OAAO,QAAA,SAAS;IACjE,WAAW,QAAA;IACZ,OAAA;IACC,uBAAkB,OAAA,OAAA,OAAA,MAAG,UAA8BJ,KAAAA,MAAK,qBAAsB,SAAK,EAAA"}
@@ -1,43 +0,0 @@
1
- import { kbdText } from "./shared.js";
2
- import { triggerNodes } from "./trigger.js";
3
- import { defineComponent, withDirectives } from "vue";
4
- import Tooltip from "primevue/tooltip";
5
- //#region src/vue/kit/primevue/Tooltip.ts
6
- /**
7
- * PrimeVue's tooltip is a directive: this component applies it to its single child (the trigger). The shortcut keys are
8
- * appended to the text (`Fett ⌘B`). Without text the child renders as it is.
9
- */
10
- var Tooltip_default = defineComponent({
11
- name: "KitTooltip",
12
- props: {
13
- text: {
14
- type: String,
15
- default: void 0
16
- },
17
- kbds: {
18
- type: Array,
19
- default: void 0
20
- }
21
- },
22
- setup(props, { slots }) {
23
- return () => {
24
- const nodes = triggerNodes(slots.default?.());
25
- const [child] = nodes;
26
- const text = [props.text, props.kbds?.length ? kbdText(props.kbds) : void 0].filter(Boolean).join(" ");
27
- if (!child || !text || nodes.length > 1) return nodes.length === 1 ? child : nodes;
28
- return withDirectives(child, [[
29
- Tooltip,
30
- {
31
- value: text,
32
- showDelay: 400
33
- },
34
- "",
35
- { top: true }
36
- ]]);
37
- };
38
- }
39
- });
40
- //#endregion
41
- export { Tooltip_default as default };
42
-
43
- //# sourceMappingURL=Tooltip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tooltip.js","names":[],"sources":["../../../../src/vue/kit/primevue/Tooltip.ts"],"sourcesContent":["import Tooltip from 'primevue/tooltip'\nimport { defineComponent, withDirectives } from 'vue'\nimport { kbdText } from './shared'\nimport { triggerNodes } from './trigger'\n\n/**\n * PrimeVue's tooltip is a directive: this component applies it to its single child (the trigger). The shortcut keys are\n * appended to the text (`Fett ⌘B`). Without text the child renders as it is.\n */\nexport default defineComponent({\n name: 'KitTooltip',\n props: {\n text: { type: String, default: undefined },\n kbds: { type: Array as () => string[], default: undefined },\n },\n setup(props, { slots }) {\n return () => {\n const nodes = triggerNodes(slots.default?.())\n const [child] = nodes\n const text = [props.text, props.kbds?.length ? kbdText(props.kbds) : undefined].filter(Boolean).join(' ')\n if (!child || !text || nodes.length > 1) return nodes.length === 1 ? child : nodes\n return withDirectives(child, [[Tooltip, { value: text, showDelay: 400 }, '', { top: true }]])\n }\n },\n})\n"],"mappings":";;;;;;;;;AASA,IAAA,kBAAe,gBAAgB;CAC7B,MAAM;CACN,OAAO;EACL,MAAM;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EACzC,MAAM;GAAE,MAAM;GAAyB,SAAS,KAAA;EAAU;CAC5D;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,aAAa;GACX,MAAM,QAAQ,aAAa,MAAM,UAAU,CAAC;GAC5C,MAAM,CAAC,SAAS;GAChB,MAAM,OAAO,CAAC,MAAM,MAAM,MAAM,MAAM,SAAS,QAAQ,MAAM,IAAI,IAAI,KAAA,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GACxG,IAAI,CAAC,SAAS,CAAC,QAAQ,MAAM,SAAS,GAAG,OAAO,MAAM,WAAW,IAAI,QAAQ;GAC7E,OAAO,eAAe,OAAO,CAAC;IAAC;IAAS;KAAE,OAAO;KAAM,WAAW;IAAI;IAAG;IAAI,EAAE,KAAK,KAAK;GAAC,CAAC,CAAC;EAC9F;CACF;AACF,CAAC"}
@@ -1,75 +0,0 @@
1
- import { computed, createBlock, createTextVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
2
- import PTree from "primevue/tree";
3
- //#region src/vue/kit/primevue/Tree.vue
4
- const _sfc_main = /*@__PURE__*/ defineComponent({
5
- __name: "Tree",
6
- props: {
7
- items: {},
8
- getKey: { type: Function },
9
- expanded: {},
10
- size: {}
11
- },
12
- emits: ["update:expanded"],
13
- setup(__props, { emit: __emit }) {
14
- const props = __props;
15
- const emit = __emit;
16
- const levels = /* @__PURE__ */ new Map();
17
- function keyOf(item) {
18
- return props.getKey ? props.getKey(item) : item.key ?? item.label ?? "";
19
- }
20
- function nodesOf(items, level) {
21
- return items.map((item) => {
22
- const key = keyOf(item);
23
- levels.set(key, level);
24
- return {
25
- key,
26
- label: item.label,
27
- data: item,
28
- leaf: !item.children?.length,
29
- ...item.children?.length && { children: nodesOf(item.children, level + 1) }
30
- };
31
- });
32
- }
33
- const nodes = computed(() => {
34
- levels.clear();
35
- return nodesOf(props.items, 0);
36
- });
37
- const expandedKeys = computed(() => Object.fromEntries((props.expanded ?? []).map((key) => [key, true])));
38
- function toggled(key, open) {
39
- const rest = (props.expanded ?? []).filter((k) => k !== key);
40
- return open ? [...rest, key] : rest;
41
- }
42
- /** Row activation (click or Enter): the item's `onSelect` first, then the tree toggles a row that has children unless it was cancelled. */
43
- function onSelect(node) {
44
- const item = node.data;
45
- const activation = new Event("select", { cancelable: true });
46
- item.onSelect?.(activation);
47
- if (activation.defaultPrevented || !item.children?.length) return;
48
- const open = !(props.expanded ?? []).includes(keyOf(item));
49
- item.onToggle?.(activation);
50
- emit("update:expanded", toggled(keyOf(item), open));
51
- }
52
- return (_ctx, _cache) => {
53
- return openBlock(), createBlock(unref(PTree), {
54
- value: nodes.value,
55
- "expanded-keys": expandedKeys.value,
56
- "selection-mode": "single",
57
- "selection-keys": {},
58
- class: "sk-tree",
59
- "onUpdate:expandedKeys": _cache[0] || (_cache[0] = (keys) => emit("update:expanded", Object.keys(keys).filter((key) => keys[key]))),
60
- onNodeSelect: onSelect
61
- }, {
62
- default: withCtx(({ node, expanded }) => [renderSlot(_ctx.$slots, "item-wrapper", {
63
- item: node.data,
64
- expanded: !!expanded,
65
- level: unref(levels).get(node.key ?? "") ?? 0
66
- }, () => [createTextVNode(toDisplayString(node.label), 1)])]),
67
- _: 3
68
- }, 8, ["value", "expanded-keys"]);
69
- };
70
- }
71
- });
72
- //#endregion
73
- export { _sfc_main as default };
74
-
75
- //# sourceMappingURL=Tree.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tree.js","names":["_openBlock","_createBlock","_unref","_withCtx","_renderSlot","_createTextVNode","_toDisplayString"],"sources":["../../../../src/vue/kit/primevue/Tree.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PTree from 'primevue/tree'\nimport type { TreeNode as PrimeNode } from 'primevue/treenode'\nimport { computed } from 'vue'\nimport type { TreeNode, TreeProps } from '../types'\n\nconst props = defineProps<TreeProps>()\nconst emit = defineEmits<{ 'update:expanded': [keys: string[]] }>()\n\nconst levels = new Map<string, number>()\n\nfunction keyOf(item: TreeNode): string {\n return props.getKey ? props.getKey(item) : (item.key ?? item.label ?? '')\n}\n\nfunction nodesOf(items: TreeNode[], level: number): PrimeNode[] {\n return items.map((item) => {\n const key = keyOf(item)\n levels.set(key, level)\n return {\n key,\n label: item.label,\n data: item,\n leaf: !item.children?.length,\n ...(item.children?.length && { children: nodesOf(item.children, level + 1) }),\n }\n })\n}\n\nconst nodes = computed(() => {\n levels.clear()\n return nodesOf(props.items, 0)\n})\nconst expandedKeys = computed(() => Object.fromEntries((props.expanded ?? []).map(key => [key, true])))\n\nfunction toggled(key: string, open: boolean): string[] {\n const rest = (props.expanded ?? []).filter(k => k !== key)\n return open ? [...rest, key] : rest\n}\n\n/** Row activation (click or Enter): the item's `onSelect` first, then the tree toggles a row that has children unless it was cancelled. */\nfunction onSelect(node: PrimeNode) {\n const item = node.data as TreeNode\n const activation = new Event('select', { cancelable: true })\n item.onSelect?.(activation)\n if (activation.defaultPrevented || !item.children?.length) return\n const open = !(props.expanded ?? []).includes(keyOf(item))\n item.onToggle?.(activation)\n emit('update:expanded', toggled(keyOf(item), open))\n}\n</script>\n\n<template>\n <PTree\n :value=\"nodes\"\n :expanded-keys=\"expandedKeys\"\n selection-mode=\"single\"\n :selection-keys=\"{}\"\n class=\"sk-tree\"\n @update:expanded-keys=\"(keys: Record<string, boolean>) => emit('update:expanded', Object.keys(keys).filter(key => keys[key]))\"\n @node-select=\"onSelect\"\n >\n <template #default=\"{ node, expanded }\">\n <slot name=\"item-wrapper\" :item=\"node.data\" :expanded=\"!!expanded\" :level=\"levels.get(node.key ?? '') ?? 0\">\n {{ node.label }}\n </slot>\n </template>\n </PTree>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAMA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,yBAAS,IAAI,IAAoB;EAEvC,SAAS,MAAM,MAAwB;GACrC,OAAO,MAAM,SAAS,MAAM,OAAO,IAAI,IAAK,KAAK,OAAO,KAAK,SAAS;EACxE;EAEA,SAAS,QAAQ,OAAmB,OAA4B;GAC9D,OAAO,MAAM,KAAK,SAAS;IACzB,MAAM,MAAM,MAAM,IAAI;IACtB,OAAO,IAAI,KAAK,KAAK;IACrB,OAAO;KACL;KACA,OAAO,KAAK;KACZ,MAAM;KACN,MAAM,CAAC,KAAK,UAAU;KACtB,GAAI,KAAK,UAAU,UAAU,EAAE,UAAU,QAAQ,KAAK,UAAU,QAAQ,CAAC,EAAE;IAC7E;GACF,CAAC;EACH;EAEA,MAAM,QAAQ,eAAe;GAC3B,OAAO,MAAM;GACb,OAAO,QAAQ,MAAM,OAAO,CAAC;EAC/B,CAAC;EACD,MAAM,eAAe,eAAe,OAAO,aAAa,MAAM,YAAY,CAAC,EAAA,CAAG,KAAI,QAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;EAEtG,SAAS,QAAQ,KAAa,MAAyB;GACrD,MAAM,QAAQ,MAAM,YAAY,CAAC,EAAA,CAAG,QAAO,MAAK,MAAM,GAAG;GACzD,OAAO,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;EACjC;;EAGA,SAAS,SAAS,MAAiB;GACjC,MAAM,OAAO,KAAK;GAClB,MAAM,aAAa,IAAI,MAAM,UAAU,EAAE,YAAY,KAAK,CAAC;GAC3D,KAAK,WAAW,UAAU;GAC1B,IAAI,WAAW,oBAAoB,CAAC,KAAK,UAAU,QAAQ;GAC3D,MAAM,OAAO,EAAE,MAAM,YAAY,CAAC,EAAA,CAAG,SAAS,MAAM,IAAI,CAAC;GACzD,KAAK,WAAW,UAAU;GAC1B,KAAK,mBAAmB,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC;EACpD;;GAIE,OAAAA,UAAA,GAAAC,YAcQC,MAAA,KAAA,GAAA;IAbL,OAAO,MAAA;IACP,iBAAe,aAAA;IAChB,kBAAe;IACd,kBAAgB,CAAA;IACjB,OAAM;IACL,yBAAoB,OAAA,OAAA,OAAA,MAAG,SAAkC,KAAI,mBAAoB,OAAO,KAAK,IAAI,CAAA,CAAE,QAAO,QAAO,KAAK,IAAG,CAAA;IACzH,cAAa;;IAEH,SAAOC,SAGT,EAHa,MAAM,eAAQ,CAClCC,WAEO,KAAA,QAAA,gBAAA;KAFoB,MAAM,KAAK;KAAO,UAAQ,CAAA,CAAI;KAAW,OAAOF,MAAA,MAAA,CAAM,CAAC,IAAI,KAAK,OAAG,EAAA,KAAA;IAA9F,SAEO,CADFG,gBAAAC,gBAAA,KAAK,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1,55 +0,0 @@
1
- //#region src/vue/kit/primevue/select-options.ts
2
- /**
3
- * Kit items to PrimeVue options: strings and numbers are choices of their own value, separators vanish (Prime lists have
4
- * none) and a `label` heading starts a group; without any heading the result is flat.
5
- */
6
- function choicesOf(items) {
7
- const grouped = items.some((item) => typeof item === "object" && item.type === "label");
8
- const options = [];
9
- let current;
10
- for (const item of items) {
11
- if (typeof item === "string" || typeof item === "number") {
12
- const choice = {
13
- label: String(item),
14
- value: item
15
- };
16
- if (current) current.items.push(choice);
17
- else options.push(choice);
18
- continue;
19
- }
20
- if (item.type === "separator") continue;
21
- if (item.type === "label") {
22
- current = {
23
- label: item.label ?? "",
24
- items: []
25
- };
26
- options.push(current);
27
- continue;
28
- }
29
- const choice = {
30
- label: item.label ?? String(item.value ?? ""),
31
- value: item.value ?? item.label ?? "",
32
- ...item.description !== void 0 && { description: item.description },
33
- ...item.icon !== void 0 && { icon: item.icon },
34
- ...item.disabled !== void 0 && { disabled: item.disabled },
35
- ...item.onSelect && { onSelect: item.onSelect }
36
- };
37
- if (current) current.items.push(choice);
38
- else options.push(choice);
39
- }
40
- return {
41
- grouped,
42
- options
43
- };
44
- }
45
- /** Finds the choice that carries `value`. */
46
- function choiceOf(options, value) {
47
- for (const option of options) if ("items" in option) {
48
- const found = option.items.find((choice) => choice.value === value);
49
- if (found) return found;
50
- } else if (option.value === value) return option;
51
- }
52
- //#endregion
53
- export { choiceOf, choicesOf };
54
-
55
- //# sourceMappingURL=select-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select-options.js","names":[],"sources":["../../../../src/vue/kit/primevue/select-options.ts"],"sourcesContent":["import type { SelectItem } from '../types'\n\n/** What a `Select` shows: a plain choice, or a heading with the choices below it. */\nexport interface Choice {\n label: string\n value: string | number | boolean\n description?: string\n icon?: string\n disabled?: boolean\n onSelect?: (event: Event) => void\n}\nexport interface ChoiceGroup { label: string, items: Choice[] }\n\ntype Entry = SelectItem | string | number\n\n/**\n * Kit items to PrimeVue options: strings and numbers are choices of their own value, separators vanish (Prime lists have\n * none) and a `label` heading starts a group; without any heading the result is flat.\n */\nexport function choicesOf(items: readonly Entry[]): { grouped: boolean, options: (Choice | ChoiceGroup)[] } {\n const grouped = items.some(item => typeof item === 'object' && item.type === 'label')\n const options: (Choice | ChoiceGroup)[] = []\n let current: ChoiceGroup | undefined\n for (const item of items) {\n if (typeof item === 'string' || typeof item === 'number') {\n const choice: Choice = { label: String(item), value: item }\n if (current) current.items.push(choice)\n else options.push(choice)\n continue\n }\n if (item.type === 'separator') continue\n if (item.type === 'label') {\n current = { label: item.label ?? '', items: [] }\n options.push(current)\n continue\n }\n const choice: Choice = {\n label: item.label ?? String(item.value ?? ''),\n value: item.value ?? item.label ?? '',\n ...(item.description !== undefined && { description: item.description }),\n ...(item.icon !== undefined && { icon: item.icon }),\n ...(item.disabled !== undefined && { disabled: item.disabled }),\n ...(item.onSelect && { onSelect: item.onSelect }),\n }\n if (current) current.items.push(choice)\n else options.push(choice)\n }\n return { grouped, options }\n}\n\n/** Finds the choice that carries `value`. */\nexport function choiceOf(options: (Choice | ChoiceGroup)[], value: unknown): Choice | undefined {\n for (const option of options) {\n if ('items' in option) {\n const found = option.items.find(choice => choice.value === value)\n if (found) return found\n }\n else if (option.value === value) return option\n }\n return undefined\n}\n"],"mappings":";;;;;AAmBA,SAAgB,UAAU,OAAkF;CAC1G,MAAM,UAAU,MAAM,MAAK,SAAQ,OAAO,SAAS,YAAY,KAAK,SAAS,OAAO;CACpF,MAAM,UAAoC,CAAC;CAC3C,IAAI;CACJ,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;GACxD,MAAM,SAAiB;IAAE,OAAO,OAAO,IAAI;IAAG,OAAO;GAAK;GAC1D,IAAI,SAAS,QAAQ,MAAM,KAAK,MAAM;QACjC,QAAQ,KAAK,MAAM;GACxB;EACF;EACA,IAAI,KAAK,SAAS,aAAa;EAC/B,IAAI,KAAK,SAAS,SAAS;GACzB,UAAU;IAAE,OAAO,KAAK,SAAS;IAAI,OAAO,CAAC;GAAE;GAC/C,QAAQ,KAAK,OAAO;GACpB;EACF;EACA,MAAM,SAAiB;GACrB,OAAO,KAAK,SAAS,OAAO,KAAK,SAAS,EAAE;GAC5C,OAAO,KAAK,SAAS,KAAK,SAAS;GACnC,GAAI,KAAK,gBAAgB,KAAA,KAAa,EAAE,aAAa,KAAK,YAAY;GACtE,GAAI,KAAK,SAAS,KAAA,KAAa,EAAE,MAAM,KAAK,KAAK;GACjD,GAAI,KAAK,aAAa,KAAA,KAAa,EAAE,UAAU,KAAK,SAAS;GAC7D,GAAI,KAAK,YAAY,EAAE,UAAU,KAAK,SAAS;EACjD;EACA,IAAI,SAAS,QAAQ,MAAM,KAAK,MAAM;OACjC,QAAQ,KAAK,MAAM;CAC1B;CACA,OAAO;EAAE;EAAS;CAAQ;AAC5B;;AAGA,SAAgB,SAAS,SAAmC,OAAoC;CAC9F,KAAK,MAAM,UAAU,SACnB,IAAI,WAAW,QAAQ;EACrB,MAAM,QAAQ,OAAO,MAAM,MAAK,WAAU,OAAO,UAAU,KAAK;EAChE,IAAI,OAAO,OAAO;CACpB,OACK,IAAI,OAAO,UAAU,OAAO,OAAO;AAG5C"}
@@ -1,49 +0,0 @@
1
- //#region src/vue/kit/primevue/shared.ts
2
- function severityOf(color) {
3
- switch (color) {
4
- case "success": return "success";
5
- case "info": return "info";
6
- case "warning": return "warn";
7
- case "error": return "danger";
8
- case "secondary":
9
- case "neutral": return "secondary";
10
- default: return;
11
- }
12
- }
13
- /** PrimeVue has three sizes: the dense kit sizes fold into `small`, the roomy ones into `large`. */
14
- function sizeOf(size) {
15
- switch (size) {
16
- case "3xs":
17
- case "2xs":
18
- case "xs":
19
- case "sm": return "small";
20
- case "lg":
21
- case "xl":
22
- case "2xl":
23
- case "3xl": return "large";
24
- default: return;
25
- }
26
- }
27
- /** `i-lucide-x` (the editor's icon spelling) as an Iconify id (`lucide:x`); `lucide:x` stays as it is. */
28
- function iconifyName(name) {
29
- if (!name.startsWith("i-")) return name;
30
- const rest = name.slice(2);
31
- const dash = rest.indexOf("-");
32
- return dash < 0 ? rest : `${rest.slice(0, dash)}:${rest.slice(dash + 1)}`;
33
- }
34
- const KEYS = {
35
- meta: "⌘",
36
- ctrl: "Ctrl",
37
- shift: "⇧",
38
- alt: "⌥",
39
- enter: "↵",
40
- escape: "Esc"
41
- };
42
- /** `['meta', 'b']` as `⌘B`: how a shortcut is written in a tooltip or a menu row. */
43
- function kbdText(kbds) {
44
- return kbds.map((key) => KEYS[key.toLowerCase()] ?? key.toUpperCase()).join("");
45
- }
46
- //#endregion
47
- export { iconifyName, kbdText, severityOf, sizeOf };
48
-
49
- //# sourceMappingURL=shared.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared.js","names":[],"sources":["../../../../src/vue/kit/primevue/shared.ts"],"sourcesContent":["import type { KitColor, KitSize } from '../types'\n\n/** PrimeVue severity of a kit colour (`undefined` is the primary colour). */\nexport type Severity = 'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'contrast' | undefined\n\nexport function severityOf(color: KitColor | undefined): Severity {\n switch (color) {\n case 'success': return 'success'\n case 'info': return 'info'\n case 'warning': return 'warn'\n case 'error': return 'danger'\n case 'secondary':\n case 'neutral': return 'secondary'\n default: return undefined\n }\n}\n\n/** PrimeVue has three sizes: the dense kit sizes fold into `small`, the roomy ones into `large`. */\nexport function sizeOf(size: KitSize | undefined): 'small' | 'large' | undefined {\n switch (size) {\n case '3xs': case '2xs': case 'xs': case 'sm': return 'small'\n case 'lg': case 'xl': case '2xl': case '3xl': return 'large'\n default: return undefined\n }\n}\n\n/** `i-lucide-x` (the editor's icon spelling) as an Iconify id (`lucide:x`); `lucide:x` stays as it is. */\nexport function iconifyName(name: string): string {\n if (!name.startsWith('i-')) return name\n const rest = name.slice(2)\n const dash = rest.indexOf('-')\n return dash < 0 ? rest : `${rest.slice(0, dash)}:${rest.slice(dash + 1)}`\n}\n\nconst KEYS: Record<string, string> = { meta: '⌘', ctrl: 'Ctrl', shift: '⇧', alt: '⌥', enter: '↵', escape: 'Esc' }\n\n/** `['meta', 'b']` as `⌘B`: how a shortcut is written in a tooltip or a menu row. */\nexport function kbdText(kbds: string[]): string {\n return kbds.map(key => KEYS[key.toLowerCase()] ?? key.toUpperCase()).join('')\n}\n"],"mappings":";AAKA,SAAgB,WAAW,OAAuC;CAChE,QAAQ,OAAR;EACE,KAAK,WAAW,OAAO;EACvB,KAAK,QAAQ,OAAO;EACpB,KAAK,WAAW,OAAO;EACvB,KAAK,SAAS,OAAO;EACrB,KAAK;EACL,KAAK,WAAW,OAAO;EACvB,SAAS;CACX;AACF;;AAGA,SAAgB,OAAO,MAA0D;CAC/E,QAAQ,MAAR;EACE,KAAK;EAAO,KAAK;EAAO,KAAK;EAAM,KAAK,MAAM,OAAO;EACrD,KAAK;EAAM,KAAK;EAAM,KAAK;EAAO,KAAK,OAAO,OAAO;EACrD,SAAS;CACX;AACF;;AAGA,SAAgB,YAAY,MAAsB;CAChD,IAAI,CAAC,KAAK,WAAW,IAAI,GAAG,OAAO;CACnC,MAAM,OAAO,KAAK,MAAM,CAAC;CACzB,MAAM,OAAO,KAAK,QAAQ,GAAG;CAC7B,OAAO,OAAO,IAAI,OAAO,GAAG,KAAK,MAAM,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,OAAO,CAAC;AACxE;AAEA,MAAM,OAA+B;CAAE,MAAM;CAAK,MAAM;CAAQ,OAAO;CAAK,KAAK;CAAK,OAAO;CAAK,QAAQ;AAAM;;AAGhH,SAAgB,QAAQ,MAAwB;CAC9C,OAAO,KAAK,KAAI,QAAO,KAAK,IAAI,YAAY,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,EAAE;AAC9E"}