polaris-vue-elements 0.4.0 → 0.4.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/CHANGELOG.md +13 -1
- package/README.md +1 -5
- package/dist/index.js +36 -33
- package/dist/index.js.map +1 -1
- package/dist/runtime/createWrapper.d.ts +2 -1
- package/dist/runtime/createWrapper.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,17 @@ major your app loads (`polaris-1.js`, `polaris-2.js`, …).
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [0.4.1] - 2026-10-29
|
|
15
|
+
|
|
16
|
+
Still generated from `@shopify/polaris-types` 2.0.0.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- A boolean prop written as a bare attribute (`<SChip removable />`, `<SButton disabled />`) is
|
|
21
|
+
now on. Vue passes such an attribute to a prop declared without a Boolean type as `''`, which
|
|
22
|
+
the wrapper treated as falsy, so the attribute never reached the element and only
|
|
23
|
+
`:removable="true"` worked.
|
|
24
|
+
|
|
14
25
|
## [0.4.0] - 2026-10-27
|
|
15
26
|
|
|
16
27
|
Still generated from `@shopify/polaris-types` 2.0.0.
|
|
@@ -96,7 +107,8 @@ Initial release: typed Vue 3 wrappers for the 59 Shopify Polaris web components
|
|
|
96
107
|
`showOverlay()` / `hideOverlay()` / `toggleOverlay()`).
|
|
97
108
|
- ESM build with bundled type declarations; `vue` ^3.5 as a peer dependency.
|
|
98
109
|
|
|
99
|
-
[Unreleased]: https://github.com/HQCuong/polaris-vue/compare/v0.4.
|
|
110
|
+
[Unreleased]: https://github.com/HQCuong/polaris-vue/compare/v0.4.1...HEAD
|
|
111
|
+
[0.4.1]: https://github.com/HQCuong/polaris-vue/compare/v0.4.0...v0.4.1
|
|
100
112
|
[0.4.0]: https://github.com/HQCuong/polaris-vue/compare/v0.3.0...v0.4.0
|
|
101
113
|
[0.3.0]: https://github.com/HQCuong/polaris-vue/compare/v0.2.0...v0.3.0
|
|
102
114
|
[0.2.0]: https://github.com/HQCuong/polaris-vue/compare/v0.1.0...v0.2.0
|
package/README.md
CHANGED
|
@@ -101,11 +101,7 @@ npm run build:lib # build the publishable package into dist/
|
|
|
101
101
|
|
|
102
102
|
## Contributing
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
2. **New form component needs v-model?** Add one line to `src/lib/overrides.ts` (the `overrides.spec.ts` drift guard will point at exactly what's missing).
|
|
106
|
-
3. **Curated docs example?** Add `docs/examples/<tag>.md` (complex live demos go in `docs/examples/demos/*.vue` — SFCs are immune to markdown-it mangling); the docs generator inlines it automatically.
|
|
107
|
-
4. Before opening a PR, make sure the full suite passes: `npm run generate && npm run docs:generate && npx vitest run && npm run type-check && npx oxlint . && npx eslint .` — CI runs the same checks plus a codegen-freshness diff.
|
|
108
|
-
5. Behavioral claims about Polaris components (slot rules, rendering quirks) should be verified against the real CDN runtime in a browser, not just jsdom — see `docs/guide/quirks.md` for previously verified findings.
|
|
104
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup, ground rules and the pre-PR checklist.
|
|
109
105
|
|
|
110
106
|
## Releasing
|
|
111
107
|
|
package/dist/index.js
CHANGED
|
@@ -71,62 +71,65 @@ var r = {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
// src/lib/runtime/createWrapper.ts
|
|
74
|
-
function i(e
|
|
74
|
+
function i(e) {
|
|
75
|
+
return e === "" || !!e;
|
|
76
|
+
}
|
|
77
|
+
function a(e, t) {
|
|
75
78
|
let n = e;
|
|
76
79
|
for (let [e, r] of t) n[e] = r;
|
|
77
80
|
}
|
|
78
|
-
function
|
|
79
|
-
let
|
|
80
|
-
for (let e of
|
|
81
|
+
function o(o) {
|
|
82
|
+
let s = r[o.tagName], c = {};
|
|
83
|
+
for (let e of o.props) c[e.name] = {
|
|
81
84
|
type: null,
|
|
82
85
|
default: void 0
|
|
83
86
|
};
|
|
84
|
-
return
|
|
87
|
+
return s && (c.modelValue = {
|
|
85
88
|
type: null,
|
|
86
89
|
default: void 0
|
|
87
90
|
}), t({
|
|
88
|
-
name:
|
|
91
|
+
name: o.tagName,
|
|
89
92
|
inheritAttrs: !1,
|
|
90
|
-
props:
|
|
91
|
-
emits:
|
|
92
|
-
setup(t, { attrs: r, slots:
|
|
93
|
+
props: c,
|
|
94
|
+
emits: s ? ["update:modelValue"] : [],
|
|
95
|
+
setup(t, { attrs: r, slots: c, emit: l }) {
|
|
93
96
|
return () => {
|
|
94
|
-
let
|
|
95
|
-
for (let e of
|
|
96
|
-
let t =
|
|
97
|
-
t !== void 0 && (e.attribute ? e.type === "boolean" ? t && (
|
|
97
|
+
let u = { ...r }, d = [], f = t;
|
|
98
|
+
for (let e of o.props) {
|
|
99
|
+
let t = f[e.name];
|
|
100
|
+
t !== void 0 && (e.attribute ? e.type === "boolean" ? i(t) && (u[e.attribute] = "") : u[e.attribute] = t : d.push([e.name, t]));
|
|
98
101
|
}
|
|
99
|
-
if (
|
|
100
|
-
let e =
|
|
102
|
+
if (s) {
|
|
103
|
+
let e = f.modelValue;
|
|
101
104
|
if (e !== void 0) {
|
|
102
|
-
let t =
|
|
103
|
-
t?.attribute ? t.type === "boolean" ? e && (
|
|
105
|
+
let t = o.props.find((e) => e.name === s.prop);
|
|
106
|
+
t?.attribute ? t.type === "boolean" ? i(e) && (u[t.attribute] = "") : u[t.attribute] = e : d.push([s.prop, e]);
|
|
104
107
|
}
|
|
105
|
-
let t = `on${
|
|
106
|
-
|
|
108
|
+
let t = `on${s.event.charAt(0).toUpperCase()}${s.event.slice(1)}`, n = u[t];
|
|
109
|
+
u[t] = (e) => {
|
|
107
110
|
let t = e.target;
|
|
108
|
-
|
|
111
|
+
l("update:modelValue", t[s.prop]), n?.(e);
|
|
109
112
|
};
|
|
110
113
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
114
|
+
d.length > 0 && (u.onVnodeMounted = (e) => {
|
|
115
|
+
a(e.el, d);
|
|
116
|
+
}, u.onVnodeUpdated = (e) => {
|
|
117
|
+
a(e.el, d);
|
|
115
118
|
});
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
for (let t of Object.keys(
|
|
119
|
+
let p = [];
|
|
120
|
+
c.default && p.push(...c.default());
|
|
121
|
+
for (let t of Object.keys(c)) {
|
|
119
122
|
if (t === "default") continue;
|
|
120
|
-
let n =
|
|
121
|
-
if (n) for (let r of n())
|
|
123
|
+
let n = c[t];
|
|
124
|
+
if (n) for (let r of n()) p.push(e(r, { slot: t }));
|
|
122
125
|
}
|
|
123
|
-
return n(
|
|
126
|
+
return n(o.tagName, u, p);
|
|
124
127
|
};
|
|
125
128
|
}
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
131
|
// src/lib/generated/metadata.ts
|
|
129
|
-
var
|
|
132
|
+
var s = {
|
|
130
133
|
SAvatar: {
|
|
131
134
|
tagName: "s-avatar",
|
|
132
135
|
props: [
|
|
@@ -3559,7 +3562,7 @@ var o = {
|
|
|
3559
3562
|
],
|
|
3560
3563
|
slots: ["details", "error"]
|
|
3561
3564
|
}
|
|
3562
|
-
},
|
|
3563
|
-
export {
|
|
3565
|
+
}, c = o(s.SAvatar), l = o(s.SBadge), u = o(s.SBanner), d = o(s.SBox), f = o(s.SButton), p = o(s.SButtonGroup), ee = o(s.SCheckbox), m = o(s.SChip), h = o(s.SChoice), g = o(s.SChoiceList), _ = o(s.SClickable), v = o(s.SClickableChip), y = o(s.SColorField), b = o(s.SColorPicker), x = o(s.SDateField), S = o(s.SDatePicker), C = o(s.SDivider), w = o(s.SDropZone), T = o(s.SEmailField), E = o(s.SEmptyState), D = o(s.SGrid), O = o(s.SGridItem), k = o(s.SHeading), A = o(s.SIcon), j = o(s.SImage), M = o(s.SLink), N = o(s.SListItem), P = o(s.SMenu), F = o(s.SModal), I = o(s.SMoneyField), L = o(s.SNumber), R = o(s.SNumberField), z = o(s.SOption), B = o(s.SOptionGroup), V = o(s.SOrderedList), te = o(s.SPage), H = o(s.SParagraph), U = o(s.SPasswordField), W = o(s.SPopover), G = o(s.SPressButton), K = o(s.SProgress), q = o(s.SQueryContainer), J = o(s.SScrollBox), Y = o(s.SSearchField), X = o(s.SSection), Z = o(s.SSelect), Q = o(s.SSpinner), ne = o(s.SStack), re = o(s.SSwitch), ie = o(s.STable), ae = o(s.STableBody), oe = o(s.STableCell), $ = o(s.STableHeader), se = o(s.STableHeaderRow), ce = o(s.STableRow), le = o(s.SText), ue = o(s.STextArea), de = o(s.STextField), fe = o(s.SThumbnail), pe = o(s.STooltip), me = o(s.SUnorderedList), he = o(s.SUrlField), ge = /* @__PURE__ */ "s-avatar.s-badge.s-banner.s-box.s-button.s-button-group.s-checkbox.s-chip.s-choice.s-choice-list.s-clickable.s-clickable-chip.s-color-field.s-color-picker.s-date-field.s-date-picker.s-divider.s-drop-zone.s-email-field.s-empty-state.s-grid.s-grid-item.s-heading.s-icon.s-image.s-link.s-list-item.s-menu.s-modal.s-money-field.s-number.s-number-field.s-option.s-option-group.s-ordered-list.s-page.s-paragraph.s-password-field.s-popover.s-press-button.s-progress.s-query-container.s-scroll-box.s-search-field.s-section.s-select.s-spinner.s-stack.s-switch.s-table.s-table-body.s-table-cell.s-table-header.s-table-header-row.s-table-row.s-text.s-text-area.s-text-field.s-thumbnail.s-tooltip.s-unordered-list.s-url-field".split(".");
|
|
3566
|
+
export { c as SAvatar, l as SBadge, u as SBanner, d as SBox, f as SButton, p as SButtonGroup, ee as SCheckbox, m as SChip, h as SChoice, g as SChoiceList, _ as SClickable, v as SClickableChip, y as SColorField, b as SColorPicker, x as SDateField, S as SDatePicker, C as SDivider, w as SDropZone, T as SEmailField, E as SEmptyState, D as SGrid, O as SGridItem, k as SHeading, A as SIcon, j as SImage, M as SLink, N as SListItem, P as SMenu, F as SModal, I as SMoneyField, L as SNumber, R as SNumberField, z as SOption, B as SOptionGroup, V as SOrderedList, te as SPage, H as SParagraph, U as SPasswordField, W as SPopover, G as SPressButton, K as SProgress, q as SQueryContainer, J as SScrollBox, Y as SSearchField, X as SSection, Z as SSelect, Q as SSpinner, ne as SStack, re as SSwitch, ie as STable, ae as STableBody, oe as STableCell, $ as STableHeader, se as STableHeaderRow, ce as STableRow, le as SText, ue as STextArea, de as STextField, fe as SThumbnail, pe as STooltip, me as SUnorderedList, he as SUrlField, ge as componentTags, o as createWrapper };
|
|
3564
3567
|
|
|
3565
3568
|
//# sourceMappingURL=index.js.map
|