igniteui-webcomponents 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +6 -1
  3. package/components/avatar/themes/dark/avatar.bootstrap.css.js +1 -1
  4. package/components/avatar/themes/dark/avatar.bootstrap.css.js.map +1 -1
  5. package/components/avatar/themes/dark/avatar.fluent.css.js +1 -1
  6. package/components/avatar/themes/dark/avatar.fluent.css.js.map +1 -1
  7. package/components/avatar/themes/dark/avatar.material.css.js +1 -1
  8. package/components/avatar/themes/dark/avatar.material.css.js.map +1 -1
  9. package/components/calendar/themes/dark/calendar.fluent.css.js +1 -1
  10. package/components/calendar/themes/dark/calendar.fluent.css.js.map +1 -1
  11. package/components/calendar/themes/light/calendar.fluent.css.js +1 -1
  12. package/components/calendar/themes/light/calendar.fluent.css.js.map +1 -1
  13. package/components/calendar/themes/light/calendar.shared.css.js +1 -1
  14. package/components/calendar/themes/light/calendar.shared.css.js.map +1 -1
  15. package/components/chip/chip.d.ts +4 -0
  16. package/components/chip/chip.js +26 -3
  17. package/components/chip/chip.js.map +1 -1
  18. package/components/chip/themes/shared/chip.common.css.js +1 -1
  19. package/components/chip/themes/shared/chip.common.css.js.map +1 -1
  20. package/components/chip/themes/shared/chip.indigo.css.js +1 -1
  21. package/components/chip/themes/shared/chip.indigo.css.js.map +1 -1
  22. package/components/common/controllers/gestures.d.ts +1 -0
  23. package/components/common/controllers/gestures.js.map +1 -1
  24. package/components/common/controllers/resize-observer.d.ts +11 -8
  25. package/components/common/controllers/resize-observer.js +3 -3
  26. package/components/common/controllers/resize-observer.js.map +1 -1
  27. package/components/date-picker/date-picker.d.ts +35 -35
  28. package/components/date-picker/date-picker.js +131 -128
  29. package/components/date-picker/date-picker.js.map +1 -1
  30. package/components/date-picker/themes/dark/date-picker.fluent.css.js +1 -1
  31. package/components/date-picker/themes/dark/date-picker.fluent.css.js.map +1 -1
  32. package/components/date-picker/themes/light/date-picker.fluent.css.js +1 -1
  33. package/components/date-picker/themes/light/date-picker.fluent.css.js.map +1 -1
  34. package/components/date-picker/themes/light/date-picker.shared.css.js +1 -1
  35. package/components/date-picker/themes/light/date-picker.shared.css.js.map +1 -1
  36. package/components/date-time-input/date-time-input.js +1 -1
  37. package/components/date-time-input/date-time-input.js.map +1 -1
  38. package/components/file-input/file-input.d.ts +1 -1
  39. package/components/file-input/file-input.js.map +1 -1
  40. package/components/input/themes/input.base.css.js +1 -1
  41. package/components/input/themes/input.base.css.js.map +1 -1
  42. package/components/progress/themes/circular/dark/circular.progress.shared.css.js +1 -1
  43. package/components/progress/themes/circular/dark/circular.progress.shared.css.js.map +1 -1
  44. package/components/progress/themes/linear/dark/linear.progress.bootstrap.css.js +1 -1
  45. package/components/progress/themes/linear/dark/linear.progress.bootstrap.css.js.map +1 -1
  46. package/components/progress/themes/linear/dark/linear.progress.shared.css.js +1 -1
  47. package/components/progress/themes/linear/dark/linear.progress.shared.css.js.map +1 -1
  48. package/components/radio-group/radio-group.d.ts +2 -1
  49. package/components/radio-group/radio-group.js +23 -10
  50. package/components/radio-group/radio-group.js.map +1 -1
  51. package/components/radio-group/themes/dark/radio-group.bootstrap.css.js +3 -0
  52. package/components/radio-group/themes/dark/radio-group.bootstrap.css.js.map +1 -0
  53. package/components/radio-group/themes/dark/radio-group.fluent.css.js +3 -0
  54. package/components/radio-group/themes/dark/radio-group.fluent.css.js.map +1 -0
  55. package/components/radio-group/themes/dark/radio-group.indigo.css.js +3 -0
  56. package/components/radio-group/themes/dark/radio-group.indigo.css.js.map +1 -0
  57. package/components/radio-group/themes/dark/radio-group.material.css.js +3 -0
  58. package/components/radio-group/themes/dark/radio-group.material.css.js.map +1 -0
  59. package/components/radio-group/themes/light/radio-group.bootstrap.css.d.ts +1 -0
  60. package/components/radio-group/themes/light/radio-group.bootstrap.css.js +3 -0
  61. package/components/radio-group/themes/light/radio-group.bootstrap.css.js.map +1 -0
  62. package/components/radio-group/themes/light/radio-group.fluent.css.d.ts +1 -0
  63. package/components/radio-group/themes/light/radio-group.fluent.css.js +3 -0
  64. package/components/radio-group/themes/light/radio-group.fluent.css.js.map +1 -0
  65. package/components/radio-group/themes/light/radio-group.indigo.css.d.ts +1 -0
  66. package/components/radio-group/themes/light/radio-group.indigo.css.js +3 -0
  67. package/components/radio-group/themes/light/radio-group.indigo.css.js.map +1 -0
  68. package/components/radio-group/themes/light/radio-group.material.css.d.ts +1 -0
  69. package/components/radio-group/themes/light/radio-group.material.css.js +3 -0
  70. package/components/radio-group/themes/light/radio-group.material.css.js.map +1 -0
  71. package/components/radio-group/themes/light/radio-group.shared.css.d.ts +1 -0
  72. package/components/radio-group/themes/light/radio-group.shared.css.js +3 -0
  73. package/components/radio-group/themes/light/radio-group.shared.css.js.map +1 -0
  74. package/components/radio-group/themes/radio-group.base.css.d.ts +1 -0
  75. package/components/radio-group/{radio-group.base.css.js → themes/radio-group.base.css.js} +1 -1
  76. package/components/radio-group/themes/radio-group.base.css.js.map +1 -0
  77. package/components/radio-group/themes/shared/radio-group.bootstrap.css.d.ts +1 -0
  78. package/components/radio-group/themes/shared/radio-group.bootstrap.css.js +3 -0
  79. package/components/radio-group/themes/shared/radio-group.bootstrap.css.js.map +1 -0
  80. package/components/radio-group/themes/shared/radio-group.common.css.d.ts +1 -0
  81. package/components/radio-group/themes/shared/radio-group.common.css.js +3 -0
  82. package/components/radio-group/themes/shared/radio-group.common.css.js.map +1 -0
  83. package/components/radio-group/themes/shared/radio-group.fluent.css.d.ts +1 -0
  84. package/components/radio-group/themes/shared/radio-group.fluent.css.js +3 -0
  85. package/components/radio-group/themes/shared/radio-group.fluent.css.js.map +1 -0
  86. package/components/radio-group/themes/shared/radio-group.indigo.css.d.ts +1 -0
  87. package/components/radio-group/themes/shared/radio-group.indigo.css.js +3 -0
  88. package/components/radio-group/themes/shared/radio-group.indigo.css.js.map +1 -0
  89. package/components/radio-group/themes/shared/radio-group.material.css.d.ts +1 -0
  90. package/components/radio-group/themes/shared/radio-group.material.css.js +3 -0
  91. package/components/radio-group/themes/shared/radio-group.material.css.js.map +1 -0
  92. package/components/radio-group/themes/themes.d.ts +2 -0
  93. package/components/radio-group/themes/themes.js +50 -0
  94. package/components/radio-group/themes/themes.js.map +1 -0
  95. package/components/stepper/themes/step/dark/step.indigo.css.js +1 -1
  96. package/components/stepper/themes/step/dark/step.indigo.css.js.map +1 -1
  97. package/components/stepper/themes/step/light/step.bootstrap.css.js +1 -1
  98. package/components/stepper/themes/step/light/step.bootstrap.css.js.map +1 -1
  99. package/components/stepper/themes/step/light/step.fluent.css.js +1 -1
  100. package/components/stepper/themes/step/light/step.fluent.css.js.map +1 -1
  101. package/components/stepper/themes/step/light/step.indigo.css.js +1 -1
  102. package/components/stepper/themes/step/light/step.indigo.css.js.map +1 -1
  103. package/components/stepper/themes/step/light/step.material.css.js +1 -1
  104. package/components/stepper/themes/step/light/step.material.css.js.map +1 -1
  105. package/components/stepper/themes/step/light/step.shared.css.js +1 -1
  106. package/components/stepper/themes/step/light/step.shared.css.js.map +1 -1
  107. package/components/tabs/tab-dom.d.ts +2 -2
  108. package/components/tabs/tab-dom.js +15 -2
  109. package/components/tabs/tab-dom.js.map +1 -1
  110. package/components/tabs/tabs.d.ts +2 -1
  111. package/components/tabs/tabs.js +2 -2
  112. package/components/tabs/tabs.js.map +1 -1
  113. package/components/tabs/themes/dark/tab.indigo.css.js +1 -1
  114. package/components/tabs/themes/dark/tab.indigo.css.js.map +1 -1
  115. package/components/tabs/themes/light/tab.indigo.css.js +1 -1
  116. package/components/tabs/themes/light/tab.indigo.css.js.map +1 -1
  117. package/components/tabs/themes/tab.base.css.js +1 -1
  118. package/components/tabs/themes/tab.base.css.js.map +1 -1
  119. package/components/textarea/textarea.d.ts +29 -32
  120. package/components/textarea/textarea.js +89 -91
  121. package/components/textarea/textarea.js.map +1 -1
  122. package/components/tooltip/tooltip.js.map +1 -1
  123. package/components/types.d.ts +1 -1
  124. package/components/types.js.map +1 -1
  125. package/components/validation-container/themes/dark/validator.indigo.css.js +1 -1
  126. package/components/validation-container/themes/dark/validator.indigo.css.js.map +1 -1
  127. package/custom-elements.json +497 -270
  128. package/package.json +1 -1
  129. package/themes/dark/bootstrap.css +1 -1
  130. package/themes/dark/fluent.css +1 -1
  131. package/themes/dark/indigo.css +1 -1
  132. package/themes/dark/material.css +1 -1
  133. package/themes/light/bootstrap.css +1 -1
  134. package/themes/light/fluent.css +1 -1
  135. package/themes/light/indigo.css +1 -1
  136. package/themes/light/material.css +1 -1
  137. package/web-types.json +1 -1
  138. package/components/radio-group/radio-group.base.css.js.map +0 -1
  139. package/components/radio-group/radio-group.fluent.css.js +0 -3
  140. package/components/radio-group/radio-group.fluent.css.js.map +0 -1
  141. package/components/radio-group/radio-group.indigo.css.js +0 -3
  142. package/components/radio-group/radio-group.indigo.css.js.map +0 -1
  143. package/components/radio-group/radio-group.material.css.js +0 -3
  144. package/components/radio-group/radio-group.material.css.js.map +0 -1
  145. /package/components/radio-group/{radio-group.base.css.d.ts → themes/dark/radio-group.bootstrap.css.d.ts} +0 -0
  146. /package/components/radio-group/{radio-group.fluent.css.d.ts → themes/dark/radio-group.fluent.css.d.ts} +0 -0
  147. /package/components/radio-group/{radio-group.indigo.css.d.ts → themes/dark/radio-group.indigo.css.d.ts} +0 -0
  148. /package/components/radio-group/{radio-group.material.css.d.ts → themes/dark/radio-group.material.css.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/gestures.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,GAAG;IACb,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,eAAe;CACP,CAAC;AACX,MAAM,YAAY,GAAiB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAmD1E,MAAM,OA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,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,yBAAyB,CAAC,KAAmB;QACnD,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAEhC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,GAAgB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBAC/D,IAAI,EAAE,KAAK,CAAC,WAAW;gBACvB,SAAS,EAAE,KAAK;aACjB,CAAC,CAAC;YAEH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC1B,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF;AAMD,MAAM,UAAU,qBAAqB,CACnC,IAA0C,EAC1C,OAAyB;IAEzB,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\n\nconst Events = [\n 'pointerdown',\n 'pointermove',\n 'lostpointercapture',\n 'pointercancel',\n] as const;\nconst defaultState: GestureState = Object.freeze({ x: 0, y: 0, time: 0 });\n\n/**\n * Configuration object for a {@link GesturesController} instance.\n */\nexport interface GesturesOptions {\n /**\n * By default, the controller listens for pointer/touch events in the context of the host element.\n * If you pass a `ref`, you can limit the observation to a certain DOM part of the host scope.\n */\n ref?: Ref<HTMLElement>;\n /**\n * The maximum amount of milliseconds between the start and end of a gesture combination\n * before it is recognized as such.\n */\n thresholdTime?: number;\n /**\n * The minimum amount a \"pointer\" should travel in pixels, before being recognized as a\n * gesture.\n */\n thresholdDistance?: number;\n /**\n * When enabled, the controller will skip events generated by a mouse device.\n */\n touchOnly?: boolean;\n}\n\ntype GestureState = {\n x: number;\n y: number;\n time: number;\n};\n\ntype GestureDirection = 'left' | 'up' | 'right' | 'down';\ntype SwipeEvents =\n | 'swipe'\n | 'swipe-left'\n | 'swipe-up'\n | 'swipe-right'\n | 'swipe-down';\n\nexport type GestureData = {\n direction: GestureDirection;\n type: string;\n xStart: number;\n xEnd: number;\n yStart: number;\n yEnd: number;\n};\n\n/* blazorSuppress */\nexport class SwipeEvent extends Event {\n public readonly data: GestureData;\n public readonly name: string;\n\n constructor(name: string, data: GestureData, initOptions?: EventInit) {\n super(name, initOptions);\n this.name = name;\n this.data = data;\n }\n}\n\nclass GesturesController extends EventTarget implements ReactiveController {\n private readonly _host: ReactiveControllerHost & HTMLElement;\n private _ref?: Ref<HTMLElement>;\n private _options: GesturesOptions = {\n thresholdDistance: 100,\n thresholdTime: 500,\n touchOnly: false,\n };\n\n private _pointerState = {\n captured: false,\n start: defaultState,\n current: defaultState,\n };\n\n protected get _element() {\n return this._ref ? this._ref.value! : this._host;\n }\n\n /** Get the current configuration object */\n public get options() {\n return this._options;\n }\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n ) {\n super();\n\n Object.assign(this._options, options);\n this._ref = this._options.ref;\n\n this._host = host;\n this._host.addController(this);\n }\n\n /**\n * Add an event listener for a given swipe event.\n */\n public set(\n type: SwipeEvents,\n callback: (event: SwipeEvent) => void,\n options?: AddEventListenerOptions\n ) {\n const bound = callback.bind(this._host) as EventListener;\n\n this.addEventListener(type, bound, options);\n return this;\n }\n\n public handleEvent(event: PointerEvent) {\n if (this._options.touchOnly && event.pointerType === 'mouse') {\n return;\n }\n switch (event.type) {\n case 'pointerdown':\n return this._handlePointerDown(event);\n case 'pointermove':\n return this._handlePointerMove(event);\n case 'lostpointercapture':\n case 'pointercancel':\n return this._handleLostPointerCapture(event);\n }\n }\n\n public async hostConnected() {\n await this._host.updateComplete;\n\n for (const event of Events) {\n this._element.addEventListener(event, this, { passive: true });\n }\n }\n\n public hostDisconnected() {\n for (const event of Events) {\n this._element.removeEventListener(event, this);\n }\n }\n\n /** Updates the configuration of the controller */\n public updateOptions(options: Omit<GesturesOptions, 'ref'>) {\n Object.assign(this._options, options);\n }\n\n private _getGestureState({\n clientX: x,\n clientY: y,\n }: PointerEvent): GestureState {\n return { x, y, time: Date.now() };\n }\n\n private _setTouchActionState(disabled: boolean) {\n Object.assign(this._element.style, {\n touchAction: disabled ? 'none' : undefined,\n });\n }\n\n private _resetState() {\n this._pointerState.start = defaultState;\n this._pointerState.current = defaultState;\n }\n\n private _setPointerCaptureState(event: PointerEvent, state: boolean) {\n this._pointerState.captured = state;\n state\n ? this._element.setPointerCapture(event.pointerId)\n : this._element.releasePointerCapture(event.pointerId);\n }\n\n private _handlePointerDown(event: PointerEvent) {\n this._setTouchActionState(true);\n this._pointerState.start = this._getGestureState(event);\n this._setPointerCaptureState(event, true);\n }\n\n private _handlePointerMove(event: PointerEvent) {\n if (this._pointerState.captured) {\n this._pointerState.current = this._getGestureState(event);\n }\n }\n\n private _emit(name: SwipeEvents, data: GestureData) {\n return this.dispatchEvent(new SwipeEvent(name, data));\n }\n\n private _createEventArgs() {\n const { start, current } = this._pointerState;\n\n return {\n xStart: start.x,\n xEnd: current.x,\n yStart: start.y,\n yEnd: current.y,\n };\n }\n\n protected _recognize(): GestureDirection | false {\n const { start, current } = this._pointerState;\n\n const dt = current.time - start.time;\n const dx = current.x - start.x;\n const dy = current.y - start.y;\n\n const time = this._options.thresholdTime ?? 500;\n const distance = this._options.thresholdDistance ?? 100;\n\n if (dt > time) {\n return false;\n }\n\n if (dx > distance && Math.abs(dy) < distance) {\n return 'right';\n }\n\n if (-dx > distance && Math.abs(dy) < distance) {\n return 'left';\n }\n\n if (dy > distance && Math.abs(dx) < distance) {\n return 'down';\n }\n\n if (-dy > distance && Math.abs(dx) < distance) {\n return 'up';\n }\n\n return false;\n }\n\n private _handleLostPointerCapture(event: PointerEvent) {\n this._setPointerCaptureState(event, false);\n const state = this._recognize();\n\n if (state) {\n const args: GestureData = Object.assign(this._createEventArgs(), {\n type: event.pointerType,\n direction: state,\n });\n\n this._emit('swipe', args);\n this._emit(`swipe-${state}`, args);\n }\n\n this._resetState();\n this._setTouchActionState(false);\n }\n}\n\n/**\n * Adds a {@link GesturesController} responsible for managing gesture behaviors\n * for the given host element.\n */\nexport function addGesturesController(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n) {\n return new GesturesController(host, options);\n}\n"]}
