@citizenplane/pimp 18.0.2 → 18.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CpMenuItem.vue.d.ts +1 -0
- package/dist/components/CpMenuItem.vue.d.ts.map +1 -1
- package/dist/components/CpSelectableButton.vue.d.ts +5 -1
- package/dist/components/CpSelectableButton.vue.d.ts.map +1 -1
- package/dist/pimp.es.js +35 -32
- package/dist/pimp.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpMenuItem.vue +7 -1
- package/src/components/CpSelectableButton.vue +5 -0
- package/src/stories/CpMenuItem.stories.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CpMenuItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/CpMenuItem.vue"],"names":[],"mappings":"AAwBA;
|
|
1
|
+
{"version":3,"file":"CpMenuItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/CpMenuItem.vue"],"names":[],"mappings":"AAwBA;AA0JA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD,UAAU,KAAK;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,KAAK,WAAW,GAAG,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC;AAyJpE,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,cAAc,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KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -16,7 +16,11 @@ type __VLS_Slots = {} & {
|
|
|
16
16
|
} & {
|
|
17
17
|
'trailing-icon'?: (props: typeof __VLS_5) => any;
|
|
18
18
|
};
|
|
19
|
-
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
+
click: (event: MouseEvent) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
22
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
23
|
+
}>, {
|
|
20
24
|
isSelected: boolean;
|
|
21
25
|
label: string;
|
|
22
26
|
size: SelectableButtonSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CpSelectableButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/CpSelectableButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CpSelectableButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/CpSelectableButton.vue"],"names":[],"mappings":"AA0BA;AAqZA,KAAK,0BAA0B,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAA;AACjG,KAAK,oBAAoB,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAA;AAE9D,UAAU,KAAK;IACb,UAAU,CAAC,EAAE,0BAA0B,CAAA;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,oBAAoB,CAAA;CAC5B;AAoGD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC9D,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACnD;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA0BvD,QAAA,MAAM,eAAe;;;;;gBArIN,OAAO;WACZ,MAAM;UACP,oBAAoB;gBALd,0BAA0B;cAC5B,OAAO;gBACL,OAAO;6EA8IpB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/dist/pimp.es.js
CHANGED
|
@@ -21538,6 +21538,7 @@ const xS = { class: "cpMenuItem" }, SS = ["disabled"], _S = {
|
|
|
21538
21538
|
}, Kr = /* @__PURE__ */ te({
|
|
21539
21539
|
__name: "CpMenuItem",
|
|
21540
21540
|
props: {
|
|
21541
|
+
hideLabel: { type: Boolean, default: !1 },
|
|
21541
21542
|
isAsync: { type: Boolean },
|
|
21542
21543
|
isCritical: { type: Boolean },
|
|
21543
21544
|
isLoading: { type: Boolean },
|
|
@@ -21560,17 +21561,17 @@ const xS = { class: "cpMenuItem" }, SS = ["disabled"], _S = {
|
|
|
21560
21561
|
const n = t, o = e, r = _t(), i = w(() => ({
|
|
21561
21562
|
"cpMenuItem__button--isCritical": n.isCritical,
|
|
21562
21563
|
"cpMenuItem__button--isSelected": n.isSelected
|
|
21563
|
-
})), a = w(() => n.isLoading || n.disabled), s = w(() => !!n.leadingIcon || !!r["leading-icon"]), l = w(() => !!n.trailingIcon || !!r["trailing-icon"]), d = w(() => n.hideLabel ? n.label : void 0),
|
|
21564
|
-
n.command && (n.isAsync ? (await n.command(
|
|
21564
|
+
})), a = w(() => n.isLoading || n.disabled), s = w(() => !!n.leadingIcon || !!r["leading-icon"]), l = w(() => !!n.trailingIcon || !!r["trailing-icon"]), d = w(() => (!!n.label || !!r.label) && !n.hideLabel), u = w(() => n.hideLabel ? n.label : void 0), c = async (p) => {
|
|
21565
|
+
n.command && (n.isAsync ? (await n.command(p), o("asyncComplete")) : (n.command(p), o("click")));
|
|
21565
21566
|
};
|
|
21566
|
-
return (
|
|
21567
|
-
const
|
|
21567
|
+
return (p, h) => {
|
|
21568
|
+
const m = q("cp-loader"), g = q("cp-icon"), $ = Ve("tooltip");
|
|
21568
21569
|
return f(), y("div", xS, [
|
|
21569
21570
|
v("button", {
|
|
21570
21571
|
class: K(["cpMenuItem__button", i.value]),
|
|
21571
21572
|
disabled: a.value,
|
|
21572
21573
|
type: "button",
|
|
21573
|
-
onClick: Mt(
|
|
21574
|
+
onClick: Mt(c, ["stop"])
|
|
21574
21575
|
}, [
|
|
21575
21576
|
j(Ge, {
|
|
21576
21577
|
duration: 100,
|
|
@@ -21579,14 +21580,14 @@ const xS = { class: "cpMenuItem" }, SS = ["disabled"], _S = {
|
|
|
21579
21580
|
}, {
|
|
21580
21581
|
default: V(() => [
|
|
21581
21582
|
t.isLoading ? (f(), y("span", _S, [
|
|
21582
|
-
j(
|
|
21583
|
+
j(m, {
|
|
21583
21584
|
class: "cpMenuItem__loader",
|
|
21584
21585
|
color: "accent",
|
|
21585
21586
|
size: "2xs"
|
|
21586
21587
|
})
|
|
21587
|
-
])) : s.value ? N(
|
|
21588
|
-
j(
|
|
21589
|
-
"aria-label":
|
|
21588
|
+
])) : s.value ? N(p.$slots, "leading-icon", { key: 1 }, () => [
|
|
21589
|
+
j(g, {
|
|
21590
|
+
"aria-label": u.value,
|
|
21590
21591
|
class: "cpMenuItem__icon",
|
|
21591
21592
|
size: "16",
|
|
21592
21593
|
type: t.leadingIcon
|
|
@@ -21595,14 +21596,14 @@ const xS = { class: "cpMenuItem" }, SS = ["disabled"], _S = {
|
|
|
21595
21596
|
]),
|
|
21596
21597
|
_: 3
|
|
21597
21598
|
}),
|
|
21598
|
-
|
|
21599
|
+
d.value ? _e((f(), y("span", kS, [
|
|
21599
21600
|
me(D(t.label), 1)
|
|
21600
21601
|
])), [
|
|
21601
|
-
[
|
|
21602
|
-
]),
|
|
21603
|
-
l.value ? N(
|
|
21604
|
-
j(
|
|
21605
|
-
"aria-label":
|
|
21602
|
+
[$, t.tooltip]
|
|
21603
|
+
]) : k("", !0),
|
|
21604
|
+
l.value ? N(p.$slots, "trailing-icon", { key: 1 }, () => [
|
|
21605
|
+
j(g, {
|
|
21606
|
+
"aria-label": u.value,
|
|
21606
21607
|
class: "cpMenuItem__icon",
|
|
21607
21608
|
size: "16",
|
|
21608
21609
|
type: t.trailingIcon
|
|
@@ -27895,36 +27896,38 @@ const gI = {
|
|
|
27895
27896
|
label: { default: "" },
|
|
27896
27897
|
size: { default: "md" }
|
|
27897
27898
|
},
|
|
27898
|
-
|
|
27899
|
-
|
|
27900
|
-
|
|
27901
|
-
`cpSelectableButton
|
|
27899
|
+
emits: ["click"],
|
|
27900
|
+
setup(t, { emit: e }) {
|
|
27901
|
+
const n = t, o = e, r = _t(), i = w(() => !!r["leading-icon"]), a = w(() => !!n.label || !!r.default), s = w(() => !!r["trailing-icon"]), l = w(() => !n.label && !r.default), d = w(() => [
|
|
27902
|
+
`cpSelectableButton--${n.size}`,
|
|
27903
|
+
`cpSelectableButton--is${Pe(n.appearance)}`,
|
|
27902
27904
|
{
|
|
27903
|
-
"cpSelectableButton--isSelected":
|
|
27904
|
-
"cpSelectableButton--isExpanded":
|
|
27905
|
-
"cpSelectableButton--isDisabled":
|
|
27906
|
-
"cpSelectableButton--isIconOnly":
|
|
27905
|
+
"cpSelectableButton--isSelected": n.isSelected,
|
|
27906
|
+
"cpSelectableButton--isExpanded": n.isExpanded,
|
|
27907
|
+
"cpSelectableButton--isDisabled": n.disabled,
|
|
27908
|
+
"cpSelectableButton--isIconOnly": l.value
|
|
27907
27909
|
}
|
|
27908
27910
|
]);
|
|
27909
|
-
return (
|
|
27911
|
+
return (u, c) => (f(), y("button", {
|
|
27910
27912
|
"aria-disabled": t.disabled,
|
|
27911
27913
|
"aria-pressed": t.isSelected,
|
|
27912
|
-
class: K(["cpSelectableButton",
|
|
27914
|
+
class: K(["cpSelectableButton", d.value]),
|
|
27913
27915
|
disabled: t.disabled,
|
|
27914
27916
|
role: "button",
|
|
27915
|
-
type: "button"
|
|
27917
|
+
type: "button",
|
|
27918
|
+
onClick: c[0] || (c[0] = (p) => o("click", p))
|
|
27916
27919
|
}, [
|
|
27917
27920
|
v("div", rO, [
|
|
27918
|
-
|
|
27919
|
-
N(
|
|
27921
|
+
i.value ? (f(), y("span", iO, [
|
|
27922
|
+
N(u.$slots, "leading-icon")
|
|
27920
27923
|
])) : k("", !0),
|
|
27921
|
-
|
|
27922
|
-
N(
|
|
27924
|
+
a.value ? (f(), y("span", aO, [
|
|
27925
|
+
N(u.$slots, "default", {}, () => [
|
|
27923
27926
|
me(D(t.label), 1)
|
|
27924
27927
|
])
|
|
27925
27928
|
])) : k("", !0),
|
|
27926
|
-
|
|
27927
|
-
N(
|
|
27929
|
+
s.value ? (f(), y("span", sO, [
|
|
27930
|
+
N(u.$slots, "trailing-icon")
|
|
27928
27931
|
])) : k("", !0)
|
|
27929
27932
|
])
|
|
27930
27933
|
], 10, oO));
|