@ucalgary-design-system/chip-group 1.0.2 → 1.0.3
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 +10 -0
- package/index.js +78 -73
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @ucalgary-design-system/chip-group
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c3fdd31: Updated dependencies and modified build
|
|
8
|
+
- Updated dependencies [386b04a]
|
|
9
|
+
- Updated dependencies [c3fdd31]
|
|
10
|
+
- @ucalgary-design-system/icon@1.0.3
|
|
11
|
+
- @ucalgary-design-system/core@1.0.3
|
|
12
|
+
|
|
3
13
|
## 1.0.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { unsafeCSS as C, html as
|
|
2
|
-
import { BaseElement as
|
|
1
|
+
import { unsafeCSS as C, html as O } from "lit";
|
|
2
|
+
import { BaseElement as b } from "@ucalgary-design-system/core";
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
5
5
|
* Copyright 2017 Google LLC
|
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const U = (r) => (t, e) => {
|
|
9
9
|
e !== void 0 ? e.addInitializer(() => {
|
|
10
10
|
customElements.define(r, t);
|
|
11
11
|
}) : customElements.define(r, t);
|
|
@@ -15,18 +15,18 @@ const O = (r) => (t, e) => {
|
|
|
15
15
|
* Copyright 2019 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const u = globalThis, y = u.ShadowRoot && (u.ShadyCSS === void 0 || u.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, g = Symbol(), E = /* @__PURE__ */ new WeakMap();
|
|
19
19
|
let A = class {
|
|
20
20
|
constructor(t, e, s) {
|
|
21
|
-
if (this._$cssResult$ = !0, s !==
|
|
21
|
+
if (this._$cssResult$ = !0, s !== g) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
22
22
|
this.cssText = t, this.t = e;
|
|
23
23
|
}
|
|
24
24
|
get styleSheet() {
|
|
25
25
|
let t = this.o;
|
|
26
26
|
const e = this.t;
|
|
27
|
-
if (
|
|
27
|
+
if (y && t === void 0) {
|
|
28
28
|
const s = e !== void 0 && e.length === 1;
|
|
29
|
-
s && (t =
|
|
29
|
+
s && (t = E.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && E.set(e, t));
|
|
30
30
|
}
|
|
31
31
|
return t;
|
|
32
32
|
}
|
|
@@ -34,13 +34,13 @@ let A = class {
|
|
|
34
34
|
return this.cssText;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
const R = (r) => new A(typeof r == "string" ? r : r + "", void 0,
|
|
38
|
-
if (
|
|
37
|
+
const R = (r) => new A(typeof r == "string" ? r : r + "", void 0, g), x = (r, t) => {
|
|
38
|
+
if (y) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
39
39
|
else for (const e of t) {
|
|
40
|
-
const s = document.createElement("style"), i =
|
|
40
|
+
const s = document.createElement("style"), i = u.litNonce;
|
|
41
41
|
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, $ = y ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
44
44
|
let e = "";
|
|
45
45
|
for (const s of t.cssRules) e += s.cssText;
|
|
46
46
|
return R(e);
|
|
@@ -50,10 +50,10 @@ const R = (r) => new A(typeof r == "string" ? r : r + "", void 0, b), x = (r, t)
|
|
|
50
50
|
* Copyright 2017 Google LLC
|
|
51
51
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
52
52
|
*/
|
|
53
|
-
const { is: M, defineProperty:
|
|
53
|
+
const { is: M, defineProperty: j, getOwnPropertyDescriptor: k, getOwnPropertyNames: z, getOwnPropertySymbols: T, getPrototypeOf: L } = Object, h = globalThis, S = h.trustedTypes, D = S ? S.emptyScript : "", m = h.reactiveElementPolyfillSupport, d = (r, t) => r, _ = { toAttribute(r, t) {
|
|
54
54
|
switch (t) {
|
|
55
55
|
case Boolean:
|
|
56
|
-
r = r ?
|
|
56
|
+
r = r ? D : null;
|
|
57
57
|
break;
|
|
58
58
|
case Object:
|
|
59
59
|
case Array:
|
|
@@ -78,46 +78,44 @@ const { is: M, defineProperty: k, getOwnPropertyDescriptor: z, getOwnPropertyNam
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
return e;
|
|
81
|
-
} },
|
|
82
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
83
|
-
class
|
|
81
|
+
} }, w = (r, t) => !M(r, t), v = { attribute: !0, type: String, converter: _, reflect: !1, useDefault: !1, hasChanged: w };
|
|
82
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), h.litPropertyMetadata ?? (h.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
83
|
+
class l extends HTMLElement {
|
|
84
84
|
static addInitializer(t) {
|
|
85
85
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
86
86
|
}
|
|
87
87
|
static get observedAttributes() {
|
|
88
88
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
89
89
|
}
|
|
90
|
-
static createProperty(t, e =
|
|
91
|
-
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
90
|
+
static createProperty(t, e = v) {
|
|
91
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
92
92
|
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
93
|
-
i !== void 0 &&
|
|
93
|
+
i !== void 0 && j(this.prototype, t, i);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
static getPropertyDescriptor(t, e, s) {
|
|
97
|
-
const { get: i, set:
|
|
97
|
+
const { get: i, set: o } = k(this.prototype, t) ?? { get() {
|
|
98
98
|
return this[e];
|
|
99
|
-
}, set(
|
|
100
|
-
this[e] =
|
|
99
|
+
}, set(n) {
|
|
100
|
+
this[e] = n;
|
|
101
101
|
} };
|
|
102
|
-
return { get() {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const h = i == null ? void 0 : i.call(this);
|
|
106
|
-
n.call(this, o), this.requestUpdate(t, h, s);
|
|
102
|
+
return { get: i, set(n) {
|
|
103
|
+
const a = i == null ? void 0 : i.call(this);
|
|
104
|
+
o == null || o.call(this, n), this.requestUpdate(t, a, s);
|
|
107
105
|
}, configurable: !0, enumerable: !0 };
|
|
108
106
|
}
|
|
109
107
|
static getPropertyOptions(t) {
|
|
110
|
-
return this.elementProperties.get(t) ??
|
|
108
|
+
return this.elementProperties.get(t) ?? v;
|
|
111
109
|
}
|
|
112
110
|
static _$Ei() {
|
|
113
|
-
if (this.hasOwnProperty(
|
|
111
|
+
if (this.hasOwnProperty(d("elementProperties"))) return;
|
|
114
112
|
const t = L(this);
|
|
115
113
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
116
114
|
}
|
|
117
115
|
static finalize() {
|
|
118
|
-
if (this.hasOwnProperty(
|
|
119
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
120
|
-
const e = this.properties, s = [...
|
|
116
|
+
if (this.hasOwnProperty(d("finalized"))) return;
|
|
117
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d("properties"))) {
|
|
118
|
+
const e = this.properties, s = [...z(e), ...T(e)];
|
|
121
119
|
for (const i of s) this.createProperty(i, e[i]);
|
|
122
120
|
}
|
|
123
121
|
const t = this[Symbol.metadata];
|
|
@@ -136,8 +134,8 @@ class c extends HTMLElement {
|
|
|
136
134
|
const e = [];
|
|
137
135
|
if (Array.isArray(t)) {
|
|
138
136
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
139
|
-
for (const i of s) e.unshift(
|
|
140
|
-
} else t !== void 0 && e.push(
|
|
137
|
+
for (const i of s) e.unshift($(i));
|
|
138
|
+
} else t !== void 0 && e.push($(t));
|
|
141
139
|
return e;
|
|
142
140
|
}
|
|
143
141
|
static _$Eu(t, e) {
|
|
@@ -187,33 +185,37 @@ class c extends HTMLElement {
|
|
|
187
185
|
attributeChangedCallback(t, e, s) {
|
|
188
186
|
this._$AK(t, s);
|
|
189
187
|
}
|
|
190
|
-
_$
|
|
191
|
-
var
|
|
188
|
+
_$ET(t, e) {
|
|
189
|
+
var o;
|
|
192
190
|
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
193
191
|
if (i !== void 0 && s.reflect === !0) {
|
|
194
|
-
const
|
|
195
|
-
this._$Em = t,
|
|
192
|
+
const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : _).toAttribute(e, s.type);
|
|
193
|
+
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
196
194
|
}
|
|
197
195
|
}
|
|
198
196
|
_$AK(t, e) {
|
|
199
|
-
var n;
|
|
197
|
+
var o, n;
|
|
200
198
|
const s = this.constructor, i = s._$Eh.get(t);
|
|
201
199
|
if (i !== void 0 && this._$Em !== i) {
|
|
202
|
-
const
|
|
203
|
-
this._$Em = i
|
|
200
|
+
const a = s.getPropertyOptions(i), c = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : _;
|
|
201
|
+
this._$Em = i;
|
|
202
|
+
const p = c.fromAttribute(e, a.type);
|
|
203
|
+
this[i] = p ?? ((n = this._$Ej) == null ? void 0 : n.get(i)) ?? p, this._$Em = null;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
requestUpdate(t, e, s) {
|
|
207
|
+
var i;
|
|
207
208
|
if (t !== void 0) {
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
const o = this.constructor, n = this[t];
|
|
210
|
+
if (s ?? (s = o.getPropertyOptions(t)), !((s.hasChanged ?? w)(n, e) || s.useDefault && s.reflect && n === ((i = this._$Ej) == null ? void 0 : i.get(t)) && !this.hasAttribute(o._$Eu(t, s)))) return;
|
|
211
|
+
this.C(t, e, s);
|
|
210
212
|
}
|
|
211
|
-
this.isUpdatePending === !1 && (this._$ES = this._$
|
|
213
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
212
214
|
}
|
|
213
|
-
|
|
214
|
-
this._$AL.has(t) || this._$AL.set(t, e),
|
|
215
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) {
|
|
216
|
+
s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
|
|
215
217
|
}
|
|
216
|
-
async _$
|
|
218
|
+
async _$EP() {
|
|
217
219
|
this.isUpdatePending = !0;
|
|
218
220
|
try {
|
|
219
221
|
await this._$ES;
|
|
@@ -231,21 +233,24 @@ class c extends HTMLElement {
|
|
|
231
233
|
if (!this.isUpdatePending) return;
|
|
232
234
|
if (!this.hasUpdated) {
|
|
233
235
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
234
|
-
for (const [
|
|
236
|
+
for (const [o, n] of this._$Ep) this[o] = n;
|
|
235
237
|
this._$Ep = void 0;
|
|
236
238
|
}
|
|
237
239
|
const i = this.constructor.elementProperties;
|
|
238
|
-
if (i.size > 0) for (const [
|
|
240
|
+
if (i.size > 0) for (const [o, n] of i) {
|
|
241
|
+
const { wrapped: a } = n, c = this[o];
|
|
242
|
+
a !== !0 || this._$AL.has(o) || c === void 0 || this.C(o, void 0, n, c);
|
|
243
|
+
}
|
|
239
244
|
}
|
|
240
245
|
let t = !1;
|
|
241
246
|
const e = this._$AL;
|
|
242
247
|
try {
|
|
243
248
|
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
|
|
244
|
-
var
|
|
245
|
-
return (
|
|
246
|
-
}), this.update(e)) : this._$
|
|
249
|
+
var o;
|
|
250
|
+
return (o = i.hostUpdate) == null ? void 0 : o.call(i);
|
|
251
|
+
}), this.update(e)) : this._$EM();
|
|
247
252
|
} catch (i) {
|
|
248
|
-
throw t = !1, this._$
|
|
253
|
+
throw t = !1, this._$EM(), i;
|
|
249
254
|
}
|
|
250
255
|
t && this._$AE(e);
|
|
251
256
|
}
|
|
@@ -258,7 +263,7 @@ class c extends HTMLElement {
|
|
|
258
263
|
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
259
264
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
260
265
|
}
|
|
261
|
-
_$
|
|
266
|
+
_$EM() {
|
|
262
267
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
263
268
|
}
|
|
264
269
|
get updateComplete() {
|
|
@@ -271,20 +276,20 @@ class c extends HTMLElement {
|
|
|
271
276
|
return !0;
|
|
272
277
|
}
|
|
273
278
|
update(t) {
|
|
274
|
-
this._$
|
|
279
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
|
|
275
280
|
}
|
|
276
281
|
updated(t) {
|
|
277
282
|
}
|
|
278
283
|
firstUpdated(t) {
|
|
279
284
|
}
|
|
280
285
|
}
|
|
281
|
-
|
|
286
|
+
l.elementStyles = [], l.shadowRootOptions = { mode: "open" }, l[d("elementProperties")] = /* @__PURE__ */ new Map(), l[d("finalized")] = /* @__PURE__ */ new Map(), m == null || m({ ReactiveElement: l }), (h.reactiveElementVersions ?? (h.reactiveElementVersions = [])).push("2.1.1");
|
|
282
287
|
/**
|
|
283
288
|
* @license
|
|
284
289
|
* Copyright 2017 Google LLC
|
|
285
290
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
286
291
|
*/
|
|
287
|
-
const
|
|
292
|
+
const N = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
|
|
288
293
|
/**
|
|
289
294
|
* @license
|
|
290
295
|
* Copyright 2021 Google LLC
|
|
@@ -292,21 +297,21 @@ const D = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate
|
|
|
292
297
|
*/
|
|
293
298
|
function q(r) {
|
|
294
299
|
return (t, e) => {
|
|
295
|
-
const { slot: s, selector: i } = {},
|
|
296
|
-
return
|
|
297
|
-
var
|
|
298
|
-
const
|
|
299
|
-
return i === void 0 ?
|
|
300
|
+
const { slot: s, selector: i } = {}, o = "slot" + (s ? `[name=${s}]` : ":not([name])");
|
|
301
|
+
return N(t, e, { get() {
|
|
302
|
+
var c;
|
|
303
|
+
const n = (c = this.renderRoot) == null ? void 0 : c.querySelector(o), a = (n == null ? void 0 : n.assignedElements(r)) ?? [];
|
|
304
|
+
return i === void 0 ? a : a.filter((p) => p.matches(i));
|
|
300
305
|
} });
|
|
301
306
|
};
|
|
302
307
|
}
|
|
303
308
|
const B = ":host{display:block}.chip-group{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:16px}";
|
|
304
309
|
var H = Object.defineProperty, I = Object.getOwnPropertyDescriptor, P = (r, t, e, s) => {
|
|
305
|
-
for (var i = s > 1 ? void 0 : s ? I(t, e) : t,
|
|
306
|
-
(
|
|
310
|
+
for (var i = s > 1 ? void 0 : s ? I(t, e) : t, o = r.length - 1, n; o >= 0; o--)
|
|
311
|
+
(n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
|
|
307
312
|
return s && i && H(t, e, i), i;
|
|
308
313
|
};
|
|
309
|
-
let
|
|
314
|
+
let f = class extends b {
|
|
310
315
|
// Focus the next sibling of the Chip being removed.
|
|
311
316
|
_focusNextSiblingOf(r) {
|
|
312
317
|
const t = this._defaultSlotNodes, e = t.indexOf(r);
|
|
@@ -327,23 +332,23 @@ let p = class extends v {
|
|
|
327
332
|
super.disconnectedCallback && super.disconnectedCallback(), this.removeEventListener("chipRemoved", this._onChildRemove);
|
|
328
333
|
}
|
|
329
334
|
render() {
|
|
330
|
-
return
|
|
335
|
+
return O`
|
|
331
336
|
<div class="chip-group">
|
|
332
337
|
<slot></slot>
|
|
333
338
|
</div>
|
|
334
339
|
`;
|
|
335
340
|
}
|
|
336
341
|
};
|
|
337
|
-
|
|
338
|
-
|
|
342
|
+
f.styles = [
|
|
343
|
+
b.styles,
|
|
339
344
|
C(B)
|
|
340
345
|
];
|
|
341
346
|
P([
|
|
342
347
|
q()
|
|
343
|
-
],
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
],
|
|
348
|
+
], f.prototype, "_defaultSlotNodes", 2);
|
|
349
|
+
f = P([
|
|
350
|
+
U("ucds-chip-group")
|
|
351
|
+
], f);
|
|
347
352
|
export {
|
|
348
|
-
|
|
353
|
+
f as ChipGroup
|
|
349
354
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucalgary-design-system/chip-group",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"require": "./index.js"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
-
"
|
|
14
|
-
"@ucalgary-design-system/core": "^1.0.
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"@ucalgary-design-system/core": "^1.0.3",
|
|
15
15
|
"@ucalgary-design-system/tokens": "^1.0.3",
|
|
16
|
+
"@ucalgary-design-system/icon": "^1.0.3",
|
|
16
17
|
"lit": "^3.2.1"
|
|
17
18
|
},
|
|
18
19
|
"description": "A web component for ChipGroup",
|