@patternfly/pfe-core 5.0.1 → 5.0.3

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.
@@ -46,6 +46,7 @@ export declare class InternalsController implements ReactiveController, ARIAMixi
46
46
  ariaPosInSet: string | null;
47
47
  ariaPressed: string | null;
48
48
  ariaReadOnly: string | null;
49
+ ariaRelevant: string | null;
49
50
  ariaRequired: string | null;
50
51
  ariaRoleDescription: string | null;
51
52
  ariaRowCount: string | null;
@@ -130,6 +130,7 @@ export class InternalsController {
130
130
  this.ariaPosInSet = null;
131
131
  this.ariaPressed = null;
132
132
  this.ariaReadOnly = null;
133
+ this.ariaRelevant = null;
133
134
  this.ariaRequired = null;
134
135
  this.ariaRoleDescription = null;
135
136
  this.ariaRowCount = null;
@@ -320,6 +321,9 @@ __decorate([
320
321
  __decorate([
321
322
  aria
322
323
  ], InternalsController.prototype, "ariaReadOnly", void 0);
324
+ __decorate([
325
+ aria
326
+ ], InternalsController.prototype, "ariaRelevant", void 0);
323
327
  __decorate([
324
328
  aria
325
329
  ], InternalsController.prototype, "ariaRequired", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"internals-controller.js","sourceRoot":"","sources":["internals-controller.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,QAAQ,GAIT,MAAM,KAAK,CAAC;AAEb,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,GAAG,KAAK,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAMD,MAAM,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;AAE7B,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAMhC;;;;GAIG;AACH,SAAS,IAAI,CACX,MAA2B,EAC3B,GAA8B;IAE9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CA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C;AAClC;IAAL,IAAI;6DAAwC;AACvC;IAAL,IAAI;sDAAiC;AAChC;IAAL,IAAI;sDAAiC;AAChC;IAAL,IAAI;qDAAgC;AAC/B;IAAL,IAAI;sDAAiC;AAChC;IAAL,IAAI;0DAAqC;AACpC;IAAL,IAAI;gEAA2C;AAC1C;IAAL,IAAI;4DAAuC;AACtC;IAAL,IAAI;4DAAuC;AACtC;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;wDAAmC;AAClC;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;gEAA2C;AAC1C;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;6DAAwC;AACvC;IAAL,IAAI;wDAAmC;AAClC;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;wDAAmC;AAClC;IAAL,IAAI;qDAAgC;AAC/B;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;yDAAoC;AACnC;IAAL,IAAI;0DAAqC;AAGpC;IAAL,IAAI;wEAAoD;AAEnD;IAAL,IAAI;iEAA+C;AAE9C;IAAL,IAAI;oEAAkD;AAEjD;IAAL,IAAI;gEAA8C;AAE7C;IAAL,IAAI;qEAAmD;AAElD;IAAL,IAAI;+DAA6C;AAE5C;IAAL,IAAI;mEAAiD;AAEhD;IAAL,IAAI;6DAA2C","sourcesContent":["import {\n isServer,\n type ReactiveController,\n type ReactiveControllerHost,\n type LitElement,\n} from 'lit';\n\nfunction isARIAMixinProp(key: string): key is keyof ARIAMixin {\n return key === 'role' || key.startsWith('aria');\n}\n\ntype FACE = HTMLElement & {\n formDisabledCallback?(disabled: boolean): void;\n};\n\nconst protos = new WeakMap();\n\nlet constructingAllowed = false;\n\ninterface InternalsControllerOptions extends Partial<ARIAMixin> {\n getHTMLElement?(): HTMLElement;\n}\n\n/**\n * reactively forward the internals object's aria mixin prototype\n * @param target\n * @param key\n */\nfunction aria(\n target: InternalsController,\n key: keyof InternalsController,\n) {\n if (!protos.has(target)) {\n protos.set(target, new Set());\n }\n if (protos.get(target).has(key)) {\n return;\n }\n if (!isARIAMixinProp(key)) {\n throw new Error('@aria can only be called on ARIAMixin properties');\n }\n // typescript experimental decorator\n Object.defineProperty(target, key, {\n enumerable: true,\n configurable: false,\n get(this: InternalsController) {\n // @ts-expect-error: because i'm bad, i'm bad\n const internals = this.attachOrRetrieveInternals();\n return internals[key];\n },\n set(this: InternalsController, value: string | null) {\n // @ts-expect-error: ya know it!\n const internals = this.attachOrRetrieveInternals();\n // @ts-expect-error: shamone!\n internals[key] = value;\n this.host.requestUpdate();\n },\n });\n protos.get(target).add(key);\n}\n\nfunction getLabelText(label: HTMLElement) {\n if (label.hidden) {\n return '';\n } else {\n const ariaLabel = label.getAttribute?.('aria-label');\n return ariaLabel ?? label.textContent;\n }\n}\n\nexport class InternalsController implements ReactiveController, ARIAMixin {\n private static instances = new WeakMap<ReactiveControllerHost, InternalsController>();\n\n declare readonly form: ElementInternals['form'];\n declare readonly shadowRoot: ElementInternals['shadowRoot'];\n\n // https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n declare readonly states: unknown;\n declare readonly willValidate: ElementInternals['willValidate'];\n declare readonly validationMessage: ElementInternals['validationMessage'];\n\n public static getLabels(host: ReactiveControllerHost): Element[] {\n return Array.from(this.instances.get(host)?.internals.labels ?? []) as Element[];\n }\n\n public static isSafari: boolean =\n !isServer && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n\n public static of(\n host: ReactiveControllerHost,\n options?: InternalsControllerOptions,\n ): InternalsController {\n constructingAllowed = true;\n // implement the singleton pattern\n // using a public static constructor method is much easier to manage,\n // due to the quirks of our typescript config\n const instance: InternalsController =\n InternalsController.instances.get(host)\n ?? new InternalsController(host, options);\n instance.initializeOptions(options);\n constructingAllowed = false;\n return instance;\n }\n\n @aria role: string | null = null;\n\n @aria ariaActivedescendant: string | null = null;\n @aria ariaAtomic: string | null = null;\n @aria ariaAutoComplete: string | null = null;\n @aria ariaBusy: string | null = null;\n @aria ariaBrailleLabel: string | null = null;\n @aria ariaBrailleRoleDescription: string | null = null;\n @aria ariaChecked: string | null = null;\n @aria ariaColCount: string | null = null;\n @aria ariaColIndex: string | null = null;\n @aria ariaColIndexText: string | null = null;\n @aria ariaColSpan: string | null = null;\n @aria ariaCurrent: string | null = null;\n @aria ariaDescription: string | null = null;\n @aria ariaDisabled: string | null = null;\n @aria ariaExpanded: string | null = null;\n @aria ariaHasPopup: string | null = null;\n @aria ariaHidden: string | null = null;\n @aria ariaInvalid: string | null = null;\n @aria ariaKeyShortcuts: string | null = null;\n @aria ariaLabel: string | null = null;\n @aria ariaLevel: string | null = null;\n @aria ariaLive: string | null = null;\n @aria ariaModal: string | null = null;\n @aria ariaMultiLine: string | null = null;\n @aria ariaMultiSelectable: string | null = null;\n @aria ariaOrientation: string | null = null;\n @aria ariaPlaceholder: string | null = null;\n @aria ariaPosInSet: string | null = null;\n @aria ariaPressed: string | null = null;\n @aria ariaReadOnly: string | null = null;\n @aria ariaRequired: string | null = null;\n @aria ariaRoleDescription: string | null = null;\n @aria ariaRowCount: string | null = null;\n @aria ariaRowIndex: string | null = null;\n @aria ariaRowIndexText: string | null = null;\n @aria ariaRowSpan: string | null = null;\n @aria ariaSelected: string | null = null;\n @aria ariaSetSize: string | null = null;\n @aria ariaSort: string | null = null;\n @aria ariaValueMax: string | null = null;\n @aria ariaValueMin: string | null = null;\n @aria ariaValueNow: string | null = null;\n @aria ariaValueText: string | null = null;\n\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaActiveDescendantElement: Element | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaControlsElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaDescribedByElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaDetailsElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaErrorMessageElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaFlowToElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaLabelledByElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaOwnsElements: Element[] | null = null;\n\n /** True when the control is disabled via it's containing fieldset element */\n get formDisabled(): boolean {\n if (isServer) {\n return this._formDisabled;\n } else {\n return this.element?.matches(':disabled') || this._formDisabled;\n }\n }\n\n get labels(): NodeList {\n return this.internals.labels;\n }\n\n get validity(): ValidityState {\n return this.internals.validity;\n }\n\n /** A best-attempt based on observed behaviour in FireFox 115 on fedora 38 */\n get computedLabelText(): string {\n return this.internals.ariaLabel\n || Array.from(this.internals.labels as NodeListOf<HTMLElement>)\n .reduce((acc, label) =>\n `${acc}${getLabelText(label)}`, '');\n }\n\n private get element() {\n if (isServer) {\n // FIXME(bennyp): a little white lie, which may break\n // when the controller is applied to non-lit frameworks.\n return this.host as LitElement;\n } else {\n return this.host instanceof HTMLElement ? this.host : this.options?.getHTMLElement?.();\n }\n }\n\n private internals!: ElementInternals;\n\n private _formDisabled = false;\n\n private constructor(\n public host: ReactiveControllerHost,\n private options?: InternalsControllerOptions,\n ) {\n if (!constructingAllowed) {\n throw new Error('InternalsController must be constructed with `InternalsController.for()`');\n }\n if (!this.element) {\n throw new Error(\n `InternalsController must be instantiated with an HTMLElement or a \\`getHTMLElement\\` function`,\n );\n }\n this.attachOrRetrieveInternals();\n this.initializeOptions(options);\n InternalsController.instances.set(host, this);\n this.#polyfillDisabledPseudo();\n }\n\n /**\n * We need to polyfill :disabled\n * see https://github.com/calebdwilliams/element-internals-polyfill/issues/88\n */\n #polyfillDisabledPseudo() {\n // START polyfill-disabled\n // We need to polyfill :disabled\n // see https://github.com/calebdwilliams/element-internals-polyfill/issues/88\n const orig = (this.element as FACE).formDisabledCallback;\n (this.element as FACE).formDisabledCallback = disabled => {\n this._formDisabled = disabled;\n orig?.call(this.host, disabled);\n // END polyfill-disabled\n };\n }\n\n /**\n * Typescript (with experimental decorators) will compile the class\n * such that the order of operations is:\n * 1. set up constructor parameter fields\n * 2. run decorated field setters with initializers as the value\n * 3. run the rest of the constructor\n * Because of that, `this.internals` may not be available in the decorator setter\n * so we cheat here with nullish coalescing assignment operator `??=`;\n */\n private attachOrRetrieveInternals() {\n this.internals ??= this.element!.attachInternals();\n return this.internals;\n }\n\n private initializeOptions(options?: Partial<ARIAMixin>) {\n this.options ??= options ?? {};\n const { getHTMLElement, ...aria } = this.options;\n this.options.getHTMLElement ??= getHTMLElement;\n for (const [key, val] of Object.entries(aria)) {\n if (isARIAMixinProp(key)) {\n this[key as keyof this] = val as this[keyof this];\n }\n }\n }\n\n hostConnected?(): void;\n\n setFormValue(...args: Parameters<ElementInternals['setFormValue']>): void {\n return this.internals.setFormValue(...args);\n }\n\n setValidity(...args: Parameters<ElementInternals['setValidity']>): void {\n return this.internals.setValidity(...args);\n }\n\n checkValidity(...args: Parameters<ElementInternals['checkValidity']>): boolean {\n return this.internals.checkValidity(...args);\n }\n\n reportValidity(...args: Parameters<ElementInternals['reportValidity']>): boolean {\n return this.internals.reportValidity(...args);\n }\n\n submit(): void {\n this.internals.form?.requestSubmit();\n }\n\n reset(): void {\n this.internals.form?.reset();\n }\n}\n\n/** @see https://w3c.github.io/aria/#ref-for-dom-ariamixin-ariaactivedescendantelement-1 */\ndeclare global {\n interface ARIAMixin {\n ariaActiveDescendantElement: Element | null;\n ariaControlsElements: readonly Element[] | null;\n ariaDescribedByElements: readonly Element[] | null;\n ariaDetailsElements: readonly Element[] | null;\n ariaErrorMessageElements: readonly Element[] | null;\n ariaFlowToElements: readonly Element[] | null;\n ariaLabelledByElements: readonly Element[] | null;\n ariaOwnsElements: readonly Element[] | null;\n }\n}\n"]}
1
+ {"version":3,"file":"internals-controller.js","sourceRoot":"","sources":["internals-controller.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,QAAQ,G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AAEjD;IAAL,IAAI;gEAA8C;AAE7C;IAAL,IAAI;qEAAmD;AAElD;IAAL,IAAI;+DAA6C;AAE5C;IAAL,IAAI;mEAAiD;AAEhD;IAAL,IAAI;6DAA2C","sourcesContent":["import {\n isServer,\n type ReactiveController,\n type ReactiveControllerHost,\n type LitElement,\n} from 'lit';\n\nfunction isARIAMixinProp(key: string): key is keyof ARIAMixin {\n return key === 'role' || key.startsWith('aria');\n}\n\ntype FACE = HTMLElement & {\n formDisabledCallback?(disabled: boolean): void;\n};\n\nconst protos = new WeakMap();\n\nlet constructingAllowed = false;\n\ninterface InternalsControllerOptions extends Partial<ARIAMixin> {\n getHTMLElement?(): HTMLElement;\n}\n\n/**\n * reactively forward the internals object's aria mixin prototype\n * @param target\n * @param key\n */\nfunction aria(\n target: InternalsController,\n key: keyof InternalsController,\n) {\n if (!protos.has(target)) {\n protos.set(target, new Set());\n }\n if (protos.get(target).has(key)) {\n return;\n }\n if (!isARIAMixinProp(key)) {\n throw new Error('@aria can only be called on ARIAMixin properties');\n }\n // typescript experimental decorator\n Object.defineProperty(target, key, {\n enumerable: true,\n configurable: false,\n get(this: InternalsController) {\n // @ts-expect-error: because i'm bad, i'm bad\n const internals = this.attachOrRetrieveInternals();\n return internals[key];\n },\n set(this: InternalsController, value: string | null) {\n // @ts-expect-error: ya know it!\n const internals = this.attachOrRetrieveInternals();\n // @ts-expect-error: shamone!\n internals[key] = value;\n this.host.requestUpdate();\n },\n });\n protos.get(target).add(key);\n}\n\nfunction getLabelText(label: HTMLElement) {\n if (label.hidden) {\n return '';\n } else {\n const ariaLabel = label.getAttribute?.('aria-label');\n return ariaLabel ?? label.textContent;\n }\n}\n\nexport class InternalsController implements ReactiveController, ARIAMixin {\n private static instances = new WeakMap<ReactiveControllerHost, InternalsController>();\n\n declare readonly form: ElementInternals['form'];\n declare readonly shadowRoot: ElementInternals['shadowRoot'];\n\n // https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n declare readonly states: unknown;\n declare readonly willValidate: ElementInternals['willValidate'];\n declare readonly validationMessage: ElementInternals['validationMessage'];\n\n public static getLabels(host: ReactiveControllerHost): Element[] {\n return Array.from(this.instances.get(host)?.internals.labels ?? []) as Element[];\n }\n\n public static isSafari: boolean =\n !isServer && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n\n public static of(\n host: ReactiveControllerHost,\n options?: InternalsControllerOptions,\n ): InternalsController {\n constructingAllowed = true;\n // implement the singleton pattern\n // using a public static constructor method is much easier to manage,\n // due to the quirks of our typescript config\n const instance: InternalsController =\n InternalsController.instances.get(host)\n ?? new InternalsController(host, options);\n instance.initializeOptions(options);\n constructingAllowed = false;\n return instance;\n }\n\n @aria role: string | null = null;\n\n @aria ariaActivedescendant: string | null = null;\n @aria ariaAtomic: string | null = null;\n @aria ariaAutoComplete: string | null = null;\n @aria ariaBusy: string | null = null;\n @aria ariaBrailleLabel: string | null = null;\n @aria ariaBrailleRoleDescription: string | null = null;\n @aria ariaChecked: string | null = null;\n @aria ariaColCount: string | null = null;\n @aria ariaColIndex: string | null = null;\n @aria ariaColIndexText: string | null = null;\n @aria ariaColSpan: string | null = null;\n @aria ariaCurrent: string | null = null;\n @aria ariaDescription: string | null = null;\n @aria ariaDisabled: string | null = null;\n @aria ariaExpanded: string | null = null;\n @aria ariaHasPopup: string | null = null;\n @aria ariaHidden: string | null = null;\n @aria ariaInvalid: string | null = null;\n @aria ariaKeyShortcuts: string | null = null;\n @aria ariaLabel: string | null = null;\n @aria ariaLevel: string | null = null;\n @aria ariaLive: string | null = null;\n @aria ariaModal: string | null = null;\n @aria ariaMultiLine: string | null = null;\n @aria ariaMultiSelectable: string | null = null;\n @aria ariaOrientation: string | null = null;\n @aria ariaPlaceholder: string | null = null;\n @aria ariaPosInSet: string | null = null;\n @aria ariaPressed: string | null = null;\n @aria ariaReadOnly: string | null = null;\n @aria ariaRelevant: string | null = null;\n @aria ariaRequired: string | null = null;\n @aria ariaRoleDescription: string | null = null;\n @aria ariaRowCount: string | null = null;\n @aria ariaRowIndex: string | null = null;\n @aria ariaRowIndexText: string | null = null;\n @aria ariaRowSpan: string | null = null;\n @aria ariaSelected: string | null = null;\n @aria ariaSetSize: string | null = null;\n @aria ariaSort: string | null = null;\n @aria ariaValueMax: string | null = null;\n @aria ariaValueMin: string | null = null;\n @aria ariaValueNow: string | null = null;\n @aria ariaValueText: string | null = null;\n\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaActiveDescendantElement: Element | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaControlsElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaDescribedByElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaDetailsElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaErrorMessageElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaFlowToElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaLabelledByElements: Element[] | null = null;\n /** WARNING: be careful of cross-root ARIA browser support */\n @aria ariaOwnsElements: Element[] | null = null;\n\n /** True when the control is disabled via it's containing fieldset element */\n get formDisabled(): boolean {\n if (isServer) {\n return this._formDisabled;\n } else {\n return this.element?.matches(':disabled') || this._formDisabled;\n }\n }\n\n get labels(): NodeList {\n return this.internals.labels;\n }\n\n get validity(): ValidityState {\n return this.internals.validity;\n }\n\n /** A best-attempt based on observed behaviour in FireFox 115 on fedora 38 */\n get computedLabelText(): string {\n return this.internals.ariaLabel\n || Array.from(this.internals.labels as NodeListOf<HTMLElement>)\n .reduce((acc, label) =>\n `${acc}${getLabelText(label)}`, '');\n }\n\n private get element() {\n if (isServer) {\n // FIXME(bennyp): a little white lie, which may break\n // when the controller is applied to non-lit frameworks.\n return this.host as LitElement;\n } else {\n return this.host instanceof HTMLElement ? this.host : this.options?.getHTMLElement?.();\n }\n }\n\n private internals!: ElementInternals;\n\n private _formDisabled = false;\n\n private constructor(\n public host: ReactiveControllerHost,\n private options?: InternalsControllerOptions,\n ) {\n if (!constructingAllowed) {\n throw new Error('InternalsController must be constructed with `InternalsController.for()`');\n }\n if (!this.element) {\n throw new Error(\n `InternalsController must be instantiated with an HTMLElement or a \\`getHTMLElement\\` function`,\n );\n }\n this.attachOrRetrieveInternals();\n this.initializeOptions(options);\n InternalsController.instances.set(host, this);\n this.#polyfillDisabledPseudo();\n }\n\n /**\n * We need to polyfill :disabled\n * see https://github.com/calebdwilliams/element-internals-polyfill/issues/88\n */\n #polyfillDisabledPseudo() {\n // START polyfill-disabled\n // We need to polyfill :disabled\n // see https://github.com/calebdwilliams/element-internals-polyfill/issues/88\n const orig = (this.element as FACE).formDisabledCallback;\n (this.element as FACE).formDisabledCallback = disabled => {\n this._formDisabled = disabled;\n orig?.call(this.host, disabled);\n // END polyfill-disabled\n };\n }\n\n /**\n * Typescript (with experimental decorators) will compile the class\n * such that the order of operations is:\n * 1. set up constructor parameter fields\n * 2. run decorated field setters with initializers as the value\n * 3. run the rest of the constructor\n * Because of that, `this.internals` may not be available in the decorator setter\n * so we cheat here with nullish coalescing assignment operator `??=`;\n */\n private attachOrRetrieveInternals() {\n this.internals ??= this.element!.attachInternals();\n return this.internals;\n }\n\n private initializeOptions(options?: Partial<ARIAMixin>) {\n this.options ??= options ?? {};\n const { getHTMLElement, ...aria } = this.options;\n this.options.getHTMLElement ??= getHTMLElement;\n for (const [key, val] of Object.entries(aria)) {\n if (isARIAMixinProp(key)) {\n this[key as keyof this] = val as this[keyof this];\n }\n }\n }\n\n hostConnected?(): void;\n\n setFormValue(...args: Parameters<ElementInternals['setFormValue']>): void {\n return this.internals.setFormValue(...args);\n }\n\n setValidity(...args: Parameters<ElementInternals['setValidity']>): void {\n return this.internals.setValidity(...args);\n }\n\n checkValidity(...args: Parameters<ElementInternals['checkValidity']>): boolean {\n return this.internals.checkValidity(...args);\n }\n\n reportValidity(...args: Parameters<ElementInternals['reportValidity']>): boolean {\n return this.internals.reportValidity(...args);\n }\n\n submit(): void {\n this.internals.form?.requestSubmit();\n }\n\n reset(): void {\n this.internals.form?.reset();\n }\n}\n\n/** @see https://w3c.github.io/aria/#ref-for-dom-ariamixin-ariaactivedescendantelement-1 */\ndeclare global {\n interface ARIAMixin {\n ariaActiveDescendantElement: Element | null;\n ariaControlsElements: readonly Element[] | null;\n ariaDescribedByElements: readonly Element[] | null;\n ariaDetailsElements: readonly Element[] | null;\n ariaErrorMessageElements: readonly Element[] | null;\n ariaFlowToElements: readonly Element[] | null;\n ariaLabelledByElements: readonly Element[] | null;\n ariaOwnsElements: readonly Element[] | null;\n }\n}\n"]}
@@ -10,7 +10,7 @@ export declare class SlotController implements SlotControllerPublicAPI {
10
10
  constructor(host: ReactiveElement, ..._: SlotControllerArgs);
11
11
  hostConnected?(): Promise<void>;
12
12
  private fromAttribute;
13
- getSlotted<T extends Element = Element>(..._: string[]): T[];
13
+ getSlotted<T extends Element = Element>(..._: (string | null)[]): T[];
14
14
  hasSlotted(...names: (string | null)[]): boolean;
15
15
  isEmpty(...names: (string | null)[]): boolean;
16
16
  }
@@ -17,6 +17,9 @@ export class SlotController {
17
17
  const attr = this.host.getAttribute(_a.attribute);
18
18
  const anon = this.host.hasAttribute(_a.anonymousAttribute);
19
19
  const hints = new Set(this.fromAttribute(attr));
20
+ if (!names.length) {
21
+ names.push(null);
22
+ }
20
23
  return names.every(x => x === null ? anon : hints.has(x));
21
24
  }
22
25
  isEmpty(...names) {
@@ -1 +1 @@
1
- {"version":3,"file":"slot-controller-server.js","sourceRoot":"","sources":["slot-controller-server.ts"],"names":[],"mappings":";AACA,OAAO,EAGN,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,cAAc;IAUzB,YAAmB,IAAqB,EAAE,GAAG,CAAqB;QAA/C,SAAI,GAAJ,IAAI,CAAiB;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAIO,aAAa,CAAC,KAAoB;QACxC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;aACf,KAAK,CAAC,MAAM,CAAC;aACb,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,UAAU,CAA8B,GAAG,CAAW;QACpD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,UAAU,CAAC,GAAG,KAAwB;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAc,CAAC,SAAS,CAAC,CAAC;QAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAc,CAAC,kBAAkB,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,CAAC,GAAG,KAAwB;QACjC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;;;AAlCa,sBAAO,GAAG,MAAM,CAAC,cAAc,CAA4B,AAApD,CAAqD;AAE1E,gCAAgC;AAClB,wBAAS,GAAW,EAAI,CAAC,OAAO,AAAvB,CAAwB;AAExC,wBAAS,GAAG,sBAA+B,AAAlC,CAAmC;AAE5C,iCAAkB,GAAG,8BAAuC,AAA1C,CAA2C","sourcesContent":["import type { ReactiveElement } from 'lit';\nimport {\n type SlotControllerArgs,\n type SlotControllerPublicAPI,\n} from './slot-controller.js';\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 static attribute = 'ssr-hint-has-slotted' as const;\n\n static anonymousAttribute = 'ssr-hint-has-slotted-default' as const;\n\n constructor(public host: ReactiveElement, ..._: SlotControllerArgs) {\n host.addController(this);\n }\n\n hostConnected?(): Promise<void>;\n\n private fromAttribute(slots: string | null) {\n return (slots ?? '')\n .split(/[, ]/)\n .map(x => x.trim());\n }\n\n getSlotted<T extends Element = Element>(..._: string[]): T[] {\n return [];\n }\n\n hasSlotted(...names: (string | null)[]): boolean {\n const attr = this.host.getAttribute(SlotController.attribute);\n const anon = this.host.hasAttribute(SlotController.anonymousAttribute);\n const hints = new Set(this.fromAttribute(attr));\n return names.every(x => x === null ? anon : hints.has(x));\n }\n\n isEmpty(...names: (string | null)[]): boolean {\n return !this.hasSlotted(...names);\n }\n}\n"]}
1
+ {"version":3,"file":"slot-controller-server.js","sourceRoot":"","sources":["slot-controller-server.ts"],"names":[],"mappings":";AACA,OAAO,EAGN,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,cAAc;IAUzB,YAAmB,IAAqB,EAAE,GAAG,CAAqB;QAA/C,SAAI,GAAJ,IAAI,CAAiB;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAIO,aAAa,CAAC,KAAoB;QACxC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;aACf,KAAK,CAAC,MAAM,CAAC;aACb,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,UAAU,CAA8B,GAAG,CAAoB;QAC7D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,UAAU,CAAC,GAAG,KAAwB;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAc,CAAC,SAAS,CAAC,CAAC;QAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,EAAc,CAAC,kBAAkB,CAAC,CAAC;QACvE,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,CAAC,GAAG,KAAwB;QACjC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;;;AArCa,sBAAO,GAAG,MAAM,CAAC,cAAc,CAA4B,AAApD,CAAqD;AAE1E,gCAAgC;AAClB,wBAAS,GAAW,EAAI,CAAC,OAAO,AAAvB,CAAwB;AAExC,wBAAS,GAAG,sBAA+B,AAAlC,CAAmC;AAE5C,iCAAkB,GAAG,8BAAuC,AAA1C,CAA2C","sourcesContent":["import type { ReactiveElement } from 'lit';\nimport {\n type SlotControllerArgs,\n type SlotControllerPublicAPI,\n} from './slot-controller.js';\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 static attribute = 'ssr-hint-has-slotted' as const;\n\n static anonymousAttribute = 'ssr-hint-has-slotted-default' as const;\n\n constructor(public host: ReactiveElement, ..._: SlotControllerArgs) {\n host.addController(this);\n }\n\n hostConnected?(): Promise<void>;\n\n private fromAttribute(slots: string | null) {\n return (slots ?? '')\n .split(/[, ]/)\n .map(x => x.trim());\n }\n\n getSlotted<T extends Element = Element>(..._: (string | null)[]): T[] {\n return [];\n }\n\n hasSlotted(...names: (string | null)[]): boolean {\n const attr = this.host.getAttribute(SlotController.attribute);\n const anon = this.host.hasAttribute(SlotController.anonymousAttribute);\n const hints = new Set(this.fromAttribute(attr));\n if (!names.length) {\n names.push(null);\n }\n return names.every(x => x === null ? anon : hints.has(x));\n }\n\n isEmpty(...names: (string | null)[]): boolean {\n return !this.hasSlotted(...names);\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  import { __decorate } from "tslib";
2
- import { expect, fixture, nextFrame } from '@open-wc/testing';
2
+ import { expect, fixture } from '@open-wc/testing';
3
3
  import { customElement } from 'lit/decorators/custom-element.js';
4
4
  import { LitElement, html } from 'lit';
5
5
  import { SlotController } from '../slot-controller.js';
6
- let TestSlotControllerWithNamedAndAnonymous = class TestSlotControllerWithNamedAndAnonymous extends LitElement {
6
+ import { SlotController as SlotControllerServer } from '../slot-controller-server.js';
7
+ let TestSlotController = class TestSlotController extends LitElement {
7
8
  constructor() {
8
9
  super(...arguments);
9
10
  this.controller = new SlotController(this, 'a', null);
@@ -11,21 +12,35 @@ let TestSlotControllerWithNamedAndAnonymous = class TestSlotControllerWithNamedA
11
12
  render() {
12
13
  return html `
13
14
  <slot name="a"></slot>
14
- <slot name="b"></slot>
15
15
  <slot></slot>
16
16
  `;
17
17
  }
18
18
  };
19
- TestSlotControllerWithNamedAndAnonymous = __decorate([
20
- customElement('test-slot-controller-with-named-and-anonymous')
21
- ], TestSlotControllerWithNamedAndAnonymous);
19
+ TestSlotController = __decorate([
20
+ customElement('test-slot-controller')
21
+ ], TestSlotController);
22
+ let TestSlotControllerServer = class TestSlotControllerServer extends LitElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.controller = new SlotControllerServer(this, 'a', null);
26
+ }
27
+ render() {
28
+ return html `
29
+ <slot name="a"></slot>
30
+ <slot></slot>
31
+ `;
32
+ }
33
+ };
34
+ TestSlotControllerServer = __decorate([
35
+ customElement('test-slot-controller-server')
36
+ ], TestSlotControllerServer);
22
37
  describe('SlotController', function () {
23
38
  describe('with named and anonymous slots', function () {
24
39
  describe('with no content', function () {
25
40
  let element;
26
41
  beforeEach(async function () {
27
42
  element = await fixture(html `
28
- <test-slot-controller-with-named-and-anonymous></test-slot-controller-with-named-and-anonymous>
43
+ <test-slot-controller></test-slot-controller>
29
44
  `);
30
45
  });
31
46
  it('reports empty named slots', function () {
@@ -54,9 +69,9 @@ describe('SlotController', function () {
54
69
  let element;
55
70
  beforeEach(async function () {
56
71
  element = await fixture(html `
57
- <test-slot-controller-with-named-and-anonymous>
72
+ <test-slot-controller>
58
73
  <p>element</p>
59
- </test-slot-controller-with-named-and-anonymous>
74
+ </test-slot-controller>
60
75
  `);
61
76
  });
62
77
  it('reports empty named slots', function () {
@@ -85,9 +100,9 @@ describe('SlotController', function () {
85
100
  let element;
86
101
  beforeEach(async function () {
87
102
  element = await fixture(html `
88
- <test-slot-controller-with-named-and-anonymous>
103
+ <test-slot-controller>
89
104
  <p slot="a">element</p>
90
- </test-slot-controller-with-named-and-anonymous>
105
+ </test-slot-controller>
91
106
  `);
92
107
  });
93
108
  it('reports non-empty named slots', function () {
@@ -116,9 +131,9 @@ describe('SlotController', function () {
116
131
  let element;
117
132
  beforeEach(async function () {
118
133
  element = await fixture(html `
119
- <test-slot-controller-with-named-and-anonymous>
134
+ <test-slot-controller>
120
135
  text
121
- </test-slot-controller-with-named-and-anonymous>
136
+ </test-slot-controller>
122
137
  `);
123
138
  });
124
139
  it('reports empty named slots', function () {
@@ -136,10 +151,198 @@ describe('SlotController', function () {
136
151
  it('returns empty list for getSlotted("a")', function () {
137
152
  expect(element.controller.getSlotted('a')).to.be.empty;
138
153
  });
139
- it('returns lengthy list for getSlotted(null)', function () {
154
+ it('returns empty list for getSlotted(null)', function () {
140
155
  expect(element.controller.getSlotted(null)).to.be.empty;
141
156
  });
142
- it('returns lengthy list for getSlotted()', function () {
157
+ it('returns empty list for getSlotted()', function () {
158
+ expect(element.controller.getSlotted()).to.be.empty;
159
+ });
160
+ });
161
+ describe('with white space in default slot', function () {
162
+ let element;
163
+ beforeEach(async function () {
164
+ element = await fixture(html `
165
+ <test-slot-controller-server>
166
+
167
+ </test-slot-controller-server>
168
+ `);
169
+ });
170
+ it('reports empty named slots', function () {
171
+ expect(element.controller.hasSlotted('a')).to.be.false;
172
+ expect(element.controller.isEmpty('a')).to.be.true;
173
+ });
174
+ it('reports empty default slot', function () {
175
+ expect(element.controller.hasSlotted(null)).to.be.false;
176
+ expect(element.controller.isEmpty(null)).to.be.true;
177
+ });
178
+ it('reports empty default slot with no arguments', function () {
179
+ expect(element.controller.hasSlotted()).to.be.false;
180
+ expect(element.controller.isEmpty()).to.be.true;
181
+ });
182
+ it('returns empty list for getSlotted("a")', function () {
183
+ expect(element.controller.getSlotted('a')).to.be.empty;
184
+ });
185
+ it('returns empty list for getSlotted(null)', function () {
186
+ expect(element.controller.getSlotted(null)).to.be.empty;
187
+ });
188
+ it('returns empty list for getSlotted()', function () {
189
+ expect(element.controller.getSlotted()).to.be.empty;
190
+ });
191
+ });
192
+ });
193
+ });
194
+ describe('SlotController (server)', function () {
195
+ describe('with named and anonymous slots', function () {
196
+ describe('with no ssr hint attrs', function () {
197
+ let element;
198
+ beforeEach(async function () {
199
+ element = await fixture(html `
200
+ <test-slot-controller-server></test-slot-controller-server>
201
+ `);
202
+ });
203
+ it('reports empty named slots', function () {
204
+ expect(element.controller.hasSlotted('a')).to.be.false;
205
+ expect(element.controller.isEmpty('a')).to.be.true;
206
+ });
207
+ it('reports empty default slot', function () {
208
+ expect(element.controller.hasSlotted(null)).to.be.false;
209
+ expect(element.controller.isEmpty(null)).to.be.true;
210
+ });
211
+ it('reports empty default slot with no arguments', function () {
212
+ expect(element.controller.hasSlotted()).to.be.false;
213
+ expect(element.controller.isEmpty()).to.be.true;
214
+ });
215
+ it('returns empty list for getSlotted("a")', function () {
216
+ expect(element.controller.getSlotted('a')).to.be.empty;
217
+ });
218
+ it('returns empty list for getSlotted(null)', function () {
219
+ expect(element.controller.getSlotted(null)).to.be.empty;
220
+ });
221
+ it('returns empty list for getSlotted()', function () {
222
+ expect(element.controller.getSlotted()).to.be.empty;
223
+ });
224
+ });
225
+ describe('with ssr-hint-has-slotted-default attr', function () {
226
+ let element;
227
+ beforeEach(async function () {
228
+ element = await fixture(html `
229
+ <test-slot-controller-server ssr-hint-has-slotted-default>
230
+ <p>element</p>
231
+ </test-slot-controller-server>
232
+ `);
233
+ });
234
+ it('reports empty named slots', function () {
235
+ expect(element.controller.hasSlotted('a')).to.be.false;
236
+ expect(element.controller.isEmpty('a')).to.be.true;
237
+ });
238
+ it('reports non-empty default slot', function () {
239
+ expect(element.controller.hasSlotted(null)).to.be.true;
240
+ expect(element.controller.isEmpty(null)).to.be.false;
241
+ });
242
+ it('reports non-empty default slot with no arguments', function () {
243
+ expect(element.controller.hasSlotted()).to.be.true;
244
+ expect(element.controller.isEmpty()).to.be.false;
245
+ });
246
+ it('returns empty list for getSlotted("a")', function () {
247
+ expect(element.controller.getSlotted('a')).to.be.empty;
248
+ });
249
+ it('returns empty list for getSlotted(null)', function () {
250
+ expect(element.controller.getSlotted(null)).to.be.empty;
251
+ });
252
+ it('returns empty list for getSlotted()', function () {
253
+ expect(element.controller.getSlotted()).to.be.empty;
254
+ });
255
+ });
256
+ describe('with ssr-hint-has-slotted="a" attr', function () {
257
+ let element;
258
+ beforeEach(async function () {
259
+ element = await fixture(html `
260
+ <test-slot-controller-server ssr-hint-has-slotted="a">
261
+ <p slot="a">element</p>
262
+ </test-slot-controller-server>
263
+ `);
264
+ });
265
+ it('reports non-empty named slots', function () {
266
+ expect(element.controller.hasSlotted('a')).to.be.true;
267
+ expect(element.controller.isEmpty('a')).to.be.false;
268
+ });
269
+ it('reports empty default slot', function () {
270
+ expect(element.controller.hasSlotted(null)).to.be.false;
271
+ expect(element.controller.isEmpty(null)).to.be.true;
272
+ });
273
+ it('reports empty default slot with no arguments', function () {
274
+ expect(element.controller.hasSlotted()).to.be.false;
275
+ expect(element.controller.isEmpty()).to.be.true;
276
+ });
277
+ it('returns empty list for getSlotted("a")', function () {
278
+ expect(element.controller.getSlotted('a')).to.be.empty;
279
+ });
280
+ it('returns empty list for getSlotted(null)', function () {
281
+ expect(element.controller.getSlotted(null)).to.be.empty;
282
+ });
283
+ it('returns empty list for getSlotted()', function () {
284
+ expect(element.controller.getSlotted()).to.be.empty;
285
+ });
286
+ });
287
+ describe('with ssr-hint-has-slotted-default attr (text node)', function () {
288
+ let element;
289
+ beforeEach(async function () {
290
+ element = await fixture(html `
291
+ <test-slot-controller-server ssr-hint-has-slotted-default>
292
+ text
293
+ </test-slot-controller-server>
294
+ `);
295
+ });
296
+ it('reports empty named slots', function () {
297
+ expect(element.controller.hasSlotted('a')).to.be.false;
298
+ expect(element.controller.isEmpty('a')).to.be.true;
299
+ });
300
+ it('reports non-empty default slot', function () {
301
+ expect(element.controller.hasSlotted(null)).to.be.true;
302
+ expect(element.controller.isEmpty(null)).to.be.false;
303
+ });
304
+ it('reports non-empty default slot with no arguments', function () {
305
+ expect(element.controller.hasSlotted()).to.be.true;
306
+ expect(element.controller.isEmpty()).to.be.false;
307
+ });
308
+ it('returns empty list for getSlotted("a")', function () {
309
+ expect(element.controller.getSlotted('a')).to.be.empty;
310
+ });
311
+ it('returns empty list for getSlotted(null)', function () {
312
+ expect(element.controller.getSlotted(null)).to.be.empty;
313
+ });
314
+ it('returns empty list for getSlotted()', function () {
315
+ expect(element.controller.getSlotted()).to.be.empty;
316
+ });
317
+ });
318
+ describe('with no ssr hint attrs (white space text node)', function () {
319
+ let element;
320
+ beforeEach(async function () {
321
+ element = await fixture(html `
322
+ <test-slot-controller-server>
323
+
324
+ </test-slot-controller-server>
325
+ `);
326
+ });
327
+ it('reports empty named slots', function () {
328
+ expect(element.controller.hasSlotted('a')).to.be.false;
329
+ expect(element.controller.isEmpty('a')).to.be.true;
330
+ });
331
+ it('reports empty default slot', function () {
332
+ expect(element.controller.hasSlotted(null)).to.be.false;
333
+ expect(element.controller.isEmpty(null)).to.be.true;
334
+ });
335
+ it('reports empty default slot with no arguments', function () {
336
+ expect(element.controller.hasSlotted()).to.be.false;
337
+ expect(element.controller.isEmpty()).to.be.true;
338
+ });
339
+ it('returns empty list for getSlotted("a")', function () {
340
+ expect(element.controller.getSlotted('a')).to.be.empty;
341
+ });
342
+ it('returns empty list for getSlotted(null)', function () {
343
+ expect(element.controller.getSlotted(null)).to.be.empty;
344
+ });
345
+ it('returns empty list for getSlotted()', function () {
143
346
  expect(element.controller.getSlotted()).to.be.empty;
144
347
  });
145
348
  });
@@ -1 +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;AAED,QAAQ,CAAC,gBAAgB,EAAE;IACzB,QAAQ,CAAC,gCAAgC,EAAE;QACzC,QAAQ,CAAC,iBAAiB,EAAE;YAC1B,IAAI,OAAgD,CAAC;YACrD,UAAU,CAAC,KAAK;gBACd,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA;;SAE3B,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,2BAA2B,EAAE;gBAC9B,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CA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U,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;gBACvD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACvD,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,kDAAkD,EAAE;gBACrD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;gBACnD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACnD,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,wCAAwC,EAAE;gBAC3C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACzD,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,2CAA2C,EAAE;gBAC9C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YAC1D,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,uCAAuC,EAAE;gBAC1C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,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"]}
1
+ {"version":3,"file":"slot-controller.spec.js","sourceRoot":"","sources":["slot-controller.spec.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,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;AACvD,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGtF,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAA3C;;QACE,eAAU,GAAG,IAAI,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAOnD,CAAC;IANC,MAAM;QACJ,OAAO,IAAI,CAAA;;;KAGV,CAAC;IACJ,CAAC;CACF,CAAA;AARK,kBAAkB;IADvB,aAAa,CAAC,sBAAsB,CAAC;GAChC,kBAAkB,CAQvB;AAGD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,UAAU;IAAjD;;QACE,eAAU,GAAG,IAAI,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAOzD,CAAC;IANC,MAAM;QACJ,OAAO,IAAI,CAAA;;;KAGV,CAAC;IACJ,CAAC;CACF,CAAA;AARK,wBAAwB;IAD7B,aAAa,CAAC,6BAA6B,CAAC;GACvC,wBAAwB,CAQ7B;AAED,QAAQ,CAAC,gBAAgB,EAAE;IACzB,QAAQ,CAAC,gCAAgC,EAAE;QACzC,QAAQ,CAAC,iBAAiB,EAAE;YAC1B,IAAI,OAA2B,CAAC;YAChC,UAAU,CAAC,KAAK;gBACd,OAAO,GAAG,MAAM,OAAO,CAAC,IA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gBACpD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;YAClD,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,wCAAwC,EAAE;gBAC3C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YACzD,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,yCAAyC,EAAE;gBAC5C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YAC1D,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,qCAAqC,EAAE;gBACxC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,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 } 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';\nimport { SlotController as SlotControllerServer } from '../slot-controller-server.js';\n\n@customElement('test-slot-controller')\nclass TestSlotController extends LitElement {\n controller = new SlotController(this, 'a', null);\n render(): TemplateResult {\n return html`\n <slot name=\"a\"></slot>\n <slot></slot>\n `;\n }\n}\n\n@customElement('test-slot-controller-server')\nclass TestSlotControllerServer extends LitElement {\n controller = new SlotControllerServer(this, 'a', null);\n render(): TemplateResult {\n return html`\n <slot name=\"a\"></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: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller></test-slot-controller>\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: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller>\n <p>element</p>\n </test-slot-controller>\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: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller>\n <p slot=\"a\">element</p>\n </test-slot-controller>\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: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller>\n text\n </test-slot-controller>\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 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 white space in default slot', function() {\n let element: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-server>\n\n </test-slot-controller-server>\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});\n\ndescribe('SlotController (server)', function() {\n describe('with named and anonymous slots', function() {\n describe('with no ssr hint attrs', function() {\n let element: TestSlotControllerServer;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-server></test-slot-controller-server>\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 ssr-hint-has-slotted-default attr', function() {\n let element: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-server ssr-hint-has-slotted-default>\n <p>element</p>\n </test-slot-controller-server>\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 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 ssr-hint-has-slotted=\"a\" attr', function() {\n let element: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-server ssr-hint-has-slotted=\"a\">\n <p slot=\"a\">element</p>\n </test-slot-controller-server>\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 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 ssr-hint-has-slotted-default attr (text node)', function() {\n let element: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-server ssr-hint-has-slotted-default>\n text\n </test-slot-controller-server>\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 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 no ssr hint attrs (white space text node)', function() {\n let element: TestSlotController;\n beforeEach(async function() {\n element = await fixture(html`\n <test-slot-controller-server>\n\n </test-slot-controller-server>\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});\n"]}