1
+ {"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/gestures.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,GAAG;IACb,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,eAAe;CACP,CAAC;AACX,MAAM,YAAY,GAAiB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAoD1E,MAAM,OAAO,UAAW,SAAQ,KAAK;IAInC,YAAY,IAAY,EAAE,IAAiB,EAAE,WAAuB;QAClE,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,kBAAmB,SAAQ,WAAW;IAe1C,IAAc,QAAQ;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACnD,CAAC;IAGD,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,YACE,IAA0C,EAC1C,OAAyB;QAEzB,KAAK,EAAE,CAAC;QAzBF,aAAQ,GA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AAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF;AAMD,MAAM,UAAU,qBAAqB,CACnC,IAA0C,EAC1C,OAAyB;IAEzB,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\n\nconst Events = [\n 'pointerdown',\n 'pointermove',\n 'lostpointercapture',\n 'pointercancel',\n] as const;\nconst defaultState: GestureState = Object.freeze({ x: 0, y: 0, time: 0 });\n\n/**\n * Configuration object for a {@link GesturesController} instance.\n * @ignore\n */\nexport interface GesturesOptions {\n /**\n * By default, the controller listens for pointer/touch events in the context of the host element.\n * If you pass a `ref`, you can limit the observation to a certain DOM part of the host scope.\n */\n ref?: Ref<HTMLElement>;\n /**\n * The maximum amount of milliseconds between the start and end of a gesture combination\n * before it is recognized as such.\n */\n thresholdTime?: number;\n /**\n * The minimum amount a \"pointer\" should travel in pixels, before being recognized as a\n * gesture.\n */\n thresholdDistance?: number;\n /**\n * When enabled, the controller will skip events generated by a mouse device.\n */\n touchOnly?: boolean;\n}\n\ntype GestureState = {\n x: number;\n y: number;\n time: number;\n};\n\ntype GestureDirection = 'left' | 'up' | 'right' | 'down';\ntype SwipeEvents =\n | 'swipe'\n | 'swipe-left'\n | 'swipe-up'\n | 'swipe-right'\n | 'swipe-down';\n\nexport type GestureData = {\n direction: GestureDirection;\n type: string;\n xStart: number;\n xEnd: number;\n yStart: number;\n yEnd: number;\n};\n\n/* blazorSuppress */\nexport class SwipeEvent extends Event {\n public readonly data: GestureData;\n public readonly name: string;\n\n constructor(name: string, data: GestureData, initOptions?: EventInit) {\n super(name, initOptions);\n this.name = name;\n this.data = data;\n }\n}\n\nclass GesturesController extends EventTarget implements ReactiveController {\n private readonly _host: ReactiveControllerHost & HTMLElement;\n private _ref?: Ref<HTMLElement>;\n private _options: GesturesOptions = {\n thresholdDistance: 100,\n thresholdTime: 500,\n touchOnly: false,\n };\n\n private _pointerState = {\n captured: false,\n start: defaultState,\n current: defaultState,\n };\n\n protected get _element() {\n return this._ref ? this._ref.value! : this._host;\n }\n\n /** Get the current configuration object */\n public get options() {\n return this._options;\n }\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n ) {\n super();\n\n Object.assign(this._options, options);\n this._ref = this._options.ref;\n\n this._host = host;\n this._host.addController(this);\n }\n\n /**\n * Add an event listener for a given swipe event.\n */\n public set(\n type: SwipeEvents,\n callback: (event: SwipeEvent) => void,\n options?: AddEventListenerOptions\n ) {\n const bound = callback.bind(this._host) as EventListener;\n\n this.addEventListener(type, bound, options);\n return this;\n }\n\n public handleEvent(event: PointerEvent) {\n if (this._options.touchOnly && event.pointerType === 'mouse') {\n return;\n }\n switch (event.type) {\n case 'pointerdown':\n return this._handlePointerDown(event);\n case 'pointermove':\n return this._handlePointerMove(event);\n case 'lostpointercapture':\n case 'pointercancel':\n return this._handleLostPointerCapture(event);\n }\n }\n\n public async hostConnected() {\n await this._host.updateComplete;\n\n for (const event of Events) {\n this._element.addEventListener(event, this, { passive: true });\n }\n }\n\n public hostDisconnected() {\n for (const event of Events) {\n this._element.removeEventListener(event, this);\n }\n }\n\n /** Updates the configuration of the controller */\n public updateOptions(options: Omit<GesturesOptions, 'ref'>) {\n Object.assign(this._options, options);\n }\n\n private _getGestureState({\n clientX: x,\n clientY: y,\n }: PointerEvent): GestureState {\n return { x, y, time: Date.now() };\n }\n\n private _setTouchActionState(disabled: boolean) {\n Object.assign(this._element.style, {\n touchAction: disabled ? 'none' : undefined,\n });\n }\n\n private _resetState() {\n this._pointerState.start = defaultState;\n this._pointerState.current = defaultState;\n }\n\n private _setPointerCaptureState(event: PointerEvent, state: boolean) {\n this._pointerState.captured = state;\n state\n ? this._element.setPointerCapture(event.pointerId)\n : this._element.releasePointerCapture(event.pointerId);\n }\n\n private _handlePointerDown(event: PointerEvent) {\n this._setTouchActionState(true);\n this._pointerState.start = this._getGestureState(event);\n this._setPointerCaptureState(event, true);\n }\n\n private _handlePointerMove(event: PointerEvent) {\n if (this._pointerState.captured) {\n this._pointerState.current = this._getGestureState(event);\n }\n }\n\n private _emit(name: SwipeEvents, data: GestureData) {\n return this.dispatchEvent(new SwipeEvent(name, data));\n }\n\n private _createEventArgs() {\n const { start, current } = this._pointerState;\n\n return {\n xStart: start.x,\n xEnd: current.x,\n yStart: start.y,\n yEnd: current.y,\n };\n }\n\n protected _recognize(): GestureDirection | false {\n const { start, current } = this._pointerState;\n\n const dt = current.time - start.time;\n const dx = current.x - start.x;\n const dy = current.y - start.y;\n\n const time = this._options.thresholdTime ?? 500;\n const distance = this._options.thresholdDistance ?? 100;\n\n if (dt > time) {\n return false;\n }\n\n if (dx > distance && Math.abs(dy) < distance) {\n return 'right';\n }\n\n if (-dx > distance && Math.abs(dy) < distance) {\n return 'left';\n }\n\n if (dy > distance && Math.abs(dx) < distance) {\n return 'down';\n }\n\n if (-dy > distance && Math.abs(dx) < distance) {\n return 'up';\n }\n\n return false;\n }\n\n private _handleLostPointerCapture(event: PointerEvent) {\n this._setPointerCaptureState(event, false);\n const state = this._recognize();\n\n if (state) {\n const args: GestureData = Object.assign(this._createEventArgs(), {\n type: event.pointerType,\n direction: state,\n });\n\n this._emit('swipe', args);\n this._emit(`swipe-${state}`, args);\n }\n\n this._resetState();\n this._setTouchActionState(false);\n }\n}\n\n/**\n * Adds a {@link GesturesController} responsible for managing gesture behaviors\n * for the given host element.\n */\nexport function addGesturesController(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n) {\n return new GesturesController(host, options);\n}\n"]}
@@ -1,9 +1,12 @@
1
1
  import { type ReactiveController, type ReactiveControllerHost } from 'lit';
