@patternfly/pfe-core 5.0.0 → 5.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.
@@ -76,7 +76,6 @@ export declare class SlotController implements SlotControllerPublicAPI {
76
76
  static anonymous: symbol;
77
77
  constructor(host: ReactiveElement, ...args: SlotControllerArgs);
78
78
  hostConnected(): Promise<void>;
79
- hostUpdated(): void;
80
79
  hostDisconnected(): void;
81
80
  /**
82
81
  * Given a slot name or slot names, returns elements assigned to the requested slots as an array.
@@ -95,7 +94,7 @@ export declare class SlotController implements SlotControllerPublicAPI {
95
94
  * this.getSlotted();
96
95
  * ```
97
96
  */
98
- getSlotted<T extends Element = Element>(...slotNames: string[]): T[];
97
+ getSlotted<T extends Element = Element>(...slotNames: string[] | [null]): T[];
99
98
  /**
100
99
  * Returns a boolean statement of whether or not any of those slots exists in the light DOM.
101
100
  * @param names The slot names to check.
@@ -1,26 +1,70 @@
1
- var _SlotController_instances, _a, _SlotController_nodes, _SlotController_slotMapInitialized, _SlotController_slotNames, _SlotController_deprecations, _SlotController_mo, _SlotController_initialize, _SlotController_initSlotMap, _SlotController_getSlotElement, _SlotController_getChildrenForSlot;
1
+ var _SlotController_instances, _a, _SlotController_slotRecords, _SlotController_slotNames, _SlotController_deprecations, _SlotController_initSlotMap, _SlotController_mo, _SlotController_initialize, _SlotController_getSlotElement;
2
2
  import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
3
  export function isObjectSpread(config) {
4
4
  return config.length === 1 && typeof config[0] === 'object' && config[0] !== null;
5
5
  }
6
- /**
7
- * If it's a named slot, return its children,
8
- * for the default slot, look for direct children not assigned to a slot
9
- * @param n slot name
10
- */
11
- const isSlot = (n) => (child) => n === SlotController.default ? !child.hasAttribute('slot')
12
- : child.getAttribute('slot') === n;
6
+ function isContent(node) {
7
+ switch (node.nodeType) {
8
+ case Node.TEXT_NODE:
9
+ return !!node.textContent?.trim();
10
+ case Node.COMMENT_NODE:
11
+ return false;
12
+ default:
13
+ return true;
14
+ }
15
+ }
16
+ class SlotRecord {
17
+ constructor(slot, name, host) {
18
+ this.slot = slot;
19
+ this.name = name;
20
+ this.host = host;
21
+ }
22
+ get elements() {
23
+ return this.slot?.assignedElements?.();
24
+ }
25
+ get hasContent() {
26
+ if (this.name === SlotController.default) {
27
+ return !!this.elements.length
28
+ || !![...this.host.childNodes]
29
+ .some(node => {
30
+ if (node instanceof Element) {
31
+ return !node.hasAttribute('slot');
32
+ }
33
+ else {
34
+ return isContent(node);
35
+ }
36
+ });
37
+ }
38
+ else {
39
+ return !!this.slot.assignedNodes()
40
+ .some(isContent);
41
+ }
42
+ }
43
+ }
13
44
  export class SlotController {
14
45
  constructor(host, ...args) {
15
46
  _SlotController_instances.add(this);
16
47
  this.host = host;
17
- _SlotController_nodes.set(this, new Map());
18
- _SlotController_slotMapInitialized.set(this, false);
48
+ _SlotController_slotRecords.set(this, new Map());
19
49
  _SlotController_slotNames.set(this, []);
20
50
  _SlotController_deprecations.set(this, {});
21
- _SlotController_mo.set(this, new MutationObserver(__classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_initSlotMap).bind(this)));
22
- __classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_initialize).call(this, ...args);
51
+ _SlotController_initSlotMap.set(this, async () => {
52
+ const { host } = this;
53
+ await host.updateComplete;
54
+ const slotRecords = __classPrivateFieldGet(this, _SlotController_slotRecords, "f");
55
+ // Loop over the properties provided by the schema
56
+ for (let slotName of __classPrivateFieldGet(this, _SlotController_slotNames, "f").concat(Object.values(__classPrivateFieldGet(this, _SlotController_deprecations, "f")))) {
57
+ slotName || (slotName = _a.default);
58
+ const slot = __classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_getSlotElement).call(this, slotName);
59
+ if (slot) {
60
+ slotRecords.set(slotName, new SlotRecord(slot, slotName, host));
61
+ }
62
+ }
63
+ host.requestUpdate();
64
+ });
65
+ _SlotController_mo.set(this, new MutationObserver(__classPrivateFieldGet(this, _SlotController_initSlotMap, "f")));
23
66
  host.addController(this);
67
+ __classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_initialize).call(this, ...args);
24
68
  if (!__classPrivateFieldGet(this, _SlotController_slotNames, "f").length) {
25
69
  __classPrivateFieldSet(this, _SlotController_slotNames, [null], "f");
26
70
  }
@@ -28,17 +72,13 @@ export class SlotController {
28
72
  async hostConnected() {
29
73
  __classPrivateFieldGet(this, _SlotController_mo, "f").observe(this.host, { childList: true });
30
74
  // Map the defined slots into an object that is easier to query
31
- __classPrivateFieldGet(this, _SlotController_nodes, "f").clear();
32
- __classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_initSlotMap).call(this);
75
+ __classPrivateFieldGet(this, _SlotController_slotRecords, "f").clear();
76
+ await this.host.updateComplete;
77
+ __classPrivateFieldGet(this, _SlotController_initSlotMap, "f").call(this);
33
78
  // insurance for framework integrations
34
79
  await this.host.updateComplete;
35
80
  this.host.requestUpdate();
36
81
  }
