@spectrum-web-components/shared 0.15.0-devmode.0 → 0.15.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/package.json +4 -4
- package/src/first-focusable-in.dev.js +4 -1
- package/src/first-focusable-in.dev.js.map +1 -1
- package/src/first-focusable-in.js +1 -5
- package/src/first-focusable-in.js.map +2 -2
- package/src/focus-visible.dev.js +10 -2
- package/src/focus-visible.dev.js.map +1 -1
- package/src/focus-visible.js +1 -67
- package/src/focus-visible.js.map +2 -2
- package/src/focusable.d.ts +2 -0
- package/src/focusable.dev.js +36 -10
- package/src/focusable.dev.js.map +2 -2
- package/src/focusable.js +1 -189
- package/src/focusable.js.map +3 -3
- package/src/get-active-element.dev.js +1 -0
- package/src/get-active-element.dev.js.map +1 -1
- package/src/get-active-element.js +1 -3
- package/src/get-active-element.js.map +2 -2
- package/src/get-deep-element-from-point.dev.js +1 -0
- package/src/get-deep-element-from-point.dev.js.map +1 -1
- package/src/get-deep-element-from-point.js +1 -11
- package/src/get-deep-element-from-point.js.map +2 -2
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -9
- package/src/index.js.map +1 -1
- package/src/like-anchor.dev.js +1 -0
- package/src/like-anchor.dev.js.map +1 -1
- package/src/like-anchor.js +12 -57
- package/src/like-anchor.js.map +2 -2
- package/src/observe-slot-presence.dev.js +11 -3
- package/src/observe-slot-presence.dev.js.map +1 -1
- package/src/observe-slot-presence.js +1 -51
- package/src/observe-slot-presence.js.map +2 -2
- package/src/observe-slot-text.dev.js +8 -5
- package/src/observe-slot-text.dev.js.map +1 -1
- package/src/observe-slot-text.js +1 -78
- package/src/observe-slot-text.js.map +2 -2
- package/src/platform.dev.js +1 -0
- package/src/platform.dev.js.map +1 -1
- package/src/platform.js +1 -30
- package/src/platform.js.map +2 -2
- package/src/reparent-children.dev.js +9 -2
- package/src/reparent-children.dev.js.map +1 -1
- package/src/reparent-children.js +1 -49
- package/src/reparent-children.js.map +2 -2
- package/test/focusable.test.js +5 -2
- package/test/focusable.test.js.map +1 -1
- package/test/observe-slot-presence.test.js +9 -3
- package/test/observe-slot-presence.test.js.map +1 -1
- package/test/observe-slot-text.test.js +5 -2
- package/test/observe-slot-text.test.js.map +1 -1
- package/test/reparent-children.test.js +25 -8
- package/test/reparent-children.test.js.map +2 -2
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["observe-slot-text.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { PropertyValues, ReactiveElement } from '@spectrum-web-components/base';\nimport {\n property,\n queryAssignedNodes,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { MutationController } from '@lit-labs/observers/mutation_controller.js';\n\nconst assignedNodesList = Symbol('assignedNodes');\n\ntype Constructor<T = Record<string, unknown>> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n prototype: T;\n};\n\nexport interface SlotTextObservingInterface {\n slotHasContent: boolean;\n manageTextObservedSlot(): void;\n}\n\nexport function ObserveSlotText<T extends Constructor<ReactiveElement>>(\n constructor: T,\n slotName?: string\n): T & Constructor<SlotTextObservingInterface> {\n class SlotTextObservingElement\n extends constructor\n implements SlotTextObservingInterface\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(...args: any[]) {\n super(args);\n\n new MutationController(this, {\n config: {\n characterData: true,\n subtree: true,\n },\n callback: (mutationsList: Array<MutationRecord>) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'characterData') {\n this.manageTextObservedSlot();\n return;\n }\n }\n },\n });\n }\n\n @property({ type: Boolean, attribute: false })\n public slotHasContent = false;\n\n @queryAssignedNodes(slotName, true)\n private [assignedNodesList]!: NodeListOf<HTMLElement>;\n\n public manageTextObservedSlot(): void {\n if (!this[assignedNodesList]) return;\n const assignedNodes = [...this[assignedNodesList]].filter(\n (node) => {\n if ((node as HTMLElement).tagName) {\n return true;\n }\n return node.textContent ? node.textContent.trim() : false;\n }\n );\n this.slotHasContent = assignedNodes.length > 0;\n }\n\n protected override update(changedProperties: PropertyValues): void {\n if (!this.hasUpdated) {\n const { childNodes } = this;\n const textNodes = [...childNodes].filter((node) => {\n if ((node as HTMLElement).tagName) {\n return slotName\n ? (node as HTMLElement).getAttribute('slot') ===\n slotName\n : !(node as HTMLElement).hasAttribute('slot');\n }\n return node.textContent ? node.textContent.trim() : false;\n });\n this.slotHasContent = textNodes.length > 0;\n }\n super.update(changedProperties);\n }\n\n protected override firstUpdated(\n changedProperties: PropertyValues\n ): void {\n super.firstUpdated(changedProperties);\n this.updateComplete.then(() => {\n this.manageTextObservedSlot();\n });\n }\n }\n return SlotTextObservingElement;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "qNAYA,OACI,YAAAA,EACA,sBAAAC,MACG,kDACP,OAAS,sBAAAC,MAA0B,6CAEnC,MAAMC,EAAoB,OAAO,eAAe,EAazC,gBAAS,gBACZC,EACAC,EAC2C,CAlC/C,IAAAC,EAmCI,MAAMC,UACMH,CAEZ,CAEI,eAAeI,EAAa,CACxB,MAAMA,CAAI,EAmBd,KAAO,eAAiB,GAjBpB,IAAIN,EAAmB,KAAM,CACzB,OAAQ,CACJ,cAAe,GACf,QAAS,EACb,EACA,SAAWO,GAAyC,CAChD,UAAWC,KAAYD,EACnB,GAAIC,EAAS,OAAS,gBAAiB,CACnC,KAAK,uBAAuB,EAC5B,MACJ,CAER,CACJ,CAAC,CACL,CAQO,wBAA+B,CAClC,GAAI,CAAC,KAAKP,GAAoB,OAC9B,MAAMQ,EAAgB,CAAC,GAAG,KAAKR,EAAkB,EAAE,OAC9CS,GACQA,EAAqB,QACf,GAEJA,EAAK,YAAcA,EAAK,YAAY,KAAK,EAAI,EAE5D,EACA,KAAK,eAAiBD,EAAc,OAAS,CACjD,CAEmB,OAAOE,EAAyC,CAC/D,GAAI,CAAC,KAAK,WAAY,CAClB,KAAM,CAAE,WAAAC,CAAW,EAAI,KACjBC,EAAY,CAAC,GAAGD,CAAU,EAAE,OAAQF,GACjCA,EAAqB,QACfP,EACAO,EAAqB,aAAa,MAAM,IACrCP,EACJ,CAAEO,EAAqB,aAAa,MAAM,EAE7CA,EAAK,YAAcA,EAAK,YAAY,KAAK,EAAI,EACvD,EACD,KAAK,eAAiBG,EAAU,OAAS,CAC7C,CACA,MAAM,OAAOF,CAAiB,CAClC,CAEmB,aACfA,EACI,CACJ,MAAM,aAAaA,CAAiB,EACpC,KAAK,eAAe,KAAK,IAAM,CAC3B,KAAK,uBAAuB,CAChC,CAAC,CACL,CACJ,CAvGJ,OA+DiBP,EAAAH,EAHFa,EAAA,CADNhB,EAAS,CAAE,KAAM,QAAS,UAAW,EAAM,CAAC,GAxB3CO,EAyBK,8BAGES,EAAA,CADRf,EAAmBI,EAAU,EAAI,GA3BhCE,EA4BO,UAAAD,EAAA,GAyCNC,CACX",
|
|
6
|
+
"names": ["property", "queryAssignedNodes", "MutationController", "assignedNodesList", "constructor", "slotName", "_a", "SlotTextObservingElement", "args", "mutationsList", "mutation", "assignedNodes", "node", "changedProperties", "childNodes", "textNodes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/platform.dev.js
CHANGED
package/src/platform.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["platform.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nfunction testUserAgent(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.userAgent)\n : false;\n}\n\nfunction testPlatform(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.platform)\n : false;\n}\n\n/* c8 ignore next 3 */\nexport function isMac(): boolean {\n return testPlatform(/^Mac/);\n}\n\nexport function isIPhone(): boolean {\n return testPlatform(/^iPhone/);\n}\n\nexport function isIPad(): boolean {\n return (\n testPlatform(/^iPad/) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1)\n );\n}\n\nexport function isIOS(): boolean {\n return isIPhone() || isIPad();\n}\n\n/* c8 ignore next 3 */\nexport function isAppleDevice(): boolean {\n return isMac() || isIOS();\n}\n\n/* c8 ignore next 3 */\nexport function isWebKit(): boolean {\n return testUserAgent(/AppleWebKit/) && !isChrome();\n}\n\n/* c8 ignore next 3 */\nexport function isChrome(): boolean {\n return testUserAgent(/Chrome/);\n}\n\nexport function isAndroid(): boolean {\n return testUserAgent(/Android/);\n}\n"],
|
|
5
|
-
"mappings": "AAYA,
|
|
5
|
+
"mappings": ";AAYA,SAAS,cAAc,IAAqB;AACxC,SAAO,OAAO,WAAW,eAAe,OAAO,aAAa,OACtD,GAAG,KAAK,OAAO,UAAU,SAAS,IAClC;AACV;AAEA,SAAS,aAAa,IAAqB;AACvC,SAAO,OAAO,WAAW,eAAe,OAAO,aAAa,OACtD,GAAG,KAAK,OAAO,UAAU,QAAQ,IACjC;AACV;AAGO,gBAAS,QAAiB;AAC7B,SAAO,aAAa,MAAM;AAC9B;AAEO,gBAAS,WAAoB;AAChC,SAAO,aAAa,SAAS;AACjC;AAEO,gBAAS,SAAkB;AAC9B,SACI,aAAa,OAAO,KAEnB,MAAM,KAAK,UAAU,iBAAiB;AAE/C;AAEO,gBAAS,QAAiB;AAC7B,SAAO,SAAS,KAAK,OAAO;AAChC;AAGO,gBAAS,gBAAyB;AACrC,SAAO,MAAM,KAAK,MAAM;AAC5B;AAGO,gBAAS,WAAoB;AAChC,SAAO,cAAc,aAAa,KAAK,CAAC,SAAS;AACrD;AAGO,gBAAS,WAAoB;AAChC,SAAO,cAAc,QAAQ;AACjC;AAEO,gBAAS,YAAqB;AACjC,SAAO,cAAc,SAAS;AAClC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/platform.js
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator.userAgent) : false;
|
|
3
|
-
}
|
|
4
|
-
function testPlatform(re) {
|
|
5
|
-
return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator.platform) : false;
|
|
6
|
-
}
|
|
7
|
-
export function isMac() {
|
|
8
|
-
return testPlatform(/^Mac/);
|
|
9
|
-
}
|
|
10
|
-
export function isIPhone() {
|
|
11
|
-
return testPlatform(/^iPhone/);
|
|
12
|
-
}
|
|
13
|
-
export function isIPad() {
|
|
14
|
-
return testPlatform(/^iPad/) || isMac() && navigator.maxTouchPoints > 1;
|
|
15
|
-
}
|
|
16
|
-
export function isIOS() {
|
|
17
|
-
return isIPhone() || isIPad();
|
|
18
|
-
}
|
|
19
|
-
export function isAppleDevice() {
|
|
20
|
-
return isMac() || isIOS();
|
|
21
|
-
}
|
|
22
|
-
export function isWebKit() {
|
|
23
|
-
return testUserAgent(/AppleWebKit/) && !isChrome();
|
|
24
|
-
}
|
|
25
|
-
export function isChrome() {
|
|
26
|
-
return testUserAgent(/Chrome/);
|
|
27
|
-
}
|
|
28
|
-
export function isAndroid() {
|
|
29
|
-
return testUserAgent(/Android/);
|
|
30
|
-
}
|
|
1
|
+
"use strict";function o(n){return typeof window!="undefined"&&window.navigator!=null?n.test(window.navigator.userAgent):!1}function e(n){return typeof window!="undefined"&&window.navigator!=null?n.test(window.navigator.platform):!1}export function isMac(){return e(/^Mac/)}export function isIPhone(){return e(/^iPhone/)}export function isIPad(){return e(/^iPad/)||isMac()&&navigator.maxTouchPoints>1}export function isIOS(){return isIPhone()||isIPad()}export function isAppleDevice(){return isMac()||isIOS()}export function isWebKit(){return o(/AppleWebKit/)&&!isChrome()}export function isChrome(){return o(/Chrome/)}export function isAndroid(){return o(/Android/)}
|
|
31
2
|
//# sourceMappingURL=platform.js.map
|
package/src/platform.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["platform.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nfunction testUserAgent(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.userAgent)\n : false;\n}\n\nfunction testPlatform(re: RegExp): boolean {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator.platform)\n : false;\n}\n\n/* c8 ignore next 3 */\nexport function isMac(): boolean {\n return testPlatform(/^Mac/);\n}\n\nexport function isIPhone(): boolean {\n return testPlatform(/^iPhone/);\n}\n\nexport function isIPad(): boolean {\n return (\n testPlatform(/^iPad/) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1)\n );\n}\n\nexport function isIOS(): boolean {\n return isIPhone() || isIPad();\n}\n\n/* c8 ignore next 3 */\nexport function isAppleDevice(): boolean {\n return isMac() || isIOS();\n}\n\n/* c8 ignore next 3 */\nexport function isWebKit(): boolean {\n return testUserAgent(/AppleWebKit/) && !isChrome();\n}\n\n/* c8 ignore next 3 */\nexport function isChrome(): boolean {\n return testUserAgent(/Chrome/);\n}\n\nexport function isAndroid(): boolean {\n return testUserAgent(/Android/);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAYA,SAASA,EAAcC,EAAqB,CACxC,OAAO,OAAO,QAAW,aAAe,OAAO,WAAa,KACtDA,EAAG,KAAK,OAAO,UAAU,SAAS,EAClC,EACV,CAEA,SAASC,EAAaD,EAAqB,CACvC,OAAO,OAAO,QAAW,aAAe,OAAO,WAAa,KACtDA,EAAG,KAAK,OAAO,UAAU,QAAQ,EACjC,EACV,CAGO,gBAAS,OAAiB,CAC7B,OAAOC,EAAa,MAAM,CAC9B,CAEO,gBAAS,UAAoB,CAChC,OAAOA,EAAa,SAAS,CACjC,CAEO,gBAAS,QAAkB,CAC9B,OACIA,EAAa,OAAO,GAEnB,MAAM,GAAK,UAAU,eAAiB,CAE/C,CAEO,gBAAS,OAAiB,CAC7B,OAAO,SAAS,GAAK,OAAO,CAChC,CAGO,gBAAS,eAAyB,CACrC,OAAO,MAAM,GAAK,MAAM,CAC5B,CAGO,gBAAS,UAAoB,CAChC,OAAOF,EAAc,aAAa,GAAK,CAAC,SAAS,CACrD,CAGO,gBAAS,UAAoB,CAChC,OAAOA,EAAc,QAAQ,CACjC,CAEO,gBAAS,WAAqB,CACjC,OAAOA,EAAc,SAAS,CAClC",
|
|
6
|
+
"names": ["testUserAgent", "re", "testPlatform"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
function restoreChildren(placeholderItems, srcElements, cleanupCallbacks = []) {
|
|
2
3
|
for (let index = 0; index < srcElements.length; ++index) {
|
|
3
4
|
const srcElement = srcElements[index];
|
|
@@ -29,7 +30,9 @@ export const reparentChildren = (srcElements, destination, {
|
|
|
29
30
|
}
|
|
30
31
|
const placeholderItems = new Array(length);
|
|
31
32
|
const cleanupCallbacks = new Array(length);
|
|
32
|
-
const placeholderTemplate = document.createComment(
|
|
33
|
+
const placeholderTemplate = document.createComment(
|
|
34
|
+
"placeholder for reparented element"
|
|
35
|
+
);
|
|
33
36
|
do {
|
|
34
37
|
const srcElement = srcElements[index];
|
|
35
38
|
if (prepareCallback) {
|
|
@@ -44,7 +47,11 @@ export const reparentChildren = (srcElements, destination, {
|
|
|
44
47
|
index += step;
|
|
45
48
|
} while (--length > 0);
|
|
46
49
|
return function() {
|
|
47
|
-
return restoreChildren(
|
|
50
|
+
return restoreChildren(
|
|
51
|
+
placeholderItems,
|
|
52
|
+
srcElements,
|
|
53
|
+
cleanupCallbacks
|
|
54
|
+
);
|
|
48
55
|
};
|
|
49
56
|
};
|
|
50
57
|
//# sourceMappingURL=reparent-children.dev.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["reparent-children.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nfunction restoreChildren<T extends Element>(\n placeholderItems: Comment[],\n srcElements: T[],\n cleanupCallbacks: ((el: T) => void)[] = []\n): T[] {\n for (let index = 0; index < srcElements.length; ++index) {\n const srcElement = srcElements[index];\n const placeholderItem = placeholderItems[index];\n const parentElement =\n placeholderItem.parentElement || placeholderItem.getRootNode();\n if (cleanupCallbacks[index]) {\n cleanupCallbacks[index](srcElement);\n }\n if (parentElement && parentElement !== placeholderItem) {\n parentElement.replaceChild(srcElement, placeholderItem);\n }\n delete placeholderItems[index];\n }\n return srcElements;\n}\n\nexport const reparentChildren = <T extends Element>(\n srcElements: T[],\n destination: Element,\n {\n position,\n prepareCallback,\n }: {\n position: InsertPosition;\n prepareCallback?: (el: T) => ((el: T) => void) | void;\n } = { position: 'beforeend' }\n): (() => T[]) => {\n let { length } = srcElements;\n if (length === 0) {\n return () => srcElements;\n }\n\n let step = 1;\n let index = 0;\n\n if (position === 'afterbegin' || position === 'afterend') {\n step = -1;\n index = length - 1;\n }\n\n const placeholderItems = new Array<Comment>(length);\n const cleanupCallbacks = new Array<(el: T) => void>(length);\n const placeholderTemplate: Comment = document.createComment(\n 'placeholder for reparented element'\n );\n\n do {\n const srcElement = srcElements[index];\n if (prepareCallback) {\n cleanupCallbacks[index] = prepareCallback(srcElement) as (\n el: T\n ) => void;\n }\n placeholderItems[index] = placeholderTemplate.cloneNode() as Comment;\n\n const parentElement =\n srcElement.parentElement || srcElement.getRootNode();\n if (parentElement && parentElement !== srcElement) {\n parentElement.replaceChild(placeholderItems[index], srcElement);\n }\n destination.insertAdjacentElement(position, srcElement);\n\n index += step;\n } while (--length > 0);\n\n return function (): T[] {\n return restoreChildren<T>(\n placeholderItems,\n srcElements,\n cleanupCallbacks\n );\n };\n};\n"],
|
|
5
|
-
"mappings": "AAWA,
|
|
5
|
+
"mappings": ";AAWA,SAAS,gBACL,kBACA,aACA,mBAAwC,CAAC,GACtC;AACH,WAAS,QAAQ,GAAG,QAAQ,YAAY,QAAQ,EAAE,OAAO;AACrD,UAAM,aAAa,YAAY;AAC/B,UAAM,kBAAkB,iBAAiB;AACzC,UAAM,gBACF,gBAAgB,iBAAiB,gBAAgB,YAAY;AACjE,QAAI,iBAAiB,QAAQ;AACzB,uBAAiB,OAAO,UAAU;AAAA,IACtC;AACA,QAAI,iBAAiB,kBAAkB,iBAAiB;AACpD,oBAAc,aAAa,YAAY,eAAe;AAAA,IAC1D;AACA,WAAO,iBAAiB;AAAA,EAC5B;AACA,SAAO;AACX;AAEO,aAAM,mBAAmB,CAC5B,aACA,aACA;AAAA,EACI;AAAA,EACA;AACJ,IAGI,EAAE,UAAU,YAAY,MACd;AACd,MAAI,EAAE,OAAO,IAAI;AACjB,MAAI,WAAW,GAAG;AACd,WAAO,MAAM;AAAA,EACjB;AAEA,MAAI,OAAO;AACX,MAAI,QAAQ;AAEZ,MAAI,aAAa,gBAAgB,aAAa,YAAY;AACtD,WAAO;AACP,YAAQ,SAAS;AAAA,EACrB;AAEA,QAAM,mBAAmB,IAAI,MAAe,MAAM;AAClD,QAAM,mBAAmB,IAAI,MAAuB,MAAM;AAC1D,QAAM,sBAA+B,SAAS;AAAA,IAC1C;AAAA,EACJ;AAEA,KAAG;AACC,UAAM,aAAa,YAAY;AAC/B,QAAI,iBAAiB;AACjB,uBAAiB,SAAS,gBAAgB,UAAU;AAAA,IAGxD;AACA,qBAAiB,SAAS,oBAAoB,UAAU;AAExD,UAAM,gBACF,WAAW,iBAAiB,WAAW,YAAY;AACvD,QAAI,iBAAiB,kBAAkB,YAAY;AAC/C,oBAAc,aAAa,iBAAiB,QAAQ,UAAU;AAAA,IAClE;AACA,gBAAY,sBAAsB,UAAU,UAAU;AAEtD,aAAS;AAAA,EACb,SAAS,EAAE,SAAS;AAEpB,SAAO,WAAiB;AACpB,WAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/reparent-children.js
CHANGED
|
@@ -1,50 +1,2 @@
|
|
|
1
|
-
function
|
|
2
|
-
for (let index = 0; index < srcElements.length; ++index) {
|
|
3
|
-
const srcElement = srcElements[index];
|
|
4
|
-
const placeholderItem = placeholderItems[index];
|
|
5
|
-
const parentElement = placeholderItem.parentElement || placeholderItem.getRootNode();
|
|
6
|
-
if (cleanupCallbacks[index]) {
|
|
7
|
-
cleanupCallbacks[index](srcElement);
|
|
8
|
-
}
|
|
9
|
-
if (parentElement && parentElement !== placeholderItem) {
|
|
10
|
-
parentElement.replaceChild(srcElement, placeholderItem);
|
|
11
|
-
}
|
|
12
|
-
delete placeholderItems[index];
|
|
13
|
-
}
|
|
14
|
-
return srcElements;
|
|
15
|
-
}
|
|
16
|
-
export const reparentChildren = (srcElements, destination, {
|
|
17
|
-
position,
|
|
18
|
-
prepareCallback
|
|
19
|
-
} = { position: "beforeend" }) => {
|
|
20
|
-
let { length } = srcElements;
|
|
21
|
-
if (length === 0) {
|
|
22
|
-
return () => srcElements;
|
|
23
|
-
}
|
|
24
|
-
let step = 1;
|
|
25
|
-
let index = 0;
|
|
26
|
-
if (position === "afterbegin" || position === "afterend") {
|
|
27
|
-
step = -1;
|
|
28
|
-
index = length - 1;
|
|
29
|
-
}
|
|
30
|
-
const placeholderItems = new Array(length);
|
|
31
|
-
const cleanupCallbacks = new Array(length);
|
|
32
|
-
const placeholderTemplate = document.createComment("placeholder for reparented element");
|
|
33
|
-
do {
|
|
34
|
-
const srcElement = srcElements[index];
|
|
35
|
-
if (prepareCallback) {
|
|
36
|
-
cleanupCallbacks[index] = prepareCallback(srcElement);
|
|
37
|
-
}
|
|
38
|
-
placeholderItems[index] = placeholderTemplate.cloneNode();
|
|
39
|
-
const parentElement = srcElement.parentElement || srcElement.getRootNode();
|
|
40
|
-
if (parentElement && parentElement !== srcElement) {
|
|
41
|
-
parentElement.replaceChild(placeholderItems[index], srcElement);
|
|
42
|
-
}
|
|
43
|
-
destination.insertAdjacentElement(position, srcElement);
|
|
44
|
-
index += step;
|
|
45
|
-
} while (--length > 0);
|
|
46
|
-
return function() {
|
|
47
|
-
return restoreChildren(placeholderItems, srcElements, cleanupCallbacks);
|
|
48
|
-
};
|
|
49
|
-
};
|
|
1
|
+
"use strict";function T(o,i,l=[]){for(let e=0;e<i.length;++e){const n=i[e],r=o[e],t=r.parentElement||r.getRootNode();l[e]&&l[e](n),t&&t!==r&&t.replaceChild(n,r),delete o[e]}return i}export const reparentChildren=(o,i,{position:l,prepareCallback:e}={position:"beforeend"})=>{let{length:n}=o;if(n===0)return()=>o;let r=1,t=0;(l==="afterbegin"||l==="afterend")&&(r=-1,t=n-1);const a=new Array(n),c=new Array(n),p=document.createComment("placeholder for reparented element");do{const d=o[t];e&&(c[t]=e(d)),a[t]=p.cloneNode();const m=d.parentElement||d.getRootNode();m&&m!==d&&m.replaceChild(a[t],d),i.insertAdjacentElement(l,d),t+=r}while(--n>0);return function(){return T(a,o,c)}};
|
|
50
2
|
//# sourceMappingURL=reparent-children.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["reparent-children.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nfunction restoreChildren<T extends Element>(\n placeholderItems: Comment[],\n srcElements: T[],\n cleanupCallbacks: ((el: T) => void)[] = []\n): T[] {\n for (let index = 0; index < srcElements.length; ++index) {\n const srcElement = srcElements[index];\n const placeholderItem = placeholderItems[index];\n const parentElement =\n placeholderItem.parentElement || placeholderItem.getRootNode();\n if (cleanupCallbacks[index]) {\n cleanupCallbacks[index](srcElement);\n }\n if (parentElement && parentElement !== placeholderItem) {\n parentElement.replaceChild(srcElement, placeholderItem);\n }\n delete placeholderItems[index];\n }\n return srcElements;\n}\n\nexport const reparentChildren = <T extends Element>(\n srcElements: T[],\n destination: Element,\n {\n position,\n prepareCallback,\n }: {\n position: InsertPosition;\n prepareCallback?: (el: T) => ((el: T) => void) | void;\n } = { position: 'beforeend' }\n): (() => T[]) => {\n let { length } = srcElements;\n if (length === 0) {\n return () => srcElements;\n }\n\n let step = 1;\n let index = 0;\n\n if (position === 'afterbegin' || position === 'afterend') {\n step = -1;\n index = length - 1;\n }\n\n const placeholderItems = new Array<Comment>(length);\n const cleanupCallbacks = new Array<(el: T) => void>(length);\n const placeholderTemplate: Comment = document.createComment(\n 'placeholder for reparented element'\n );\n\n do {\n const srcElement = srcElements[index];\n if (prepareCallback) {\n cleanupCallbacks[index] = prepareCallback(srcElement) as (\n el: T\n ) => void;\n }\n placeholderItems[index] = placeholderTemplate.cloneNode() as Comment;\n\n const parentElement =\n srcElement.parentElement || srcElement.getRootNode();\n if (parentElement && parentElement !== srcElement) {\n parentElement.replaceChild(placeholderItems[index], srcElement);\n }\n destination.insertAdjacentElement(position, srcElement);\n\n index += step;\n } while (--length > 0);\n\n return function (): T[] {\n return restoreChildren<T>(\n placeholderItems,\n srcElements,\n cleanupCallbacks\n );\n };\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,SAASA,EACLC,EACAC,EACAC,EAAwC,CAAC,EACtC,CACH,QAASC,EAAQ,EAAGA,EAAQF,EAAY,OAAQ,EAAEE,EAAO,CACrD,MAAMC,EAAaH,EAAYE,GACzBE,EAAkBL,EAAiBG,GACnCG,EACFD,EAAgB,eAAiBA,EAAgB,YAAY,EAC7DH,EAAiBC,IACjBD,EAAiBC,GAAOC,CAAU,EAElCE,GAAiBA,IAAkBD,GACnCC,EAAc,aAAaF,EAAYC,CAAe,EAE1D,OAAOL,EAAiBG,EAC5B,CACA,OAAOF,CACX,CAEO,aAAM,iBAAmB,CAC5BA,EACAM,EACA,CACI,SAAAC,EACA,gBAAAC,CACJ,EAGI,CAAE,SAAU,WAAY,IACd,CACd,GAAI,CAAE,OAAAC,CAAO,EAAIT,EACjB,GAAIS,IAAW,EACX,MAAO,IAAMT,EAGjB,IAAIU,EAAO,EACPR,EAAQ,GAERK,IAAa,cAAgBA,IAAa,cAC1CG,EAAO,GACPR,EAAQO,EAAS,GAGrB,MAAMV,EAAmB,IAAI,MAAeU,CAAM,EAC5CR,EAAmB,IAAI,MAAuBQ,CAAM,EACpDE,EAA+B,SAAS,cAC1C,oCACJ,EAEA,EAAG,CACC,MAAMR,EAAaH,EAAYE,GAC3BM,IACAP,EAAiBC,GAASM,EAAgBL,CAAU,GAIxDJ,EAAiBG,GAASS,EAAoB,UAAU,EAExD,MAAMN,EACFF,EAAW,eAAiBA,EAAW,YAAY,EACnDE,GAAiBA,IAAkBF,GACnCE,EAAc,aAAaN,EAAiBG,GAAQC,CAAU,EAElEG,EAAY,sBAAsBC,EAAUJ,CAAU,EAEtDD,GAASQ,CACb,OAAS,EAAED,EAAS,GAEpB,OAAO,UAAiB,CACpB,OAAOX,EACHC,EACAC,EACAC,CACJ,CACJ,CACJ",
|
|
6
|
+
"names": ["restoreChildren", "placeholderItems", "srcElements", "cleanupCallbacks", "index", "srcElement", "placeholderItem", "parentElement", "destination", "position", "prepareCallback", "length", "step", "placeholderTemplate"]
|
|
7
7
|
}
|
package/test/focusable.test.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import "@spectrum-web-components/shared/src/focusable.js";
|
|
2
3
|
import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
|
|
3
4
|
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
@@ -6,9 +7,11 @@ describe("Focusable", () => {
|
|
|
6
7
|
customElements.define("focusable-test", class extends Focusable {
|
|
7
8
|
});
|
|
8
9
|
try {
|
|
9
|
-
const el = await fixture(
|
|
10
|
+
const el = await fixture(
|
|
11
|
+
html`
|
|
10
12
|
<focusable-test></focusable-test>
|
|
11
|
-
`
|
|
13
|
+
`
|
|
14
|
+
);
|
|
12
15
|
await elementUpdated(el);
|
|
13
16
|
const focusEl = el.focusElement;
|
|
14
17
|
expect(focusEl).to.exist;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["focusable.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/shared/src/focusable.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\ndescribe('Focusable', () => {\n it('enforces the presense of a `focusElement`', async () => {\n customElements.define('focusable-test', class extends Focusable {});\n try {\n const el = await fixture<Focusable>(\n html`\n <focusable-test></focusable-test>\n `\n );\n await elementUpdated(el);\n const focusEl = el.focusElement;\n expect(focusEl).to.exist;\n } catch (error) {\n expect(() => {\n throw error;\n }).to.throw('Must implement focusElement getter!');\n }\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,SAAS,aAAa,MAAM;AACxB,KAAG,6CAA6C,YAAY;AACxD,mBAAe,OAAO,kBAAkB,cAAc,UAAU;AAAA,IAAC,CAAC;AAClE,QAAI;AACA,YAAM,KAAK,MAAM;AAAA,QACb;AAAA;AAAA;AAAA,MAGJ;AACA,YAAM,eAAe,EAAE;AACvB,YAAM,UAAU,GAAG;AACnB,aAAO,OAAO,EAAE,GAAG;AAAA,IACvB,SAAS,OAAP;AACE,aAAO,MAAM;AACT,cAAM;AAAA,MACV,CAAC,EAAE,GAAG,MAAM,qCAAqC;AAAA,IACrD;AAAA,EACJ,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { ObserveSlotPresence } from "@spectrum-web-components/shared/src/observe-slot-presence.js";
|
|
2
3
|
import { LitElement } from "@spectrum-web-components/base";
|
|
3
4
|
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
4
|
-
class ObserverTest extends ObserveSlotPresence(
|
|
5
|
+
class ObserverTest extends ObserveSlotPresence(
|
|
6
|
+
LitElement,
|
|
7
|
+
'[slot="test-slot"]'
|
|
8
|
+
) {
|
|
5
9
|
render() {
|
|
6
10
|
return html`
|
|
7
11
|
Test Element
|
|
@@ -11,9 +15,11 @@ class ObserverTest extends ObserveSlotPresence(LitElement, '[slot="test-slot"]')
|
|
|
11
15
|
customElements.define("observe-presence-test", ObserverTest);
|
|
12
16
|
describe("ObserveSlotPresence", () => {
|
|
13
17
|
it("does no management when slot unavailable", async () => {
|
|
14
|
-
const el = await fixture(
|
|
18
|
+
const el = await fixture(
|
|
19
|
+
html`
|
|
15
20
|
<observe-presence-test></observe-presence-test>
|
|
16
|
-
`
|
|
21
|
+
`
|
|
22
|
+
);
|
|
17
23
|
await elementUpdated(el);
|
|
18
24
|
expect(el.slotContentIsPresent).to.be.false;
|
|
19
25
|
el.innerHTML = '<div slot="test-slot"></div>';
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["observe-slot-presence.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.js';\nimport { LitElement, TemplateResult } from '@spectrum-web-components/base';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nclass ObserverTest extends ObserveSlotPresence(\n LitElement,\n '[slot=\"test-slot\"]'\n) {\n protected override render(): TemplateResult {\n return html`\n Test Element\n `;\n }\n}\n\ncustomElements.define('observe-presence-test', ObserverTest);\n\ndescribe('ObserveSlotPresence', () => {\n it('does no management when slot unavailable', async () => {\n const el = await fixture<ObserverTest>(\n html`\n <observe-presence-test></observe-presence-test>\n `\n );\n await elementUpdated(el);\n\n expect(el.slotContentIsPresent).to.be.false;\n\n el.innerHTML = '<div slot=\"test-slot\"></div>';\n await elementUpdated(el);\n\n expect(el.slotContentIsPresent).to.be.true;\n });\n});\n"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,2BAA2B;AACpC,SAAS,kBAAkC;AAC3C,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,MAAM,qBAAqB;AAAA,EACvB;AAAA,EACA;AACJ,EAAE;AAAA,EACqB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AACJ;AAEA,eAAe,OAAO,yBAAyB,YAAY;AAE3D,SAAS,uBAAuB,MAAM;AAClC,KAAG,4CAA4C,YAAY;AACvD,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AACA,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,oBAAoB,EAAE,GAAG,GAAG;AAEtC,OAAG,YAAY;AACf,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,oBAAoB,EAAE,GAAG,GAAG;AAAA,EAC1C,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { ObserveSlotText } from "@spectrum-web-components/shared/src/observe-slot-text.js";
|
|
2
3
|
import { LitElement } from "@spectrum-web-components/base";
|
|
3
4
|
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
@@ -11,9 +12,11 @@ class ObserverTest extends ObserveSlotText(LitElement) {
|
|
|
11
12
|
customElements.define("observe-slot-test", ObserverTest);
|
|
12
13
|
describe("ObserveSlotText", () => {
|
|
13
14
|
it("does no management when slot unavailable", async () => {
|
|
14
|
-
const el = await fixture(
|
|
15
|
+
const el = await fixture(
|
|
16
|
+
html`
|
|
15
17
|
<observe-slot-test></observe-slot-test>
|
|
16
|
-
`
|
|
18
|
+
`
|
|
19
|
+
);
|
|
17
20
|
await elementUpdated(el);
|
|
18
21
|
expect(el.slotHasContent).to.be.false;
|
|
19
22
|
el.textContent = `hi, i'm some text`;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["observe-slot-text.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport { LitElement, TemplateResult } from '@spectrum-web-components/base';\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nclass ObserverTest extends ObserveSlotText(LitElement) {\n protected override render(): TemplateResult {\n return html`\n <slot @slotchange=${this.manageTextObservedSlot}></slot>\n `;\n }\n}\n\ncustomElements.define('observe-slot-test', ObserverTest);\n\ndescribe('ObserveSlotText', () => {\n it('does no management when slot unavailable', async () => {\n const el = await fixture<ObserverTest>(\n html`\n <observe-slot-test></observe-slot-test>\n `\n );\n await elementUpdated(el);\n\n expect(el.slotHasContent).to.be.false;\n\n el.textContent = `hi, i'm some text`;\n\n await elementUpdated(el);\n\n expect(el.slotHasContent).to.be.true;\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,SAAS,uBAAuB;AAChC,SAAS,kBAAkC;AAC3C,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,MAAM,qBAAqB,gBAAgB,UAAU,EAAE;AAAA,EAChC,SAAyB;AACxC,WAAO;AAAA,gCACiB,KAAK;AAAA;AAAA,EAEjC;AACJ;AAEA,eAAe,OAAO,qBAAqB,YAAY;AAEvD,SAAS,mBAAmB,MAAM;AAC9B,KAAG,4CAA4C,YAAY;AACvD,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AACA,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,cAAc,EAAE,GAAG,GAAG;AAEhC,OAAG,cAAc;AAEjB,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,cAAc,EAAE,GAAG,GAAG;AAAA,EACpC,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { expect, fixture, html } from "@open-wc/testing";
|
|
2
3
|
import { reparentChildren } from "@spectrum-web-components/shared/src/reparent-children.js";
|
|
3
4
|
describe("Reparent Children", () => {
|
|
@@ -12,7 +13,9 @@ describe("Reparent Children", () => {
|
|
|
12
13
|
`);
|
|
13
14
|
const source = context.querySelector(".source");
|
|
14
15
|
const child = context.querySelector(".child");
|
|
15
|
-
const destination = context.querySelector(
|
|
16
|
+
const destination = context.querySelector(
|
|
17
|
+
".destination"
|
|
18
|
+
);
|
|
16
19
|
expect(source.children.length).to.equal(1);
|
|
17
20
|
expect(destination.children.length).to.equal(0);
|
|
18
21
|
const restore = reparentChildren([child], destination);
|
|
@@ -31,7 +34,9 @@ describe("Reparent Children", () => {
|
|
|
31
34
|
`);
|
|
32
35
|
const source = context.querySelector(".source");
|
|
33
36
|
const children = [...source.children];
|
|
34
|
-
const destination = context.querySelector(
|
|
37
|
+
const destination = context.querySelector(
|
|
38
|
+
".destination"
|
|
39
|
+
);
|
|
35
40
|
expect(source.children.length).to.equal(0);
|
|
36
41
|
expect(destination.children.length).to.equal(0);
|
|
37
42
|
const restore = reparentChildren(children, destination);
|
|
@@ -56,7 +61,9 @@ describe("Reparent Children", () => {
|
|
|
56
61
|
`);
|
|
57
62
|
const source = context.querySelector(".source");
|
|
58
63
|
const { children } = source;
|
|
59
|
-
const destination = context.querySelector(
|
|
64
|
+
const destination = context.querySelector(
|
|
65
|
+
".destination"
|
|
66
|
+
);
|
|
60
67
|
expect(source.children.length).to.equal(5);
|
|
61
68
|
expect(destination.children.length).to.equal(0);
|
|
62
69
|
const restore = reparentChildren([...children], destination);
|
|
@@ -76,7 +83,9 @@ describe("Reparent Children", () => {
|
|
|
76
83
|
</div>
|
|
77
84
|
`);
|
|
78
85
|
const child = context.querySelector(".child");
|
|
79
|
-
const destination = context.querySelector(
|
|
86
|
+
const destination = context.querySelector(
|
|
87
|
+
".destination"
|
|
88
|
+
);
|
|
80
89
|
expect(child.getAttribute("slot")).to.equal("slot");
|
|
81
90
|
const restore = reparentChildren([child], destination, {
|
|
82
91
|
position: "beforeend",
|
|
@@ -110,7 +119,9 @@ describe("Reparent Children", () => {
|
|
|
110
119
|
`);
|
|
111
120
|
const source = context.querySelector(".source");
|
|
112
121
|
const { children } = source;
|
|
113
|
-
const destination = context.querySelector(
|
|
122
|
+
const destination = context.querySelector(
|
|
123
|
+
".destination"
|
|
124
|
+
);
|
|
114
125
|
expect(source.children.length).to.equal(5);
|
|
115
126
|
expect(destination.children.length).to.equal(1);
|
|
116
127
|
const restore = reparentChildren([...children], destination, {
|
|
@@ -146,7 +157,9 @@ describe("Reparent Children", () => {
|
|
|
146
157
|
`);
|
|
147
158
|
const source = context.querySelector(".source");
|
|
148
159
|
const { children } = source;
|
|
149
|
-
const destination = context.querySelector(
|
|
160
|
+
const destination = context.querySelector(
|
|
161
|
+
".destination"
|
|
162
|
+
);
|
|
150
163
|
expect(source.children.length).to.equal(5);
|
|
151
164
|
expect(destination.children.length).to.equal(1);
|
|
152
165
|
const restore = reparentChildren([...children], destination, {
|
|
@@ -181,7 +194,9 @@ describe("Reparent Children", () => {
|
|
|
181
194
|
`);
|
|
182
195
|
const source = context.querySelector(".source");
|
|
183
196
|
const { children } = source;
|
|
184
|
-
const destination = context.querySelector(
|
|
197
|
+
const destination = context.querySelector(
|
|
198
|
+
".destination"
|
|
199
|
+
);
|
|
185
200
|
expect(source.children.length).to.equal(5);
|
|
186
201
|
const restore = reparentChildren([...children], destination, {
|
|
187
202
|
position: "beforebegin"
|
|
@@ -215,7 +230,9 @@ describe("Reparent Children", () => {
|
|
|
215
230
|
`);
|
|
216
231
|
const source = context.querySelector(".source");
|
|
217
232
|
const { children } = source;
|
|
218
|
-
const destination = context.querySelector(
|
|
233
|
+
const destination = context.querySelector(
|
|
234
|
+
".destination"
|
|
235
|
+
);
|
|
219
236
|
expect(source.children.length).to.equal(5);
|
|
220
237
|
const marker = context.querySelector(".marker");
|
|
221
238
|
expect(marker.previousElementSibling).to.equal(destination);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["reparent-children.test.ts"],
|
|
4
4
|
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { expect, fixture, html } from '@open-wc/testing';\nimport { reparentChildren } from '@spectrum-web-components/shared/src/reparent-children.js';\n\ndescribe('Reparent Children', () => {\n it('reparents and returns a single child', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\">\n <div class=\"child\"></div>\n </div>\n <div class=\"destination\"></div>\n </div>\n `);\n\n const source = context.querySelector('.source') as HTMLDivElement;\n const child = context.querySelector('.child') as HTMLDivElement;\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(source.children.length).to.equal(1);\n expect(destination.children.length).to.equal(0);\n const restore = reparentChildren([child], destination);\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(1);\n\n restore();\n expect(source.children.length).to.equal(1);\n expect(destination.children.length).to.equal(0);\n });\n\n it('early exits no children', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\"></div>\n <div class=\"destination\"></div>\n </div>\n `);\n\n const source = context.querySelector('.source') as HTMLDivElement;\n const children = [...source.children] as HTMLDivElement[];\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(0);\n const restore = reparentChildren(children, destination);\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(0);\n\n restore();\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(0);\n });\n\n it('reparents and returns multiple child', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\">\n <div class=\"child\"></div>\n <div class=\"child\"></div>\n <div class=\"child\"></div>\n <div class=\"child\"></div>\n <div class=\"child\"></div>\n </div>\n <div class=\"destination\"></div>\n </div>\n `);\n\n const source = context.querySelector('.source') as HTMLDivElement;\n const { children } = source;\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(source.children.length).to.equal(5);\n expect(destination.children.length).to.equal(0);\n const restore = reparentChildren([...children], destination);\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(5);\n\n restore();\n expect(source.children.length).to.equal(5);\n expect(destination.children.length).to.equal(0);\n });\n\n it('augments the child via a callback', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\">\n <div class=\"child\" slot=\"slot\"></div>\n </div>\n <div class=\"destination\"></div>\n </div>\n `);\n\n const child = context.querySelector('.child') as HTMLDivElement;\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(child.getAttribute('slot')).to.equal('slot');\n const restore = reparentChildren([child], destination, {\n position: 'beforeend',\n prepareCallback: (el: Element) => {\n const slotName = el.slot;\n el.removeAttribute('slot');\n return (el: Element) => {\n el.slot = slotName;\n };\n },\n });\n\n expect(child.hasAttribute('slot')).to.be.false;\n\n restore();\n expect(child.getAttribute('slot')).to.equal('slot');\n });\n\n it('beforeend - reparents and returns multiple children', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\">\n <div class=\"child\">1</div>\n <div class=\"child\">2</div>\n <div class=\"child\">3</div>\n <div class=\"child\">4</div>\n <div class=\"child\">5</div>\n </div>\n <div class=\"destination\">\n <div class=\"marker\"></div>\n </div>\n </div>\n `);\n\n const source = context.querySelector('.source') as HTMLDivElement;\n const { children } = source;\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(source.children.length).to.equal(5);\n expect(destination.children.length).to.equal(1);\n const restore = reparentChildren([...children], destination, {\n position: 'beforeend',\n });\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(5 + 1);\n\n const marker = context.querySelector('.marker') as HTMLDivElement;\n expect(marker.previousElementSibling).to.be.null;\n expect(marker.nextElementSibling?.textContent).to.equal('1');\n expect(destination.lastElementChild?.textContent).to.equal('5');\n\n restore();\n expect(source.children.length).to.equal(5);\n expect(destination.children.length).to.equal(1);\n\n expect(source.firstElementChild?.textContent).to.equal('1');\n expect(source.lastElementChild?.textContent).to.equal('5');\n });\n\n it('afterbegin - reparents and returns multiple children', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\">\n <div class=\"child\">1</div>\n <div class=\"child\">2</div>\n <div class=\"child\">3</div>\n <div class=\"child\">4</div>\n <div class=\"child\">5</div>\n </div>\n <div class=\"destination\">\n <div class=\"marker\"></div>\n </div>\n </div>\n `);\n\n const source = context.querySelector('.source') as HTMLDivElement;\n const { children } = source;\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(source.children.length).to.equal(5);\n expect(destination.children.length).to.equal(1);\n const restore = reparentChildren([...children], destination, {\n position: 'afterbegin',\n });\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(5 + 1);\n\n const marker = context.querySelector('.marker') as HTMLDivElement;\n expect(marker.nextElementSibling).to.be.null;\n expect(marker.previousElementSibling?.textContent).to.equal('5');\n expect(destination.firstElementChild?.textContent).to.equal('1');\n\n restore();\n expect(source.children.length).to.equal(5);\n expect(destination.children.length).to.equal(1);\n\n expect(source.firstElementChild?.textContent).to.equal('1');\n expect(source.lastElementChild?.textContent).to.equal('5');\n });\n\n it('beforebegin - reparents and returns multiple children', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\">\n <div class=\"child\">1</div>\n <div class=\"child\">2</div>\n <div class=\"child\">3</div>\n <div class=\"child\">4</div>\n <div class=\"child\">5</div>\n </div>\n <div class=\"marker\"></div>\n <div class=\"destination\"></div>\n </div>\n `);\n\n const source = context.querySelector('.source') as HTMLDivElement;\n const { children } = source;\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(source.children.length).to.equal(5);\n const restore = reparentChildren([...children], destination, {\n position: 'beforebegin',\n });\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(0);\n\n const marker = context.querySelector('.marker') as HTMLDivElement;\n expect(marker.previousElementSibling).to.not.be.null;\n expect(marker.nextElementSibling?.textContent).to.equal('1');\n expect(destination.previousElementSibling?.textContent).to.equal('5');\n\n restore();\n expect(source.children.length).to.equal(5);\n expect(marker.nextElementSibling).to.equal(destination);\n\n expect(source.firstElementChild?.textContent).to.equal('1');\n expect(source.lastElementChild?.textContent).to.equal('5');\n });\n\n it('afterend - reparents and returns multiple children', async () => {\n const context = await fixture<HTMLDivElement>(html`\n <div>\n <div class=\"source\">\n <div class=\"child\">1</div>\n <div class=\"child\">2</div>\n <div class=\"child\">3</div>\n <div class=\"child\">4</div>\n <div class=\"child\">5</div>\n </div>\n <div class=\"destination\"></div>\n <div class=\"marker\"></div>\n </div>\n `);\n\n const source = context.querySelector('.source') as HTMLDivElement;\n const { children } = source;\n const destination = context.querySelector(\n '.destination'\n ) as HTMLDivElement;\n\n expect(source.children.length).to.equal(5);\n\n const marker = context.querySelector('.marker') as HTMLDivElement;\n expect(marker.previousElementSibling).to.equal(destination);\n expect(marker.nextElementSibling).to.be.null;\n\n const restore = reparentChildren([...children], destination, {\n position: 'afterend',\n });\n\n expect(source.children.length).to.equal(0);\n expect(destination.children.length).to.equal(0);\n\n expect(destination.nextElementSibling?.textContent).to.equal('1');\n expect(marker.previousElementSibling?.textContent).to.equal('5');\n\n restore();\n expect(source.children.length).to.equal(5);\n expect(marker.previousElementSibling).to.equal(destination);\n\n expect(source.firstElementChild?.textContent).to.equal('1');\n expect(source.lastElementChild?.textContent).to.equal('5');\n });\n});\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";AAYA,SAAS,QAAQ,SAAS,YAAY;AACtC,SAAS,wBAAwB;AAEjC,SAAS,qBAAqB,MAAM;AAChC,KAAG,wCAAwC,YAAY;AACnD,UAAM,UAAU,MAAM,QAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAO7C;AAED,UAAM,SAAS,QAAQ,cAAc,SAAS;AAC9C,UAAM,QAAQ,QAAQ,cAAc,QAAQ;AAC5C,UAAM,cAAc,QAAQ;AA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