@voicenter-team/voicenter-ui-plus 4.3.0 → 4.3.2
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/MIGRATION_v3.md +196 -196
- package/README.md +1058 -1057
- package/library/assets/assets/sass/main.css +1 -1
- package/library/assets/components/VcCodeBlock/VcCodeBlock.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileUploaderSimple.css +1 -1
- package/library/assets/components/VcJsonSchema/Components/JsonSchemaEditor.css +1 -1
- package/library/assets/components/VcLoading/Loaders/Circles.css +1 -1
- package/library/assets/components/VcLoading/Loaders/DotSpinner.css +1 -1
- package/library/assets/components/VcLoading/Loaders/LdsSpinner.css +1 -1
- package/library/assets/components/VcLoading/Loaders/LoadIcon.css +1 -1
- package/library/assets/components/VcLoading/Loaders/Stretch.css +1 -1
- package/library/assets/components/VcLoading/VcLoading.css +1 -1
- package/library/assets/components/VcMdEditor/ParameterNode.css +1 -1
- package/library/assets/components/VcNavigationSidebar/VcNavigationSidebar.css +1 -0
- package/library/assets/components/VcSegmented/VcSegmented.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Card.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Circle.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Row.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Square.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Text.css +1 -1
- package/library/assets/components/VcSkeletonLoader/VcSkeletonItem.css +1 -0
- package/library/assets/components/VcTag/VcTag.css +1 -1
- package/library/components/VcFileUploader/VcFileUploaderSimple.vue.mjs +1 -1
- package/library/components/VcJsonSchema/Components/JsonSchemaEditor.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Circles.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/DotSpinner.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/DotSpinner.vue2.mjs +2 -2
- package/library/components/VcLoading/Loaders/LdsSpinner.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/LoadIcon.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Stretch.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Stretch.vue2.mjs +1 -1
- package/library/components/VcLoading/VcLoading.vue.mjs +1 -1
- package/library/components/VcMdEditor/ParameterNode.vue.mjs +1 -1
- package/library/components/VcNavigationSidebar/NavigationSidebarLink.vue.mjs +154 -0
- package/library/components/VcNavigationSidebar/NavigationSidebarLink.vue2.mjs +4 -0
- package/library/components/VcNavigationSidebar/NavigationSidebarMobileList.vue.mjs +128 -0
- package/library/components/VcNavigationSidebar/NavigationSidebarMobileList.vue2.mjs +4 -0
- package/library/components/VcNavigationSidebar/NavigationSidebarMore.vue.mjs +94 -0
- package/library/components/VcNavigationSidebar/NavigationSidebarMore.vue2.mjs +4 -0
- package/library/components/VcNavigationSidebar/NavigationSidebarPanel.vue.mjs +179 -0
- package/library/components/VcNavigationSidebar/NavigationSidebarPanel.vue2.mjs +4 -0
- package/library/components/VcNavigationSidebar/VcNavigationSidebar.vue.mjs +737 -0
- package/library/components/VcNavigationSidebar/VcNavigationSidebar.vue3.mjs +5 -0
- package/library/components/VcNavigationSidebar/navigationSidebarModel.mjs +51 -0
- package/library/components/VcSegmented/VcSegmented.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Card.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Circle.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Row.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Square.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Text.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/VcSkeletonItem.vue.mjs +7 -0
- package/library/components/VcSkeletonLoader/VcSkeletonItem.vue2.mjs +39 -0
- package/library/components/VcSkeletonLoader/VcSkeletonLoader.vue.mjs +19 -6
- package/library/docs/guides/migration/migrating-from-4.0.md +88 -87
- package/library/index.mjs +121 -116
- package/library/index.mjs.br +0 -0
- package/library/index.mjs.gz +0 -0
- package/library/localization/index.mjs.gz +0 -0
- package/library/localization/locales/en.json.mjs +9 -1
- package/library/plugin-components.gen.mjs +165 -160
- package/library/plugin.mjs +119 -114
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/style.css +22 -18
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/theme/index.mjs.gz +0 -0
- package/library/types/components/VcFilterBar/VcFilterBar.vue.d.ts +1 -1
- package/library/types/components/VcNavigationSidebar/NavigationSidebarLink.vue.d.ts +17 -0
- package/library/types/components/VcNavigationSidebar/NavigationSidebarMobileList.vue.d.ts +15 -0
- package/library/types/components/VcNavigationSidebar/NavigationSidebarMore.vue.d.ts +15 -0
- package/library/types/components/VcNavigationSidebar/NavigationSidebarPanel.vue.d.ts +33 -0
- package/library/types/components/VcNavigationSidebar/VcNavigationSidebar.vue.d.ts +121 -0
- package/library/types/components/VcNavigationSidebar/navigationSidebarModel.d.ts +42 -0
- package/library/types/components/VcSkeletonLoader/VcSkeletonItem.vue.d.ts +16 -0
- package/library/types/components/VcSkeletonLoader/VcSkeletonLoader.vue.d.ts +19 -1
- package/library/types/components/exports.d.ts +5 -1
- package/library/types/components.gen.d.ts +2 -0
- package/library/types/localization/locales/en.json.d.ts +9 -1
- package/library/types/theme/themes.json.d.ts +72 -72
- package/library/types/types/VcNavigationSidebar.types.d.ts +66 -0
- package/library/types/types/VcSkeletonLoader.types.d.ts +1 -0
- package/library/types/types/index.d.ts +1 -0
- package/library/utils/jsonSchema/index.mjs.gz +0 -0
- package/package.json +310 -310
- package/src/theme/index.ts +101 -101
- package/src/theme/tailwindScheme.js +78 -78
- package/src/theme/theme.types.ts +31 -31
- package/src/theme/themeMerge.ts +63 -63
- package/src/theme/themes.json +72 -72
- package/tailwind.config.d.ts +5 -5
- package/tailwind.config.js +178 -178
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function isNavigationGroup(item) {
|
|
2
|
+
return "children" in item && Array.isArray(item.children);
|
|
3
|
+
}
|
|
4
|
+
function isNavigationSection(item) {
|
|
5
|
+
return "children" in item && Array.isArray(item.children);
|
|
6
|
+
}
|
|
7
|
+
function toActiveKeys(active) {
|
|
8
|
+
if (active === null || active === void 0 || active === "") {
|
|
9
|
+
return /* @__PURE__ */ new Set();
|
|
10
|
+
}
|
|
11
|
+
return new Set(Array.isArray(active) ? active.filter(Boolean) : [active]);
|
|
12
|
+
}
|
|
13
|
+
function groupLinks(group) {
|
|
14
|
+
return group.children.flatMap((child) => isNavigationSection(child) ? child.children : [child]);
|
|
15
|
+
}
|
|
16
|
+
function isItemActive(item, activeKeys) {
|
|
17
|
+
if (activeKeys.has(item.key)) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (!isNavigationGroup(item)) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return groupLinks(item).some((link) => activeKeys.has(link.key));
|
|
24
|
+
}
|
|
25
|
+
function activeLinkKey(links, active) {
|
|
26
|
+
const keys = Array.isArray(active) ? active : active ? [active] : [];
|
|
27
|
+
const linkKeys = new Set(links.map((link) => link.key));
|
|
28
|
+
for (let i = keys.length - 1; i >= 0; i--) {
|
|
29
|
+
if (linkKeys.has(keys[i])) {
|
|
30
|
+
return keys[i];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
function hasLinkTooltip(link) {
|
|
36
|
+
return Boolean(link.description || link.docsUrl);
|
|
37
|
+
}
|
|
38
|
+
const NAVIGATION_SIDEBAR_KEY = Symbol("VcNavigationSidebar");
|
|
39
|
+
const NavigationSidebarRender = (props) => props.render();
|
|
40
|
+
NavigationSidebarRender.props = ["render"];
|
|
41
|
+
export {
|
|
42
|
+
NAVIGATION_SIDEBAR_KEY,
|
|
43
|
+
NavigationSidebarRender,
|
|
44
|
+
activeLinkKey,
|
|
45
|
+
groupLinks,
|
|
46
|
+
hasLinkTooltip,
|
|
47
|
+
isItemActive,
|
|
48
|
+
isNavigationGroup,
|
|
49
|
+
isNavigationSection,
|
|
50
|
+
toActiveKeys
|
|
51
|
+
};
|
|
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
31
|
emits: ["update:modelValue", "change"],
|
|
32
32
|
setup(__props, { emit: __emit }) {
|
|
33
33
|
useCssVars((_ctx) => ({
|
|
34
|
-
"
|
|
34
|
+
"v45dce9af": slideDuration
|
|
35
35
|
}));
|
|
36
36
|
const MAPPED_OPTION_KEYS = {
|
|
37
37
|
value: "value",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Card.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcSkeletonLoader/Loaders/Card.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const Card = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Card = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-16ee0368"]]);
|
|
5
5
|
export {
|
|
6
6
|
Card as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Circle.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcSkeletonLoader/Loaders/Circle.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const Circle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Circle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0ad3df7c"]]);
|
|
5
5
|
export {
|
|
6
6
|
Circle as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Row.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcSkeletonLoader/Loaders/Row.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const Row = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Row = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-147d5fbb"]]);
|
|
5
5
|
export {
|
|
6
6
|
Row as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Square.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcSkeletonLoader/Loaders/Square.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const Square = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Square = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-daeb74ee"]]);
|
|
5
5
|
export {
|
|
6
6
|
Square as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./Text.vue2.mjs";
|
|
2
2
|
import '../../../assets/components/VcSkeletonLoader/Loaders/Text.css';/* empty css */
|
|
3
3
|
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const Text = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const Text = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2723084e"]]);
|
|
5
5
|
export {
|
|
6
6
|
Text as default
|
|
7
7
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from "./VcSkeletonItem.vue2.mjs";
|
|
2
|
+
import '../../assets/components/VcSkeletonLoader/VcSkeletonItem.css';/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const VcSkeletonItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-66f4ccc6"]]);
|
|
5
|
+
export {
|
|
6
|
+
VcSkeletonItem as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, normalizeClass } from "vue";
|
|
2
|
+
import { convertToUnit } from "../../utils/helpers.mjs";
|
|
3
|
+
const DEFAULT_ROW_HEIGHT = "1.5rem";
|
|
4
|
+
const DEFAULT_SIZE = "25px";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "VcSkeletonItem",
|
|
7
|
+
props: {
|
|
8
|
+
variant: { default: "row" },
|
|
9
|
+
width: { default: void 0 },
|
|
10
|
+
height: { default: void 0 },
|
|
11
|
+
size: { default: void 0 }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const styles = computed(() => {
|
|
16
|
+
if (props.variant === "row") {
|
|
17
|
+
return {
|
|
18
|
+
width: convertToUnit(props.width) || "100%",
|
|
19
|
+
height: convertToUnit(props.height) || DEFAULT_ROW_HEIGHT
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const size = convertToUnit(props.size) || DEFAULT_SIZE;
|
|
23
|
+
return {
|
|
24
|
+
width: convertToUnit(props.width) || size,
|
|
25
|
+
height: convertToUnit(props.height) || size
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createElementBlock("div", {
|
|
30
|
+
class: normalizeClass(["vc-skeleton-item", `vc-skeleton-item--${__props.variant}`]),
|
|
31
|
+
style: normalizeStyle(styles.value),
|
|
32
|
+
"aria-hidden": "true"
|
|
33
|
+
}, null, 6);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
_sfc_main as default
|
|
39
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, markRaw, openBlock, createElementBlock, mergeProps, createBlock, resolveDynamicComponent } from "vue";
|
|
1
|
+
import { defineComponent, computed, markRaw, openBlock, createElementBlock, mergeProps, Fragment, renderList, renderSlot, createBlock, resolveDynamicComponent } from "vue";
|
|
2
2
|
import { convertToUnit } from "../../utils/helpers.mjs";
|
|
3
3
|
import Card from "./Loaders/Card.vue.mjs";
|
|
4
4
|
import Row from "./Loaders/Row.vue.mjs";
|
|
@@ -19,7 +19,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
maxWidth: { default: void 0 },
|
|
20
20
|
maxHeight: { default: void 0 },
|
|
21
21
|
textLoading: { default: void 0 },
|
|
22
|
-
type: { default: DEFAULT_TYPE }
|
|
22
|
+
type: { default: DEFAULT_TYPE },
|
|
23
|
+
loading: { type: Boolean, default: true },
|
|
24
|
+
count: { default: 1 }
|
|
23
25
|
},
|
|
24
26
|
setup(__props) {
|
|
25
27
|
const LOADERS = {
|
|
@@ -42,6 +44,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
44
|
if (width) _styles.width = width;
|
|
43
45
|
return _styles;
|
|
44
46
|
});
|
|
47
|
+
const repeatCount = computed(() => {
|
|
48
|
+
return Math.max(1, Math.floor(Number(props.count) || 1));
|
|
49
|
+
});
|
|
45
50
|
const heightRows = computed(() => {
|
|
46
51
|
return convertToUnit(props.rowHeight);
|
|
47
52
|
});
|
|
@@ -75,15 +80,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
80
|
return {};
|
|
76
81
|
});
|
|
77
82
|
return (_ctx, _cache) => {
|
|
78
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
83
|
+
return __props.loading ? (openBlock(), createElementBlock("div", mergeProps({
|
|
84
|
+
key: 0,
|
|
79
85
|
class: "vc-skeleton-loader w-full h-full animation-block",
|
|
80
|
-
style: styles.value
|
|
86
|
+
style: styles.value,
|
|
87
|
+
"aria-busy": "true"
|
|
81
88
|
}, _ctx.$attrs), [
|
|
82
|
-
(openBlock(),
|
|
89
|
+
_ctx.$slots.template ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(repeatCount.value, (index) => {
|
|
90
|
+
return renderSlot(_ctx.$slots, "template", {
|
|
91
|
+
key: index,
|
|
92
|
+
index: index - 1
|
|
93
|
+
});
|
|
94
|
+
}), 128)) : (openBlock(), createBlock(resolveDynamicComponent(loaderType.value), mergeProps({
|
|
95
|
+
key: 1,
|
|
83
96
|
"row-height": heightRows.value,
|
|
84
97
|
cols: colsCount.value
|
|
85
98
|
}, additionalAttrs.value), null, 16, ["row-height", "cols"]))
|
|
86
|
-
], 16);
|
|
99
|
+
], 16)) : renderSlot(_ctx.$slots, "default", { key: 1 });
|
|
87
100
|
};
|
|
88
101
|
}
|
|
89
102
|
});
|
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Migrating from 4.0
|
|
3
|
-
description: What an application on ui-plus 4.0 changes on the way to the current release, and how a project moves to the shared ESLint config and TypeScript 6
|
|
4
|
-
group: migration
|
|
5
|
-
order: 2
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Migrating from 4.0
|
|
9
|
-
|
|
10
|
-
What an application on `4.0` changes or checks on the way to the current release. An application on a 4.0 beta takes the rows of README "Upgrading from a 4.0 beta" first.
|
|
11
|
-
|
|
12
|
-
## What changed in the library
|
|
13
|
-
|
|
14
|
-
A row names the last release without the change, so the application takes every row whose release is the one it has installed (the `version` its `package.json` or lock file gives for the library before the upgrade) or a later one.
|
|
15
|
-
|
|
16
|
-
| Changed after | What changed | What the application does |
|
|
17
|
-
| --- | --- | --- |
|
|
18
|
-
| `4.0.1` | `VcEntityEditableTabs` has no `entityMethodDataType` prop, and its record is always a row of the entity's `list` or the answer of its `info`. The type of its `entity` prop is `VcEntityWithTypedInfo<Entity>` | Nothing at runtime. `entity-method-data-type` is removed from every `<VcEntityEditableTabs>` (`grep -rnE "entity-method-data-type\|entityMethodDataType" src`). A generic component that passes its own `entity` prop on declares that prop as `VcEntityWithTypedInfo<Entity>` and reads the record type as `ExtractServiceImplementsEntity<Entity>`: `vue-tsc` reports the earlier `entity: Entity` there |
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
eslint-plugin
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
import
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- a
|
|
82
|
-
- a
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Migrating from 4.0
|
|
3
|
+
description: What an application on ui-plus 4.0 changes on the way to the current release, and how a project moves to the shared ESLint config and TypeScript 6
|
|
4
|
+
group: migration
|
|
5
|
+
order: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Migrating from 4.0
|
|
9
|
+
|
|
10
|
+
What an application on `4.0` changes or checks on the way to the current release. An application on a 4.0 beta takes the rows of README "Upgrading from a 4.0 beta" first.
|
|
11
|
+
|
|
12
|
+
## What changed in the library
|
|
13
|
+
|
|
14
|
+
A row names the last release without the change, so the application takes every row whose release is the one it has installed (the `version` its `package.json` or lock file gives for the library before the upgrade) or a later one.
|
|
15
|
+
|
|
16
|
+
| Changed after | What changed | What the application does |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| `4.0.1` | `VcEntityEditableTabs` has no `entityMethodDataType` prop, and its record is always a row of the entity's `list` or the answer of its `info`. The type of its `entity` prop is `VcEntityWithTypedInfo<Entity>` | Nothing at runtime. `entity-method-data-type` is removed from every `<VcEntityEditableTabs>` (`grep -rnE "entity-method-data-type\|entityMethodDataType" src`). A generic component that passes its own `entity` prop on declares that prop as `VcEntityWithTypedInfo<Entity>` and reads the record type as `ExtractServiceImplementsEntity<Entity>`: `vue-tsc` reports the earlier `entity: Entity` there |
|
|
19
|
+
| `4.3.0` | `VcTag` has a minimum height of 28px (24px `compact`) wherever it sits, which `--vc-tag-height` replaces, and taller content in its `label` slot makes it taller: its label has its own line-height, where it took its container's, and its parts no vertical padding | An application that shows tags in a container with a line-height other than 1.5 (an Element Plus table cell, a block with `leading-*`) checks that row's height and alignment; one that set a line-height around a tag to size it sets `--vc-tag-height` instead; slot content that relied on the padding of the tag brings its own (README, "Styles and component defaults") |
|
|
20
|
+
|
|
21
|
+
Additions that ask nothing of an application (new components, props, theme keys and classes) are not rows.
|
|
22
|
+
|
|
23
|
+
## TypeScript and ESLint
|
|
24
|
+
|
|
25
|
+
From `4.2.0` the library is written on TypeScript 6 and linted with `@voicenter-team/eslint-config`. This asks nothing of an application: the declarations in `library/types/` are read by an application on TypeScript 5.9 as before, and the library brings no lint rule into a project.
|
|
26
|
+
|
|
27
|
+
A project moves to the same toolchain on its own schedule. The steps below are the ones the library took.
|
|
28
|
+
|
|
29
|
+
### Packages
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm rm @voicenter-team/eslint-config-vue @voicenter-team/eslint-config-ts \
|
|
33
|
+
@typescript-eslint/eslint-plugin @typescript-eslint/parser \
|
|
34
|
+
eslint-plugin-vue vue-eslint-parser @vue/eslint-config-typescript
|
|
35
|
+
npm i -D eslint@^10 @voicenter-team/eslint-config@^1 typescript@^6 vue-tsc@^3
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The config brings typescript-eslint, eslint-plugin-vue and the stylistic rules itself: a project installs none of them. Node is `^20.19`, `^22.13` or `>=24`.
|
|
39
|
+
|
|
40
|
+
A project that builds declarations with `vite-plugin-dts` takes `vite-plugin-dts@^5` and renames its `outDir` option to `outDirs`: version 3 writes broken declarations on TypeScript 6.
|
|
41
|
+
|
|
42
|
+
### ESLint
|
|
43
|
+
|
|
44
|
+
`.eslintrc.*` and `.eslintignore` are replaced by `eslint.config.mjs`:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import { defineConfig, includeIgnoreFile } from 'eslint/config'
|
|
48
|
+
import voicenterVue from '@voicenter-team/eslint-config/vue'
|
|
49
|
+
|
|
50
|
+
export default defineConfig(
|
|
51
|
+
includeIgnoreFile(new URL('./.gitignore', import.meta.url).pathname),
|
|
52
|
+
voicenterVue
|
|
53
|
+
)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The script is `eslint .`, with no `--ext` and no `--ignore-path`. A folder that is a project of its own, with its own `package.json` and ESLint config, is named in `globalIgnores([ 'docs/' ])` (from `eslint/config`), or ESLint loads that folder's config for its files.
|
|
57
|
+
|
|
58
|
+
What the config enforces, and what moved from the earlier `-vue` and `-ts` configs, is in the config's own README: `node_modules/@voicenter-team/eslint-config/README.md`, "Migrating from @voicenter-team/eslint-config-ts or -vue".
|
|
59
|
+
|
|
60
|
+
### tsconfig
|
|
61
|
+
|
|
62
|
+
TypeScript 6 reports `baseUrl` as deprecated. It is removed, and each `paths` entry becomes relative to the tsconfig:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"compilerOptions": {
|
|
67
|
+
"moduleResolution": "bundler",
|
|
68
|
+
"paths": {
|
|
69
|
+
"@/*": [ "./src/*" ]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`moduleResolution` is `bundler` in the tsconfig of the application and in the one of `vite.config.ts`.
|
|
76
|
+
|
|
77
|
+
### The code
|
|
78
|
+
|
|
79
|
+
The config bans the type assertion (`value as T`, `<T>value`), the non-null assertion (`value!`), `any`, and the comments `@ts-expect-error`, `@ts-ignore` and `@ts-nocheck`. A finding is fixed in the code, with no `eslint-disable` comment:
|
|
80
|
+
|
|
81
|
+
- a value of unknown shape (a parsed JSON, a `catch` variable, an injected value) is `unknown`, narrowed by a type guard, `(value: unknown): value is T`;
|
|
82
|
+
- a type the compiler cannot follow is fixed where it is declared: a generic parameter, a narrower return type, the generated contract;
|
|
83
|
+
- a template ref is read with `useTemplateRef<T>()`;
|
|
84
|
+
- `inject()` without a provider gives `undefined`, and the code handles it.
|
|
85
|
+
|
|
86
|
+
`npx eslint . --no-inline-config` counts the findings that the `eslint-disable` comments of the project hide: that number, not the one of `npx eslint .`, is the size of the work.
|
|
87
|
+
|
|
88
|
+
Done when `npx eslint .` prints nothing with no `eslint-disable` comment left in the code, and the type check exits 0.
|