37
- hostUpdated() {
38
- if (!__classPrivateFieldGet(this, _SlotController_slotMapInitialized, "f")) {
39
- __classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_initSlotMap).call(this);
40
- }
41
- }
42
82
  hostDisconnected() {
43
83
  __classPrivateFieldGet(this, _SlotController_mo, "f").disconnect();
44
84
  }
@@ -60,11 +100,11 @@ export class SlotController {
60
100
  * ```
61
101
  */
62
102
  getSlotted(...slotNames) {
63
- if (!slotNames.length) {
64
- return (__classPrivateFieldGet(this, _SlotController_nodes, "f").get(_a.default)?.elements ?? []);
103
+ if (!slotNames.length || slotNames.length === 1 && slotNames.at(0) === null) {
104
+ return (__classPrivateFieldGet(this, _SlotController_slotRecords, "f").get(_a.default)?.elements ?? []);
65
105
  }
66
106
  else {
67
- return slotNames.flatMap(slotName => __classPrivateFieldGet(this, _SlotController_nodes, "f").get(slotName)?.elements ?? []);
107
+ return slotNames.flatMap(slotName => __classPrivateFieldGet(this, _SlotController_slotRecords, "f").get(slotName ?? _a.default)?.elements ?? []);
68
108
  }
69
109
  }
70
110
  /**
@@ -77,7 +117,15 @@ export class SlotController {
77
117
  if (!slotNames.length) {
78
118
  slotNames.push(_a.default);
79
119
  }
80
- return slotNames.some(x => __classPrivateFieldGet(this, _SlotController_nodes, "f").get(x)?.hasContent ?? false);
120
+ return slotNames.some(slotName => {
121
+ const slot = __classPrivateFieldGet(this, _SlotController_slotRecords, "f").get(slotName);
122
+ if (!slot) {
123
+ return false;
124
+ }
125
+ else {
126
+ return slot.hasContent;
127
+ }
128
+ });
81
129
  }
82
130
  /**
83
131
  * Whether or not all the requested slots are empty.
@@ -90,7 +138,7 @@ export class SlotController {
90
138
  return !this.hasSlotted(...names);
91
139
  }
92
140
  }
93
- _a = SlotController, _SlotController_nodes = new WeakMap(), _SlotController_slotMapInitialized = new WeakMap(), _SlotController_slotNames = new WeakMap(), _SlotController_deprecations = new WeakMap(), _SlotController_mo = new WeakMap(), _SlotController_instances = new WeakSet(), _SlotController_initialize = function _SlotController_initialize(...config) {
141
+ _a = SlotController, _SlotController_slotRecords = new WeakMap(), _SlotController_slotNames = new WeakMap(), _SlotController_deprecations = new WeakMap(), _SlotController_initSlotMap = new WeakMap(), _SlotController_mo = new WeakMap(), _SlotController_instances = new WeakSet(), _SlotController_initialize = function _SlotController_initialize(...config) {
94
142
  if (isObjectSpread(config)) {
95
143
  const [{ slots, deprecations }] = config;
96
144
  __classPrivateFieldSet(this, _SlotController_slotNames, slots, "f");
@@ -100,30 +148,9 @@ _a = SlotController, _SlotController_nodes = new WeakMap(), _SlotController_slot
100
148
  __classPrivateFieldSet(this, _SlotController_slotNames, config, "f");
101
149
  __classPrivateFieldSet(this, _SlotController_deprecations, {}, "f");
102
150
  }
103
- }, _SlotController_initSlotMap = function _SlotController_initSlotMap() {
104
- // Loop over the properties provided by the schema
105
- for (const slotName of __classPrivateFieldGet(this, _SlotController_slotNames, "f")
106
- .concat(Object.values(__classPrivateFieldGet(this, _SlotController_deprecations, "f")))) {
107
- const slotId = slotName || _a.default;
108
- const name = slotName ?? '';
109
- const elements = __classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_getChildrenForSlot).call(this, slotId);
110
- const slot = __classPrivateFieldGet(this, _SlotController_instances, "m", _SlotController_getSlotElement).call(this, slotId);
111
- const hasContent = !!elements.length || !!slot?.assignedNodes?.()?.filter(x => x.textContent?.trim()).length;
112
- __classPrivateFieldGet(this, _SlotController_nodes, "f").set(slotId, { elements, name, hasContent, slot });
113
- }
114
- this.host.requestUpdate();
115
- __classPrivateFieldSet(this, _SlotController_slotMapInitialized, true, "f");
116
151
  }, _SlotController_getSlotElement = function _SlotController_getSlotElement(slotId) {
117
152
  const selector = slotId === _a.default ? 'slot:not([name])' : `slot[name="${slotId}"]`;
118
153
  return this.host.shadowRoot?.querySelector?.(selector) ?? null;
119
- }, _SlotController_getChildrenForSlot = function _SlotController_getChildrenForSlot(name) {
120
- if (__classPrivateFieldGet(this, _SlotController_nodes, "f").has(name)) {
121
- return (__classPrivateFieldGet(this, _SlotController_nodes, "f").get(name).slot?.assignedElements?.() ?? []);
122
- }
123
- else {
124
- const children = Array.from(this.host.children);
125
- return children.filter(isSlot(name));
126
- }
127
154
  };
128
155
  SlotController.default = Symbol('default slot');
129
156
  /** @deprecated use `default` */
@@ -1 +1 @@
1
- {"version":3,"file":"slot-controller.js","sourceRoot":"","sources":["slot-controller.ts"],"names":[],"mappings":";;AAoCA,MAAM,UAAU,cAAc,CAAC,MAA0B;IACvD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AACpF,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GACV,CAA8B,CAAyC,EAAE,EAAE,CACzE,CAAC,KAAc,EAAc,EAAE,CAC3B,CAAC,KAAK,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY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CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,MAAgB,IAAI,CAAC;IAC9F,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,EAAE,CAAkB,QAAQ,CAAC,IAAI,IAAI,CAAC;AAClF,CAAC,mFAGC,IAA4C;IAE5C,IAAI,uBAAA,IAAI,6BAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,uBAAA,IAAI,6BAAO,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,IAAI,EAAE,CAAQ,CAAC;IAC1E,CAAC;SAAM,CAAC;QACN,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAQ,CAAC;QACvD,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AArFa,sBAAO,GAAG,MAAM,CAAC,cAAc,CAA4B,AAApD,CAAqD;AAE1E,gCAAgC;AAClB,wBAAS,GAAW,EAAI,CAAC,OAAO,AAAvB,CAAwB","sourcesContent":["import type { ReactiveController, ReactiveElement } from 'lit';\n\ninterface AnonymousSlot {\n hasContent: boolean;\n elements: Element[];\n slot: HTMLSlotElement | null;\n}\n\ninterface NamedSlot extends AnonymousSlot {\n name: string;\n initialized: true;\n}\n\nexport type Slot = NamedSlot | AnonymousSlot;\n\nexport type SlotName = string | null;\n\nexport interface SlotsConfig {\n slots: SlotName[];\n /**\n * Object mapping new slot name keys to deprecated slot name values\n * @example `pf-modal--header` is deprecated in favour of `header`\n * ```js\n * new SlotController(this, {\n * slots: ['header'],\n * deprecations: {\n * 'header': 'pf-modal--header'\n * }\n * })\n * ```\n */\n deprecations?: Record<string, string>;\n}\n\nexport type SlotControllerArgs = [SlotsConfig] | SlotName[];\n\nexport function isObjectSpread(config: SlotControllerArgs): config is [SlotsConfig] {\n return config.length === 1 && typeof config[0] === 'object' && config[0] !== null;\n}\n\n/**\n * If it's a named slot, return its children,\n * for the default slot, look for direct children not assigned to a slot\n * @param n slot name\n */\nconst isSlot =\n <T extends Element = Element>(n: string | typeof SlotController.default) =>\n (child: Element): child is T =>\n n === SlotController.default ? !child.hasAttribute('slot')\n : child.getAttribute('slot') === n;\n\nexport declare class SlotControllerPublicAPI implements ReactiveController {\n static default: symbol;\n\n public host: ReactiveElement;\n\n constructor(host: ReactiveElement, ...args: SlotControllerArgs);\n\n hostConnected?(): Promise<void>;\n\n hostDisconnected?(): void;\n\n hostUpdated?(): void;\n\n /**\n * Given a slot name or slot names, returns elements assigned to the requested slots as an array.\n * If no value is provided, it returns all children not assigned to a slot (without a slot attribute).\n * @param slotNames slots to query\n * @example Get header-slotted elements\n * ```js\n * this.getSlotted('header')\n * ```\n * @example Get header- and footer-slotted elements\n * ```js\n * this.getSlotted('header', 'footer')\n * ```\n * @example Get default-slotted elements\n * ```js\n * this.getSlotted();\n * ```\n */\n getSlotted<T extends Element = Element>(...slotNames: string[]): T[];\n\n /**\n * Returns a boolean statement of whether or not any of those slots exists in the light DOM.\n * @param names The slot names to check.\n * @example this.hasSlotted('header');\n */\n hasSlotted(...names: (string | null | undefined)[]): boolean;\n\n /**\n * Whether or not all the requested slots are empty.\n * @param names The slot names to query. If no value is provided, it returns the default slot.\n * @example this.isEmpty('header', 'footer');\n * @example this.isEmpty();\n * @returns\n */\n isEmpty(...names: (string | null | undefined)[]): boolean;\n}\n\nexport class SlotController implements SlotControllerPublicAPI {\n public static default = Symbol('default slot') satisfies symbol as symbol;\n\n /** @deprecated use `default` */\n public static anonymous: symbol = this.default;\n\n #nodes = new Map<string | typeof SlotController.default, Slot>();\n\n #slotMapInitialized = false;\n\n #slotNames: (string | null)[] = [];\n\n #deprecations: Record<string, string> = {};\n\n #mo = new MutationObserver(this.#initSlotMap.bind(this));\n\n constructor(public host: ReactiveElement, ...args: SlotControllerArgs) {\n this.#initialize(...args);\n host.addController(this);\n if (!this.#slotNames.length) {\n this.#slotNames = [null];\n }\n }\n\n #initialize(...config: SlotControllerArgs) {\n if (isObjectSpread(config)) {\n const [{ slots, deprecations }] = config;\n this.#slotNames = slots;\n this.#deprecations = deprecations ?? {};\n } else if (config.length >= 1) {\n this.#slotNames = config;\n this.#deprecations = {};\n }\n }\n\n async hostConnected(): Promise<void> {\n this.#mo.observe(this.host, { childList: true });\n // Map the defined slots into an object that is easier to query\n this.#nodes.clear();\n this.#initSlotMap();\n // insurance for framework integrations\n await this.host.updateComplete;\n this.host.requestUpdate();\n }\n\n hostUpdated(): void {\n if (!this.#slotMapInitialized) {\n this.#initSlotMap();\n }\n }\n\n hostDisconnected(): void {\n this.#mo.disconnect();\n }\n\n #initSlotMap() {\n // Loop over the properties provided by the schema\n for (const slotName of this.#slotNames\n .concat(Object.values(this.#deprecations))) {\n const slotId = slotName || SlotController.default;\n const name = slotName ?? '';\n const elements = this.#getChildrenForSlot(slotId);\n const slot = this.#getSlotElement(slotId);\n const hasContent =\n !!elements.length || !!slot?.assignedNodes?.()?.filter(x => x.textContent?.trim()).length;\n this.#nodes.set(slotId, { elements, name, hasContent, slot });\n }\n this.host.requestUpdate();\n this.#slotMapInitialized = true;\n }\n\n #getSlotElement(slotId: string | symbol) {\n const selector =\n slotId === SlotController.default ? 'slot:not([name])' : `slot[name=\"${slotId as string}\"]`;\n return this.host.shadowRoot?.querySelector?.<HTMLSlotElement>(selector) ?? null;\n }\n\n #getChildrenForSlot<T extends Element = Element>(\n name: string | typeof SlotController.default,\n ): T[] {\n if (this.#nodes.has(name)) {\n return (this.#nodes.get(name)!.slot?.assignedElements?.() ?? []) as T[];\n } else {\n const children = Array.from(this.host.children) as T[];\n return children.filter(isSlot(name));\n }\n }\n\n /**\n * Given a slot name or slot names, returns elements assigned to the requested slots as an array.\n * If no value is provided, it returns all children not assigned to a slot (without a slot attribute).\n * @param slotNames slots to query\n * @example Get header-slotted elements\n * ```js\n * this.getSlotted('header')\n * ```\n * @example Get header- and footer-slotted elements\n * ```js\n * this.getSlotted('header', 'footer')\n * ```\n * @example Get default-slotted elements\n * ```js\n * this.getSlotted();\n * ```\n */\n getSlotted<T extends Element = Element>(...slotNames: string[]): T[] {\n if (!slotNames.length) {\n return (this.#nodes.get(SlotController.default)?.elements ?? []) as T[];\n } else {\n return slotNames.flatMap(slotName =>\n this.#nodes.get(slotName)?.elements ?? []) as T[];\n }\n }\n\n /**\n * Returns a boolean statement of whether or not any of those slots exists in the light DOM.\n * @param names The slot names to check.\n * @example this.hasSlotted('header');\n */\n hasSlotted(...names: (string | null | undefined)[]): boolean {\n const slotNames = Array.from(names, x => x == null ? SlotController.default : x);\n if (!slotNames.length) {\n slotNames.push(SlotController.default);\n }\n return slotNames.some(x => this.#nodes.get(x)?.hasContent ?? false);\n }\n\n /**\n * Whether or not all the requested slots are empty.\n * @param names The slot names to query. If no value is provided, it returns the default slot.\n * @example this.isEmpty('header', 'footer');\n * @example this.isEmpty();\n * @returns\n */\n isEmpty(...names: (string | null | undefined)[]): boolean {\n return !this.hasSlotted(...names);\n }\n}\n"]}
1
+ {"version":3,"file":"slot-controller.js","sourceRoot":"","sources":["slot-controller.ts"],"names":[],"mappings":";;AAoCA,MAAM,UAAU,cAAc,CAAC,MAA0B;IACvD,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AACpF,CAAC;AAED,SAAS,SAAS,CAAC,IAAU;IAC3B,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,SAAS;YACjB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;QACpC,KAAK,IAAI,CAAC,YAAY;YACpB,OAAO,KAAK,CAAC;QACf;YACE,OAAO,IAAI,CAAC;IAChB,CAA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AM,CAAC;gBACN,OAAO,IAAI,CAAC,UAAU,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CAAC,GAAG,KAAoC;QACpD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;;wVAxFW,GAAG,MAA0B;IACvC,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,GAAG,MAAM,CAAC;QACzC,uBAAA,IAAI,6BAAc,KAAK,MAAA,CAAC;QACxB,uBAAA,IAAI,gCAAiB,YAAY,IAAI,EAAE,MAAA,CAAC;IAC1C,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC9B,uBAAA,IAAI,6BAAc,MAAM,MAAA,CAAC;QACzB,uBAAA,IAAI,gCAAiB,EAAE,MAAA,CAAC;IAC1B,CAAC;AACH,CAAC,2EAEe,MAAuB;IACrC,MAAM,QAAQ,GACZ,MAAM,KAAK,EAAc,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,MAAgB,IAAI,CAAC;IAC9F,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,EAAE,CAAkB,QAAQ,CAAC,IAAI,IAAI,CAAC;AAClF,CAAC;AAnDa,sBAAO,GAAG,MAAM,CAAC,cAAc,CAA4B,AAApD,CAAqD;AAE1E,gCAAgC;AAClB,wBAAS,GAAW,EAAI,CAAC,OAAO,AAAvB,CAAwB","sourcesContent":["import type { ReactiveController, ReactiveElement } from 'lit';\n\ninterface AnonymousSlot {\n hasContent: boolean;\n elements: Element[];\n slot: HTMLSlotElement | null;\n}\n\ninterface NamedSlot extends AnonymousSlot {\n name: string;\n initialized: true;\n}\n\nexport type Slot = NamedSlot | AnonymousSlot;\n\nexport type SlotName = string | null;\n\nexport interface SlotsConfig {\n slots: SlotName[];\n /**\n * Object mapping new slot name keys to deprecated slot name values\n * @example `pf-modal--header` is deprecated in favour of `header`\n * ```js\n * new SlotController(this, {\n * slots: ['header'],\n * deprecations: {\n * 'header': 'pf-modal--header'\n * }\n * })\n * ```\n */\n deprecations?: Record<string, string>;\n}\n\nexport type SlotControllerArgs = [SlotsConfig] | SlotName[];\n\nexport function isObjectSpread(config: SlotControllerArgs): config is [SlotsConfig] {\n return config.length === 1 && typeof config[0] === 'object' && config[0] !== null;\n}\n\nfunction isContent(node: Node) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return !!node.textContent?.trim();\n case Node.COMMENT_NODE:\n return false;\n default:\n return true;\n }\n}\n\nexport declare class SlotControllerPublicAPI implements ReactiveController {\n static default: symbol;\n\n public host: ReactiveElement;\n\n constructor(host: ReactiveElement, ...args: SlotControllerArgs);\n\n hostConnected?(): Promise<void>;\n\n hostDisconnected?(): void;\n\n hostUpdated?(): void;\n\n /**\n * Given a slot name or slot names, returns elements assigned to the requested slots as an array.\n * If no value is provided, it returns all children not assigned to a slot (without a slot attribute).\n * @param slotNames slots to query\n * @example Get header-slotted elements\n * ```js\n * this.getSlotted('header')\n * ```\n * @example Get header- and footer-slotted elements\n * ```js\n * this.getSlotted('header', 'footer')\n * ```\n * @example Get default-slotted elements\n * ```js\n * this.getSlotted();\n * ```\n */\n getSlotted<T extends Element = Element>(...slotNames: string[]): T[];\n\n /**\n * Returns a boolean statement of whether or not any of those slots exists in the light DOM.\n * @param names The slot names to check.\n * @example this.hasSlotted('header');\n */\n hasSlotted(...names: (string | null | undefined)[]): boolean;\n\n /**\n * Whether or not all the requested slots are empty.\n * @param names The slot names to query. If no value is provided, it returns the default slot.\n * @example this.isEmpty('header', 'footer');\n * @example this.isEmpty();\n * @returns\n */\n isEmpty(...names: (string | null | undefined)[]): boolean;\n}\n\nclass SlotRecord {\n constructor(\n public slot: HTMLSlotElement,\n public name: string | symbol,\n private host: ReactiveElement,\n ) {}\n\n get elements() {\n return this.slot?.assignedElements?.();\n }\n\n get hasContent() {\n if (this.name === SlotController.default) {\n return !!this.elements.length\n || !![...this.host.childNodes]\n .some(node => {\n if (node instanceof Element) {\n return !node.hasAttribute('slot');\n } else {\n return isContent(node);\n }\n });\n } else {\n return !!this.slot.assignedNodes()\n .some(isContent);\n }\n }\n}\n\nexport class SlotController implements SlotControllerPublicAPI {\n public static default = Symbol('default slot') satisfies symbol as symbol;\n\n /** @deprecated use `default` */\n public static anonymous: symbol = this.default;\n\n #slotRecords = new Map<string | typeof SlotController.default, SlotRecord>();\n\n #slotNames: (string | symbol | null)[] = [];\n\n #deprecations: Record<string, string> = {};\n\n #initSlotMap = async () => {\n const { host } = this;\n await host.updateComplete;\n const slotRecords = this.#slotRecords;\n // Loop over the properties provided by the schema\n for (let slotName of this.#slotNames.concat(Object.values(this.#deprecations))) {\n slotName ||= SlotController.default;\n const slot = this.#getSlotElement(slotName);\n if (slot) {\n slotRecords.set(slotName, new SlotRecord(slot, slotName, host));\n }\n }\n host.requestUpdate();\n };\n\n #mo = new MutationObserver(this.#initSlotMap);\n\n constructor(public host: ReactiveElement, ...args: SlotControllerArgs) {\n host.addController(this);\n this.#initialize(...args);\n if (!this.#slotNames.length) {\n this.#slotNames = [null];\n }\n }\n\n #initialize(...config: SlotControllerArgs) {\n if (isObjectSpread(config)) {\n const [{ slots, deprecations }] = config;\n this.#slotNames = slots;\n this.#deprecations = deprecations ?? {};\n } else if (config.length >= 1) {\n this.#slotNames = config;\n this.#deprecations = {};\n }\n }\n\n #getSlotElement(slotId: string | symbol) {\n const selector =\n slotId === SlotController.default ? 'slot:not([name])' : `slot[name=\"${slotId as string}\"]`;\n return this.host.shadowRoot?.querySelector?.<HTMLSlotElement>(selector) ?? null;\n }\n\n async hostConnected(): Promise<void> {\n this.#mo.observe(this.host, { childList: true });\n // Map the defined slots into an object that is easier to query\n this.#slotRecords.clear();\n await this.host.updateComplete;\n this.#initSlotMap();\n // insurance for framework integrations\n await this.host.updateComplete;\n this.host.requestUpdate();\n }\n\n hostDisconnected(): void {\n this.#mo.disconnect();\n }\n\n /**\n * Given a slot name or slot names, returns elements assigned to the requested slots as an array.\n * If no value is provided, it returns all children not assigned to a slot (without a slot attribute).\n * @param slotNames slots to query\n * @example Get header-slotted elements\n * ```js\n * this.getSlotted('header')\n * ```\n * @example Get header- and footer-slotted elements\n * ```js\n * this.getSlotted('header', 'footer')\n * ```\n * @example Get default-slotted elements\n * ```js\n * this.getSlotted();\n * ```\n */\n public getSlotted<T extends Element = Element>(...slotNames: string[] | [null]): T[] {\n if (!slotNames.length || slotNames.length === 1 && slotNames.at(0) === null) {\n return (this.#slotRecords.get(SlotController.default)?.elements ?? []) as T[];\n } else {\n return slotNames.flatMap(slotName =>\n this.#slotRecords.get(slotName ?? SlotController.default)?.elements ?? []) as T[];\n }\n }\n\n /**\n * Returns a boolean statement of whether or not any of those slots exists in the light DOM.\n * @param names The slot names to check.\n * @example this.hasSlotted('header');\n */\n public hasSlotted(...names: (string | null | undefined)[]): boolean {\n const slotNames = Array.from(names, x =>\n x == null ? SlotController.default : x);\n if (!slotNames.length) {\n slotNames.push(SlotController.default);\n }\n return slotNames.some(slotName => {\n const slot = this.#slotRecords.get(slotName);\n if (!slot) {\n return false;\n } else {\n return slot.hasContent;\n }\n });\n }\n\n /**\n * Whether or not all the requested slots are empty.\n * @param names The slot names to query. If no value is provided, it returns the default slot.\n * @example this.isEmpty('header', 'footer');\n * @example this.isEmpty();\n * @returns\n */\n public isEmpty(...names: (string | null | undefined)[]): boolean {\n return !this.hasSlotted(...names);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,148 @@
1
+ import { __decorate } from "tslib";
2
+ import { expect, fixture, nextFrame } from '@open-wc/testing';
3
+ import { customElement } from 'lit/decorators/custom-element.js';
4
+ import { LitElement, html } from 'lit';
5
+ import { SlotController } from '../slot-controller.js';
6
+ let TestSlotControllerWithNamedAndAnonymous = class TestSlotControllerWithNamedAndAnonymous extends LitElement {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.controller = new SlotController(this, 'a', null);
10
+ }
11
+ render() {
12
+ return html `
13
+ <slot name="a"></slot>
14
+ <slot name="b"></slot>
15
+ <slot></slot>
16
+ `;
17
+ }
18
+ };
19
+ TestSlotControllerWithNamedAndAnonymous = __decorate([
20
+ customElement('test-slot-controller-with-named-and-anonymous')
21
+ ], TestSlotControllerWithNamedAndAnonymous);
22
+ describe('SlotController', function () {
23
+ describe('with named and anonymous slots', function () {
24
+ describe('with no content', function () {
25
+ let element;
26
+ beforeEach(async function () {
27
+ element = await fixture(html `
28
+ <test-slot-controller-with-named-and-anonymous></test-slot-controller-with-named-and-anonymous>
29
+ `);
30
+ });
31
+ it('reports empty named slots', function () {
32
+ expect(element.controller.hasSlotted('a')).to.be.false;
33
+ expect(element.controller.isEmpty('a')).to.be.true;
34
+ });
35
+ it('reports empty default slot', function () {
36
+ expect(element.controller.hasSlotted(null)).to.be.false;
37
+ expect(element.controller.isEmpty(null)).to.be.true;
38
+ });
39
+ it('reports empty default slot with no arguments', function () {
40
+ expect(element.controller.hasSlotted()).to.be.false;
41
+ expect(element.controller.isEmpty()).to.be.true;
42
+ });
43
+ it('returns empty list for getSlotted("a")', function () {
44
+ expect(element.controller.getSlotted('a')).to.be.empty;
45
+ });
46
+ it('returns empty list for getSlotted(null)', function () {
47
+ expect(element.controller.getSlotted(null)).to.be.empty;
48
+ });
49
+ it('returns empty list for getSlotted()', function () {
50
+ expect(element.controller.getSlotted()).to.be.empty;
51
+ });
52
+ });
53
+ describe('with element content in default slot', function () {
54
+ let element;
55
+ beforeEach(async function () {
56
+ element = await fixture(html `
57
+ <test-slot-controller-with-named-and-anonymous>
58
+ <p>element</p>
59
+ </test-slot-controller-with-named-and-anonymous>
60
+ `);
61
+ });
62
+ it('reports empty named slots', function () {
63
+ expect(element.controller.hasSlotted('a')).to.be.false;
64
+ expect(element.controller.isEmpty('a')).to.be.true;
65
+ });
66
+ it('reports non-empty default slot', function () {
67
+ expect(element.controller.hasSlotted(null)).to.be.true;
68
+ expect(element.controller.isEmpty(null)).to.be.false;
69
+ });
70
+ it('reports non-empty default slot with no arguments', function () {
71
+ expect(element.controller.hasSlotted()).to.be.true;
72
+ expect(element.controller.isEmpty()).to.be.false;
73
+ });
74
+ it('returns empty list for getSlotted("a")', function () {
75
+ expect(element.controller.getSlotted('a')).to.be.empty;
76
+ });
77
+ it('returns lengthy list for getSlotted(null)', function () {
78
+ expect(element.controller.getSlotted(null)).to.not.be.empty;
79
+ });
80
+ it('returns lengthy list for getSlotted()', function () {
81
+ expect(element.controller.getSlotted()).to.not.be.empty;
82
+ });
83
+ });
84
+ describe('with element content in named slot', function () {
85
+ let element;
86
+ beforeEach(async function () {
87
+ element = await fixture(html `
88
+ <test-slot-controller-with-named-and-anonymous>
89
+ <p slot="a">element</p>
90
+ </test-slot-controller-with-named-and-anonymous>
91
+ `);
92
+ });
93
+ it('reports non-empty named slots', function () {
94
+ expect(element.controller.hasSlotted('a')).to.be.true;
95
+ expect(element.controller.isEmpty('a')).to.be.false;
96
+ });
97
+ it('reports empty default slot', function () {
98
+ expect(element.controller.hasSlotted(null)).to.be.false;
99
+ expect(element.controller.isEmpty(null)).to.be.true;
100
+ });
101
+ it('reports empty default slot with no arguments', function () {
102
+ expect(element.controller.hasSlotted()).to.be.false;
103
+ expect(element.controller.isEmpty()).to.be.true;
104
+ });
105
+ it('returns lengthy list for getSlotted("a")', function () {
106
+ expect(element.controller.getSlotted('a')).to.not.be.empty;
107
+ });
108
+ it('returns empty list for getSlotted(null)', function () {
109
+ expect(element.controller.getSlotted(null)).to.be.empty;
110
+ });
111
+ it('returns empty list for getSlotted()', function () {
112
+ expect(element.controller.getSlotted()).to.be.empty;
113
+ });
114
+ });
115
+ describe('with text content in default slot', function () {
116
+ let element;
117
+ beforeEach(async function () {
118
+ element = await fixture(html `
119
+ <test-slot-controller-with-named-and-anonymous>
120
+ text
121
+ </test-slot-controller-with-named-and-anonymous>
122
+ `);
123
+ });
124
+ it('reports empty named slots', function () {
125
+ expect(element.controller.hasSlotted('a')).to.be.false;
126
+ expect(element.controller.isEmpty('a')).to.be.true;
127
+ });
128
+ it('reports non-empty default slot', function () {
129
+ expect(element.controller.hasSlotted(null)).to.be.true;
130
+ expect(element.controller.isEmpty(null)).to.be.false;
131
+ });
132
+ it('reports non-empty default slot with no arguments', function () {
133
+ expect(element.controller.hasSlotted()).to.be.true;
134
+ expect(element.controller.isEmpty()).to.be.false;
135
+ });
136
+ it('returns empty list for getSlotted("a")', function () {
137
+ expect(element.controller.getSlotted('a')).to.be.empty;
138
+ });
139
+ it('returns lengthy list for getSlotted(null)', function () {
140
+ expect(element.controller.getSlotted(null)).to.be.empty;
141
+ });
142
+ it('returns lengthy list for getSlotted()', function () {
143
+ expect(element.controller.getSlotted()).to.be.empty;
144
+ });
145
+ });
146
+ });
147
+ });
148
+ //# sourceMappingURL=slot-controller.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-controller.spec.js","sourceRoot":"","sources":["slot-controller.spec.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,IAAM,uCAAuC,GAA7C,MAAM,uCAAwC,SAAQ,UAAU;IAAhE;;QACE,eAAU,GAAG,IAAI,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAQnD,CAAC;IAPC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;KAIV,CAAC;IACJ,CAAC;CACF,CAAA;AATK,uCAAuC;IAD5C,aAAa,CAAC,+CAA+C,CAAC;GACzD,uCAAuC,CAS5C;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AC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACtD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect, fixture, nextFrame } from '@open-wc/testing';\n\nimport { customElement } from 'lit/decorators/custom-element.js';\nimport { LitElement, html, type TemplateResult } from 'lit';\n\nimport { SlotController } from '../slot-controller.js';\n\n@customElement('test-slot-controller-with-named-and-anonymous')\nclass TestSlotControllerWithNamedAndAnonymous extends LitElement {\n controller = new SlotController(this, 'a', null);\n render(): TemplateResult {\n return html`\n <slot name=\"a\"></slot>\n <slot name=\"b\"></slot>\n <slot></slot>\n `;\n }\n}\n\ndescribe('SlotController', function() {\n describe('with named and anonymous slots', function() {\n describe('with no content', function() {\n let element: TestSlotControllerWithNamedAndAnonymous;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-with-named-and-anonymous></test-slot-controller-with-named-and-anonymous>\n `);\n });\n it('reports empty named slots', function() {\n expect(element.controller.hasSlotted('a')).to.be.false;\n expect(element.controller.isEmpty('a')).to.be.true;\n });\n it('reports empty default slot', function() {\n expect(element.controller.hasSlotted(null)).to.be.false;\n expect(element.controller.isEmpty(null)).to.be.true;\n });\n it('reports empty default slot with no arguments', function() {\n expect(element.controller.hasSlotted()).to.be.false;\n expect(element.controller.isEmpty()).to.be.true;\n });\n it('returns empty list for getSlotted(\"a\")', function() {\n expect(element.controller.getSlotted('a')).to.be.empty;\n });\n it('returns empty list for getSlotted(null)', function() {\n expect(element.controller.getSlotted(null)).to.be.empty;\n });\n it('returns empty list for getSlotted()', function() {\n expect(element.controller.getSlotted()).to.be.empty;\n });\n });\n\n describe('with element content in default slot', function() {\n let element: TestSlotControllerWithNamedAndAnonymous;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-with-named-and-anonymous>\n <p>element</p>\n </test-slot-controller-with-named-and-anonymous>\n `);\n });\n it('reports empty named slots', function() {\n expect(element.controller.hasSlotted('a')).to.be.false;\n expect(element.controller.isEmpty('a')).to.be.true;\n });\n it('reports non-empty default slot', function() {\n expect(element.controller.hasSlotted(null)).to.be.true;\n expect(element.controller.isEmpty(null)).to.be.false;\n });\n it('reports non-empty default slot with no arguments', function() {\n expect(element.controller.hasSlotted()).to.be.true;\n expect(element.controller.isEmpty()).to.be.false;\n });\n it('returns empty list for getSlotted(\"a\")', function() {\n expect(element.controller.getSlotted('a')).to.be.empty;\n });\n it('returns lengthy list for getSlotted(null)', function() {\n expect(element.controller.getSlotted(null)).to.not.be.empty;\n });\n it('returns lengthy list for getSlotted()', function() {\n expect(element.controller.getSlotted()).to.not.be.empty;\n });\n });\n\n describe('with element content in named slot', function() {\n let element: TestSlotControllerWithNamedAndAnonymous;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-with-named-and-anonymous>\n <p slot=\"a\">element</p>\n </test-slot-controller-with-named-and-anonymous>\n `);\n });\n it('reports non-empty named slots', function() {\n expect(element.controller.hasSlotted('a')).to.be.true;\n expect(element.controller.isEmpty('a')).to.be.false;\n });\n it('reports empty default slot', function() {\n expect(element.controller.hasSlotted(null)).to.be.false;\n expect(element.controller.isEmpty(null)).to.be.true;\n });\n it('reports empty default slot with no arguments', function() {\n expect(element.controller.hasSlotted()).to.be.false;\n expect(element.controller.isEmpty()).to.be.true;\n });\n it('returns lengthy list for getSlotted(\"a\")', function() {\n expect(element.controller.getSlotted('a')).to.not.be.empty;\n });\n it('returns empty list for getSlotted(null)', function() {\n expect(element.controller.getSlotted(null)).to.be.empty;\n });\n it('returns empty list for getSlotted()', function() {\n expect(element.controller.getSlotted()).to.be.empty;\n });\n });\n\n describe('with text content in default slot', function() {\n let element: TestSlotControllerWithNamedAndAnonymous;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-with-named-and-anonymous>\n text\n </test-slot-controller-with-named-and-anonymous>\n `);\n });\n it('reports empty named slots', function() {\n expect(element.controller.hasSlotted('a')).to.be.false;\n expect(element.controller.isEmpty('a')).to.be.true;\n });\n it('reports non-empty default slot', function() {\n expect(element.controller.hasSlotted(null)).to.be.true;\n expect(element.controller.isEmpty(null)).to.be.false;\n });\n it('reports non-empty default slot with no arguments', function() {\n expect(element.controller.hasSlotted()).to.be.true;\n expect(element.controller.isEmpty()).to.be.false;\n });\n it('returns empty list for getSlotted(\"a\")', function() {\n expect(element.controller.getSlotted('a')).to.be.empty;\n });\n it('returns lengthy list for getSlotted(null)', function() {\n expect(element.controller.getSlotted(null)).to.be.empty;\n });\n it('returns lengthy list for getSlotted()', function() {\n expect(element.controller.getSlotted()).to.be.empty;\n });\n });\n });\n});\n"]}
@@ -9019,15 +9019,6 @@
9019
9019
  }
