@ucalgary-design-system/core 1.0.2 → 1.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/CHANGELOG.md +12 -0
- package/index.js +5 -291
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ucalgary-design-system/core
|
|
2
2
|
|
|
3
|
+
## 1.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fe87dab: Updated externalized dependencies
|
|
8
|
+
|
|
9
|
+
## 1.0.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- c3fdd31: Updated dependencies and modified build
|
|
14
|
+
|
|
3
15
|
## 1.0.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/index.js
CHANGED
|
@@ -1,291 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2017 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
const P = (r) => (t, e) => {
|
|
8
|
-
e !== void 0 ? e.addInitializer(() => {
|
|
9
|
-
customElements.define(r, t);
|
|
10
|
-
}) : customElements.define(r, t);
|
|
1
|
+
import { LitElement as e, css as s } from "lit";
|
|
2
|
+
const t = class t extends e {
|
|
11
3
|
};
|
|
12
|
-
|
|
13
|
-
* @license
|
|
14
|
-
* Copyright 2019 Google LLC
|
|
15
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/
|
|
17
|
-
const l = globalThis, y = l.ShadowRoot && (l.ShadyCSS === void 0 || l.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, S = Symbol(), m = /* @__PURE__ */ new WeakMap();
|
|
18
|
-
let w = class {
|
|
19
|
-
constructor(t, e, s) {
|
|
20
|
-
if (this._$cssResult$ = !0, s !== S) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
21
|
-
this.cssText = t, this.t = e;
|
|
22
|
-
}
|
|
23
|
-
get styleSheet() {
|
|
24
|
-
let t = this.o;
|
|
25
|
-
const e = this.t;
|
|
26
|
-
if (y && t === void 0) {
|
|
27
|
-
const s = e !== void 0 && e.length === 1;
|
|
28
|
-
s && (t = m.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && m.set(e, t));
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
}
|
|
32
|
-
toString() {
|
|
33
|
-
return this.cssText;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const U = (r) => new w(typeof r == "string" ? r : r + "", void 0, S), C = (r, t) => {
|
|
37
|
-
if (y) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
38
|
-
else for (const e of t) {
|
|
39
|
-
const s = document.createElement("style"), i = l.litNonce;
|
|
40
|
-
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
41
|
-
}
|
|
42
|
-
}, E = y ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
43
|
-
let e = "";
|
|
44
|
-
for (const s of t.cssRules) e += s.cssText;
|
|
45
|
-
return U(e);
|
|
46
|
-
})(r) : r;
|
|
47
|
-
/**
|
|
48
|
-
* @license
|
|
49
|
-
* Copyright 2017 Google LLC
|
|
50
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/
|
|
52
|
-
const { is: O, defineProperty: A, getOwnPropertyDescriptor: R, getOwnPropertyNames: z, getOwnPropertySymbols: x, getPrototypeOf: M } = Object, a = globalThis, $ = a.trustedTypes, T = $ ? $.emptyScript : "", p = a.reactiveElementPolyfillSupport, c = (r, t) => r, u = { toAttribute(r, t) {
|
|
53
|
-
switch (t) {
|
|
54
|
-
case Boolean:
|
|
55
|
-
r = r ? T : null;
|
|
56
|
-
break;
|
|
57
|
-
case Object:
|
|
58
|
-
case Array:
|
|
59
|
-
r = r == null ? r : JSON.stringify(r);
|
|
60
|
-
}
|
|
61
|
-
return r;
|
|
62
|
-
}, fromAttribute(r, t) {
|
|
63
|
-
let e = r;
|
|
64
|
-
switch (t) {
|
|
65
|
-
case Boolean:
|
|
66
|
-
e = r !== null;
|
|
67
|
-
break;
|
|
68
|
-
case Number:
|
|
69
|
-
e = r === null ? null : Number(r);
|
|
70
|
-
break;
|
|
71
|
-
case Object:
|
|
72
|
-
case Array:
|
|
73
|
-
try {
|
|
74
|
-
e = JSON.parse(r);
|
|
75
|
-
} catch {
|
|
76
|
-
e = null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return e;
|
|
80
|
-
} }, b = (r, t) => !O(r, t), _ = { attribute: !0, type: String, converter: u, reflect: !1, hasChanged: b };
|
|
81
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a.litPropertyMetadata ?? (a.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
82
|
-
class h extends HTMLElement {
|
|
83
|
-
static addInitializer(t) {
|
|
84
|
-
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
85
|
-
}
|
|
86
|
-
static get observedAttributes() {
|
|
87
|
-
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
88
|
-
}
|
|
89
|
-
static createProperty(t, e = _) {
|
|
90
|
-
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
91
|
-
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
92
|
-
i !== void 0 && A(this.prototype, t, i);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
static getPropertyDescriptor(t, e, s) {
|
|
96
|
-
const { get: i, set: o } = R(this.prototype, t) ?? { get() {
|
|
97
|
-
return this[e];
|
|
98
|
-
}, set(n) {
|
|
99
|
-
this[e] = n;
|
|
100
|
-
} };
|
|
101
|
-
return { get() {
|
|
102
|
-
return i == null ? void 0 : i.call(this);
|
|
103
|
-
}, set(n) {
|
|
104
|
-
const d = i == null ? void 0 : i.call(this);
|
|
105
|
-
o.call(this, n), this.requestUpdate(t, d, s);
|
|
106
|
-
}, configurable: !0, enumerable: !0 };
|
|
107
|
-
}
|
|
108
|
-
static getPropertyOptions(t) {
|
|
109
|
-
return this.elementProperties.get(t) ?? _;
|
|
110
|
-
}
|
|
111
|
-
static _$Ei() {
|
|
112
|
-
if (this.hasOwnProperty(c("elementProperties"))) return;
|
|
113
|
-
const t = M(this);
|
|
114
|
-
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
115
|
-
}
|
|
116
|
-
static finalize() {
|
|
117
|
-
if (this.hasOwnProperty(c("finalized"))) return;
|
|
118
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(c("properties"))) {
|
|
119
|
-
const e = this.properties, s = [...z(e), ...x(e)];
|
|
120
|
-
for (const i of s) this.createProperty(i, e[i]);
|
|
121
|
-
}
|
|
122
|
-
const t = this[Symbol.metadata];
|
|
123
|
-
if (t !== null) {
|
|
124
|
-
const e = litPropertyMetadata.get(t);
|
|
125
|
-
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
|
|
126
|
-
}
|
|
127
|
-
this._$Eh = /* @__PURE__ */ new Map();
|
|
128
|
-
for (const [e, s] of this.elementProperties) {
|
|
129
|
-
const i = this._$Eu(e, s);
|
|
130
|
-
i !== void 0 && this._$Eh.set(i, e);
|
|
131
|
-
}
|
|
132
|
-
this.elementStyles = this.finalizeStyles(this.styles);
|
|
133
|
-
}
|
|
134
|
-
static finalizeStyles(t) {
|
|
135
|
-
const e = [];
|
|
136
|
-
if (Array.isArray(t)) {
|
|
137
|
-
const s = new Set(t.flat(1 / 0).reverse());
|
|
138
|
-
for (const i of s) e.unshift(E(i));
|
|
139
|
-
} else t !== void 0 && e.push(E(t));
|
|
140
|
-
return e;
|
|
141
|
-
}
|
|
142
|
-
static _$Eu(t, e) {
|
|
143
|
-
const s = e.attribute;
|
|
144
|
-
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
145
|
-
}
|
|
146
|
-
constructor() {
|
|
147
|
-
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
148
|
-
}
|
|
149
|
-
_$Ev() {
|
|
150
|
-
var t;
|
|
151
|
-
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
|
|
152
|
-
}
|
|
153
|
-
addController(t) {
|
|
154
|
-
var e;
|
|
155
|
-
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
|
156
|
-
}
|
|
157
|
-
removeController(t) {
|
|
158
|
-
var e;
|
|
159
|
-
(e = this._$EO) == null || e.delete(t);
|
|
160
|
-
}
|
|
161
|
-
_$E_() {
|
|
162
|
-
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
163
|
-
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
164
|
-
t.size > 0 && (this._$Ep = t);
|
|
165
|
-
}
|
|
166
|
-
createRenderRoot() {
|
|
167
|
-
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
168
|
-
return C(t, this.constructor.elementStyles), t;
|
|
169
|
-
}
|
|
170
|
-
connectedCallback() {
|
|
171
|
-
var t;
|
|
172
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
173
|
-
var s;
|
|
174
|
-
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
enableUpdating(t) {
|
|
178
|
-
}
|
|
179
|
-
disconnectedCallback() {
|
|
180
|
-
var t;
|
|
181
|
-
(t = this._$EO) == null || t.forEach((e) => {
|
|
182
|
-
var s;
|
|
183
|
-
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
attributeChangedCallback(t, e, s) {
|
|
187
|
-
this._$AK(t, s);
|
|
188
|
-
}
|
|
189
|
-
_$EC(t, e) {
|
|
190
|
-
var o;
|
|
191
|
-
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
192
|
-
if (i !== void 0 && s.reflect === !0) {
|
|
193
|
-
const n = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : u).toAttribute(e, s.type);
|
|
194
|
-
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
_$AK(t, e) {
|
|
198
|
-
var o;
|
|
199
|
-
const s = this.constructor, i = s._$Eh.get(t);
|
|
200
|
-
if (i !== void 0 && this._$Em !== i) {
|
|
201
|
-
const n = s.getPropertyOptions(i), d = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((o = n.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? n.converter : u;
|
|
202
|
-
this._$Em = i, this[i] = d.fromAttribute(e, n.type), this._$Em = null;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
requestUpdate(t, e, s) {
|
|
206
|
-
if (t !== void 0) {
|
|
207
|
-
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? b)(this[t], e)) return;
|
|
208
|
-
this.P(t, e, s);
|
|
209
|
-
}
|
|
210
|
-
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
211
|
-
}
|
|
212
|
-
P(t, e, s) {
|
|
213
|
-
this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
|
214
|
-
}
|
|
215
|
-
async _$ET() {
|
|
216
|
-
this.isUpdatePending = !0;
|
|
217
|
-
try {
|
|
218
|
-
await this._$ES;
|
|
219
|
-
} catch (e) {
|
|
220
|
-
Promise.reject(e);
|
|
221
|
-
}
|
|
222
|
-
const t = this.scheduleUpdate();
|
|
223
|
-
return t != null && await t, !this.isUpdatePending;
|
|
224
|
-
}
|
|
225
|
-
scheduleUpdate() {
|
|
226
|
-
return this.performUpdate();
|
|
227
|
-
}
|
|
228
|
-
performUpdate() {
|
|
229
|
-
var s;
|
|
230
|
-
if (!this.isUpdatePending) return;
|
|
231
|
-
if (!this.hasUpdated) {
|
|
232
|
-
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
233
|
-
for (const [o, n] of this._$Ep) this[o] = n;
|
|
234
|
-
this._$Ep = void 0;
|
|
235
|
-
}
|
|
236
|
-
const i = this.constructor.elementProperties;
|
|
237
|
-
if (i.size > 0) for (const [o, n] of i) n.wrapped !== !0 || this._$AL.has(o) || this[o] === void 0 || this.P(o, this[o], n);
|
|
238
|
-
}
|
|
239
|
-
let t = !1;
|
|
240
|
-
const e = this._$AL;
|
|
241
|
-
try {
|
|
242
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
|
|
243
|
-
var o;
|
|
244
|
-
return (o = i.hostUpdate) == null ? void 0 : o.call(i);
|
|
245
|
-
}), this.update(e)) : this._$EU();
|
|
246
|
-
} catch (i) {
|
|
247
|
-
throw t = !1, this._$EU(), i;
|
|
248
|
-
}
|
|
249
|
-
t && this._$AE(e);
|
|
250
|
-
}
|
|
251
|
-
willUpdate(t) {
|
|
252
|
-
}
|
|
253
|
-
_$AE(t) {
|
|
254
|
-
var e;
|
|
255
|
-
(e = this._$EO) == null || e.forEach((s) => {
|
|
256
|
-
var i;
|
|
257
|
-
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
258
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
259
|
-
}
|
|
260
|
-
_$EU() {
|
|
261
|
-
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
262
|
-
}
|
|
263
|
-
get updateComplete() {
|
|
264
|
-
return this.getUpdateComplete();
|
|
265
|
-
}
|
|
266
|
-
getUpdateComplete() {
|
|
267
|
-
return this._$ES;
|
|
268
|
-
}
|
|
269
|
-
shouldUpdate(t) {
|
|
270
|
-
return !0;
|
|
271
|
-
}
|
|
272
|
-
update(t) {
|
|
273
|
-
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
|
|
274
|
-
}
|
|
275
|
-
updated(t) {
|
|
276
|
-
}
|
|
277
|
-
firstUpdated(t) {
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
h.elementStyles = [], h.shadowRootOptions = { mode: "open" }, h[c("elementProperties")] = /* @__PURE__ */ new Map(), h[c("finalized")] = /* @__PURE__ */ new Map(), p == null || p({ ReactiveElement: h }), (a.reactiveElementVersions ?? (a.reactiveElementVersions = [])).push("2.0.4");
|
|
281
|
-
var k = Object.getOwnPropertyDescriptor, L = (r, t, e, s) => {
|
|
282
|
-
for (var i = s > 1 ? void 0 : s ? k(t, e) : t, o = r.length - 1, n; o >= 0; o--)
|
|
283
|
-
(n = r[o]) && (i = n(i) || i);
|
|
284
|
-
return i;
|
|
285
|
-
};
|
|
286
|
-
let f = class extends v {
|
|
287
|
-
};
|
|
288
|
-
f.styles = g`
|
|
4
|
+
t.styles = s`
|
|
289
5
|
|
|
290
6
|
:host {
|
|
291
7
|
font-family: var(--ucds-font-family-sans-serif);
|
|
@@ -312,9 +28,7 @@ f.styles = g`
|
|
|
312
28
|
color: inherit;
|
|
313
29
|
}
|
|
314
30
|
`;
|
|
315
|
-
|
|
316
|
-
P("base-element")
|
|
317
|
-
], f);
|
|
31
|
+
let i = t;
|
|
318
32
|
export {
|
|
319
|
-
|
|
33
|
+
i as BaseElement
|
|
320
34
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucalgary-design-system/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"require": "./index.js"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"peerDependencies": {
|
|
14
14
|
"lit": "^3.2.1"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|