2
- type ResizeControllerCallback = (...args: Parameters<ResizeObserverCallback>) => unknown;
3
- /** Configuration for initializing a resize controller. */
4
- export interface ResizeControllerConfig {
2
+ type ResizeObserverControllerCallback = (...args: Parameters<ResizeObserverCallback>) => unknown;
3
+ /**
4
+ * Configuration for initializing a resize controller.
5
+ * @ignore
6
+ */
7
+ export interface ResizeObserverControllerConfig {
5
8
  /** The callback function to run when a resize mutation is triggered. */
6
- callback: ResizeControllerCallback;
9
+ callback: ResizeObserverControllerCallback;
7
10
  /** Configuration options passed to the underlying ResizeObserver. */
8
11
  options?: ResizeObserverOptions;
9
12
  /**
@@ -14,12 +17,12 @@ export interface ResizeControllerConfig {
14
17
  */
15
18
  target?: Element | null;
16
19
  }
17
- declare class ResizeController implements ReactiveController {
20
+ declare class ResizeObserverController implements ReactiveController {
18
21
  private readonly _host;
19
22
  private readonly _targets;
20
23
  private readonly _observer;
21
24
  private readonly _config;
22
- constructor(host: ReactiveControllerHost & Element, config: ResizeControllerConfig);
25
+ constructor(host: ReactiveControllerHost & Element, config: ResizeObserverControllerConfig);
23
26
  /** Starts observing the `targe` element. */
24
27
  observe(target: Element): void;
25
28
  /** Stops observing the `target` element. */
@@ -31,7 +34,7 @@ declare class ResizeController implements ReactiveController {
31
34
  }
32
35
  /**
33
36
  * Creates a new resize controller bound to the given `host`
34
- * with {@link ResizeControllerConfig | `config`}.
37
+ * with {@link ResizeObserverControllerConfig | `config`}.
35
38
  */
36
- export declare function createResizeController(host: ReactiveControllerHost & Element, config: ResizeControllerConfig): ResizeController;
39
+ export declare function createResizeObserverController(host: ReactiveControllerHost & Element, config: ResizeObserverControllerConfig): ResizeObserverController;
37
40
  export {};
@@ -1,5 +1,5 @@
1
1
  import { isServer, } from 'lit';
2
- class ResizeController {
2
+ class ResizeObserverController {
3
3
  constructor(host, config) {
4
4
  this._targets = new Set();
5
5
  this._host = host;
@@ -31,7 +31,7 @@ class ResizeController {
31
31
  this._observer.disconnect();
32
32
  }
33
33
  }
34
- export function createResizeController(host, config) {
35
- return new ResizeController(host, config);
34
+ export function createResizeObserverController(host, config) {
35
+ return new ResizeObserverController(host, config);
36
36
  }
37
37
  //# sourceMappingURL=resize-observer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resize-observer.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/resize-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,GACT,MAAM,KAAK,CAAC;AAqBb,MAAM,gBAAgB;IAMpB,YACE,IAAsC,EACtC,MAA8B;QANf,aAAQ,GAAG,IAAI,GAAG,EAAW,CAAC;QAQ7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;QACjD,CAAC;QAGD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE,CAC9C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAChE,CAAC;QAEF,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAGM,OAAO,CAAC,MAAe;QAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAGM,SAAS,CAAC,MAAe;QAC9B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAGM,aAAa;QAClB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAGM,gBAAgB;QACrB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IAC9B,CAAC;CACF;AAMD,MAAM,UAAU,sBAAsB,CACpC,IAAsC,EACtC,MAA8B;IAE9B,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import {\n type ReactiveController,\n type ReactiveControllerHost,\n isServer,\n} from 'lit';\n\ntype ResizeControllerCallback = (\n ...args: Parameters<ResizeObserverCallback>\n) => unknown;\n\n/** Configuration for initializing a resize controller. */\nexport interface ResizeControllerConfig {\n /** The callback function to run when a resize mutation is triggered. */\n callback: ResizeControllerCallback;\n /** Configuration options passed to the underlying ResizeObserver. */\n options?: ResizeObserverOptions;\n /**\n * The initial target element to observe for resize mutations.\n *\n * If not provided, the host element will be set as initial target.\n * Pass in `null` to skip setting an initial target.\n */\n target?: Element | null;\n}\n\nclass ResizeController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & Element;\n private readonly _targets = new Set<Element>();\n private readonly _observer!: ResizeObserver;\n private readonly _config: ResizeControllerConfig;\n\n constructor(\n host: ReactiveControllerHost & Element,\n config: ResizeControllerConfig\n ) {\n this._host = host;\n this._config = config;\n\n if (this._config.target !== null) {\n this._targets.add(this._config.target ?? host);\n }\n\n /* c8 ignore next 3 */\n if (isServer) {\n return;\n }\n\n this._observer = new ResizeObserver((entries) =>\n this._config.callback.call(this._host, entries, this._observer)\n );\n\n host.addController(this);\n }\n\n /** Starts observing the `targe` element. */\n public observe(target: Element): void {\n this._targets.add(target);\n this._observer.observe(target, this._config.options);\n this._host.requestUpdate();\n }\n\n /** Stops observing the `target` element. */\n public unobserve(target: Element): void {\n this._targets.delete(target);\n this._observer.unobserve(target);\n }\n\n /** @internal */\n public hostConnected(): void {\n for (const target of this._targets) {\n this.observe(target);\n }\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._observer.disconnect();\n }\n}\n\n/**\n * Creates a new resize controller bound to the given `host`\n * with {@link ResizeControllerConfig | `config`}.\n */\nexport function createResizeController(\n host: ReactiveControllerHost & Element,\n config: ResizeControllerConfig\n): ResizeController {\n return new ResizeController(host, config);\n}\n"]}
1
+ {"version":3,"file":"resize-observer.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/resize-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,GACT,MAAM,KAAK,CAAC;AAwBb,MAAM,wBAAwB;IAM5B,YACE,IAAsC,EACtC,MAAsC;QANvB,aAAQ,GAAG,IAAI,GAAG,EAAW,CAAC;QAQ7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;QACjD,CAAC;QAGD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE,CAC9C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAChE,CAAC;QAEF,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAGM,OAAO,CAAC,MAAe;QAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAGM,SAAS,CAAC,MAAe;QAC9B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAGM,aAAa;QAClB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAGM,gBAAgB;QACrB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IAC9B,CAAC;CACF;AAMD,MAAM,UAAU,8BAA8B,CAC5C,IAAsC,EACtC,MAAsC;IAEtC,OAAO,IAAI,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import {\n type ReactiveController,\n type ReactiveControllerHost,\n isServer,\n} from 'lit';\n\ntype ResizeObserverControllerCallback = (\n ...args: Parameters<ResizeObserverCallback>\n) => unknown;\n\n/**\n * Configuration for initializing a resize controller.\n * @ignore\n */\nexport interface ResizeObserverControllerConfig {\n /** The callback function to run when a resize mutation is triggered. */\n callback: ResizeObserverControllerCallback;\n /** Configuration options passed to the underlying ResizeObserver. */\n options?: ResizeObserverOptions;\n /**\n * The initial target element to observe for resize mutations.\n *\n * If not provided, the host element will be set as initial target.\n * Pass in `null` to skip setting an initial target.\n */\n target?: Element | null;\n}\n\nclass ResizeObserverController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & Element;\n private readonly _targets = new Set<Element>();\n private readonly _observer!: ResizeObserver;\n private readonly _config: ResizeObserverControllerConfig;\n\n constructor(\n host: ReactiveControllerHost & Element,\n config: ResizeObserverControllerConfig\n ) {\n this._host = host;\n this._config = config;\n\n if (this._config.target !== null) {\n this._targets.add(this._config.target ?? host);\n }\n\n /* c8 ignore next 3 */\n if (isServer) {\n return;\n }\n\n this._observer = new ResizeObserver((entries) =>\n this._config.callback.call(this._host, entries, this._observer)\n );\n\n host.addController(this);\n }\n\n /** Starts observing the `targe` element. */\n public observe(target: Element): void {\n this._targets.add(target);\n this._observer.observe(target, this._config.options);\n this._host.requestUpdate();\n }\n\n /** Stops observing the `target` element. */\n public unobserve(target: Element): void {\n this._targets.delete(target);\n this._observer.unobserve(target);\n }\n\n /** @internal */\n public hostConnected(): void {\n for (const target of this._targets) {\n this.observe(target);\n }\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._observer.disconnect();\n }\n}\n\n/**\n * Creates a new resize controller bound to the given `host`\n * with {@link ResizeObserverControllerConfig | `config`}.\n */\nexport function createResizeObserverController(\n host: ReactiveControllerHost & Element,\n config: ResizeObserverControllerConfig\n): ResizeObserverController {\n return new ResizeObserverController(host, config);\n}\n"]}
@@ -100,10 +100,10 @@ export default class IgcDatePickerComponent extends IgcDatePickerComponent_base
100
100
  serializable?: boolean;
101
101
  slotAssignment?: SlotAssignmentMode;
102
102
  };
103
- private static readonly increment;
104
- protected inputId: string;
105
- protected get __validators(): import("../common/validators.js").Validator<IgcDatePickerComponent>[];
106
103
  static register(): void;
104
+ private static readonly _increment;
105
+ protected _inputId: string;
106
+ protected get __validators(): import("../common/validators.js").Validator<IgcDatePickerComponent>[];
107
107
  private _activeDate;
108
108
  private _min;
109
109
  private _max;
@@ -111,15 +111,15 @@ export default class IgcDatePickerComponent extends IgcDatePickerComponent_base
111
111
  private _dateConstraints?;
112
112
  private _displayFormat?;
113
113
  private _inputFormat?;
114
- private get isDropDown();
115
- private _input;
116
- private _calendar;
117
- private prefixes;
118
- private suffixes;
119
- private actions;
120
- private headerDateSlotItems;
114
+ protected readonly _formValue: FormValue<Date | null>;
115
+ private readonly _input;
116
+ private readonly _calendar;
117
+ private readonly _prefixes;
118
+ private readonly _suffixes;
119
+ private readonly _actions;
120
+ private readonly _headerSlotItems;
121
+ private get _isDropDown();
121
122
  protected get _isMaterialTheme(): boolean;
122
- protected _formValue: FormValue<Date | null>;
123
123
  /**
124
124
  * Sets the state of the datepicker dropdown.
125
125
  * @attr
@@ -239,11 +239,25 @@ export default class IgcDatePickerComponent extends IgcDatePickerComponent_base
239
239
  prompt: string;
240
240
  /** The resource strings of the calendar. */
241
241
  resourceStrings: IgcCalendarResourceStrings;
242
- protected openChange(): void;
243
242
  /** Sets the start day of the week for the calendar. */
244
243
  weekStart: WeekDays;
244
+ protected _openChange(): void;
245
245
  constructor();
246
246
  protected createRenderRoot(): HTMLElement | DocumentFragment;
247
+ private _setDateConstraints;
248
+ private _shouldCloseCalendarDropdown;
249
+ protected _onEscapeKey(): Promise<void>;
250
+ protected _handleFocusIn(): void;
251
+ protected _handleFocusOut({ relatedTarget }: FocusEvent): void;
252
+ protected _handlerCalendarIconSlotPointerDown(event: PointerEvent): void;
253
+ protected _handleInputClick(event: Event): void;
254
+ protected handleAnchorClick(): Promise<void>;
255
+ protected _handleInputChangeEvent(event: CustomEvent<Date>): void;
256
+ protected _handleCalendarChangeEvent(event: CustomEvent<Date>): Promise<void>;
257
+ protected _handleInputEvent(event: CustomEvent<Date>): void;
258
+ protected _handleClosing(): void;
259
+ protected _handleDialogClosing(event: Event): void;
260
+ protected _handleDialogClosed(event: Event): void;
247
261
  /** Clears the input part of the component of any user input */
248
262
  clear(): void;
249
263
  /** Increments the passed in date part */
@@ -255,29 +269,15 @@ export default class IgcDatePickerComponent extends IgcDatePickerComponent_base
255
269
  /** Sets the text selection range in the input of the component */
256
270
  setSelectionRange(start: number, end: number, direction?: SelectionRangeDirection): void;
257
271
  setRangeText(replacement: string, start: number, end: number, mode?: RangeTextSelectMode): void;
258
- protected onEscapeKey(): Promise<void>;
259
- protected handleFocusIn(): void;
260
- protected handleFocusOut({ relatedTarget }: FocusEvent): void;
261
- protected handlerCalendarIconSlotPointerDown(event: PointerEvent): void;
262
- protected handleInputClick(event: Event): void;
263
- protected handleAnchorClick(): Promise<void>;
264
- private _shouldCloseCalendarDropdown;
265
- protected handleInputChangeEvent(event: CustomEvent<Date>): void;
266
- protected handleCalendarChangeEvent(event: CustomEvent<Date>): Promise<void>;
267
- protected handleInputEvent(event: CustomEvent<Date>): void;
268
- protected handleClosing(): void;
269
- protected handleDialogClosing(event: Event): void;
270
- protected handleDialogClosed(event: Event): void;
271
- private setDateConstraints;
272
- private renderClearIcon;
273
- private renderCalendarIcon;
274
- private renderCalendarSlots;
275
- private renderCalendar;
276
- protected renderActions(): TemplateResult<1>;
277
- protected renderPicker(id: string): TemplateResult<1>;
278
- private renderLabel;
279
- private renderHelperText;
280
- protected renderInput(id: string): TemplateResult<1>;
272
+ private _renderClearIcon;
273
+ private _renderCalendarIcon;
274
+ private _renderCalendarSlots;
275
+ private _renderCalendar;
276
+ protected _renderActions(): TemplateResult<1>;
277
+ protected _renderPicker(id: string): TemplateResult<1>;
278
+ private _renderLabel;
279
+ private _renderHelperText;
280
+ protected _renderInput(id: string): TemplateResult<1>;
281
281
  protected render(): TemplateResult<1>;
282
282
  }
283
283
  declare global {