@patternfly/pfe-core 2.4.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +0 -1
  2. package/controllers/cascade-controller.d.ts +6 -0
  3. package/controllers/cascade-controller.js +5 -3
  4. package/controllers/cascade-controller.js.map +1 -1
  5. package/controllers/floating-dom-controller.d.ts +2 -2
  6. package/controllers/floating-dom-controller.js +84 -81
  7. package/controllers/floating-dom-controller.js.map +1 -1
  8. package/controllers/internals-controller.d.ts +86 -41
  9. package/controllers/internals-controller.js +322 -36
  10. package/controllers/internals-controller.js.map +1 -1
  11. package/controllers/light-dom-controller.js.map +1 -1
  12. package/controllers/listbox-controller.d.ts +58 -0
  13. package/controllers/listbox-controller.js +250 -0
  14. package/controllers/listbox-controller.js.map +1 -0
  15. package/controllers/logger.d.ts +27 -3
  16. package/controllers/logger.js +50 -9
  17. package/controllers/logger.js.map +1 -1
  18. package/controllers/overflow-controller.d.ts +10 -3
  19. package/controllers/overflow-controller.js +75 -44
  20. package/controllers/overflow-controller.js.map +1 -1
  21. package/controllers/perf-controller.js.map +1 -1
  22. package/controllers/property-observer-controller.js +2 -3
  23. package/controllers/property-observer-controller.js.map +1 -1
  24. package/controllers/roving-tabindex-controller.d.ts +42 -24
  25. package/controllers/roving-tabindex-controller.js +167 -140
  26. package/controllers/roving-tabindex-controller.js.map +1 -1
  27. package/controllers/scroll-spy-controller.js +91 -93
  28. package/controllers/scroll-spy-controller.js.map +1 -1
  29. package/controllers/slot-controller.d.ts +18 -20
  30. package/controllers/slot-controller.js +89 -91
  31. package/controllers/slot-controller.js.map +1 -1
  32. package/controllers/style-controller.js.map +1 -1
  33. package/controllers/tabs-aria-controller.d.ts +29 -0
  34. package/controllers/tabs-aria-controller.js +95 -0
  35. package/controllers/tabs-aria-controller.js.map +1 -0
  36. package/controllers/timestamp-controller.js +68 -70
  37. package/controllers/timestamp-controller.js.map +1 -1
  38. package/core.d.ts +3 -0
  39. package/core.js.map +1 -1
  40. package/custom-elements.json +3245 -1317
  41. package/decorators/bound.js.map +1 -1
  42. package/decorators/cascades.d.ts +1 -0
  43. package/decorators/cascades.js +1 -0
  44. package/decorators/cascades.js.map +1 -1
  45. package/decorators/deprecation.js.map +1 -1
  46. package/decorators/initializer.js.map +1 -1
  47. package/decorators/observed.js.map +1 -1
  48. package/decorators/time.js.map +1 -1
  49. package/decorators/trace.js.map +1 -1
  50. package/functions/containsDeep.d.ts +6 -0
  51. package/functions/containsDeep.js +21 -0
  52. package/functions/containsDeep.js.map +1 -0
  53. package/functions/context.d.ts +9 -0
  54. package/functions/context.js +17 -0
  55. package/functions/context.js.map +1 -0
  56. package/functions/debounce.js.map +1 -1
  57. package/functions/isElementInView.js.map +1 -1
  58. package/package.json +7 -4
  59. package/functions/deprecatedCustomEvent.d.ts +0 -5
  60. package/functions/deprecatedCustomEvent.js +0 -12
  61. package/functions/deprecatedCustomEvent.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"bound.js","sourceRoot":"","sources":["bound.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,CAAU,EAAE,GAAW,EAAE,UAA8B;IAC3E,IAAI,OAAO,UAAU,EAAE,KAAK,KAAK,UAAU,EAAE;QAC3C,MAAM,IAAI,SAAS,CAAC,+CAA+C,GAAG,IAAK,CAAgB,CAAC,IAAI,oBAAoB,CAAC,CAAC;KACvH,CAAC,oBAAoB;IACtB,OAAO;QACL,YAAY;QACZ,GAAG;YACD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1E,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["const configurable = true;\n\n/**\n * Binds a class method to the instance\n *\n * @example Binding an event listener\n * ```ts\n * private mo = new MutationObserver(this.onMutation);\n *\n * @bound onMutation(records: MutationRecord[]) {\n * this.count = this.children.length;\n * }\n * ```\n */\nexport function bound(_: unknown, key: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n if (typeof descriptor?.value !== 'function') {\n throw new TypeError(`Only methods can be decorated with @bound. <${key ?? (_ as () => void).name}> is not a method!`);\n } /* c8 ignore next */\n return {\n configurable,\n get() {\n const value = descriptor.value.bind(this);\n Object.defineProperty(this, key, { value, configurable, writable: true });\n return value;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"bound.js","sourceRoot":"","sources":["bound.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,CAAU,EAAE,GAAW,EAAE,UAA8B;IAC3E,IAAI,OAAO,UAAU,EAAE,KAAK,KAAK,UAAU,EAAE,CAAC;QAC5C,MAAM,IAAI,SAAS,CAAC,+CAA+C,GAAG,IAAK,CAAgB,CAAC,IAAI,oBAAoB,CAAC,CAAC;IACxH,CAAC,CAAC,oBAAoB;IACtB,OAAO;QACL,YAAY;QACZ,GAAG;YACD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1E,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["const configurable = true;\n\n/**\n * Binds a class method to the instance\n *\n * @example Binding an event listener\n * ```ts\n * private mo = new MutationObserver(this.onMutation);\n *\n * @bound onMutation(records: MutationRecord[]) {\n * this.count = this.children.length;\n * }\n * ```\n */\nexport function bound(_: unknown, key: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n if (typeof descriptor?.value !== 'function') {\n throw new TypeError(`Only methods can be decorated with @bound. <${key ?? (_ as () => void).name}> is not a method!`);\n } /* c8 ignore next */\n return {\n configurable,\n get() {\n const value = descriptor.value.bind(this);\n Object.defineProperty(this, key, { value, configurable, writable: true });\n return value;\n },\n };\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { ReactiveElement } from 'lit';
2
2
  /**
3
3
  * Cascades the decorated attribute to children
4
+ * @deprecated: use context, especially via `@patternfly/pfe-core/functions/context.js`;
4
5
  */
5
6
  export declare function cascades<T extends ReactiveElement>(...items: string[]): PropertyDecorator;
@@ -1,6 +1,7 @@
1
1
  import { CascadeController } from '../controllers/cascade-controller.js';
2
2
  /**
3
3
  * Cascades the decorated attribute to children
4
+ * @deprecated: use context, especially via `@patternfly/pfe-core/functions/context.js`;
4
5
  */
5
6
  export function cascades(...items) {
6
7
  return function (proto, key) {
@@ -1 +1 @@
1
- {"version":3,"file":"cascades.js","sourceRoot":"","sources":["cascades.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE;;GAEG;AACH,MAAM,UAAU,QAAQ,CAA4B,GAAG,KAAe;IACpE,OAAO,UAAS,KAAQ,EAAE,GAAqB;QAC5C,KAAK,CAAC,WAAsC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;YAC/D,MAAM,QAAQ,GAAG,CAAoB,CAAC;YACtC,6DAA6D;YAC7D,6DAA6D;YAC7D,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;gBAC9C,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;aAC5E;YAED,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAsB,CAAC;AACzB,CAAC","sourcesContent":["import type { ReactiveElement } from 'lit';\n\nimport { CascadeController } from '../controllers/cascade-controller.js';\n\n/**\n * Cascades the decorated attribute to children\n */\nexport function cascades<T extends ReactiveElement>(...items: string[]): PropertyDecorator {\n return function(proto: T, key: string & keyof T) {\n (proto.constructor as typeof ReactiveElement).addInitializer(x => {\n const instance = x as ReactiveElement;\n // You can have multiple `@cascades` decorators on an element\n // and it will only get one CascadeController for all of them\n if (!CascadeController.instances.has(instance)) {\n CascadeController.instances.set(instance, new CascadeController(instance));\n }\n\n CascadeController.instances.get(instance)?.initProp(key, items);\n });\n } as PropertyDecorator;\n}\n"]}
1
+ {"version":3,"file":"cascades.js","sourceRoot":"","sources":["cascades.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAA4B,GAAG,KAAe;IACpE,OAAO,UAAS,KAAQ,EAAE,GAAqB;QAC5C,KAAK,CAAC,WAAsC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;YAC/D,MAAM,QAAQ,GAAG,CAAoB,CAAC;YACtC,6DAA6D;YAC7D,6DAA6D;YAC7D,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC/C,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC7E,CAAC;YAED,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAsB,CAAC;AACzB,CAAC","sourcesContent":["import type { ReactiveElement } from 'lit';\n\nimport { CascadeController } from '../controllers/cascade-controller.js';\n\n/**\n * Cascades the decorated attribute to children\n * @deprecated: use context, especially via `@patternfly/pfe-core/functions/context.js`;\n */\nexport function cascades<T extends ReactiveElement>(...items: string[]): PropertyDecorator {\n return function(proto: T, key: string & keyof T) {\n (proto.constructor as typeof ReactiveElement).addInitializer(x => {\n const instance = x as ReactiveElement;\n // You can have multiple `@cascades` decorators on an element\n // and it will only get one CascadeController for all of them\n if (!CascadeController.instances.has(instance)) {\n CascadeController.instances.set(instance, new CascadeController(instance));\n }\n\n CascadeController.instances.get(instance)?.initProp(key, items);\n });\n } as PropertyDecorator;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"deprecation.js","sourceRoot":"","sources":["deprecation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAOlD;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAwB,OAAkC;IACnF,OAAO,UACL,KAAgC,EAChC,GAAqB;QAErB,MAAM,EAAE,KAAK,EAAE,GAAG,kBAAkB,EAAE,GAAG,OAAO,CAAC;QACjD,MAAM,KAAK,GAAI,KAAK,CAAC,WAAsC,CAAC;QAC5D,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpD,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,GAAG,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAC,CAAC;QACrE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;YAC9B,QAAQ,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAa,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,WAAW;IAKf,YACU,IAAO,EACP,OAAkC,EAClC,aAA+B;QAF/B,SAAI,GAAJ,IAAI,CAAG;QACP,YAAO,GAAP,OAAO,CAA2B;QAClC,kBAAa,GAAb,aAAa,CAAkB;QALjC,WAAM,GAAG,KAAK,CAAC;QAOrB,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,UAAU;QACR,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC;QACnD,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;YAC5B,IAAI,IAAI,CAAC,IAAI,CAAC,KAAgB,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;gBAC5D,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;oBAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,uBAAuB,KAAK,UAAU,CAAC,CAAC;oBACzE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;iBACpB;gBACD,IAAI,CAAC,IAAI,CAAC,KAAgB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aACxD;SACF;IACH,CAAC;CACF","sourcesContent":["import type { ReactiveElement, PropertyDeclaration, ReactiveController } from 'lit';\n\nimport { Logger } from '../controllers/logger.js';\n\nexport type DeprecationDeclaration<K extends PropertyKey> = PropertyDeclaration & {\n alias: string & K;\n attribute: string;\n}\n\n/**\n * Aliases the decorated field to an existing property, and logs a warning if it is used\n * @example deprecating an attribute\n * ```ts\n * @property({ reflect: true, attribute: 'color-palette'})\n * colorPalette: ColorPalette = 'base';\n *\n * @deprecation('colorPalette') color?: ColorPalette;\n * ```\n */\nexport function deprecation<K extends PropertyKey>(options: DeprecationDeclaration<K>) {\n return function<T extends ReactiveElement, L extends PropertyKey>(\n proto: Partial<Record<K | L, T>>,\n key: string & keyof T\n ) {\n const { alias, ...deprecationOptions } = options;\n const klass = (proto.constructor as typeof ReactiveElement);\n const declaration = klass.getPropertyOptions(alias);\n klass.createProperty(key, { ...declaration, ...deprecationOptions });\n klass.addInitializer(instance => {\n instance.addController(new Deprecation(instance as T, options, key));\n });\n };\n}\n\nclass Deprecation<T extends ReactiveElement, K extends PropertyKey> implements ReactiveController {\n private logger: Logger;\n\n private logged = false;\n\n constructor(\n private host: T,\n private options: DeprecationDeclaration<K>,\n private deprecatedKey: string & keyof T\n ) {\n this.logger = new Logger(host);\n }\n\n hostUpdate() {\n const { deprecatedKey, options: { alias } } = this;\n if (this.host[deprecatedKey]) {\n if (this.host[alias as keyof T] !== this.host[deprecatedKey]) {\n if (!this.logged) {\n this.logger.warn(`${deprecatedKey} is deprecated, use ${alias} instead`);\n this.logged = true;\n }\n this.host[alias as keyof T] = this.host[deprecatedKey];\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"deprecation.js","sourceRoot":"","sources":["deprecation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAOlD;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAwB,OAAkC;IACnF,OAAO,UACL,KAAgC,EAChC,GAAqB;QAErB,MAAM,EAAE,KAAK,EAAE,GAAG,kBAAkB,EAAE,GAAG,OAAO,CAAC;QACjD,MAAM,KAAK,GAAI,KAAK,CAAC,WAAsC,CAAC;QAC5D,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpD,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,GAAG,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAC,CAAC;QACrE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;YAC9B,QAAQ,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAa,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,WAAW;IAKf,YACU,IAAO,EACP,OAAkC,EAClC,aAA+B;QAF/B,SAAI,GAAJ,IAAI,CAAG;QACP,YAAO,GAAP,OAAO,CAA2B;QAClC,kBAAa,GAAb,aAAa,CAAkB;QALjC,WAAM,GAAG,KAAK,CAAC;QAOrB,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,UAAU;QACR,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC;QACnD,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC7B,IAAI,IAAI,CAAC,IAAI,CAAC,KAAgB,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;gBAC7D,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;oBACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,uBAAuB,KAAK,UAAU,CAAC,CAAC;oBACzE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBACrB,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,KAAgB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import type { ReactiveElement, PropertyDeclaration, ReactiveController } from 'lit';\n\nimport { Logger } from '../controllers/logger.js';\n\nexport type DeprecationDeclaration<K extends PropertyKey> = PropertyDeclaration & {\n alias: string & K;\n attribute: string;\n}\n\n/**\n * Aliases the decorated field to an existing property, and logs a warning if it is used\n * @example deprecating an attribute\n * ```ts\n * @property({ reflect: true, attribute: 'color-palette'})\n * colorPalette: ColorPalette = 'base';\n *\n * @deprecation('colorPalette') color?: ColorPalette;\n * ```\n */\nexport function deprecation<K extends PropertyKey>(options: DeprecationDeclaration<K>) {\n return function<T extends ReactiveElement, L extends PropertyKey>(\n proto: Partial<Record<K | L, T>>,\n key: string & keyof T\n ) {\n const { alias, ...deprecationOptions } = options;\n const klass = (proto.constructor as typeof ReactiveElement);\n const declaration = klass.getPropertyOptions(alias);\n klass.createProperty(key, { ...declaration, ...deprecationOptions });\n klass.addInitializer(instance => {\n instance.addController(new Deprecation(instance as T, options, key));\n });\n };\n}\n\nclass Deprecation<T extends ReactiveElement, K extends PropertyKey> implements ReactiveController {\n private logger: Logger;\n\n private logged = false;\n\n constructor(\n private host: T,\n private options: DeprecationDeclaration<K>,\n private deprecatedKey: string & keyof T\n ) {\n this.logger = new Logger(host);\n }\n\n hostUpdate() {\n const { deprecatedKey, options: { alias } } = this;\n if (this.host[deprecatedKey]) {\n if (this.host[alias as keyof T] !== this.host[deprecatedKey]) {\n if (!this.logged) {\n this.logger.warn(`${deprecatedKey} is deprecated, use ${alias} instead`);\n this.logged = true;\n }\n this.host[alias as keyof T] = this.host[deprecatedKey];\n }\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"initializer.js","sourceRoot":"","sources":["initializer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAA4B,OAAiB;IACtE,OAAO,UAAS,KAAQ,EAAE,GAAW;QACnC,qCAAqC;QACpC,KAAK,CAAC,WAAsC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;YACtE,MAAM,WAAW,GAAG,KAAK,CAAC,GAAc,CAA0B,CAAC;YACnE,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,QAA2B,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YAC7F,IAAI,QAAQ,CAAC,WAAW,EAAE;gBACxB,UAAU,CAAC,aAAa,EAAE,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactiveElement } from 'lit';\nimport type { Options } from '../controllers/light-dom-controller.js';\n\nimport { LightDOMController } from '../controllers/light-dom-controller.js';\n\n/**\n * Runs the decorated method in `connectedCallback`,\n * provided the element has light children, and sets\n * up a mutation observer to re-run the callback,\n * unless opted-out with `{ observe: false }`\n * @param options Set `observe` to `false` to skip mutation observer setup, or pass a MutationObserverInit as options\n */\nexport function initializer<T extends ReactiveElement>(options?: Options) {\n return function(proto: T, key: string) {\n // @TODO: allow multiple initializers\n (proto.constructor as typeof ReactiveElement).addInitializer(instance => {\n const initializer = proto[key as keyof T] as unknown as () => void;\n const controller = new LightDOMController(instance as ReactiveElement, initializer, options);\n if (instance.isConnected) {\n controller.hostConnected();\n }\n });\n };\n}\n"]}
1
+ {"version":3,"file":"initializer.js","sourceRoot":"","sources":["initializer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAA4B,OAAiB;IACtE,OAAO,UAAS,KAAQ,EAAE,GAAW;QACnC,qCAAqC;QACpC,KAAK,CAAC,WAAsC,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;YACtE,MAAM,WAAW,GAAG,KAAK,CAAC,GAAc,CAA0B,CAAC;YACnE,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,QAA2B,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YAC7F,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC;gBACzB,UAAU,CAAC,aAAa,EAAE,CAAC;YAC7B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactiveElement } from 'lit';\nimport type { Options } from '../controllers/light-dom-controller.js';\n\nimport { LightDOMController } from '../controllers/light-dom-controller.js';\n\n/**\n * Runs the decorated method in `connectedCallback`,\n * provided the element has light children, and sets\n * up a mutation observer to re-run the callback,\n * unless opted-out with `{ observe: false }`\n * @param options Set `observe` to `false` to skip mutation observer setup, or pass a MutationObserverInit as options\n */\nexport function initializer<T extends ReactiveElement>(options?: Options) {\n return function(proto: T, key: string) {\n // @TODO: allow multiple initializers\n (proto.constructor as typeof ReactiveElement).addInitializer(instance => {\n const initializer = proto[key as keyof T] as unknown as () => void;\n const controller = new LightDOMController(instance as ReactiveElement, initializer, options);\n if (instance.isConnected) {\n controller.hostConnected();\n }\n });\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"observed.js","sourceRoot":"","sources":["observed.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gDAAgD,CAAC;AAgCxD,MAAM,UAAU,QAAQ,CAA4B,GAAG,EAAS;IAC9D,2CAA2C;IAC3C,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACnB,MAAM,CAAC,oBAAoB,CAAC,GAAG,EAAE,CAAC;QAClC,OAAO,UAAS,KAAK,EAAE,GAAG;YACvB,KAAK,CAAC,WAAsC;iBAC1C,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1D,eAAe,CAAC,KAAK,EAAE,GAAuB,EAAE,oBAAoB,CAAC,CAAC;QACxE,CAAC,CAAC;KACH;SAAM;QACL,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;QACvB,KAAK,CAAC,WAAsC;aAC1C,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KAC7B;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAQ,EACR,GAAqB,EACrB,gBAAoC;IAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE;QAChC,GAAG,UAAU;QACb,YAAY,EAAE,IAAI;QAClB,GAAG,CAAgC,MAAkB;YACnD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAc,CAAC,CAAC;YACpC,yDAAyD;YACzD,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAEpC,yCAAyC;YACzC,uDAAuD;YACvD,sFAAsF;YACtF,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;gBAC1C,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;aAC7C;iBAAM;gBACL,6DAA6D;gBAC7D,qCAAqC;gBACrC,0DAA0D;gBAC1D,MAAM,gBAAgB,GAAG,gBAAgB,IAAI,IAAI,GAAG,SAAS,CAAC;gBAE9D,sEAAsE;gBACtE,gEAAgE;gBAChE,qEAAqE;gBACrE,IAAI,IAAI,CAAC,UAAU,EAAE;oBACnB,IAAI,CAAC,gBAAsC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;iBAChE;qBAAM;oBACL,IAAI,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,GAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;iBACjF;aACF;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ReactiveElement } from 'lit';\nimport type {\n ChangeCallback,\n ChangeCallbackName,\n PropertyObserverHost,\n} from '../controllers/property-observer-controller.js';\n\nimport {\n observedController,\n PropertyObserverController,\n} from '../controllers/property-observer-controller.js';\n\ntype TypedFieldDecorator<T> = (proto: T, key: string | keyof T) => void ;\n\n/**\n * Calls a _fooChanged method on the instance when the value changes.\n * Works on any class field. When using on lit observed properties,\n * Make sure `@observed` is to the left (i.e. called after) the `@property`\n * or `@state` decorator.\n *\n * @example observing a lit property\n * ```ts\n * @observed @property() foo = 'bar';\n *\n * protected _fooChanged(oldValue?: string, newValue?: string) {}\n * ```\n *\n * @example using a custom callback\n * ```ts\n * @observed('_myCallback') size = 'lg';\n *\n * _myCallback(_, size) {...}\n * ```\n *\n * @example using an arrow function\n * ```ts\n * @observed((oldVal, newVal) => console.log(`Size changed from ${oldVal} to ${newVal}`))\n * ```\n */\nexport function observed<T extends ReactiveElement>(methodName: string): TypedFieldDecorator<T>\nexport function observed<T extends ReactiveElement>(cb: ChangeCallback<T>): TypedFieldDecorator<T>\nexport function observed<T extends ReactiveElement>(proto: T, key: string): void\nexport function observed<T extends ReactiveElement>(...as: any[]): void | TypedFieldDecorator<T> {\n /** @observed('_myCustomChangeCallback') */\n if (as.length === 1) {\n const [methodNameOrCallback] = as;\n return function(proto, key) {\n (proto.constructor as typeof ReactiveElement)\n .addInitializer(x => new PropertyObserverController(x));\n observeProperty(proto, key as string & keyof T, methodNameOrCallback);\n };\n } else {\n const [proto, key] = as;\n (proto.constructor as typeof ReactiveElement)\n .addInitializer(x => new PropertyObserverController(x));\n observeProperty(proto, key);\n }\n}\n\nexport function observeProperty<T extends ReactiveElement>(\n proto: T,\n key: string & keyof T,\n callbackOrMethod?: ChangeCallback<T>\n) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n Object.defineProperty(proto, key, {\n ...descriptor,\n configurable: true,\n set(this: PropertyObserverHost<T>, newVal: T[keyof T]) {\n const oldVal = this[key as keyof T];\n // first, call any pre-existing setters, e.g. `@property`\n descriptor?.set?.call(this, newVal);\n\n // if the user passed a callback, call it\n // e.g. `@observed((_, newVal) => console.log(newVal))`\n // safe to call before connectedCallback, because it's impossible to get a `this` ref.\n if (typeof callbackOrMethod === 'function') {\n callbackOrMethod.call(this, oldVal, newVal);\n } else {\n // if the user passed a string method name, call it on `this`\n // e.g. `@observed('_renderOptions')`\n // otherwise, use a default method name e.g. `_fooChanged`\n const actualMethodName = callbackOrMethod || `_${key}Changed`;\n\n // if the component has already connected to the DOM, run the callback\n // otherwise, If the component has not yet connected to the DOM,\n // cache the old and new values. See PropertyObserverController above\n if (this.hasUpdated) {\n this[actualMethodName as ChangeCallbackName]?.(oldVal, newVal);\n } else {\n this[observedController].cache(key as string, actualMethodName, oldVal, newVal);\n }\n }\n },\n });\n}\n"]}
1
+ {"version":3,"file":"observed.js","sourceRoot":"","sources":["observed.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gDAAgD,CAAC;AAgCxD,MAAM,UAAU,QAAQ,CAA4B,GAAG,EAAS;IAC9D,2CAA2C;IAC3C,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,oBAAoB,CAAC,GAAG,EAAE,CAAC;QAClC,OAAO,UAAS,KAAK,EAAE,GAAG;YACvB,KAAK,CAAC,WAAsC;iBAC1C,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1D,eAAe,CAAC,KAAK,EAAE,GAAuB,EAAE,oBAAoB,CAAC,CAAC;QACxE,CAAC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;QACvB,KAAK,CAAC,WAAsC;aAC1C,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAQ,EACR,GAAqB,EACrB,gBAAoC;IAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/D,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE;QAChC,GAAG,UAAU;QACb,YAAY,EAAE,IAAI;QAClB,GAAG,CAAgC,MAAkB;YACnD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAc,CAAC,CAAC;YACpC,yDAAyD;YACzD,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAEpC,yCAAyC;YACzC,uDAAuD;YACvD,sFAAsF;YACtF,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE,CAAC;gBAC3C,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;YAC9C,CAAC;iBAAM,CAAC;gBACN,6DAA6D;gBAC7D,qCAAqC;gBACrC,0DAA0D;gBAC1D,MAAM,gBAAgB,GAAG,gBAAgB,IAAI,IAAI,GAAG,SAAS,CAAC;gBAE9D,sEAAsE;gBACtE,gEAAgE;gBAChE,qEAAqE;gBACrE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;oBACpB,IAAI,CAAC,gBAAsC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACjE,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,GAAa,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;gBAClF,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ReactiveElement } from 'lit';\nimport type {\n ChangeCallback,\n ChangeCallbackName,\n PropertyObserverHost,\n} from '../controllers/property-observer-controller.js';\n\nimport {\n observedController,\n PropertyObserverController,\n} from '../controllers/property-observer-controller.js';\n\ntype TypedFieldDecorator<T> = (proto: T, key: string | keyof T) => void ;\n\n/**\n * Calls a _fooChanged method on the instance when the value changes.\n * Works on any class field. When using on lit observed properties,\n * Make sure `@observed` is to the left (i.e. called after) the `@property`\n * or `@state` decorator.\n *\n * @example observing a lit property\n * ```ts\n * @observed @property() foo = 'bar';\n *\n * protected _fooChanged(oldValue?: string, newValue?: string) {}\n * ```\n *\n * @example using a custom callback\n * ```ts\n * @observed('_myCallback') size = 'lg';\n *\n * _myCallback(_, size) {...}\n * ```\n *\n * @example using an arrow function\n * ```ts\n * @observed((oldVal, newVal) => console.log(`Size changed from ${oldVal} to ${newVal}`))\n * ```\n */\nexport function observed<T extends ReactiveElement>(methodName: string): TypedFieldDecorator<T>\nexport function observed<T extends ReactiveElement>(cb: ChangeCallback<T>): TypedFieldDecorator<T>\nexport function observed<T extends ReactiveElement>(proto: T, key: string): void\nexport function observed<T extends ReactiveElement>(...as: any[]): void | TypedFieldDecorator<T> {\n /** @observed('_myCustomChangeCallback') */\n if (as.length === 1) {\n const [methodNameOrCallback] = as;\n return function(proto, key) {\n (proto.constructor as typeof ReactiveElement)\n .addInitializer(x => new PropertyObserverController(x));\n observeProperty(proto, key as string & keyof T, methodNameOrCallback);\n };\n } else {\n const [proto, key] = as;\n (proto.constructor as typeof ReactiveElement)\n .addInitializer(x => new PropertyObserverController(x));\n observeProperty(proto, key);\n }\n}\n\nexport function observeProperty<T extends ReactiveElement>(\n proto: T,\n key: string & keyof T,\n callbackOrMethod?: ChangeCallback<T>\n) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n Object.defineProperty(proto, key, {\n ...descriptor,\n configurable: true,\n set(this: PropertyObserverHost<T>, newVal: T[keyof T]) {\n const oldVal = this[key as keyof T];\n // first, call any pre-existing setters, e.g. `@property`\n descriptor?.set?.call(this, newVal);\n\n // if the user passed a callback, call it\n // e.g. `@observed((_, newVal) => console.log(newVal))`\n // safe to call before connectedCallback, because it's impossible to get a `this` ref.\n if (typeof callbackOrMethod === 'function') {\n callbackOrMethod.call(this, oldVal, newVal);\n } else {\n // if the user passed a string method name, call it on `this`\n // e.g. `@observed('_renderOptions')`\n // otherwise, use a default method name e.g. `_fooChanged`\n const actualMethodName = callbackOrMethod || `_${key}Changed`;\n\n // if the component has already connected to the DOM, run the callback\n // otherwise, If the component has not yet connected to the DOM,\n // cache the old and new values. See PropertyObserverController above\n if (this.hasUpdated) {\n this[actualMethodName as ChangeCallbackName]?.(oldVal, newVal);\n } else {\n this[observedController].cache(key as string, actualMethodName, oldVal, newVal);\n }\n }\n },\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"time.js","sourceRoot":"","sources":["time.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,GAAY;IAC/B,OAAO,UAAS,CAAU,EAAE,GAAW,EAAE,UAA8B;QACrE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,UAAU,IAAI,EAAE,CAAC;QAEtC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC5D;QAED,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAW;YACxC,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;YACrD,MAAM,SAAS,GAAG,SAAS,GAAG,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC;YAE7B,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE;gBACrC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC7B;YAED,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;YAEhC,MAAM,GAAG,GAAG,GAAG,EAAE;gBACf,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE;oBACrC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC1B,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;oBAC7C,sCAAsC;oBACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;iBAClE;gBACD,OAAO,CAAC,CAAC;YACX,CAAC,CAAC;YAEF,IAAI,CAAC,YAAY,OAAO,EAAE;gBACxB,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACpB;iBAAM;gBACL,OAAO,GAAG,EAAE,CAAC;aACd;QACH,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Tracks the time a method takes to complete using the [performance API](https://developer.mozilla.org/en-US/docs/Web/API/Performance)\n */\nexport function time(tag?: string) {\n return function(_: unknown, key: string, descriptor: PropertyDescriptor) {\n const { value: f } = descriptor ?? {};\n\n if (!(typeof f === 'function')) {\n throw new Error('@time() may only decorate class methods');\n }\n\n descriptor.value = function(...args: any[]) {\n const TAG = tag ?? `${this.constructor.name}-${key}`;\n const START_TAG = `start-${TAG}`;\n const END_TAG = `end-${TAG}`;\n\n if (window.PfeConfig.trackPerformance) {\n performance.mark(START_TAG);\n }\n\n const x = f.call(this, ...args);\n\n const ret = () => {\n if (window.PfeConfig.trackPerformance) {\n performance.mark(END_TAG);\n performance.measure(TAG, START_TAG, END_TAG);\n // eslint-disable-next-line no-console\n console.log(Array.from(performance.getEntriesByName(TAG)).pop());\n }\n return x;\n };\n\n if (x instanceof Promise) {\n return x.then(ret);\n } else {\n return ret();\n }\n };\n };\n}\n"]}
1
+ {"version":3,"file":"time.js","sourceRoot":"","sources":["time.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,GAAY;IAC/B,OAAO,UAAS,CAAU,EAAE,GAAW,EAAE,UAA8B;QACrE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,UAAU,IAAI,EAAE,CAAC;QAEtC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAED,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAW;YACxC,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;YACrD,MAAM,SAAS,GAAG,SAAS,GAAG,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC;YAE7B,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;gBACtC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC9B,CAAC;YAED,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;YAEhC,MAAM,GAAG,GAAG,GAAG,EAAE;gBACf,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;oBACtC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC1B,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;oBAC7C,sCAAsC;oBACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;gBACnE,CAAC;gBACD,OAAO,CAAC,CAAC;YACX,CAAC,CAAC;YAEF,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC;gBACzB,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,EAAE,CAAC;YACf,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Tracks the time a method takes to complete using the [performance API](https://developer.mozilla.org/en-US/docs/Web/API/Performance)\n */\nexport function time(tag?: string) {\n return function(_: unknown, key: string, descriptor: PropertyDescriptor) {\n const { value: f } = descriptor ?? {};\n\n if (!(typeof f === 'function')) {\n throw new Error('@time() may only decorate class methods');\n }\n\n descriptor.value = function(...args: any[]) {\n const TAG = tag ?? `${this.constructor.name}-${key}`;\n const START_TAG = `start-${TAG}`;\n const END_TAG = `end-${TAG}`;\n\n if (window.PfeConfig.trackPerformance) {\n performance.mark(START_TAG);\n }\n\n const x = f.call(this, ...args);\n\n const ret = () => {\n if (window.PfeConfig.trackPerformance) {\n performance.mark(END_TAG);\n performance.measure(TAG, START_TAG, END_TAG);\n // eslint-disable-next-line no-console\n console.log(Array.from(performance.getEntriesByName(TAG)).pop());\n }\n return x;\n };\n\n if (x instanceof Promise) {\n return x.then(ret);\n } else {\n return ret();\n }\n };\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","sourceRoot":"","sources":["trace.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,OAAO,UAAS,CAAU,EAAE,GAAW,EAAE,UAA8B;QACrE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC;QAChC,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAW;YACxC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;YAEhC,MAAM,GAAG,GAAG,GAAG,EAAE;gBACf,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC;gBAC3B,OAAO,CAAC,CAAC;YACX,CAAC,CAAC;YAEF,IAAI,CAAC,YAAY,OAAO,EAAE;gBACxB,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACpB;iBAAM;gBACL,OAAO,GAAG,EAAE,CAAC;aACd;QACH,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/** Logs the result of a class method */\nexport function trace(tag?: string) {\n return function(_: unknown, key: string, descriptor: PropertyDescriptor) {\n const { value: f } = descriptor;\n descriptor.value = function(...args: any[]) {\n const x = f.call(this, ...args);\n\n const ret = () => {\n // eslint-disable-next-line no-console\n console.log(tag ?? key, x);\n return x;\n };\n\n if (x instanceof Promise) {\n return x.then(ret);\n } else {\n return ret();\n }\n };\n };\n}\n"]}
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["trace.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,OAAO,UAAS,CAAU,EAAE,GAAW,EAAE,UAA8B;QACrE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC;QAChC,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAW;YACxC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;YAEhC,MAAM,GAAG,GAAG,GAAG,EAAE;gBACf,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC;gBAC3B,OAAO,CAAC,CAAC;YACX,CAAC,CAAC;YAEF,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC;gBACzB,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,EAAE,CAAC;YACf,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/** Logs the result of a class method */\nexport function trace(tag?: string) {\n return function(_: unknown, key: string, descriptor: PropertyDescriptor) {\n const { value: f } = descriptor;\n descriptor.value = function(...args: any[]) {\n const x = f.call(this, ...args);\n\n const ret = () => {\n // eslint-disable-next-line no-console\n console.log(tag ?? key, x);\n return x;\n };\n\n if (x instanceof Promise) {\n return x.then(ret);\n } else {\n return ret();\n }\n };\n };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Whether or not the container contains the node,
3
+ * and if not, whether the node is contained by any element
4
+ * slotted in to the container
5
+ */
6
+ export declare function containsDeep(container: Element, node: Node): boolean;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Whether or not the container contains the node,
3
+ * and if not, whether the node is contained by any element
4
+ * slotted in to the container
5
+ */
6
+ export function containsDeep(container, node) {
7
+ if (container.contains(node)) {
8
+ return true;
9
+ }
10
+ else {
11
+ for (const slot of container.querySelectorAll('slot') ?? []) {
12
+ for (const el of slot.assignedElements()) {
13
+ if (el.contains(node)) {
14
+ return true;
15
+ }
16
+ }
17
+ }
18
+ return false;
19
+ }
20
+ }
21
+ //# sourceMappingURL=containsDeep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containsDeep.js","sourceRoot":"","sources":["containsDeep.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,SAAkB,EAAE,IAAU;IACzD,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5D,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;gBACzC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBACtB,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["/**\n * Whether or not the container contains the node,\n * and if not, whether the node is contained by any element\n * slotted in to the container\n */\nexport function containsDeep(container: Element, node: Node) {\n if (container.contains(node)) {\n return true;\n } else {\n for (const slot of container.querySelectorAll('slot') ?? []) {\n for (const el of slot.assignedElements()) {\n if (el.contains(node)) {\n return true;\n }\n }\n }\n return false;\n }\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import { createContext } from '@lit/context';
2
+ /**
3
+ * In order to prevent late-upgrading-context-consumers from 'missing'
4
+ * their rightful context providers, we must set up a `ContextRoot` on the body.
5
+ * Always use this function when creating contexts that are shared with child elements.
6
+ */
7
+ export declare function createContextWithRoot<T>(...args: Parameters<typeof createContext>): {
8
+ __context__: T;
9
+ };
@@ -0,0 +1,17 @@
1
+ import { ContextRoot, createContext } from '@lit/context';
2
+ let root;
3
+ function makeContextRoot() {
4
+ root = new ContextRoot();
5
+ root.attach(document.body);
6
+ return root;
7
+ }
8
+ /**
9
+ * In order to prevent late-upgrading-context-consumers from 'missing'
10
+ * their rightful context providers, we must set up a `ContextRoot` on the body.
11
+ * Always use this function when creating contexts that are shared with child elements.
12
+ */
13
+ export function createContextWithRoot(...args) {
14
+ root ?? (root = makeContextRoot());
15
+ return createContext(...args);
16
+ }
17
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1D,IAAI,IAAiB,CAAC;AAEtB,SAAS,eAAe;IACtB,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;IACzB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAI,GAAG,IAAsC;IAChF,IAAI,KAAJ,IAAI,GAAK,eAAe,EAAE,EAAC;IAC3B,OAAO,aAAa,CAAI,GAAG,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { ContextRoot, createContext } from '@lit/context';\n\nlet root: ContextRoot;\n\nfunction makeContextRoot() {\n root = new ContextRoot();\n root.attach(document.body);\n return root;\n}\n\n/**\n * In order to prevent late-upgrading-context-consumers from 'missing'\n * their rightful context providers, we must set up a `ContextRoot` on the body.\n * Always use this function when creating contexts that are shared with child elements.\n */\nexport function createContextWithRoot<T>(...args: Parameters<typeof createContext>) {\n root ??= makeContextRoot();\n return createContext<T>(...args);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.js","sourceRoot":"","sources":["debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAiC,EACjC,KAAa,EACb,SAAS,GAAG,KAAK;IAEjB,IAAI,OAAsB,CAAC;IAC3B,OAAO,UAAwB,GAAG,IAAW;QAC3C,4DAA4D;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,MAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS,EAAE;gBACd,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QACtC,YAAY,CAAC,OAAiB,CAAC,CAAC;QAChC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1C,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SAC3B;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Debounce helper function\n * @see https://davidwalsh.name/javascript-debounce-function\n *\n * @param func Function to be debounced\n * @param delay How long until it will be run\n * @param immediate Whether it should be run at the start instead of the end of the debounce\n */\nexport function debounce(\n func: (...args: any[]) => unknown,\n delay: number,\n immediate = false\n) {\n let timeout: number | null;\n return function(this: unknown, ...args: any[]) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const context = this;\n const later = function() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout as number);\n timeout = window.setTimeout(later, delay);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"debounce.js","sourceRoot":"","sources":["debounce.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAiC,EACjC,KAAa,EACb,SAAS,GAAG,KAAK;IAEjB,IAAI,OAAsB,CAAC;IAC3B,OAAO,UAAwB,GAAG,IAAW;QAC3C,4DAA4D;QAC5D,MAAM,OAAO,GAAG,IAAI,CAAC;QACrB,MAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QACtC,YAAY,CAAC,OAAiB,CAAC,CAAC;QAChC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1C,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Debounce helper function\n * @see https://davidwalsh.name/javascript-debounce-function\n *\n * @param func Function to be debounced\n * @param delay How long until it will be run\n * @param immediate Whether it should be run at the start instead of the end of the debounce\n */\nexport function debounce(\n func: (...args: any[]) => unknown,\n delay: number,\n immediate = false\n) {\n let timeout: number | null;\n return function(this: unknown, ...args: any[]) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const context = this;\n const later = function() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout as number);\n timeout = window.setTimeout(later, delay);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"isElementInView.js","sourceRoot":"","sources":["isElementInView.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAsB,EACtB,OAAoB,EACpB,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,KAAK;IAEd,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE;QAC1B,OAAO,KAAK,CAAC;KACd;IACD,MAAM,eAAe,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;IAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IACtD,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE3D,mBAAmB;IACnB,MAAM,eAAe,GACnB,iBAAiB,IAAI,mBAAmB;QACxC,kBAAkB,IAAI,oBAAoB,CAAC;IAC7C,MAAM,iBAAiB,GACrB,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QACrE,CAAC,CAAC,iBAAiB,GAAG,mBAAmB,IAAI,kBAAkB,GAAG,mBAAmB,CAAC;YACpF,CAAC,kBAAkB,GAAG,oBAAoB,IAAI,iBAAiB,GAAG,oBAAoB,CAAC,CAAC,CAAC;IAE7F,iBAAiB;IACjB,OAAO,eAAe,IAAI,iBAAiB,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * This function returns whether or not an element is within the viewable area of a container. If partial is true,\n * then this function will return true even if only part of the element is in view.\n *\n * @param {HTMLElement} container The container to check if the element is in view of.\n * @param {HTMLElement} element The element to check if it is view\n * @param {boolean} partial true if partial view is allowed\n * @param {boolean} strict true if strict mode is set, never consider the container width and element width\n *\n * @returns True if the component is in View.\n */\nexport function isElementInView(\n container: HTMLElement,\n element: HTMLElement,\n partial = false,\n strict = false\n): boolean {\n if (!container || !element) {\n return false;\n }\n const containerBounds = container.getBoundingClientRect();\n const elementBounds = element.getBoundingClientRect();\n const containerBoundsLeft = Math.ceil(containerBounds.left);\n const containerBoundsRight = Math.floor(containerBounds.right);\n const elementBoundsLeft = Math.ceil(elementBounds.left);\n const elementBoundsRight = Math.floor(elementBounds.right);\n\n // Check if in view\n const isTotallyInView =\n elementBoundsLeft >= containerBoundsLeft &&\n elementBoundsRight <= containerBoundsRight;\n const isPartiallyInView =\n (partial || (!strict && containerBounds.width < elementBounds.width)) &&\n ((elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft) ||\n (elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight));\n\n // Return outcome\n return isTotallyInView || isPartiallyInView;\n}\n"]}
1
+ {"version":3,"file":"isElementInView.js","sourceRoot":"","sources":["isElementInView.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAsB,EACtB,OAAoB,EACpB,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,KAAK;IAEd,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,eAAe,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;IAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IACtD,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE3D,mBAAmB;IACnB,MAAM,eAAe,GACnB,iBAAiB,IAAI,mBAAmB;QACxC,kBAAkB,IAAI,oBAAoB,CAAC;IAC7C,MAAM,iBAAiB,GACrB,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QACrE,CAAC,CAAC,iBAAiB,GAAG,mBAAmB,IAAI,kBAAkB,GAAG,mBAAmB,CAAC;YACpF,CAAC,kBAAkB,GAAG,oBAAoB,IAAI,iBAAiB,GAAG,oBAAoB,CAAC,CAAC,CAAC;IAE7F,iBAAiB;IACjB,OAAO,eAAe,IAAI,iBAAiB,CAAC;AAC9C,CAAC","sourcesContent":["/**\n * This function returns whether or not an element is within the viewable area of a container. If partial is true,\n * then this function will return true even if only part of the element is in view.\n *\n * @param {HTMLElement} container The container to check if the element is in view of.\n * @param {HTMLElement} element The element to check if it is view\n * @param {boolean} partial true if partial view is allowed\n * @param {boolean} strict true if strict mode is set, never consider the container width and element width\n *\n * @returns True if the component is in View.\n */\nexport function isElementInView(\n container: HTMLElement,\n element: HTMLElement,\n partial = false,\n strict = false\n): boolean {\n if (!container || !element) {\n return false;\n }\n const containerBounds = container.getBoundingClientRect();\n const elementBounds = element.getBoundingClientRect();\n const containerBoundsLeft = Math.ceil(containerBounds.left);\n const containerBoundsRight = Math.floor(containerBounds.right);\n const elementBoundsLeft = Math.ceil(elementBounds.left);\n const elementBoundsRight = Math.floor(elementBounds.right);\n\n // Check if in view\n const isTotallyInView =\n elementBoundsLeft >= containerBoundsLeft &&\n elementBoundsRight <= containerBoundsRight;\n const isPartiallyInView =\n (partial || (!strict && containerBounds.width < elementBounds.width)) &&\n ((elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft) ||\n (elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight));\n\n // Return outcome\n return isTotallyInView || isPartiallyInView;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/pfe-core",
3
- "version": "2.4.0",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "description": "PatternFly Elements Core Library",
6
6
  "customElements": "custom-elements.json",
@@ -29,6 +29,7 @@
29
29
  "./controllers/slot-controller.js": "./controllers/slot-controller.js",
30
30
  "./controllers/style-controller.js": "./controllers/style-controller.js",
31
31
  "./controllers/timestamp-controller.js": "./controllers/timestamp-controller.js",
32
+ "./controllers/tabs-controller.js": "./controllers/tabs-controller.js",
32
33
  "./decorators/bound.js": "./decorators/bound.js",
33
34
  "./decorators/cascades.js": "./decorators/cascades.js",
34
35
  "./decorators/deprecation.js": "./decorators/deprecation.js",
@@ -36,8 +37,9 @@
36
37
  "./decorators/observed.js": "./decorators/observed.js",
37
38
  "./decorators/time.js": "./decorators/time.js",
38
39
  "./decorators/trace.js": "./decorators/trace.js",
40
+ "./functions/context.js": "./functions/context.js",
41
+ "./functions/containsDeep.js": "./functions/containsDeep.js",
39
42
  "./functions/debounce.js": "./functions/debounce.js",
40
- "./functions/deprecatedCustomEvent.js": "./functions/deprecatedCustomEvent.js",
41
43
  "./functions/random.js": "./functions/random.js",
42
44
  "./functions/isElementInView.js": "./functions/isElementInView.js"
43
45
  },
@@ -51,8 +53,9 @@
51
53
  "test": "wtr --files './test/*.spec.ts' --config ../../web-test-runner.config.js"
52
54
  },
53
55
  "dependencies": {
54
- "@floating-ui/dom": "^1.2.6",
55
- "lit": "^2.7.2"
56
+ "@floating-ui/dom": "^1.6.3",
57
+ "@lit/context": "^1.1.0",
58
+ "lit": "^3.1.2"
56
59
  },
57
60
  "repository": {
58
61
  "type": "git",
@@ -1,5 +0,0 @@
1
- /**
2
- * Construct a CustomEvent with the given name and detail.
3
- * The event bubbles and is composed.
4
- */
5
- export declare function deprecatedCustomEvent<T>(name: string, detail?: T): CustomEvent<T>;
@@ -1,12 +0,0 @@
1
- /**
2
- * Construct a CustomEvent with the given name and detail.
3
- * The event bubbles and is composed.
4
- */
5
- export function deprecatedCustomEvent(name, detail) {
6
- return new CustomEvent(name, {
7
- bubbles: true,
8
- composed: true,
9
- detail,
10
- });
11
- }
12
- //# sourceMappingURL=deprecatedCustomEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deprecatedCustomEvent.js","sourceRoot":"","sources":["deprecatedCustomEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAI,IAAY,EAAE,MAAU;IAC/D,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE;QAC3B,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,MAAM;KACP,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Construct a CustomEvent with the given name and detail.\n * The event bubbles and is composed.\n */\nexport function deprecatedCustomEvent<T>(name: string, detail?: T): CustomEvent<T> {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail,\n });\n}\n"]}