@milaboratories/uikit 2.14.25 → 2.15.1
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/.turbo/turbo-build.log +21 -21
- package/.turbo/turbo-formatter$colon$check.log +2 -2
- package/.turbo/turbo-linter$colon$check.log +2 -2
- package/.turbo/turbo-types$colon$check.log +1 -1
- package/CHANGELOG.md +16 -0
- package/dist/components/PlAlert/pl-alert.css +1 -1
- package/dist/components/PlDropdown/PlDropdown.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts +5 -0
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue2.js +66 -62
- package/dist/components/PlDropdown/PlDropdown.vue2.js.map +1 -1
- package/dist/components/PlDropdown/pl-dropdown.css +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts +5 -0
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js +75 -58
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js.map +1 -1
- package/dist/components/PlDropdownMulti/pl-dropdown-multi.css +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.js.map +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts +6 -0
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue2.js +1 -0
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue2.js.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.js.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts +5 -0
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue2.js +1 -0
- package/dist/components/PlDropdownRef/PlDropdownRef.vue2.js.map +1 -1
- package/package.json +2 -2
- package/src/components/PlAlert/pl-alert.scss +3 -1
- package/src/components/PlDropdown/PlDropdown.vue +25 -14
- package/src/components/PlDropdown/__tests__/PlDropdown.spec.ts +119 -0
- package/src/components/PlDropdown/pl-dropdown.scss +9 -0
- package/src/components/PlDropdownMulti/PlDropdownMulti.vue +32 -4
- package/src/components/PlDropdownMulti/__tests__/PlDropdownMulti.spec.ts +135 -0
- package/src/components/PlDropdownMulti/pl-dropdown-multi.scss +11 -0
- package/src/components/PlDropdownMultiRef/PlDropdownMultiRef.vue +6 -0
- package/src/components/PlDropdownMultiRef/__tests__/PlDropdownMultiRef.spec.ts +42 -0
- package/src/components/PlDropdownRef/PlDropdownRef.vue +6 -0
- package/src/components/PlDropdownRef/__tests__/PlDropdownRef.spec.ts +53 -0
|
@@ -63,4 +63,46 @@ describe("PlDropdownMultiRef", () => {
|
|
|
63
63
|
|
|
64
64
|
expect(getOptions().length).toBe(2); // options are not closed after click
|
|
65
65
|
});
|
|
66
|
+
|
|
67
|
+
it("renders the ref-specific missingValueLabel default for a stale ref", async () => {
|
|
68
|
+
const wrapper = mount(PlDropdownMultiRef, {
|
|
69
|
+
props: {
|
|
70
|
+
modelValue: [
|
|
71
|
+
{ __isRef: true as const, blockId: "1", name: "Ref to block 1" },
|
|
72
|
+
{ __isRef: true as const, blockId: "deleted", name: "Ref to deleted block" },
|
|
73
|
+
],
|
|
74
|
+
options: [
|
|
75
|
+
{
|
|
76
|
+
label: "Ref 1",
|
|
77
|
+
ref: { __isRef: true as const, blockId: "1", name: "Ref to block 1" },
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
await flushPromises();
|
|
84
|
+
|
|
85
|
+
const missing = wrapper.findAll(".pl-dropdown-multi__chip--missing");
|
|
86
|
+
expect(missing.length).toBe(1);
|
|
87
|
+
expect(missing[0].text()).toContain("Upstream value removed");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("forwards a caller-supplied missingValueLabel that overrides the Ref default", async () => {
|
|
91
|
+
const wrapper = mount(PlDropdownMultiRef, {
|
|
92
|
+
props: {
|
|
93
|
+
modelValue: [{ __isRef: true as const, blockId: "deleted", name: "Ref to deleted block" }],
|
|
94
|
+
missingValueLabel: "Caller override",
|
|
95
|
+
options: [
|
|
96
|
+
{
|
|
97
|
+
label: "Ref 1",
|
|
98
|
+
ref: { __isRef: true as const, blockId: "1", name: "Ref to block 1" },
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
await flushPromises();
|
|
104
|
+
const missing = wrapper.findAll(".pl-dropdown-multi__chip--missing");
|
|
105
|
+
expect(missing.length).toBe(1);
|
|
106
|
+
expect(missing[0].text()).toContain("Caller override");
|
|
107
|
+
});
|
|
66
108
|
});
|
|
@@ -52,6 +52,11 @@ const props = withDefaults(
|
|
|
52
52
|
* Placeholder text shown when no value is selected.
|
|
53
53
|
*/
|
|
54
54
|
placeholder?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Text shown in the field when the referenced upstream block / output no longer
|
|
57
|
+
* exists. Defaults to "Upstream value removed".
|
|
58
|
+
*/
|
|
59
|
+
missingValueLabel?: string;
|
|
55
60
|
/**
|
|
56
61
|
* Enables a button to clear the selected value (default: false)
|
|
57
62
|
*/
|
|
@@ -75,6 +80,7 @@ const props = withDefaults(
|
|
|
75
80
|
loadingOptionsHelper: undefined,
|
|
76
81
|
error: undefined,
|
|
77
82
|
placeholder: "...",
|
|
83
|
+
missingValueLabel: "Upstream value removed",
|
|
78
84
|
clearable: false,
|
|
79
85
|
required: false,
|
|
80
86
|
disabled: false,
|
|
@@ -51,4 +51,57 @@ describe("PlDropdownRef", () => {
|
|
|
51
51
|
|
|
52
52
|
expect(await wrapper.findAll(".dropdown-list-item").length).toBe(0); // options are closed after click
|
|
53
53
|
});
|
|
54
|
+
|
|
55
|
+
it("renders the ref-specific missingValueLabel default when ref is not in options", async () => {
|
|
56
|
+
const wrapper = mount(PlDropdownRef, {
|
|
57
|
+
props: {
|
|
58
|
+
modelValue: {
|
|
59
|
+
__isRef: true as const,
|
|
60
|
+
blockId: "deleted-block",
|
|
61
|
+
name: "Ref to deleted block",
|
|
62
|
+
},
|
|
63
|
+
options: [
|
|
64
|
+
{
|
|
65
|
+
label: "Ref 1",
|
|
66
|
+
ref: {
|
|
67
|
+
__isRef: true as const,
|
|
68
|
+
blockId: "1",
|
|
69
|
+
name: "Ref to block 1",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
await flushPromises();
|
|
77
|
+
|
|
78
|
+
const missing = wrapper.find(".input-value--missing");
|
|
79
|
+
expect(missing.exists()).toBe(true);
|
|
80
|
+
expect(missing.text()).toBe("Upstream value removed");
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("forwards a caller-supplied missingValueLabel that overrides the Ref default", async () => {
|
|
84
|
+
const wrapper = mount(PlDropdownRef, {
|
|
85
|
+
props: {
|
|
86
|
+
modelValue: {
|
|
87
|
+
__isRef: true as const,
|
|
88
|
+
blockId: "deleted-block",
|
|
89
|
+
name: "Ref to deleted block",
|
|
90
|
+
},
|
|
91
|
+
missingValueLabel: "Caller override",
|
|
92
|
+
options: [
|
|
93
|
+
{
|
|
94
|
+
label: "Ref 1",
|
|
95
|
+
ref: {
|
|
96
|
+
__isRef: true as const,
|
|
97
|
+
blockId: "1",
|
|
98
|
+
name: "Ref to block 1",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
await flushPromises();
|
|
105
|
+
expect(wrapper.find(".input-value--missing").text()).toBe("Caller override");
|
|
106
|
+
});
|
|
54
107
|
});
|