@maggioli-design-system/mds-table-row 3.0.0 → 4.0.0
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-516d954b.js → index-1066e7b9.js} +93 -7
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/mds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/mds-table-row.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/common/keyboard-manager.js +40 -0
- package/dist/collection/components/mds-table-row/mds-table-row.js +2 -2
- package/dist/collection/dictionary/icon.js +3 -1
- package/dist/collection/dictionary/typography.js +5 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +1 -1
- package/dist/components/mds-table-row.js +1 -1
- package/dist/esm/{index-e2bb9874.js → index-be386e76.js} +93 -8
- package/dist/esm/loader.js +4 -3
- package/dist/esm/mds-table-row.entry.js +1 -1
- package/dist/esm/mds-table-row.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm-es5/index-be386e76.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-table-row.entry.js +1 -1
- package/dist/esm-es5/mds-table-row.js +1 -1
- package/dist/mds-table-row/mds-table-row.esm.js +1 -1
- package/dist/mds-table-row/mds-table-row.js +1 -1
- package/dist/mds-table-row/p-2647d8bd.system.js +2 -0
- package/dist/mds-table-row/{p-02435eb4.entry.js → p-30a6116a.entry.js} +1 -1
- package/dist/mds-table-row/p-426bd1f3.js +2 -0
- package/dist/mds-table-row/{p-c7a8ce4b.system.entry.js → p-7d3f05d4.system.entry.js} +1 -1
- package/dist/mds-table-row/p-fb327bab.system.js +1 -0
- package/dist/stats.json +54 -51
- package/dist/types/common/keyboard-manager.d.ts +11 -0
- package/dist/types/dictionary/icon.d.ts +2 -1
- package/dist/types/dictionary/typography.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +59 -3
- package/dist/types/type/autocomplete.d.ts +2 -0
- package/dist/types/type/button.d.ts +4 -0
- package/dist/types/type/floating-ui.d.ts +2 -0
- package/dist/types/type/form-rel.d.ts +1 -0
- package/dist/types/type/input-text-type.d.ts +1 -0
- package/dist/types/type/input-value-type.d.ts +1 -0
- package/dist/types/type/loading.d.ts +1 -0
- package/dist/types/type/typography.d.ts +9 -0
- package/dist/types/type/variant.d.ts +10 -0
- package/loader/index.d.ts +9 -0
- package/package.json +4 -4
- package/src/common/keyboard-manager.ts +46 -0
- package/src/components/mds-table-row/mds-table-row.tsx +1 -1
- package/src/dictionary/icon.ts +4 -0
- package/src/dictionary/typography.ts +9 -3
- package/src/fixtures/icons.json +174 -0
- package/src/fixtures/iconsauce.json +175 -0
- package/src/tailwind/components.css +1 -0
- package/src/{types → type}/typography.ts +4 -0
- package/www/build/mds-table-row.esm.js +1 -1
- package/www/build/mds-table-row.js +1 -1
- package/www/build/p-2647d8bd.system.js +2 -0
- package/www/build/{p-02435eb4.entry.js → p-30a6116a.entry.js} +1 -1
- package/www/build/p-426bd1f3.js +2 -0
- package/www/build/{p-c7a8ce4b.system.entry.js → p-7d3f05d4.system.entry.js} +1 -1
- package/www/build/p-fb327bab.system.js +1 -0
- package/dist/esm-es5/index-e2bb9874.js +0 -2
- package/dist/mds-table-row/p-2689570a.system.js +0 -2
- package/dist/mds-table-row/p-76031000.system.js +0 -1
- package/dist/mds-table-row/p-a14f9222.js +0 -2
- package/dist/types/types/autocomplete.d.ts +0 -2
- package/dist/types/types/button.d.ts +0 -4
- package/dist/types/types/floating-ui.d.ts +0 -2
- package/dist/types/types/form-rel.d.ts +0 -1
- package/dist/types/types/input-text-type.d.ts +0 -1
- package/dist/types/types/input-value-type.d.ts +0 -1
- package/dist/types/types/loading.d.ts +0 -1
- package/dist/types/types/typography.d.ts +0 -8
- package/dist/types/types/variant.d.ts +0 -10
- package/www/build/p-2689570a.system.js +0 -2
- package/www/build/p-76031000.system.js +0 -1
- package/www/build/p-a14f9222.js +0 -2
- /package/dist/collection/{types → type}/autocomplete.js +0 -0
- /package/dist/collection/{types → type}/button.js +0 -0
- /package/dist/collection/{types → type}/floating-ui.js +0 -0
- /package/dist/collection/{types → type}/form-rel.js +0 -0
- /package/dist/collection/{types → type}/input-text-type.js +0 -0
- /package/dist/collection/{types → type}/input-value-type.js +0 -0
- /package/dist/collection/{types → type}/loading.js +0 -0
- /package/dist/collection/{types → type}/typography.js +0 -0
- /package/dist/collection/{types → type}/variant.js +0 -0
- /package/src/{types → type}/autocomplete.ts +0 -0
- /package/src/{types → type}/button.ts +0 -0
- /package/src/{types → type}/floating-ui.ts +0 -0
- /package/src/{types → type}/form-rel.ts +0 -0
- /package/src/{types → type}/input-text-type.ts +0 -0
- /package/src/{types → type}/input-value-type.ts +0 -0
- /package/src/{types → type}/loading.ts +0 -0
- /package/src/{types → type}/variant.ts +0 -0
|
@@ -48,7 +48,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
const HYDRATED_CSS = '{visibility:hidden}
|
|
51
|
+
const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
52
52
|
/**
|
|
53
53
|
* Default style mode id
|
|
54
54
|
*/
|
|
@@ -63,6 +63,18 @@ const isComplexType = (o) => {
|
|
|
63
63
|
o = typeof o;
|
|
64
64
|
return o === 'object' || o === 'function';
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
68
|
+
* out of a DOM's head.
|
|
69
|
+
*
|
|
70
|
+
* @param doc The DOM containing the `head` to query against
|
|
71
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
72
|
+
* exists or the tag has no content.
|
|
73
|
+
*/
|
|
74
|
+
function queryNonceMetaTagContent(doc) {
|
|
75
|
+
var _a, _b, _c;
|
|
76
|
+
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
77
|
+
}
|
|
66
78
|
/**
|
|
67
79
|
* Production h() function based on Preact by
|
|
68
80
|
* Jason Miller (@developit)
|
|
@@ -71,7 +83,6 @@ const isComplexType = (o) => {
|
|
|
71
83
|
*
|
|
72
84
|
* Modified for Stencil's compiler and vdom
|
|
73
85
|
*/
|
|
74
|
-
// const stack: any[] = [];
|
|
75
86
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
76
87
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
77
88
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -109,6 +120,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
109
120
|
}
|
|
110
121
|
return vnode;
|
|
111
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
125
|
+
* possible text content.
|
|
126
|
+
*
|
|
127
|
+
* @param tag the tag for this element
|
|
128
|
+
* @param text possible text content for the node
|
|
129
|
+
* @returns a newly-minted virtual DOM node
|
|
130
|
+
*/
|
|
112
131
|
const newVNode = (tag, text) => {
|
|
113
132
|
const vnode = {
|
|
114
133
|
$flags$: 0,
|
|
@@ -123,6 +142,12 @@ const newVNode = (tag, text) => {
|
|
|
123
142
|
return vnode;
|
|
124
143
|
};
|
|
125
144
|
const Host = {};
|
|
145
|
+
/**
|
|
146
|
+
* Check whether a given node is a Host node or not
|
|
147
|
+
*
|
|
148
|
+
* @param node the virtual DOM node to check
|
|
149
|
+
* @returns whether it's a Host node or not
|
|
150
|
+
*/
|
|
126
151
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
127
152
|
/**
|
|
128
153
|
* Parse a new property value for a given property type.
|
|
@@ -192,6 +217,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
192
217
|
styles.set(scopeId, style);
|
|
193
218
|
};
|
|
194
219
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
220
|
+
var _a;
|
|
195
221
|
let scopeId = getScopeId(cmpMeta);
|
|
196
222
|
const style = styles.get(scopeId);
|
|
197
223
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -211,6 +237,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
211
237
|
styleElm = doc.createElement('style');
|
|
212
238
|
styleElm.innerHTML = style;
|
|
213
239
|
}
|
|
240
|
+
// Apply CSP nonce to the style tag if it exists
|
|
241
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
242
|
+
if (nonce != null) {
|
|
243
|
+
styleElm.setAttribute('nonce', nonce);
|
|
244
|
+
}
|
|
214
245
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
215
246
|
}
|
|
216
247
|
if (appliedStyles) {
|
|
@@ -357,6 +388,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
357
388
|
}
|
|
358
389
|
return elm;
|
|
359
390
|
};
|
|
391
|
+
/**
|
|
392
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
393
|
+
* add them to the DOM in the appropriate place.
|
|
394
|
+
*
|
|
395
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
396
|
+
* DOM nodes
|
|
397
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
398
|
+
* inserted before (optional)
|
|
399
|
+
* @param parentVNode the parent virtual DOM node
|
|
400
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
401
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
402
|
+
* creating DOM nodes (inclusive)
|
|
403
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
404
|
+
* creating DOM nodes (inclusive)
|
|
405
|
+
*/
|
|
360
406
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
361
407
|
let containerElm = (parentElm);
|
|
362
408
|
let childNode;
|
|
@@ -373,6 +419,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
373
419
|
}
|
|
374
420
|
}
|
|
375
421
|
};
|
|
422
|
+
/**
|
|
423
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
424
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
425
|
+
* should no longer be shown.
|
|
426
|
+
*
|
|
427
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
428
|
+
*
|
|
429
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
430
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
431
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
432
|
+
* @param vnode a VNode
|
|
433
|
+
* @param elm an element
|
|
434
|
+
*/
|
|
376
435
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
377
436
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
378
437
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -564,7 +623,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
564
623
|
*
|
|
565
624
|
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
566
625
|
* changing order within a `children` array or something along those lines then
|
|
567
|
-
* we could obtain a false
|
|
626
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
627
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
568
628
|
*
|
|
569
629
|
* @param leftVNode the first VNode to check
|
|
570
630
|
* @param rightVNode the second VNode to check
|
|
@@ -617,6 +677,18 @@ const patch = (oldVNode, newVNode) => {
|
|
|
617
677
|
}
|
|
618
678
|
}
|
|
619
679
|
};
|
|
680
|
+
/**
|
|
681
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
682
|
+
*
|
|
683
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
684
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
685
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
686
|
+
* relocation, and reflecting attributes.
|
|
687
|
+
*
|
|
688
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
689
|
+
* the DOM node into which it should be rendered.
|
|
690
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
691
|
+
*/
|
|
620
692
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
621
693
|
const hostElm = hostRef.$hostElement$;
|
|
622
694
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -793,8 +865,8 @@ const safeCall = (instance, method, arg) => {
|
|
|
793
865
|
const then = (promise, thenFn) => {
|
|
794
866
|
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
795
867
|
};
|
|
796
|
-
const addHydratedFlag = (elm) => elm.
|
|
797
|
-
|
|
868
|
+
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
869
|
+
;
|
|
798
870
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
799
871
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
800
872
|
// check our new property value against our internal value
|
|
@@ -1051,6 +1123,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1051
1123
|
}
|
|
1052
1124
|
};
|
|
1053
1125
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1126
|
+
var _a;
|
|
1054
1127
|
const endBootstrap = createTime();
|
|
1055
1128
|
const cmpTags = [];
|
|
1056
1129
|
const exclude = options.exclude || [];
|
|
@@ -1130,6 +1203,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1130
1203
|
{
|
|
1131
1204
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1132
1205
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1206
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1207
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1208
|
+
if (nonce != null) {
|
|
1209
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1210
|
+
}
|
|
1133
1211
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1134
1212
|
}
|
|
1135
1213
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1173,12 +1251,19 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1173
1251
|
}
|
|
1174
1252
|
};
|
|
1175
1253
|
const getHostListenerTarget = (elm, flags) => {
|
|
1176
|
-
if (flags &
|
|
1177
|
-
return doc
|
|
1254
|
+
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1255
|
+
return doc;
|
|
1178
1256
|
return elm;
|
|
1179
1257
|
};
|
|
1180
1258
|
// prettier-ignore
|
|
1181
1259
|
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1260
|
+
/**
|
|
1261
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1262
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1263
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1264
|
+
* @returns void
|
|
1265
|
+
*/
|
|
1266
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1182
1267
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1183
1268
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1184
1269
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1291,3 +1376,4 @@ exports.bootstrapLazy = bootstrapLazy;
|
|
|
1291
1376
|
exports.h = h;
|
|
1292
1377
|
exports.promiseResolve = promiseResolve;
|
|
1293
1378
|
exports.registerInstance = registerInstance;
|
|
1379
|
+
exports.setNonce = setNonce;
|
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-1066e7b9.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,8 +14,9 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540]},[[
|
|
17
|
+
return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
+
exports.setNonce = index.setNonce;
|
|
21
22
|
exports.defineCustomElements = defineCustomElements;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-1066e7b9.js');
|
|
6
6
|
|
|
7
7
|
const mdsTableRowCss = ".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:table-row}:host([interactive]:hover){--mds-table-cell-background:var(--mds-table-cell-background-hover, rgb(var(--tone-neutral)))}";
|
|
8
8
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-1066e7b9.js');
|
|
4
6
|
|
|
5
7
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
8
|
+
Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
7
9
|
*/
|
|
8
10
|
const patchBrowser = () => {
|
|
9
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-table-row.cjs.js', document.baseURI).href));
|
|
@@ -15,5 +17,7 @@ const patchBrowser = () => {
|
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540]},[[
|
|
20
|
+
return index.bootstrapLazy([["mds-table-row.cjs",[[1,"mds-table-row",{"interactive":[1540]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
|
|
19
21
|
});
|
|
22
|
+
|
|
23
|
+
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export class KeyboardManager {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.elements = [];
|
|
4
|
+
this.handleClickBehaviorDispatchEvent = (event) => {
|
|
5
|
+
if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
|
|
6
|
+
event.target.click();
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
this.handleEscapeBehaviorDispatchEvent = (event) => {
|
|
10
|
+
if (event.code === 'Escape' && this.escapeCallback) {
|
|
11
|
+
this.escapeCallback();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.addElement = (el, name = 'element') => {
|
|
15
|
+
this.elements[name] = el;
|
|
16
|
+
};
|
|
17
|
+
this.attachClickBehavior = (name = 'element') => {
|
|
18
|
+
if (this.elements[name]) {
|
|
19
|
+
this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.detachClickBehavior = (name = 'element') => {
|
|
23
|
+
if (this.elements[name]) {
|
|
24
|
+
this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.attachEscapeBehavior = (callBack) => {
|
|
28
|
+
this.escapeCallback = callBack;
|
|
29
|
+
if (typeof window !== undefined) {
|
|
30
|
+
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.detachEscapeBehavior = () => {
|
|
34
|
+
this.escapeCallback = null;
|
|
35
|
+
if (typeof window !== undefined) {
|
|
36
|
+
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -44,9 +44,9 @@ export class MdsTableRow {
|
|
|
44
44
|
}
|
|
45
45
|
static get listeners() {
|
|
46
46
|
return [{
|
|
47
|
-
"name": "
|
|
47
|
+
"name": "mdsTableInteractiveChange",
|
|
48
48
|
"method": "tableInteractiveHandler",
|
|
49
|
-
"target": "
|
|
49
|
+
"target": "document",
|
|
50
50
|
"capture": false,
|
|
51
51
|
"passive": false
|
|
52
52
|
}];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import jsonIconsDictionary from '../fixtures/icons.json';
|
|
2
|
+
import jsonMggIconsDictionary from '../fixtures/iconsauce.json';
|
|
2
3
|
const iconsDictionary = jsonIconsDictionary;
|
|
3
|
-
|
|
4
|
+
const mggIconsDictionary = jsonMggIconsDictionary;
|
|
5
|
+
export { iconsDictionary, mggIconsDictionary, };
|
|
@@ -21,6 +21,10 @@ const typographyVariationsDictionary = [
|
|
|
21
21
|
'read',
|
|
22
22
|
'code',
|
|
23
23
|
];
|
|
24
|
+
const typographyReadingVariationsDictionary = [
|
|
25
|
+
'info',
|
|
26
|
+
'read',
|
|
27
|
+
];
|
|
24
28
|
const typographyMonoDictionary = [
|
|
25
29
|
'snippet',
|
|
26
30
|
'hack',
|
|
@@ -56,4 +60,4 @@ const typographyTooltipDictionary = [
|
|
|
56
60
|
'detail',
|
|
57
61
|
'tip',
|
|
58
62
|
];
|
|
59
|
-
export { typographyDictionary,
|
|
63
|
+
export { typographyDictionary, typographyInfoDictionary, typographyReadingVariationsDictionary, typographyMonoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTitleDictionary, typographyTooltipDictionary, typographyVariationsDictionary, };
|
|
@@ -13,6 +13,15 @@ export { MdsTableRow as MdsTableRow } from '../types/components/mds-table-row/md
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const setAssetPath: (path: string) => void;
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
18
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
19
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
20
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
21
|
+
* will result in the same behavior.
|
|
22
|
+
*/
|
|
23
|
+
export declare const setNonce: (nonce: string) => void
|
|
24
|
+
|
|
16
25
|
export interface SetPlatformOptions {
|
|
17
26
|
raf?: (c: FrameRequestCallback) => number;
|
|
18
27
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
package/dist/components/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
1
|
+
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
2
|
export { MdsTableRow, defineCustomElement as defineCustomElementMdsTableRow } from './mds-table-row.js';
|
|
@@ -18,7 +18,7 @@ const MdsTableRow$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
18
18
|
static get style() { return mdsTableRowCss; }
|
|
19
19
|
}, [1, "mds-table-row", {
|
|
20
20
|
"interactive": [1540]
|
|
21
|
-
}, [[
|
|
21
|
+
}, [[4, "mdsTableInteractiveChange", "tableInteractiveHandler"]]]);
|
|
22
22
|
function defineCustomElement$1() {
|
|
23
23
|
if (typeof customElements === "undefined") {
|
|
24
24
|
return;
|
|
@@ -26,7 +26,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
const HYDRATED_CSS = '{visibility:hidden}
|
|
29
|
+
const HYDRATED_CSS = '{visibility:hidden}[hydrated]{visibility:inherit}';
|
|
30
30
|
/**
|
|
31
31
|
* Default style mode id
|
|
32
32
|
*/
|
|
@@ -41,6 +41,18 @@ const isComplexType = (o) => {
|
|
|
41
41
|
o = typeof o;
|
|
42
42
|
return o === 'object' || o === 'function';
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
46
|
+
* out of a DOM's head.
|
|
47
|
+
*
|
|
48
|
+
* @param doc The DOM containing the `head` to query against
|
|
49
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
50
|
+
* exists or the tag has no content.
|
|
51
|
+
*/
|
|
52
|
+
function queryNonceMetaTagContent(doc) {
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
55
|
+
}
|
|
44
56
|
/**
|
|
45
57
|
* Production h() function based on Preact by
|
|
46
58
|
* Jason Miller (@developit)
|
|
@@ -49,7 +61,6 @@ const isComplexType = (o) => {
|
|
|
49
61
|
*
|
|
50
62
|
* Modified for Stencil's compiler and vdom
|
|
51
63
|
*/
|
|
52
|
-
// const stack: any[] = [];
|
|
53
64
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
54
65
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
55
66
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -87,6 +98,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
87
98
|
}
|
|
88
99
|
return vnode;
|
|
89
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
|
103
|
+
* possible text content.
|
|
104
|
+
*
|
|
105
|
+
* @param tag the tag for this element
|
|
106
|
+
* @param text possible text content for the node
|
|
107
|
+
* @returns a newly-minted virtual DOM node
|
|
108
|
+
*/
|
|
90
109
|
const newVNode = (tag, text) => {
|
|
91
110
|
const vnode = {
|
|
92
111
|
$flags$: 0,
|
|
@@ -101,6 +120,12 @@ const newVNode = (tag, text) => {
|
|
|
101
120
|
return vnode;
|
|
102
121
|
};
|
|
103
122
|
const Host = {};
|
|
123
|
+
/**
|
|
124
|
+
* Check whether a given node is a Host node or not
|
|
125
|
+
*
|
|
126
|
+
* @param node the virtual DOM node to check
|
|
127
|
+
* @returns whether it's a Host node or not
|
|
128
|
+
*/
|
|
104
129
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
105
130
|
/**
|
|
106
131
|
* Parse a new property value for a given property type.
|
|
@@ -170,6 +195,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
170
195
|
styles.set(scopeId, style);
|
|
171
196
|
};
|
|
172
197
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
198
|
+
var _a;
|
|
173
199
|
let scopeId = getScopeId(cmpMeta);
|
|
174
200
|
const style = styles.get(scopeId);
|
|
175
201
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -189,6 +215,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
189
215
|
styleElm = doc.createElement('style');
|
|
190
216
|
styleElm.innerHTML = style;
|
|
191
217
|
}
|
|
218
|
+
// Apply CSP nonce to the style tag if it exists
|
|
219
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
220
|
+
if (nonce != null) {
|
|
221
|
+
styleElm.setAttribute('nonce', nonce);
|
|
222
|
+
}
|
|
192
223
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
193
224
|
}
|
|
194
225
|
if (appliedStyles) {
|
|
@@ -335,6 +366,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
335
366
|
}
|
|
336
367
|
return elm;
|
|
337
368
|
};
|
|
369
|
+
/**
|
|
370
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
|
371
|
+
* add them to the DOM in the appropriate place.
|
|
372
|
+
*
|
|
373
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
|
374
|
+
* DOM nodes
|
|
375
|
+
* @param before a child of the `parentElm` which the new children should be
|
|
376
|
+
* inserted before (optional)
|
|
377
|
+
* @param parentVNode the parent virtual DOM node
|
|
378
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
|
379
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
|
380
|
+
* creating DOM nodes (inclusive)
|
|
381
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
|
382
|
+
* creating DOM nodes (inclusive)
|
|
383
|
+
*/
|
|
338
384
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
339
385
|
let containerElm = (parentElm);
|
|
340
386
|
let childNode;
|
|
@@ -351,6 +397,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
|
351
397
|
}
|
|
352
398
|
}
|
|
353
399
|
};
|
|
400
|
+
/**
|
|
401
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
|
402
|
+
* This can be used to, for instance, clean up after a list of children which
|
|
403
|
+
* should no longer be shown.
|
|
404
|
+
*
|
|
405
|
+
* This function also handles some of Stencil's slot relocation logic.
|
|
406
|
+
*
|
|
407
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
|
408
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
|
409
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
|
410
|
+
* @param vnode a VNode
|
|
411
|
+
* @param elm an element
|
|
412
|
+
*/
|
|
354
413
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
355
414
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
356
415
|
if ((vnode = vnodes[startIdx])) {
|
|
@@ -542,7 +601,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
542
601
|
*
|
|
543
602
|
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
544
603
|
* changing order within a `children` array or something along those lines then
|
|
545
|
-
* we could obtain a false
|
|
604
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
|
605
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
|
546
606
|
*
|
|
547
607
|
* @param leftVNode the first VNode to check
|
|
548
608
|
* @param rightVNode the second VNode to check
|
|
@@ -595,6 +655,18 @@ const patch = (oldVNode, newVNode) => {
|
|
|
595
655
|
}
|
|
596
656
|
}
|
|
597
657
|
};
|
|
658
|
+
/**
|
|
659
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
|
660
|
+
*
|
|
661
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
662
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
|
663
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
664
|
+
* relocation, and reflecting attributes.
|
|
665
|
+
*
|
|
666
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
667
|
+
* the DOM node into which it should be rendered.
|
|
668
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
669
|
+
*/
|
|
598
670
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
599
671
|
const hostElm = hostRef.$hostElement$;
|
|
600
672
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -771,8 +843,8 @@ const safeCall = (instance, method, arg) => {
|
|
|
771
843
|
const then = (promise, thenFn) => {
|
|
772
844
|
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
773
845
|
};
|
|
774
|
-
const addHydratedFlag = (elm) => elm.
|
|
775
|
-
|
|
846
|
+
const addHydratedFlag = (elm) => elm.setAttribute('hydrated', '')
|
|
847
|
+
;
|
|
776
848
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
777
849
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
778
850
|
// check our new property value against our internal value
|
|
@@ -1029,6 +1101,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1029
1101
|
}
|
|
1030
1102
|
};
|
|
1031
1103
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1104
|
+
var _a;
|
|
1032
1105
|
const endBootstrap = createTime();
|
|
1033
1106
|
const cmpTags = [];
|
|
1034
1107
|
const exclude = options.exclude || [];
|
|
@@ -1108,6 +1181,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1108
1181
|
{
|
|
1109
1182
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1110
1183
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1184
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1185
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1186
|
+
if (nonce != null) {
|
|
1187
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1188
|
+
}
|
|
1111
1189
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1112
1190
|
}
|
|
1113
1191
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1151,12 +1229,19 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1151
1229
|
}
|
|
1152
1230
|
};
|
|
1153
1231
|
const getHostListenerTarget = (elm, flags) => {
|
|
1154
|
-
if (flags &
|
|
1155
|
-
return doc
|
|
1232
|
+
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1233
|
+
return doc;
|
|
1156
1234
|
return elm;
|
|
1157
1235
|
};
|
|
1158
1236
|
// prettier-ignore
|
|
1159
1237
|
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1238
|
+
/**
|
|
1239
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1240
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1241
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1242
|
+
* @returns void
|
|
1243
|
+
*/
|
|
1244
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1160
1245
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1161
1246
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1162
1247
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1264,4 +1349,4 @@ const flush = () => {
|
|
|
1264
1349
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1265
1350
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1266
1351
|
|
|
1267
|
-
export { Host as H, bootstrapLazy as b, h, promiseResolve as p, registerInstance as r };
|
|
1352
|
+
export { Host as H, bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-be386e76.js';
|
|
2
|
+
export { s as setNonce } from './index-be386e76.js';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
|
-
Stencil Client Patch Esm v2.
|
|
5
|
+
Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
5
6
|
*/
|
|
6
7
|
const patchEsm = () => {
|
|
7
8
|
return promiseResolve();
|
|
@@ -10,7 +11,7 @@ const patchEsm = () => {
|
|
|
10
11
|
const defineCustomElements = (win, options) => {
|
|
11
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
13
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["mds-table-row",[[1,"mds-table-row",{"interactive":[1540]},[[
|
|
14
|
+
return bootstrapLazy([["mds-table-row",[[1,"mds-table-row",{"interactive":[1540]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
|
|
14
15
|
});
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-be386e76.js';
|
|
2
2
|
|
|
3
3
|
const mdsTableRowCss = ".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:table-row}:host([interactive]:hover){--mds-table-cell-background:var(--mds-table-cell-background-hover, rgb(var(--tone-neutral)))}";
|
|
4
4
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-be386e76.js';
|
|
2
|
+
export { s as setNonce } from './index-be386e76.js';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
|
-
Stencil Client Patch Browser v2.
|
|
5
|
+
Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
5
6
|
*/
|
|
6
7
|
const patchBrowser = () => {
|
|
7
8
|
const importMeta = import.meta.url;
|
|
@@ -13,5 +14,5 @@ const patchBrowser = () => {
|
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["mds-table-row",[[1,"mds-table-row",{"interactive":[1540]},[[
|
|
17
|
+
return bootstrapLazy([["mds-table-row",[[1,"mds-table-row",{"interactive":[1540]},[[4,"mdsTableInteractiveChange","tableInteractiveHandler"]]]]]], options);
|
|
17
18
|
});
|