9020
9020
  }
9021
9021
  },
9022
- {
9023
- "kind": "method",
9024
- "name": "hostUpdated",
9025
- "return": {
9026
- "type": {
9027
- "text": "void"
9028
- }
9029
- }
9030
- },
9031
9022
  {
9032
9023
  "kind": "method",
9033
9024
  "name": "hostDisconnected",
@@ -9049,7 +9040,7 @@
9049
9040
  {
9050
9041
  "name": "slotNames",
9051
9042
  "type": {
9052
- "text": "string[]"
9043
+ "text": "string[] | [null]"
9053
9044
  },
9054
9045
  "description": "slots to query"
9055
9046
  }
@@ -9146,10 +9137,6 @@
9146
9137
  "kind": "method",
9147
9138
  "name": "hostConnected"
9148
9139
  },
9149
- {
9150
- "kind": "method",
9151
- "name": "hostUpdated"
9152
- },
9153
9140
  {
9154
9141
  "kind": "method",
9155
9142
  "name": "hostDisconnected"
@@ -11932,6 +11919,24 @@
11932
11919
  "path": "controllers/test/combobox-controller.spec.ts",
11933
11920
  "declarations": [],
11934
11921
  "exports": []
11922
+ },
11923
+ {
11924
+ "kind": "javascript-module",
11925
+ "path": "controllers/test/slot-controller.spec.d.ts",
11926
+ "declarations": [],
11927
+ "exports": []
11928
+ },
11929
+ {
11930
+ "kind": "javascript-module",
11931
+ "path": "controllers/test/slot-controller.spec.js",
11932
+ "declarations": [],
11933
+ "exports": []
11934
+ },
11935
+ {
11936
+ "kind": "javascript-module",
11937
+ "path": "controllers/test/slot-controller.spec.ts",
11938
+ "declarations": [],
11939
+ "exports": []
11935
11940
  }
11936
11941
  ]
11937
11942
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/pfe-core",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "license": "MIT",
5
5
  "description": "PatternFly Elements Core Library",
6
6
  "customElements": "custom-elements.json",