@maggioli-design-system/mds-list 2.0.0 → 3.0.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/dist/cjs/{index-41114fc6.js → index-3c3cf8ce.js} +164 -121
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mds-list.cjs.entry.js +2 -2
- package/dist/cjs/mds-list.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/common/aria.js +19 -0
- package/dist/collection/components/mds-list/mds-list.css +10 -0
- package/dist/collection/components/mds-list/mds-list.js +12 -9
- package/dist/collection/components/mds-list/test/mds-list.stories.js +4 -14
- package/dist/collection/dictionary/floating-ui.js +19 -0
- package/dist/collection/dictionary/typography.js +21 -5
- package/dist/collection/types/floating-ui.js +1 -0
- package/dist/components/index.d.ts +2 -6
- package/dist/components/index.js +1 -0
- package/dist/components/mds-list.js +1 -1
- package/dist/esm/{index-6230983e.js → index-0497c2b2.js} +164 -121
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mds-list.entry.js +2 -2
- package/dist/esm/mds-list.js +2 -2
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm-es5/index-0497c2b2.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-list.entry.js +1 -1
- package/dist/esm-es5/mds-list.js +1 -1
- package/dist/mds-list/mds-list.esm.js +1 -1
- package/dist/mds-list/mds-list.js +2 -1
- package/dist/mds-list/{p-c0afbcd5.system.js → p-10206fc6.system.js} +1 -1
- package/dist/mds-list/p-16684a5a.system.entry.js +1 -0
- package/dist/mds-list/p-1cb99ed5.js +2 -0
- package/dist/mds-list/p-ab75225f.system.js +2 -0
- package/dist/mds-list/p-bcc83db0.entry.js +1 -0
- package/dist/stats.json +43 -35
- package/dist/types/common/aria.d.ts +4 -0
- package/dist/types/components/mds-list/test/mds-list.stories.d.ts +14 -0
- package/dist/types/dictionary/floating-ui.d.ts +3 -0
- package/dist/types/dictionary/typography.d.ts +6 -3
- package/dist/types/stencil-public-runtime.d.ts +20 -4
- package/dist/types/types/floating-ui.d.ts +2 -0
- package/dist/types/types/typography.d.ts +7 -4
- package/loader/package.json +1 -0
- package/package.json +3 -3
- package/src/common/aria.ts +27 -0
- package/src/components/mds-list/.gitlab-ci.yml +25 -0
- package/src/components/mds-list/test/{mds-list.stories.js → mds-list.stories.tsx} +1 -3
- package/src/dictionary/floating-ui.ts +25 -0
- package/src/dictionary/typography.ts +28 -6
- package/src/fixtures/icons.json +13 -3
- package/src/types/floating-ui.ts +17 -0
- package/src/types/typography.ts +20 -4
- package/www/build/mds-list.esm.js +1 -1
- package/www/build/mds-list.js +2 -1
- package/www/build/{p-c0afbcd5.system.js → p-10206fc6.system.js} +1 -1
- package/www/build/p-16684a5a.system.entry.js +1 -0
- package/www/build/p-1cb99ed5.js +2 -0
- package/www/build/p-ab75225f.system.js +2 -0
- package/www/build/p-bcc83db0.entry.js +1 -0
- package/dist/esm-es5/index-6230983e.js +0 -1
- package/dist/mds-list/p-003c08b3.system.entry.js +0 -1
- package/dist/mds-list/p-5b7327b3.js +0 -1
- package/dist/mds-list/p-9fd9e0ef.system.js +0 -1
- package/dist/mds-list/p-e8a6f651.entry.js +0 -1
- package/www/build/p-003c08b3.system.entry.js +0 -1
- package/www/build/p-5b7327b3.js +0 -1
- package/www/build/p-9fd9e0ef.system.js +0 -1
- package/www/build/p-e8a6f651.entry.js +0 -1
|
@@ -22,31 +22,17 @@ function _interopNamespace(e) {
|
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'mds-list';
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
27
|
+
* Simon Friis Vindum (@paldepind)
|
|
28
|
+
* Licensed under the MIT License
|
|
29
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
30
|
+
*
|
|
31
|
+
* Modified for Stencil's renderer and slot projection
|
|
32
|
+
*/
|
|
25
33
|
let scopeId;
|
|
26
34
|
let hostTagName;
|
|
27
35
|
let queuePending = false;
|
|
28
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
29
|
-
const doc = win.document || { head: {} };
|
|
30
|
-
const plt = {
|
|
31
|
-
$flags$: 0,
|
|
32
|
-
$resourcesUrl$: '',
|
|
33
|
-
jmp: (h) => h(),
|
|
34
|
-
raf: (h) => requestAnimationFrame(h),
|
|
35
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
36
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
37
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
38
|
-
};
|
|
39
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
40
|
-
const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
41
|
-
try {
|
|
42
|
-
new CSSStyleSheet();
|
|
43
|
-
return typeof new CSSStyleSheet().replace === 'function';
|
|
44
|
-
}
|
|
45
|
-
catch (e) { }
|
|
46
|
-
return false;
|
|
47
|
-
})()
|
|
48
|
-
;
|
|
49
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
50
36
|
const createTime = (fnName, tagName = '') => {
|
|
51
37
|
{
|
|
52
38
|
return () => {
|
|
@@ -61,71 +47,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
61
47
|
};
|
|
62
48
|
}
|
|
63
49
|
};
|
|
64
|
-
const
|
|
65
|
-
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
66
|
-
let style = styles.get(scopeId);
|
|
67
|
-
if (supportsConstructibleStylesheets && allowCS) {
|
|
68
|
-
style = (style || new CSSStyleSheet());
|
|
69
|
-
style.replace(cssText);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
style = cssText;
|
|
73
|
-
}
|
|
74
|
-
styles.set(scopeId, style);
|
|
75
|
-
};
|
|
76
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
77
|
-
let scopeId = getScopeId(cmpMeta);
|
|
78
|
-
let style = styles.get(scopeId);
|
|
79
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
80
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
81
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
82
|
-
if (style) {
|
|
83
|
-
if (typeof style === 'string') {
|
|
84
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
85
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
86
|
-
let styleElm;
|
|
87
|
-
if (!appliedStyles) {
|
|
88
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
89
|
-
}
|
|
90
|
-
if (!appliedStyles.has(scopeId)) {
|
|
91
|
-
{
|
|
92
|
-
{
|
|
93
|
-
styleElm = doc.createElement('style');
|
|
94
|
-
styleElm.innerHTML = style;
|
|
95
|
-
}
|
|
96
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
97
|
-
}
|
|
98
|
-
if (appliedStyles) {
|
|
99
|
-
appliedStyles.add(scopeId);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
104
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return scopeId;
|
|
108
|
-
};
|
|
109
|
-
const attachStyles = (hostRef) => {
|
|
110
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
111
|
-
const elm = hostRef.$hostElement$;
|
|
112
|
-
const flags = cmpMeta.$flags$;
|
|
113
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
114
|
-
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
115
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
116
|
-
// only required when we're NOT using native shadow dom (slot)
|
|
117
|
-
// or this browser doesn't support native shadow dom
|
|
118
|
-
// and this host element was NOT created with SSR
|
|
119
|
-
// let's pick out the inner content for slot projection
|
|
120
|
-
// create a node to represent where the original
|
|
121
|
-
// content was first placed, which is useful later on
|
|
122
|
-
// DOM WRITE!!
|
|
123
|
-
elm['s-sc'] = scopeId;
|
|
124
|
-
elm.classList.add(scopeId + '-h');
|
|
125
|
-
}
|
|
126
|
-
endAttachStyles();
|
|
127
|
-
};
|
|
128
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
50
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
129
51
|
const isDef = (v) => v != null;
|
|
130
52
|
const isComplexType = (o) => {
|
|
131
53
|
// https://jsperf.com/typeof-fn-object/5
|
|
@@ -147,7 +69,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
147
69
|
let child = null;
|
|
148
70
|
let simple = false;
|
|
149
71
|
let lastSimple = false;
|
|
150
|
-
|
|
72
|
+
const vNodeChildren = [];
|
|
151
73
|
const walk = (c) => {
|
|
152
74
|
for (let i = 0; i < c.length; i++) {
|
|
153
75
|
child = c[i];
|
|
@@ -190,9 +112,101 @@ const newVNode = (tag, text) => {
|
|
|
190
112
|
};
|
|
191
113
|
const Host = {};
|
|
192
114
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
115
|
+
/**
|
|
116
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
117
|
+
* @param elm the target of the Event
|
|
118
|
+
* @param name the name to give the custom Event
|
|
119
|
+
* @param opts options for configuring a custom Event
|
|
120
|
+
* @returns the custom Event
|
|
121
|
+
*/
|
|
122
|
+
const emitEvent = (elm, name, opts) => {
|
|
123
|
+
const ev = plt.ce(name, opts);
|
|
124
|
+
elm.dispatchEvent(ev);
|
|
125
|
+
return ev;
|
|
126
|
+
};
|
|
127
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
128
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
129
|
+
let style = styles.get(scopeId);
|
|
130
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
131
|
+
style = (style || new CSSStyleSheet());
|
|
132
|
+
if (typeof style === 'string') {
|
|
133
|
+
style = cssText;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
style.replaceSync(cssText);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
style = cssText;
|
|
141
|
+
}
|
|
142
|
+
styles.set(scopeId, style);
|
|
143
|
+
};
|
|
144
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
145
|
+
let scopeId = getScopeId(cmpMeta);
|
|
146
|
+
const style = styles.get(scopeId);
|
|
147
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
148
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
149
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
150
|
+
if (style) {
|
|
151
|
+
if (typeof style === 'string') {
|
|
152
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
153
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
154
|
+
let styleElm;
|
|
155
|
+
if (!appliedStyles) {
|
|
156
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
157
|
+
}
|
|
158
|
+
if (!appliedStyles.has(scopeId)) {
|
|
159
|
+
{
|
|
160
|
+
{
|
|
161
|
+
styleElm = doc.createElement('style');
|
|
162
|
+
styleElm.innerHTML = style;
|
|
163
|
+
}
|
|
164
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
165
|
+
}
|
|
166
|
+
if (appliedStyles) {
|
|
167
|
+
appliedStyles.add(scopeId);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
172
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return scopeId;
|
|
176
|
+
};
|
|
177
|
+
const attachStyles = (hostRef) => {
|
|
178
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
179
|
+
const elm = hostRef.$hostElement$;
|
|
180
|
+
const flags = cmpMeta.$flags$;
|
|
181
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
182
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
183
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
184
|
+
// only required when we're NOT using native shadow dom (slot)
|
|
185
|
+
// or this browser doesn't support native shadow dom
|
|
186
|
+
// and this host element was NOT created with SSR
|
|
187
|
+
// let's pick out the inner content for slot projection
|
|
188
|
+
// create a node to represent where the original
|
|
189
|
+
// content was first placed, which is useful later on
|
|
190
|
+
// DOM WRITE!!
|
|
191
|
+
elm['s-sc'] = scopeId;
|
|
192
|
+
elm.classList.add(scopeId + '-h');
|
|
193
|
+
}
|
|
194
|
+
endAttachStyles();
|
|
195
|
+
};
|
|
196
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
197
|
+
/**
|
|
198
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
199
|
+
*
|
|
200
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
201
|
+
* @param newParentVNode the parent VNode from the current render
|
|
202
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
203
|
+
* children, for which we will create a new DOM node
|
|
204
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
205
|
+
* @returns the newly created node
|
|
206
|
+
*/
|
|
193
207
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
194
208
|
// tslint:disable-next-line: prefer-const
|
|
195
|
-
|
|
209
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
196
210
|
let i = 0;
|
|
197
211
|
let elm;
|
|
198
212
|
let childNode;
|
|
@@ -234,6 +248,14 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
234
248
|
}
|
|
235
249
|
}
|
|
236
250
|
};
|
|
251
|
+
/**
|
|
252
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
253
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
254
|
+
* children of the two nodes (if any).
|
|
255
|
+
*
|
|
256
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
257
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
258
|
+
*/
|
|
237
259
|
const patch = (oldVNode, newVNode) => {
|
|
238
260
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
239
261
|
const newChildren = newVNode.$children$;
|
|
@@ -251,7 +273,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
251
273
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
252
274
|
hostTagName = hostElm.tagName;
|
|
253
275
|
rootVnode.$tag$ = null;
|
|
254
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
276
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
255
277
|
hostRef.$vnode$ = rootVnode;
|
|
256
278
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
257
279
|
{
|
|
@@ -260,26 +282,14 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
260
282
|
// synchronous patch
|
|
261
283
|
patch(oldVNode, rootVnode);
|
|
262
284
|
};
|
|
263
|
-
/**
|
|
264
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
265
|
-
* @param elm the target of the Event
|
|
266
|
-
* @param name the name to give the custom Event
|
|
267
|
-
* @param opts options for configuring a custom Event
|
|
268
|
-
* @returns the custom Event
|
|
269
|
-
*/
|
|
270
|
-
const emitEvent = (elm, name, opts) => {
|
|
271
|
-
const ev = plt.ce(name, opts);
|
|
272
|
-
elm.dispatchEvent(ev);
|
|
273
|
-
return ev;
|
|
274
|
-
};
|
|
275
285
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
276
286
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
277
287
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
278
288
|
}
|
|
279
289
|
};
|
|
280
290
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
281
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
282
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
291
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
292
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
283
293
|
return;
|
|
284
294
|
}
|
|
285
295
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -326,7 +336,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
326
336
|
}
|
|
327
337
|
else {
|
|
328
338
|
Promise.all(childrenPromises).then(postUpdate);
|
|
329
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
339
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
330
340
|
childrenPromises.length = 0;
|
|
331
341
|
}
|
|
332
342
|
}
|
|
@@ -335,7 +345,7 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
335
345
|
try {
|
|
336
346
|
instance = instance.render() ;
|
|
337
347
|
{
|
|
338
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
348
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
339
349
|
}
|
|
340
350
|
{
|
|
341
351
|
{
|
|
@@ -358,8 +368,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
358
368
|
const elm = hostRef.$hostElement$;
|
|
359
369
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
360
370
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
361
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
362
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
371
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
372
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
363
373
|
{
|
|
364
374
|
// DOM WRITE!
|
|
365
375
|
addHydratedFlag(elm);
|
|
@@ -382,10 +392,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
382
392
|
hostRef.$onRenderResolve$();
|
|
383
393
|
hostRef.$onRenderResolve$ = undefined;
|
|
384
394
|
}
|
|
385
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
395
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
386
396
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
387
397
|
}
|
|
388
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
398
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
389
399
|
}
|
|
390
400
|
// ( •_•)
|
|
391
401
|
// ( •_•)>⌐■-■
|
|
@@ -404,15 +414,25 @@ const then = (promise, thenFn) => {
|
|
|
404
414
|
};
|
|
405
415
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
406
416
|
;
|
|
417
|
+
/**
|
|
418
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
419
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
420
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
421
|
+
*
|
|
422
|
+
* @param Cstr the constructor for a component that we need to process
|
|
423
|
+
* @param cmpMeta metadata collected previously about the component
|
|
424
|
+
* @param flags a number used to store a series of bit flags
|
|
425
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
426
|
+
*/
|
|
407
427
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
408
428
|
return Cstr;
|
|
409
429
|
};
|
|
410
430
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
411
431
|
// initializeComponent
|
|
412
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
432
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
413
433
|
{
|
|
414
434
|
// we haven't initialized this element yet
|
|
415
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
435
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
416
436
|
// lazy loaded components
|
|
417
437
|
// request the component's implementation to be
|
|
418
438
|
// wired up with the host element
|
|
@@ -442,7 +462,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
442
462
|
const scopeId = getScopeId(cmpMeta);
|
|
443
463
|
if (!styles.has(scopeId)) {
|
|
444
464
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
445
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
465
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
446
466
|
endRegisterStyles();
|
|
447
467
|
}
|
|
448
468
|
}
|
|
@@ -464,13 +484,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
464
484
|
}
|
|
465
485
|
};
|
|
466
486
|
const connectedCallback = (elm) => {
|
|
467
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
487
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
468
488
|
const hostRef = getHostRef(elm);
|
|
469
489
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
470
490
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
471
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
491
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
472
492
|
// first time this component has connected
|
|
473
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
493
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
474
494
|
{
|
|
475
495
|
// find the first ancestor component (if there is one) and register
|
|
476
496
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -494,7 +514,7 @@ const connectedCallback = (elm) => {
|
|
|
494
514
|
}
|
|
495
515
|
};
|
|
496
516
|
const disconnectedCallback = (elm) => {
|
|
497
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
517
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
498
518
|
getHostRef(elm);
|
|
499
519
|
}
|
|
500
520
|
};
|
|
@@ -527,7 +547,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
527
547
|
super(self);
|
|
528
548
|
self = this;
|
|
529
549
|
registerHost(self, cmpMeta);
|
|
530
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
550
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
531
551
|
// this component is using shadow dom
|
|
532
552
|
// and this browser supports shadow dom
|
|
533
553
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -584,7 +604,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
584
604
|
// Fallback appLoad event
|
|
585
605
|
endBootstrap();
|
|
586
606
|
};
|
|
587
|
-
const hostRefs = new WeakMap();
|
|
607
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
588
608
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
589
609
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
590
610
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -611,7 +631,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
611
631
|
if (module) {
|
|
612
632
|
return module[exportName];
|
|
613
633
|
}
|
|
634
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
614
635
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
636
|
+
/* @vite-ignore */
|
|
615
637
|
/* webpackInclude: /\.entry\.js$/ */
|
|
616
638
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
617
639
|
/* webpackMode: "lazy" */
|
|
@@ -622,14 +644,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
622
644
|
return importedModule[exportName];
|
|
623
645
|
}, consoleError);
|
|
624
646
|
};
|
|
625
|
-
const styles = new Map();
|
|
647
|
+
const styles = /*@__PURE__*/ new Map();
|
|
648
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
649
|
+
const doc = win.document || { head: {} };
|
|
650
|
+
const plt = {
|
|
651
|
+
$flags$: 0,
|
|
652
|
+
$resourcesUrl$: '',
|
|
653
|
+
jmp: (h) => h(),
|
|
654
|
+
raf: (h) => requestAnimationFrame(h),
|
|
655
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
656
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
657
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
658
|
+
};
|
|
659
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
660
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
661
|
+
try {
|
|
662
|
+
new CSSStyleSheet();
|
|
663
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
664
|
+
}
|
|
665
|
+
catch (e) { }
|
|
666
|
+
return false;
|
|
667
|
+
})()
|
|
668
|
+
;
|
|
626
669
|
const queueDomReads = [];
|
|
627
670
|
const queueDomWrites = [];
|
|
628
671
|
const queueTask = (queue, write) => (cb) => {
|
|
629
672
|
queue.push(cb);
|
|
630
673
|
if (!queuePending) {
|
|
631
674
|
queuePending = true;
|
|
632
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
675
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
633
676
|
nextTick(flush);
|
|
634
677
|
}
|
|
635
678
|
else {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3c3cf8ce.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-3c3cf8ce.js');
|
|
6
6
|
|
|
7
|
-
const mdsListCss = ".border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{display:grid;gap:1rem;padding-left:1rem}ul{margin:0px;padding:0px}";
|
|
7
|
+
const mdsListCss = ".fixed{position:fixed}.absolute{position:absolute}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{display:grid;gap:1rem;padding-left:1rem}ul{margin:0px;padding:0px}";
|
|
8
8
|
|
|
9
9
|
const MdsList = class {
|
|
10
10
|
constructor(hostRef) {
|
package/dist/cjs/mds-list.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-3c3cf8ce.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-list.cjs.js', document.baseURI).href));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const hash = (s) => {
|
|
2
|
+
let i, h;
|
|
3
|
+
for (i = 0, h = 0; i < s.length; i++) {
|
|
4
|
+
h = Math.imul(31, h) + s.charCodeAt(i) | 0;
|
|
5
|
+
}
|
|
6
|
+
return h.toString();
|
|
7
|
+
};
|
|
8
|
+
const unslugName = (name) => {
|
|
9
|
+
return name.split('/').slice(-1).pop().replace(/-/g, ' ');
|
|
10
|
+
};
|
|
11
|
+
const setAttributeIfEmpty = (element, attribute, value) => {
|
|
12
|
+
if (element.hasAttribute(attribute)) {
|
|
13
|
+
return element.getAttribute(attribute);
|
|
14
|
+
}
|
|
15
|
+
element.setAttribute(attribute, value);
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
const hashValue = (value) => `${value}-${hash(value)}`;
|
|
19
|
+
export { unslugName, setAttributeIfEmpty, hashValue, };
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Host, h } from '@stencil/core';
|
|
2
2
|
export class MdsList {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, null,
|
|
5
|
-
h("slot", null)));
|
|
4
|
+
return (h(Host, null, h("slot", null)));
|
|
6
5
|
}
|
|
7
6
|
static get is() { return "mds-list"; }
|
|
8
7
|
static get encapsulation() { return "shadow"; }
|
|
9
|
-
static get originalStyleUrls() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
static get originalStyleUrls() {
|
|
9
|
+
return {
|
|
10
|
+
"$": ["mds-list.css"]
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
static get styleUrls() {
|
|
14
|
+
return {
|
|
15
|
+
"$": ["mds-list.css"]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
15
18
|
}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import MdsList from '@component/mds-list/mds-list'
|
|
3
|
-
|
|
1
|
+
import { h } from '@stencil/core';
|
|
4
2
|
export default {
|
|
5
3
|
title: 'UI / List',
|
|
6
|
-
component: MdsList,
|
|
7
4
|
argTypes: {
|
|
8
5
|
type: {
|
|
9
6
|
type: { name: 'string', required: false },
|
|
10
7
|
description: 'Defines if the list is ordered or unordered',
|
|
11
8
|
},
|
|
12
9
|
},
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
<mds-list {...args}>
|
|
17
|
-
<mds-list-item>Pane</mds-list-item>
|
|
18
|
-
<mds-list-item>Acqua</mds-list-item>
|
|
19
|
-
<mds-list-item>Pasta</mds-list-item>
|
|
20
|
-
</mds-list>
|
|
21
|
-
|
|
22
|
-
export const Default = Template.bind({})
|
|
10
|
+
};
|
|
11
|
+
const Template = args => h("mds-list", Object.assign({}, args), h("mds-list-item", null, "Pane"), h("mds-list-item", null, "Acqua"), h("mds-list-item", null, "Pasta"));
|
|
12
|
+
export const Default = Template.bind({});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const floatingUIPlacementDictionary = [
|
|
2
|
+
'bottom',
|
|
3
|
+
'bottom-end',
|
|
4
|
+
'bottom-start',
|
|
5
|
+
'left',
|
|
6
|
+
'left-end',
|
|
7
|
+
'left-start',
|
|
8
|
+
'right',
|
|
9
|
+
'right-end',
|
|
10
|
+
'right-start',
|
|
11
|
+
'top',
|
|
12
|
+
'top-end',
|
|
13
|
+
'top-start',
|
|
14
|
+
];
|
|
15
|
+
const floatingUIStrategyDictionary = [
|
|
16
|
+
'absolute',
|
|
17
|
+
'fixed',
|
|
18
|
+
];
|
|
19
|
+
export { floatingUIPlacementDictionary, floatingUIStrategyDictionary, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const typographyDictionary = [
|
|
2
2
|
'action',
|
|
3
3
|
'caption',
|
|
4
|
-
'
|
|
4
|
+
'snippet',
|
|
5
5
|
'detail',
|
|
6
6
|
'h1',
|
|
7
7
|
'h2',
|
|
@@ -15,11 +15,17 @@ const typographyDictionary = [
|
|
|
15
15
|
'paragraph',
|
|
16
16
|
'tip',
|
|
17
17
|
];
|
|
18
|
-
const
|
|
18
|
+
const typographyVariationsDictionary = [
|
|
19
|
+
'title',
|
|
20
|
+
'info',
|
|
21
|
+
'read',
|
|
19
22
|
'code',
|
|
23
|
+
];
|
|
24
|
+
const typographyMonoDictionary = [
|
|
25
|
+
'snippet',
|
|
20
26
|
'hack',
|
|
21
27
|
];
|
|
22
|
-
const
|
|
28
|
+
const typographyTitleDictionary = [
|
|
23
29
|
'action',
|
|
24
30
|
'h1',
|
|
25
31
|
'h2',
|
|
@@ -28,7 +34,7 @@ const typographyPrimaryDictionary = [
|
|
|
28
34
|
'h5',
|
|
29
35
|
'h6',
|
|
30
36
|
];
|
|
31
|
-
const
|
|
37
|
+
const typographyInfoDictionary = [
|
|
32
38
|
'caption',
|
|
33
39
|
'detail',
|
|
34
40
|
'label',
|
|
@@ -36,8 +42,18 @@ const typographySecondaryDictionary = [
|
|
|
36
42
|
'paragraph',
|
|
37
43
|
'tip',
|
|
38
44
|
];
|
|
45
|
+
const typographyReadDictionary = [
|
|
46
|
+
'caption',
|
|
47
|
+
'detail',
|
|
48
|
+
'paragraph',
|
|
49
|
+
];
|
|
39
50
|
const typographySmallerDictionary = [
|
|
40
51
|
'option',
|
|
41
52
|
'tip',
|
|
42
53
|
];
|
|
43
|
-
|
|
54
|
+
const typographyTooltipDictionary = [
|
|
55
|
+
'caption',
|
|
56
|
+
'detail',
|
|
57
|
+
'tip',
|
|
58
|
+
];
|
|
59
|
+
export { typographyDictionary, typographyVariationsDictionary, typographyMonoDictionary, typographyTitleDictionary, typographyInfoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTooltipDictionary, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|