@sapudex/web-components 2.20.0 → 2.21.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 (151) hide show
  1. package/bundle.esm.js +2 -0
  2. package/cypress/specs/Feed.cy.tsx +72 -0
  3. package/cypress/specs/FeedItem.cy.tsx +82 -0
  4. package/cypress/specs/Footer.cy.tsx +45 -1
  5. package/cypress/support/component-imports.instrumented.ts +4 -0
  6. package/cypress/support/component-imports.src.ts +4 -0
  7. package/dist/AssetsVariables.js +4 -0
  8. package/dist/AssetsVariables.js.map +1 -1
  9. package/dist/Carousel.d.ts +29 -2
  10. package/dist/Carousel.js +34 -6
  11. package/dist/Carousel.js.map +1 -1
  12. package/dist/CarouselTemplate.js +2 -2
  13. package/dist/CarouselTemplate.js.map +1 -1
  14. package/dist/DatePicker.d.ts +4 -4
  15. package/dist/DatePicker.js +3 -10
  16. package/dist/DatePicker.js.map +1 -1
  17. package/dist/DatePickerPopoverTemplate.d.ts +2 -0
  18. package/dist/DatePickerPopoverTemplate.js +13 -0
  19. package/dist/DatePickerPopoverTemplate.js.map +1 -0
  20. package/dist/DatePickerTemplate.d.ts +2 -0
  21. package/dist/DatePickerTemplate.js +7 -0
  22. package/dist/DatePickerTemplate.js.map +1 -0
  23. package/dist/Feed.d.ts +88 -0
  24. package/dist/Feed.js +103 -0
  25. package/dist/Feed.js.map +1 -0
  26. package/dist/FeedItem.d.ts +114 -0
  27. package/dist/FeedItem.js +131 -0
  28. package/dist/FeedItem.js.map +1 -0
  29. package/dist/FeedItemTemplate.d.ts +2 -0
  30. package/dist/FeedItemTemplate.js +16 -0
  31. package/dist/FeedItemTemplate.js.map +1 -0
  32. package/dist/FeedTemplate.d.ts +2 -0
  33. package/dist/FeedTemplate.js +19 -0
  34. package/dist/FeedTemplate.js.map +1 -0
  35. package/dist/Footer.d.ts +14 -2
  36. package/dist/Footer.js +10 -4
  37. package/dist/Footer.js.map +1 -1
  38. package/dist/FooterTemplate.js +3 -3
  39. package/dist/FooterTemplate.js.map +1 -1
  40. package/dist/MediaPlayerTemplate.js +2 -2
  41. package/dist/MediaPlayerTemplate.js.map +1 -1
  42. package/dist/MessageStripTemplate.js +3 -1
  43. package/dist/MessageStripTemplate.js.map +1 -1
  44. package/dist/RatingBarTemplate.js +1 -1
  45. package/dist/RatingBarTemplate.js.map +1 -1
  46. package/dist/Review.js +3 -6
  47. package/dist/Review.js.map +1 -1
  48. package/dist/ReviewItem.d.ts +1 -1
  49. package/dist/ReviewItem.js +15 -18
  50. package/dist/ReviewItem.js.map +1 -1
  51. package/dist/ReviewItemTemplate.d.ts +2 -0
  52. package/dist/ReviewItemTemplate.js +10 -0
  53. package/dist/ReviewItemTemplate.js.map +1 -0
  54. package/dist/ReviewTemplate.d.ts +2 -0
  55. package/dist/ReviewTemplate.js +9 -0
  56. package/dist/ReviewTemplate.js.map +1 -0
  57. package/dist/TileTemplate.js +1 -1
  58. package/dist/TileTemplate.js.map +1 -1
  59. package/dist/assets/{InputSuggestions-DOj9B3SE.js → InputSuggestions-B0P5JAFd.js} +1 -1
  60. package/dist/assets/{ListItemStandardExpandableTextTemplate-C6q5EhEr.js → ListItemStandardExpandableTextTemplate-CFj3_UAT.js} +1 -1
  61. package/dist/assets/{bundle.esm-CmHUshBw.js → bundle.esm-BaPBMfCT.js} +211 -205
  62. package/dist/assets/messagebundle_en-D_yCmNrd.js +1 -0
  63. package/dist/css/themes/Feed.css +1 -0
  64. package/dist/css/themes/FeedItem.css +1 -0
  65. package/dist/css/themes/Footer.css +1 -1
  66. package/dist/css/themes/MediaPlayer.css +1 -1
  67. package/dist/css/themes/RatingIndicator.css +1 -1
  68. package/dist/css/themes/Slider.css +1 -1
  69. package/dist/custom-elements-internal.json +533 -0
  70. package/dist/custom-elements.json +507 -0
  71. package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
  72. package/dist/generated/i18n/i18n-defaults.d.ts +2 -1
  73. package/dist/generated/i18n/i18n-defaults.js +2 -1
  74. package/dist/generated/i18n/i18n-defaults.js.map +1 -1
  75. package/dist/generated/themes/Feed.css.d.ts +2 -0
  76. package/dist/generated/themes/Feed.css.js +8 -0
  77. package/dist/generated/themes/Feed.css.js.map +1 -0
  78. package/dist/generated/themes/FeedItem.css.d.ts +2 -0
  79. package/dist/generated/themes/FeedItem.css.js +8 -0
  80. package/dist/generated/themes/FeedItem.css.js.map +1 -0
  81. package/dist/generated/themes/Footer.css.d.ts +1 -1
  82. package/dist/generated/themes/Footer.css.js +1 -1
  83. package/dist/generated/themes/Footer.css.js.map +1 -1
  84. package/dist/generated/themes/MediaPlayer.css.d.ts +1 -1
  85. package/dist/generated/themes/MediaPlayer.css.js +1 -1
  86. package/dist/generated/themes/MediaPlayer.css.js.map +1 -1
  87. package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
  88. package/dist/generated/themes/RatingIndicator.css.js +1 -1
  89. package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
  90. package/dist/generated/themes/Slider.css.d.ts +1 -1
  91. package/dist/generated/themes/Slider.css.js +1 -1
  92. package/dist/generated/themes/Slider.css.js.map +1 -1
  93. package/dist/messagebundle.properties +3 -0
  94. package/dist/messagebundle_en.properties +1 -0
  95. package/dist/vscode.html-custom-data.json +114 -0
  96. package/dist/web-types.json +255 -1
  97. package/package.json +1 -1
  98. package/src/AssetsVariables.ts +4 -0
  99. package/src/Carousel.ts +36 -6
  100. package/src/CarouselTemplate.tsx +4 -0
  101. package/src/DatePicker.ts +7 -11
  102. package/src/DatePickerPopoverTemplate.tsx +35 -0
  103. package/src/DatePickerTemplate.tsx +27 -0
  104. package/src/Feed.ts +144 -0
  105. package/src/FeedItem.ts +198 -0
  106. package/src/FeedItemTemplate.tsx +60 -0
  107. package/src/FeedTemplate.tsx +66 -0
  108. package/src/Footer.ts +20 -4
  109. package/src/FooterTemplate.tsx +29 -39
  110. package/src/MediaPlayerTemplate.tsx +20 -19
  111. package/src/MessageStripTemplate.tsx +4 -2
  112. package/src/RatingBarTemplate.tsx +1 -0
  113. package/src/Review.ts +3 -6
  114. package/src/ReviewItem.ts +15 -19
  115. package/src/ReviewItemTemplate.tsx +49 -0
  116. package/src/ReviewTemplate.tsx +69 -0
  117. package/src/TileTemplate.tsx +1 -0
  118. package/src/generated/i18n/i18n-defaults.ts +2 -2
  119. package/src/generated/themes/Feed.css.ts +9 -0
  120. package/src/generated/themes/FeedItem.css.ts +9 -0
  121. package/src/generated/themes/Footer.css.ts +1 -1
  122. package/src/generated/themes/MediaPlayer.css.ts +1 -1
  123. package/src/generated/themes/RatingIndicator.css.ts +1 -1
  124. package/src/generated/themes/Slider.css.ts +1 -1
  125. package/src/i18n/messagebundle.properties +3 -0
  126. package/src/i18n/messagebundle_en.properties +1 -0
  127. package/src/themes/Feed.css +51 -0
  128. package/src/themes/FeedItem.css +60 -0
  129. package/src/themes/Footer.css +9 -5
  130. package/src/themes/MediaPlayer.css +1 -1
  131. package/dist/assets/messagebundle_en-BhTYnZbC.js +0 -1
  132. package/dist/generated/templates/DatePickerPopoverTemplate.lit.d.ts +0 -3
  133. package/dist/generated/templates/DatePickerPopoverTemplate.lit.js +0 -10
  134. package/dist/generated/templates/DatePickerPopoverTemplate.lit.js.map +0 -1
  135. package/dist/generated/templates/DatePickerTemplate.lit.d.ts +0 -3
  136. package/dist/generated/templates/DatePickerTemplate.lit.js +0 -10
  137. package/dist/generated/templates/DatePickerTemplate.lit.js.map +0 -1
  138. package/dist/generated/templates/ReviewItemTemplate.lit.d.ts +0 -3
  139. package/dist/generated/templates/ReviewItemTemplate.lit.js +0 -10
  140. package/dist/generated/templates/ReviewItemTemplate.lit.js.map +0 -1
  141. package/dist/generated/templates/ReviewTemplate.lit.d.ts +0 -3
  142. package/dist/generated/templates/ReviewTemplate.lit.js +0 -12
  143. package/dist/generated/templates/ReviewTemplate.lit.js.map +0 -1
  144. package/src/DatePicker.hbs +0 -19
  145. package/src/DatePickerPopover.hbs +0 -24
  146. package/src/Review.hbs +0 -44
  147. package/src/ReviewItem.hbs +0 -20
  148. package/src/generated/templates/DatePickerPopoverTemplate.lit.ts +0 -14
  149. package/src/generated/templates/DatePickerTemplate.lit.ts +0 -14
  150. package/src/generated/templates/ReviewItemTemplate.lit.ts +0 -14
  151. package/src/generated/templates/ReviewTemplate.lit.ts +0 -16
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../src/DatePicker.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,iBAAiB,MAAM,8CAA8C,CAAC;AAC7E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,2BAA2B;AAC3B,OAAO,QAAgD,MAAM,qCAAqC,CAAC;AACnG,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,iCAAiC,CAAC;AACzC,OAAO,gDAAgD,CAAC;AACxD,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAC/F,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,WAAW;AACX,OAAO,kBAAkB,MAAM,iDAAiD,CAAC;AAEjF,SAAS;AACT,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,oBAAoB,MAAM,6CAA6C,CAAC;AAE/E,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,gDAAiB,CAAA;IACjB,8CAAe,CAAA;AACjB,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC;AAaD;;;;;;;;;;;;;;;;;;GAkBG;AA6BH,IAAM,cAAc,s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C,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACD;AAQxB;IADD,QAAQ,EAAE;yDACsB;AAS/B;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACV;AASf;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;qDACjB;AAS3B;IADD,QAAQ,EAAE;kDACiD;AAQ1D;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACc;AAOvC;IADD,QAAQ,EAAE;kDACW;AAGf;IADN,IAAI,CAAC,yBAAyB,CAAC;wCACF;AA5H1B,cAAc;IA5BnB,aAAa,CAAC;QACb,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,CAAC,aAAa,EAAE,oBAAoB,CAAC;QAC7C,QAAQ,EAAE,kBAAkB;QAC5B,YAAY,EAAE,CAAC,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,CAAC;KACvF,CAAC;IACF;;;;;;;OAOG;;IACF,KAAK,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAE/D;;;;;;;;OAQG;;IACF,KAAK,CAAC,oBAAoB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAEzC,cAAc,CAsdnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import DateComponentBase from \"@ui5/webcomponents/dist/DateComponentBase.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\n// eslint-disable-next-line\nimport Calendar, { CalendarSelectionChangeEventDetail } from \"@ui5/webcomponents/dist/Calendar.js\";\nimport CalendarDate from \"@ui5/webcomponents/dist/CalendarDate.js\";\nimport \"@ui5/webcomponents/dist/Icon.js\";\nimport \"@ui5/webcomponents-icons/dist/appointment-2.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { CALENDAR_ICON, DATEPICKER_DATE_DESCRIPTION } from \"./generated/i18n/i18n-defaults.js\";\nimport UDExTextField from \"./TextField.js\";\nimport UDExDropdown from \"./Dropdown.js\";\nimport UDExStatusMessage from \"./StatusMessage.js\";\nimport UDExValueState from \"./types/common.js\";\n\n// Template\nimport DatePickerTemplate from \"./generated/templates/DatePickerTemplate.lit.js\";\n\n// Styles\nimport DatePickerCss from \"./generated/themes/DatePicker.css.js\";\nimport DatePickerPopoverCss from \"./generated/themes/DatePickerPopover.css.js\";\n\nexport enum UDExDatePickerSelectionMode {\n Single = \"Single\",\n Range = \"Range\",\n}\n\ntype UDExDatePickerSelectionChangeEventDetail = {\n selectedValues: Array<string>;\n selectedDates: Array<number | undefined>;\n timestamp: number | undefined;\n};\n\ntype UDExDatePickerValueStateChangeEventDetail = {\n valueState: `${UDExValueState}`,\n valid: boolean\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-date-picker</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/DatePicker.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @extends DateComponentBase\n * @tagname udex-date-picker\n * @public\n */\n@customElement({\n tag: \"udex-date-picker\",\n renderer: litRender,\n styles: [DatePickerCss, DatePickerPopoverCss],\n template: DatePickerTemplate,\n dependencies: [CalendarDate, Calendar, UDExTextField, UDExDropdown, UDExStatusMessage],\n})\n/**\n * Fired when the selected dates change.\n *\n * @allowPreventDefault\n * @param {Array<string>} selectedValues The selected dates\n * @param {Array<number>} selectedDates The selected dates as UTC timestamps\n * @public\n */\n@event(\"selection-change\", { cancelable: true, bubbles: true })\n\n/**\n * Fired before the value state of the component is updated internally.\n * The event is preventable, meaning that if it's default action is\n * prevented, the component will not update the value state.\n * @allowPreventDefault\n * @public\n * @param {string} UDExValueState The new `UDExValueState` that will be set.\n * @param {boolean} valid Indicator if the value is in between the min and max value.\n */\n@event(\"value-state-change\", { bubbles: true })\n\nclass UDExDatePicker extends DateComponentBase {\n eventDetails!: {\n \"selection-change\": UDExDatePickerSelectionChangeEventDetail,\n \"value-state-change\": UDExDatePickerValueStateChangeEventDetail,\n };\n /**\n * Defines selection mode of the calendar component.\n *\n * @default \"Single\"\n * @public\n */\n @property()\n selectionMode: `${UDExDatePickerSelectionMode}` = \"Single\";\n\n /**\n * Defines whether the component is read-only.\n * <br><br>\n * <b>Note:</b> A read-only component is not editable,\n * but still provides visual feedback upon user interaction.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n readonly!: boolean;\n\n /**\n * Defines whether the component is required.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n required!: boolean;\n\n /**\n * Defines whether the component is in disabled state.\n * <br><br>\n * <b>Note:</b> A disabled component is completely noninteractive.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n disabled!: boolean;\n\n /**\n * Defines supporting text under the input field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n supportingText: string = \"\";\n\n /**\n * Defines the value of the input.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n value: string = \"\";\n\n /**\n * Sets the accessible ARIA name of the component.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n accessibleName!: string;\n\n /**\n * Receives id (or many ids) of the elements that label the component.\n * @default \"\"\n * @public\n */\n @property()\n accessibleNameRef: string = \"\";\n\n /**\n * Defines label text for the input field.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n label?: string;\n\n /**\n * Defines selected dates values.\n *\n * @default \"\"\n * @private\n */\n @property({ type: String, noAttribute: true })\n selectedDates: string = \"\";\n\n /**\n * Defines the value state of the component.\n *\n * @default \"Standard\"\n * @public\n */\n @property()\n valueState: `${UDExValueState}` = UDExValueState.Standard;\n\n /**\n * Defines the date format pattern (e.g., \\\"MMM dd, yyyy\\\" or \\\"MM/dd/yyyy\\\").\n * @default \"MMM dd, yyyy\"\n * @public\n */\n @property({ type: String })\n formatPattern: string = \"MMM dd, yyyy\";\n\n /**\n * The first date in the range during selection (this is a temporary value, not the first date in the value range)\n * @private\n */\n @property()\n _tempValue!: string;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n responsivePopover?: UDExDropdown;\n\n private _prevDelimiter!: string | null;\n\n _getResponsePopover(): UDExDropdown {\n return this.shadowRoot!.querySelector<UDExDropdown>(`#udex-${this.__id!}-calendar__popover`)!;\n }\n\n /**\n * Getter for the interactive element that opens the overflow\n * @private\n */\n get _dropdownTrigger(): UDExTextField {\n return this.shadowRoot!.querySelector<UDExTextField>(\"[udex-text-field]\")!;\n }\n\n _afterDropdownClose(): void {\n this._dropdownTrigger.active = false;\n this._dropdownTrigger.iconActive = false;\n this._dropdownTrigger.shadowRoot?.querySelector(\"input\")?.blur();\n this._tempValue = \"\";\n }\n\n _afterDropdownOpen(): void {\n this._dropdownTrigger.iconActive = true;\n }\n\n _closeRespPopover(): void {\n if (this.responsivePopover) {\n this.responsivePopover.open = false;\n }\n }\n\n _openRespPopover(): void {\n this._dropdownTrigger.active = true;\n this.responsivePopover = this._getResponsePopover();\n this.responsivePopover.opener = this._dropdownTrigger._inputHolder;\n this.responsivePopover.open = true;\n }\n\n hideCalendar(): void {\n this._closeRespPopover();\n }\n\n showCalendar(): void {\n this._openRespPopover();\n }\n\n handleCalendarChange(e: CustomEvent<CalendarSelectionChangeEventDetail>): void {\n e.preventDefault();\n if (this.selectionMode === UDExDatePickerSelectionMode.Single) {\n const newValue = e.detail.selectedValues && e.detail.selectedValues[0];\n this._updateValueAndFireDecoratorEvents(newValue, true, e);\n }\n\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n const values = e.detail.selectedValues;\n\n if (values.length === 0) {\n return;\n }\n\n if (values.length === 1) { // Do nothing until the user selects 2 dates, we don't change any state at all for one date\n this._tempValue = values[0];\n return;\n }\n\n const newValue = this._buildValue(e.detail.selectedDates[0], e.detail.selectedDates[1]);\n this._updateValueAndFireDecoratorEvents(newValue, true, e);\n }\n\n this.hideCalendar();\n }\n\n get _effectiveDelimiter(): string {\n return \"-\";\n }\n\n _getInput(): HTMLInputElement | null | undefined {\n return this._dropdownTrigger.shadowRoot?.querySelector(\"input\");\n }\n\n _splitValueByDelimiter(value: string) {\n const valuesArray: Array<string> = [];\n const partsArray = value.split(this._prevDelimiter || this._effectiveDelimiter);\n\n // if format successfully parse the value, the value contains only single date\n if (this.getFormat().parse(value)) {\n valuesArray[0] = partsArray.join(this._effectiveDelimiter);\n valuesArray[1] = \"\";\n\n return valuesArray;\n }\n\n valuesArray[0] = partsArray.slice(0, partsArray.length / 2).join(this._effectiveDelimiter);\n valuesArray[1] = partsArray.slice(partsArray.length / 2).join(this._effectiveDelimiter);\n\n return valuesArray;\n }\n\n /**\n * Returns a UTC timestamp, representing the last date in the value string or undefined if the value is empty or there is just one date\n * @private\n */\n _extractLastTimestamp(value: string) {\n if (!value || !this._checkValueValidity(value)) {\n return undefined;\n }\n\n const dateStrings = this._splitValueByDelimiter(value);\n if (dateStrings[1]) {\n const parsedDate = this.getFormat().parse(dateStrings[1], true) as Date;\n return parsedDate.getTime() / 1000;\n }\n\n return undefined;\n }\n\n /**\n * Returns a UTC timestamp, representing the first date in the value string or undefined if the value is empty\n * @private\n */\n _extractFirstTimestamp(value: string) {\n if (!value || !this._checkValueValidity(value)) {\n return undefined;\n }\n\n const dateStrings = this._splitValueByDelimiter(value); // at least one item guaranteed due to the checks above (non-empty and valid)\n\n const parsedDate = this.getFormat().parse(dateStrings[0], true) as Date;\n return parsedDate.getTime() / 1000;\n }\n\n /**\n * Checks if a value is valid against the current date format of the DatePicker.\n * @public\n * @param value A value to be tested against the current date format\n */\n isValid(value: string): boolean {\n if (value === \"\" || value === undefined) {\n return true;\n }\n\n return !!this.getFormat().parse(value);\n }\n\n isValidRange(value: string): boolean {\n const parts = this._splitValueByDelimiter(value);\n return parts.length <= 2 && parts.every(dateString => this.isValid(dateString)); // must be at most 2 dates and each must be valid\n }\n\n isInValidRange(value: string): boolean {\n if (value === \"\" || value === undefined) {\n return true;\n }\n\n const calendarDate = this._getCalendarDateFromString(value);\n\n if (!calendarDate || !this._minDate || !this._maxDate) {\n return false;\n }\n\n return calendarDate.valueOf() >= this._minDate.valueOf() && calendarDate.valueOf() <= this._maxDate.valueOf();\n }\n\n /**\n * Checks if a date is between the minimum and maximum date.\n * @public\n * @param value A value to be checked\n */\n isInValidRangeRange(value: string): boolean {\n return this._splitValueByDelimiter(value).every(dateString => this.isInValidRange(dateString));\n }\n\n _checkValueValidity(value: string): boolean {\n let result = false;\n if (value === \"\") {\n return true;\n }\n if (this.selectionMode === UDExDatePickerSelectionMode.Single) {\n result = this.isValid(value) && this.isInValidRange(value);\n }\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n result = this.isValidRange(value) && this.isInValidRangeRange(value);\n }\n return result;\n }\n\n /**\n * Builds a string value out of two UTC timestamps - this method is the counterpart to _extractFirstTimestamp/_extractLastTimestamp\n * @private\n */\n _buildValue(firstDateTimestamp: number | undefined, lastDateTimestamp: number | undefined) {\n this._prevDelimiter = this._effectiveDelimiter;\n if (firstDateTimestamp) {\n const firstDateString = this._getStringFromTimestamp(firstDateTimestamp * 1000);\n\n if (!lastDateTimestamp) {\n return firstDateString;\n }\n\n const lastDateString = this._getStringFromTimestamp(lastDateTimestamp * 1000);\n return `${firstDateString} ${this._effectiveDelimiter} ${lastDateString}`;\n }\n\n return \"\";\n }\n\n /**\n * The parser understands many formats, but we need one format OR extract both dates as timestamps, flip if necessary, and build (which will use the desired format so we enforce the format too)\n * @protected\n */\n normalizeValue(value: string) {\n let result = \"\";\n if (this.selectionMode === UDExDatePickerSelectionMode.Single) {\n if (value === \"\") {\n return value;\n }\n result = this.getFormat().format(this.getFormat().parse(value, true), true); // it is important to both parse and format the date as UTC\n }\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n const firstDateTimestamp = this._extractFirstTimestamp(value);\n const lastDateTimestamp = this._extractLastTimestamp(value);\n if (firstDateTimestamp && lastDateTimestamp && firstDateTimestamp > lastDateTimestamp) { // if both are timestamps (not undefined), flip if necessary\n return this._buildValue(lastDateTimestamp, firstDateTimestamp);\n }\n result = this._buildValue(firstDateTimestamp, lastDateTimestamp);\n }\n return result;\n }\n\n _updateValueState() {\n const valid = this._checkValueValidity(this.value);\n const previousValueState = this.valueState;\n\n this.valueState = valid ? UDExValueState.Standard : UDExValueState.Error;\n\n const eventPrevented = !this.fireDecoratorEvent(\"value-state-change\", { valueState: this.valueState, valid });\n\n if (eventPrevented) {\n this.valueState = previousValueState;\n }\n }\n\n _buildEventData(value: string): UDExDatePickerSelectionChangeEventDetail {\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n return {\n selectedDates: [this._extractFirstTimestamp(value), this._extractLastTimestamp(value)],\n selectedValues: this._splitValueByDelimiter(this.value),\n timestamp: this._extractLastTimestamp(value),\n };\n }\n return {\n selectedDates: [this._extractFirstTimestamp(value)],\n selectedValues: [value],\n timestamp: this._extractFirstTimestamp(value),\n };\n }\n\n _updateValueAndFireDecoratorEvents(value: string, normalizeValue: boolean, e?: CustomEvent | null) {\n const valid = this._checkValueValidity(value);\n\n if (valid && normalizeValue) {\n value = this.normalizeValue(value); // transform valid values (in any format) to the correct format\n }\n\n this.value = value;\n this._updateValueState(); // Change the value state to Error/None, but only if needed\n\n if (!valid) { return; }\n\n if (e) {\n const { selectedDates, timestamp, selectedValues } = e.detail;\n\n this.fireDecoratorEvent(\n \"selection-change\",\n {\n timestamp,\n selectedDates,\n selectedValues,\n },\n );\n } else {\n this.fireDecoratorEvent(\n \"selection-change\",\n this._buildEventData(value),\n );\n }\n }\n\n _onInputChange(e: Event) {\n this._updateValueAndFireDecoratorEvents((e.target as UDExDatePicker).value, true);\n }\n\n handleInputClick(e: MouseEvent | KeyboardEvent): void {\n e.preventDefault();\n\n if (this.disabled || this.readonly) {\n return;\n }\n\n if (this.responsivePopover?.open) {\n this.hideCalendar();\n } else {\n this.showCalendar();\n }\n }\n\n /**\n * Used to provide selectedDates to the calendar based on the component's state\n * Override in derivatives to provide different rules for setting the calendar's selected dates\n * @protected\n */\n get _calendarSelectedDates(): Array<string> {\n if (this._tempValue) {\n return [this._tempValue];\n }\n\n if (this.value && this._checkValueValidity(this.value)) {\n return this.value.split(\" - \");\n }\n\n return [];\n }\n\n get startValue(): string {\n return this._calendarSelectedDates[0] || \"\";\n }\n\n get endValue(): string {\n return this._calendarSelectedDates[1] || \"\";\n }\n\n get accessibleIconName(): string {\n return UDExDatePicker.i18nBundle.getText(CALENDAR_ICON);\n }\n\n get dateAccessibleName(): string {\n return this.accessibleName || UDExDatePicker.i18nBundle.getText(DATEPICKER_DATE_DESCRIPTION);\n }\n\n get isRangeMode(): boolean {\n return this.selectionMode === UDExDatePickerSelectionMode.Range;\n }\n}\n\nUDExDatePicker.define();\n\nexport default UDExDatePicker;\nexport type { UDExDatePickerSelectionChangeEventDetail, UDExDatePickerValueStateChangeEventDetail };\n"]}
1
+ {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../src/DatePicker.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,iBAAiB,MAAM,8CAA8C,CAAC;AAC7E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAE5E,OAAO,iCAAiC,CAAC;AACzC,OAAO,gDAAgD,CAAC;AACxD,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,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C,cAAc,CAsdnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import DateComponentBase from \"@ui5/webcomponents/dist/DateComponentBase.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport type { CalendarSelectionChangeEventDetail } from \"@ui5/webcomponents/dist/Calendar.js\";\nimport \"@ui5/webcomponents/dist/Icon.js\";\nimport \"@ui5/webcomponents-icons/dist/appointment-2.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { CALENDAR_ICON, DATEPICKER_DATE_DESCRIPTION } from \"./generated/i18n/i18n-defaults.js\";\nimport type UDExTextField from \"./TextField.js\";\nimport type UDExDropdown from \"./Dropdown.js\";\nimport UDExValueState from \"./types/common.js\";\n\n// Template\nimport DatePickerTemplate from \"./DatePickerTemplate.js\";\n\n// Styles\nimport DatePickerCss from \"./generated/themes/DatePicker.css.js\";\nimport DatePickerPopoverCss from \"./generated/themes/DatePickerPopover.css.js\";\n\nexport enum UDExDatePickerSelectionMode {\n Single = \"Single\",\n Range = \"Range\",\n}\n\ntype UDExDatePickerSelectionChangeEventDetail = {\n selectedValues: Array<string>;\n selectedDates: Array<number | undefined>;\n timestamp: number | undefined;\n};\n\ntype UDExDatePickerValueStateChangeEventDetail = {\n valueState: `${UDExValueState}`,\n valid: boolean\n}\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-date-picker</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/DatePicker.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @extends DateComponentBase\n * @tagname udex-date-picker\n * @public\n */\n@customElement({\n tag: \"udex-date-picker\",\n renderer: jsxRenderer,\n styles: [DatePickerCss, DatePickerPopoverCss],\n template: DatePickerTemplate,\n})\n/**\n * Fired when the selected dates change.\n *\n * @allowPreventDefault\n * @param {Array<string>} selectedValues The selected dates\n * @param {Array<number>} selectedDates The selected dates as UTC timestamps\n * @public\n */\n@event(\"selection-change\", { cancelable: true, bubbles: true })\n\n/**\n * Fired before the value state of the component is updated internally.\n * The event is preventable, meaning that if it's default action is\n * prevented, the component will not update the value state.\n * @allowPreventDefault\n * @public\n * @param {string} UDExValueState The new `UDExValueState` that will be set.\n * @param {boolean} valid Indicator if the value is in between the min and max value.\n */\n@event(\"value-state-change\", { bubbles: true })\n\nclass UDExDatePicker extends DateComponentBase {\n eventDetails!: {\n \"selection-change\": UDExDatePickerSelectionChangeEventDetail,\n \"value-state-change\": UDExDatePickerValueStateChangeEventDetail,\n };\n /**\n * Defines selection mode of the calendar component.\n *\n * @default \"Single\"\n * @public\n */\n @property()\n selectionMode: `${UDExDatePickerSelectionMode}` = \"Single\";\n\n /**\n * Defines whether the component is read-only.\n * <br><br>\n * <b>Note:</b> A read-only component is not editable,\n * but still provides visual feedback upon user interaction.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n readonly!: boolean;\n\n /**\n * Defines whether the component is required.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n required!: boolean;\n\n /**\n * Defines whether the component is in disabled state.\n * <br><br>\n * <b>Note:</b> A disabled component is completely noninteractive.\n *\n * @default false\n * @public\n */\n @property({ type: Boolean })\n disabled!: boolean;\n\n /**\n * Defines supporting text under the input field.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n supportingText: string = \"\";\n\n /**\n * Defines the value of the input.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n value: string = \"\";\n\n /**\n * Sets the accessible ARIA name of the component.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n accessibleName!: string;\n\n /**\n * Receives id (or many ids) of the elements that label the component.\n * @default \"\"\n * @public\n */\n @property()\n accessibleNameRef: string = \"\";\n\n /**\n * Defines label text for the input field.\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n label?: string;\n\n /**\n * Defines selected dates values.\n *\n * @default \"\"\n * @private\n */\n @property({ type: String, noAttribute: true })\n selectedDates: string = \"\";\n\n /**\n * Defines the value state of the component.\n *\n * @default \"Standard\"\n * @public\n */\n @property()\n valueState: `${UDExValueState}` = UDExValueState.Standard;\n\n /**\n * Defines the date format pattern (e.g., \\\"MMM dd, yyyy\\\" or \\\"MM/dd/yyyy\\\").\n * @default \"MMM dd, yyyy\"\n * @public\n */\n @property({ type: String })\n formatPattern: string = \"MMM dd, yyyy\";\n\n /**\n * The first date in the range during selection (this is a temporary value, not the first date in the value range)\n * @private\n */\n @property()\n _tempValue!: string;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n responsivePopover?: UDExDropdown;\n\n private _prevDelimiter!: string | null;\n\n _getResponsePopover(): UDExDropdown {\n return this.shadowRoot!.querySelector<UDExDropdown>(`#udex-${this.__id!}-calendar__popover`)!;\n }\n\n /**\n * Getter for the interactive element that opens the overflow\n * @private\n */\n get _dropdownTrigger(): UDExTextField {\n return this.shadowRoot!.querySelector<UDExTextField>(\"[udex-text-field]\")!;\n }\n\n _afterDropdownClose(): void {\n this._dropdownTrigger.active = false;\n this._dropdownTrigger.iconActive = false;\n this._dropdownTrigger.shadowRoot?.querySelector(\"input\")?.blur();\n this._tempValue = \"\";\n }\n\n _afterDropdownOpen(): void {\n this._dropdownTrigger.iconActive = true;\n }\n\n _closeRespPopover(): void {\n if (this.responsivePopover) {\n this.responsivePopover.open = false;\n }\n }\n\n _openRespPopover(): void {\n this._dropdownTrigger.active = true;\n this.responsivePopover = this._getResponsePopover();\n this.responsivePopover.opener = this._dropdownTrigger._inputHolder;\n this.responsivePopover.open = true;\n }\n\n hideCalendar(): void {\n this._closeRespPopover();\n }\n\n showCalendar(): void {\n this._openRespPopover();\n }\n\n handleCalendarChange(e: CustomEvent<CalendarSelectionChangeEventDetail>): void {\n e.preventDefault();\n if (this.selectionMode === UDExDatePickerSelectionMode.Single) {\n const newValue = e.detail.selectedValues && e.detail.selectedValues[0];\n this._updateValueAndFireDecoratorEvents(newValue, true, e);\n }\n\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n const values = e.detail.selectedValues;\n\n if (values.length === 0) {\n return;\n }\n\n if (values.length === 1) { // Do nothing until the user selects 2 dates, we don't change any state at all for one date\n this._tempValue = values[0];\n return;\n }\n\n const newValue = this._buildValue(e.detail.selectedDates[0], e.detail.selectedDates[1]);\n this._updateValueAndFireDecoratorEvents(newValue, true, e);\n }\n\n this.hideCalendar();\n }\n\n get _effectiveDelimiter(): string {\n return \"-\";\n }\n\n _getInput(): HTMLInputElement | null | undefined {\n return this._dropdownTrigger.shadowRoot?.querySelector(\"input\");\n }\n\n _splitValueByDelimiter(value: string) {\n const valuesArray: Array<string> = [];\n const partsArray = value.split(this._prevDelimiter || this._effectiveDelimiter);\n\n // if format successfully parse the value, the value contains only single date\n if (this.getFormat().parse(value)) {\n valuesArray[0] = partsArray.join(this._effectiveDelimiter);\n valuesArray[1] = \"\";\n\n return valuesArray;\n }\n\n valuesArray[0] = partsArray.slice(0, partsArray.length / 2).join(this._effectiveDelimiter);\n valuesArray[1] = partsArray.slice(partsArray.length / 2).join(this._effectiveDelimiter);\n\n return valuesArray;\n }\n\n /**\n * Returns a UTC timestamp, representing the last date in the value string or undefined if the value is empty or there is just one date\n * @private\n */\n _extractLastTimestamp(value: string) {\n if (!value || !this._checkValueValidity(value)) {\n return undefined;\n }\n\n const dateStrings = this._splitValueByDelimiter(value);\n if (dateStrings[1]) {\n const parsedDate = this.getFormat().parse(dateStrings[1], true) as Date;\n return parsedDate.getTime() / 1000;\n }\n\n return undefined;\n }\n\n /**\n * Returns a UTC timestamp, representing the first date in the value string or undefined if the value is empty\n * @private\n */\n _extractFirstTimestamp(value: string) {\n if (!value || !this._checkValueValidity(value)) {\n return undefined;\n }\n\n const dateStrings = this._splitValueByDelimiter(value); // at least one item guaranteed due to the checks above (non-empty and valid)\n\n const parsedDate = this.getFormat().parse(dateStrings[0], true) as Date;\n return parsedDate.getTime() / 1000;\n }\n\n /**\n * Checks if a value is valid against the current date format of the DatePicker.\n * @public\n * @param value A value to be tested against the current date format\n */\n isValid(value: string): boolean {\n if (value === \"\" || value === undefined) {\n return true;\n }\n\n return !!this.getFormat().parse(value);\n }\n\n isValidRange(value: string): boolean {\n const parts = this._splitValueByDelimiter(value);\n return parts.length <= 2 && parts.every(dateString => this.isValid(dateString)); // must be at most 2 dates and each must be valid\n }\n\n isInValidRange(value: string): boolean {\n if (value === \"\" || value === undefined) {\n return true;\n }\n\n const calendarDate = this._getCalendarDateFromString(value);\n\n if (!calendarDate || !this._minDate || !this._maxDate) {\n return false;\n }\n\n return calendarDate.valueOf() >= this._minDate.valueOf() && calendarDate.valueOf() <= this._maxDate.valueOf();\n }\n\n /**\n * Checks if a date is between the minimum and maximum date.\n * @public\n * @param value A value to be checked\n */\n isInValidRangeRange(value: string): boolean {\n return this._splitValueByDelimiter(value).every(dateString => this.isInValidRange(dateString));\n }\n\n _checkValueValidity(value: string): boolean {\n let result = false;\n if (value === \"\") {\n return true;\n }\n if (this.selectionMode === UDExDatePickerSelectionMode.Single) {\n result = this.isValid(value) && this.isInValidRange(value);\n }\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n result = this.isValidRange(value) && this.isInValidRangeRange(value);\n }\n return result;\n }\n\n /**\n * Builds a string value out of two UTC timestamps - this method is the counterpart to _extractFirstTimestamp/_extractLastTimestamp\n * @private\n */\n _buildValue(firstDateTimestamp: number | undefined, lastDateTimestamp: number | undefined) {\n this._prevDelimiter = this._effectiveDelimiter;\n if (firstDateTimestamp) {\n const firstDateString = this._getStringFromTimestamp(firstDateTimestamp * 1000);\n\n if (!lastDateTimestamp) {\n return firstDateString;\n }\n\n const lastDateString = this._getStringFromTimestamp(lastDateTimestamp * 1000);\n return `${firstDateString} ${this._effectiveDelimiter} ${lastDateString}`;\n }\n\n return \"\";\n }\n\n /**\n * The parser understands many formats, but we need one format OR extract both dates as timestamps, flip if necessary, and build (which will use the desired format so we enforce the format too)\n * @protected\n */\n normalizeValue(value: string) {\n let result = \"\";\n if (this.selectionMode === UDExDatePickerSelectionMode.Single) {\n if (value === \"\") {\n return value;\n }\n result = this.getFormat().format(this.getFormat().parse(value, true), true); // it is important to both parse and format the date as UTC\n }\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n const firstDateTimestamp = this._extractFirstTimestamp(value);\n const lastDateTimestamp = this._extractLastTimestamp(value);\n if (firstDateTimestamp && lastDateTimestamp && firstDateTimestamp > lastDateTimestamp) { // if both are timestamps (not undefined), flip if necessary\n return this._buildValue(lastDateTimestamp, firstDateTimestamp);\n }\n result = this._buildValue(firstDateTimestamp, lastDateTimestamp);\n }\n return result;\n }\n\n _updateValueState() {\n const valid = this._checkValueValidity(this.value);\n const previousValueState = this.valueState;\n\n this.valueState = valid ? UDExValueState.Standard : UDExValueState.Error;\n\n const eventPrevented = !this.fireDecoratorEvent(\"value-state-change\", { valueState: this.valueState, valid });\n\n if (eventPrevented) {\n this.valueState = previousValueState;\n }\n }\n\n _buildEventData(value: string): UDExDatePickerSelectionChangeEventDetail {\n if (this.selectionMode === UDExDatePickerSelectionMode.Range) {\n return {\n selectedDates: [this._extractFirstTimestamp(value), this._extractLastTimestamp(value)],\n selectedValues: this._splitValueByDelimiter(this.value),\n timestamp: this._extractLastTimestamp(value),\n };\n }\n return {\n selectedDates: [this._extractFirstTimestamp(value)],\n selectedValues: [value],\n timestamp: this._extractFirstTimestamp(value),\n };\n }\n\n _updateValueAndFireDecoratorEvents(value: string, normalizeValue: boolean, e?: CustomEvent | null) {\n const valid = this._checkValueValidity(value);\n\n if (valid && normalizeValue) {\n value = this.normalizeValue(value); // transform valid values (in any format) to the correct format\n }\n\n this.value = value;\n this._updateValueState(); // Change the value state to Error/None, but only if needed\n\n if (!valid) { return; }\n\n if (e) {\n const { selectedDates, timestamp, selectedValues } = e.detail;\n\n this.fireDecoratorEvent(\n \"selection-change\",\n {\n timestamp,\n selectedDates,\n selectedValues,\n },\n );\n } else {\n this.fireDecoratorEvent(\n \"selection-change\",\n this._buildEventData(value),\n );\n }\n }\n\n _onInputChange(e: Event) {\n this._updateValueAndFireDecoratorEvents((e.target as UDExDatePicker).value, true);\n }\n\n handleInputClick(e: CustomEvent<void>): void {\n e.preventDefault();\n\n if (this.disabled || this.readonly) {\n return;\n }\n\n if (this.responsivePopover?.open) {\n this.hideCalendar();\n } else {\n this.showCalendar();\n }\n }\n\n /**\n * Used to provide selectedDates to the calendar based on the component's state\n * Override in derivatives to provide different rules for setting the calendar's selected dates\n * @protected\n */\n get _calendarSelectedDates(): Array<string> {\n if (this._tempValue) {\n return [this._tempValue];\n }\n\n if (this.value && this._checkValueValidity(this.value)) {\n return this.value.split(\" - \");\n }\n\n return [];\n }\n\n get startValue(): string {\n return this._calendarSelectedDates[0] || \"\";\n }\n\n get endValue(): string {\n return this._calendarSelectedDates[1] || \"\";\n }\n\n get accessibleIconName(): string {\n return UDExDatePicker.i18nBundle.getText(CALENDAR_ICON);\n }\n\n get dateAccessibleName(): string {\n return this.accessibleName || UDExDatePicker.i18nBundle.getText(DATEPICKER_DATE_DESCRIPTION);\n }\n\n get isRangeMode(): boolean {\n return this.selectionMode === UDExDatePickerSelectionMode.Range;\n }\n}\n\nUDExDatePicker.define();\n\nexport default UDExDatePicker;\nexport type { UDExDatePickerSelectionChangeEventDetail, UDExDatePickerValueStateChangeEventDetail };\n"]}
@@ -0,0 +1,2 @@
1
+ import type DatePicker from "./DatePicker.js";
2
+ export default function DatePickerPopoverTemplate(this: DatePicker): import("@ui5/webcomponents-base").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "@ui5/webcomponents-base/jsx-runtime";
2
+ import Calendar from "@ui5/webcomponents/dist/Calendar.js";
3
+ import UDExDropdown from "./Dropdown.js";
4
+ import { Placement } from "./types/Dropdown.js";
5
+ import CalendarDate from "@ui5/webcomponents/dist/CalendarDate.js";
6
+ import CalendarDateRange from "@ui5/webcomponents/dist/CalendarDateRange.js";
7
+ export default function DatePickerPopoverTemplate() {
8
+ return (_jsx(UDExDropdown, { id: `udex-${this._id}-calendar__popover`, opener: `udex-${this._id}-calendar__opener`, class: "udex-date-picker__popover", placement: Placement.Bottom, "horizontal-align": "Start", onClose: this._afterDropdownClose, onOpen: this._afterDropdownOpen, children: _jsx(Calendar, { class: "udex-date-picker__calendar", onSelectionChange: this.handleCalendarChange, "selection-mode": this.selectionMode, "min-date": this.minDate, "max-date": this.maxDate, "format-pattern": this.formatPattern, children: this.isRangeMode ?
9
+ _jsx(CalendarDateRange, { "start-value": this.startValue, "end-value": this.endValue })
10
+ :
11
+ this._calendarSelectedDates.map(date => _jsx(CalendarDate, { value: date })) }) }));
12
+ }
13
+ //# sourceMappingURL=DatePickerPopoverTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerPopoverTemplate.js","sourceRoot":"","sources":["../src/DatePickerPopoverTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,qCAAqC,CAAC;AAE3D,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,iBAAiB,MAAM,8CAA8C,CAAC;AAE7E,MAAM,CAAC,OAAO,UAAU,yBAAyB;IAC/C,OAAO,CACL,KAAC,YAAY,IACX,EAAE,EAAE,QAAQ,IAAI,CAAC,GAAG,oBAAoB,EACxC,MAAM,EAAE,QAAQ,IAAI,CAAC,GAAG,mBAAmB,EAC3C,KAAK,EAAC,2BAA2B,EACjC,SAAS,EAAE,SAAS,CAAC,MAAM,sBACV,OAAO,EACxB,OAAO,EAAE,IAAI,CAAC,mBAAmB,EACjC,MAAM,EAAE,IAAI,CAAC,kBAAkB,YAC/B,KAAC,QAAQ,IACP,KAAK,EAAC,4BAA4B,EAClC,iBAAiB,EAAE,IAAI,CAAC,oBAAoB,oBAC5B,IAAI,CAAC,aAAa,cACxB,IAAI,CAAC,OAAO,cACZ,IAAI,CAAC,OAAO,oBACN,IAAI,CAAC,aAAa,YAChC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAClB,KAAC,iBAAiB,mBAAc,IAAI,CAAC,UAAU,eAAa,IAAI,CAAC,QAAQ,GAAsB;gBAC/F,CAAC;oBACD,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CACrC,KAAC,YAAY,IAAC,KAAK,EAAE,IAAI,GAAiB,CAC3C,GAEM,GACE,CAChB,CAAC;AACJ,CAAC","sourcesContent":["import Calendar from \"@ui5/webcomponents/dist/Calendar.js\";\nimport type DatePicker from \"./DatePicker.js\";\nimport UDExDropdown from \"./Dropdown.js\";\nimport { Placement } from \"./types/Dropdown.js\";\nimport CalendarDate from \"@ui5/webcomponents/dist/CalendarDate.js\";\nimport CalendarDateRange from \"@ui5/webcomponents/dist/CalendarDateRange.js\";\n\nexport default function DatePickerPopoverTemplate(this: DatePicker) {\n return (\n <UDExDropdown\n id={`udex-${this._id}-calendar__popover`}\n opener={`udex-${this._id}-calendar__opener`}\n class=\"udex-date-picker__popover\"\n placement={Placement.Bottom}\n horizontal-align=\"Start\"\n onClose={this._afterDropdownClose}\n onOpen={this._afterDropdownOpen}>\n <Calendar\n class=\"udex-date-picker__calendar\"\n onSelectionChange={this.handleCalendarChange}\n selection-mode={this.selectionMode}\n min-date={this.minDate}\n max-date={this.maxDate}\n format-pattern={this.formatPattern}>\n { this.isRangeMode ?\n <CalendarDateRange start-value={this.startValue} end-value={this.endValue}></CalendarDateRange>\n :\n this._calendarSelectedDates.map(date =>\n <CalendarDate value={date}></CalendarDate>\n )\n }\n </Calendar>\n </UDExDropdown>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type DatePicker from "./DatePicker.js";
2
+ export default function DatePickerTemplate(this: DatePicker): import("@ui5/webcomponents-base").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
2
+ import DatePickerPopoverTemplate from "./DatePickerPopoverTemplate.js";
3
+ import UDExTextField from "./TextField.js";
4
+ export default function DatePickerTemplate() {
5
+ return (_jsxs(_Fragment, { children: [_jsx(UDExTextField, { class: "udex-date-picker__input", "_aria-has-popup": "grid", icon: "appointment-2", value: this.value, label: this.label, "accessible-name": this.dateAccessibleName, "accessible-name-ref": this.accessibleNameRef, "accessible-icon-name": this.accessibleIconName, ...(this.disabled ? { "disabled": true } : {}), ...(this.required ? { "required": true } : {}), ...(this.readonly ? { "readonly": true } : {}), onClickIcon: this.handleInputClick, onChange: this._onInputChange, "value-state": this.valueState, "supporting-text": this.supportingText }), DatePickerPopoverTemplate.call(this)] }));
6
+ }
7
+ //# sourceMappingURL=DatePickerTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerTemplate.js","sourceRoot":"","sources":["../src/DatePickerTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,yBAAyB,MAAM,gCAAgC,CAAC;AACvE,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAE3C,MAAM,CAAC,OAAO,UAAU,kBAAkB;IACxC,OAAO,CACL,8BACE,KAAC,aAAa,IACZ,KAAK,EAAC,yBAAyB,qBACf,MAAM,EACtB,IAAI,EAAC,eAAe,EACpB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,qBACA,IAAI,CAAC,kBAAkB,yBACnB,IAAI,CAAC,iBAAiB,0BACrB,IAAI,CAAC,kBAAkB,KACzC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAC3C,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAC3C,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/C,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAClC,QAAQ,EAAE,IAAI,CAAC,cAAc,iBAChB,IAAI,CAAC,UAAU,qBACX,IAAI,CAAC,cAAc,GAAI,EACzC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,IACpC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import type DatePicker from \"./DatePicker.js\";\nimport DatePickerPopoverTemplate from \"./DatePickerPopoverTemplate.js\";\nimport UDExTextField from \"./TextField.js\";\n\nexport default function DatePickerTemplate(this: DatePicker) {\n return (\n <>\n <UDExTextField\n class=\"udex-date-picker__input\"\n _aria-has-popup=\"grid\"\n icon=\"appointment-2\"\n value={this.value}\n label={this.label}\n accessible-name={this.dateAccessibleName}\n accessible-name-ref={this.accessibleNameRef}\n accessible-icon-name={this.accessibleIconName}\n {...(this.disabled ? { \"disabled\": true } : {})}\n {...(this.required ? { \"required\": true } : {})}\n {...(this.readonly ? { \"readonly\": true } : {})}\n onClickIcon={this.handleInputClick}\n onChange={this._onInputChange}\n value-state={this.valueState}\n supporting-text={this.supportingText} />\n {DatePickerPopoverTemplate.call(this)}\n </>\n );\n}\n"]}
package/dist/Feed.d.ts ADDED
@@ -0,0 +1,88 @@
1
+ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
+ import UDExButtonDesign from "./types/ButtonDesign.js";
3
+ import type UDExFeedItem from "./FeedItem.js";
4
+ /**
5
+ * @class
6
+ *
7
+ * <h3 class="comment-api-title">Overview</h3>
8
+ *
9
+ *
10
+ * <h3>Usage</h3>
11
+ *
12
+ * For the <code>udex-feed</code>
13
+ * <h3>ES6 Module Import</h3>
14
+ *
15
+ * <code>import "@sapudex/web-components/dist/Feed.js";</code>
16
+ *
17
+ *
18
+ * @constructor
19
+ * @extends UI5Element
20
+ * @tagname udex-feed
21
+ * @public
22
+ */
23
+ declare class UDExFeed extends UI5Element {
24
+ eventDetails: {
25
+ "button-click": void;
26
+ };
27
+ /**
28
+ * Slot for feed items.
29
+ *
30
+ * @slot items
31
+ * @public
32
+ */
33
+ items: Array<UDExFeedItem>;
34
+ /**
35
+ * Defines the UI5 icon name in the pictogram section.
36
+ *
37
+ * @default ""
38
+ * @public
39
+ */
40
+ icon?: string;
41
+ /**
42
+ * Defines the image URL in the pictogram section.
43
+ *
44
+ * @default ""
45
+ * @public
46
+ */
47
+ imageUrl?: string;
48
+ /**
49
+ * Defines the image aria label and alt in the pictogram section.
50
+ *
51
+ * @default ""
52
+ * @public
53
+ */
54
+ imageLabel?: string;
55
+ /**
56
+ * Defines the header text of the component.
57
+ *
58
+ * @default ""
59
+ * @public
60
+ */
61
+ header?: string;
62
+ /**
63
+ * Defines the CTA button label
64
+ *
65
+ * @default ""
66
+ * @public
67
+ */
68
+ button?: string;
69
+ /**
70
+ * Defines the CTA button design
71
+ *
72
+ * @default "UDExButtonDesign.Secondary"
73
+ * @public
74
+ */
75
+ buttonDesign: UDExButtonDesign;
76
+ /**
77
+ * Defines the accessible ARIA name of the component.
78
+ *
79
+ * @default undefined
80
+ * @public
81
+ */
82
+ accessibleName?: string;
83
+ get _showPictogram(): boolean;
84
+ get _showImage(): boolean;
85
+ get _imageLabel(): string;
86
+ handleCTAButtonClick(): void;
87
+ }
88
+ export default UDExFeed;
package/dist/Feed.js ADDED
@@ -0,0 +1,103 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
8
+ import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
9
+ import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
10
+ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
11
+ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
12
+ import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
13
+ import UDExButtonDesign from "./types/ButtonDesign.js";
14
+ import FeedItem from "./FeedItem.js";
15
+ import FeedTemplate from "./FeedTemplate.js";
16
+ // Styles
17
+ import FeedCss from "./generated/themes/Feed.css.js";
18
+ /**
19
+ * @class
20
+ *
21
+ * <h3 class="comment-api-title">Overview</h3>
22
+ *
23
+ *
24
+ * <h3>Usage</h3>
25
+ *
26
+ * For the <code>udex-feed</code>
27
+ * <h3>ES6 Module Import</h3>
28
+ *
29
+ * <code>import "@sapudex/web-components/dist/Feed.js";</code>
30
+ *
31
+ *
32
+ * @constructor
33
+ * @extends UI5Element
34
+ * @tagname udex-feed
35
+ * @public
36
+ */
37
+ let UDExFeed = class UDExFeed extends UI5Element {
38
+ constructor() {
39
+ super(...arguments);
40
+ /**
41
+ * Defines the CTA button design
42
+ *
43
+ * @default "UDExButtonDesign.Secondary"
44
+ * @public
45
+ */
46
+ this.buttonDesign = UDExButtonDesign.Secondary;
47
+ }
48
+ get _showPictogram() {
49
+ return !!this.icon || !!this.imageUrl;
50
+ }
51
+ get _showImage() {
52
+ return !this.icon && !!this.imageUrl;
53
+ }
54
+ get _imageLabel() {
55
+ return this.imageLabel || "";
56
+ }
57
+ handleCTAButtonClick() {
58
+ this.fireDecoratorEvent("button-click");
59
+ }
60
+ };
61
+ __decorate([
62
+ slot({ type: HTMLElement, individualSlots: true })
63
+ ], UDExFeed.prototype, "items", void 0);
64
+ __decorate([
65
+ property({ type: String })
66
+ ], UDExFeed.prototype, "icon", void 0);
67
+ __decorate([
68
+ property({ type: String })
69
+ ], UDExFeed.prototype, "imageUrl", void 0);
70
+ __decorate([
71
+ property({ type: String })
72
+ ], UDExFeed.prototype, "imageLabel", void 0);
73
+ __decorate([
74
+ property({ type: String })
75
+ ], UDExFeed.prototype, "header", void 0);
76
+ __decorate([
77
+ property({ type: String })
78
+ ], UDExFeed.prototype, "button", void 0);
79
+ __decorate([
80
+ property()
81
+ ], UDExFeed.prototype, "buttonDesign", void 0);
82
+ __decorate([
83
+ property()
84
+ ], UDExFeed.prototype, "accessibleName", void 0);
85
+ UDExFeed = __decorate([
86
+ customElement({
87
+ tag: "udex-feed",
88
+ renderer: jsxRenderer,
89
+ styles: FeedCss,
90
+ template: FeedTemplate,
91
+ dependencies: [FeedItem],
92
+ })
93
+ /**
94
+ * Triggered when the user clicks on the CTA button
95
+ *
96
+ * @public
97
+ */
98
+ ,
99
+ event("button-click", { cancelable: true, bubbles: true })
100
+ ], UDExFeed);
101
+ UDExFeed.define();
102
+ export default UDExFeed;
103
+ //# sourceMappingURL=Feed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Feed.js","sourceRoot":"","sources":["../src/Feed.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC,OAAO,YAAY,MAAM,mB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YAAY;QACtB,YAAY,EAAE,CAAC,QAAQ,CAAC;KACzB,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,cAAc,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;GAErD,QAAQ,CA2Fb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport UDExButtonDesign from \"./types/ButtonDesign.js\";\nimport FeedItem from \"./FeedItem.js\";\nimport type UDExFeedItem from \"./FeedItem.js\";\nimport FeedTemplate from \"./FeedTemplate.js\";\n\n// Styles\nimport FeedCss from \"./generated/themes/Feed.css.js\";\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-feed</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/Feed.js\";</code>\n *\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-feed\n * @public\n */\n@customElement({\n tag: \"udex-feed\",\n renderer: jsxRenderer,\n styles: FeedCss,\n template: FeedTemplate,\n dependencies: [FeedItem],\n})\n\n/**\n * Triggered when the user clicks on the CTA button\n *\n * @public\n */\n@event(\"button-click\", { cancelable: true, bubbles: true })\n\nclass UDExFeed extends UI5Element {\n eventDetails!: {\n \"button-click\": void\n };\n /**\n * Slot for feed items.\n *\n * @slot items\n * @public\n */\n @slot({ type: HTMLElement, individualSlots: true })\n items!: Array<UDExFeedItem>;\n\n /**\n * Defines the UI5 icon name in the pictogram section.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n icon?: string;\n\n /**\n * Defines the image URL in the pictogram section.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n imageUrl?: string;\n\n /**\n * Defines the image aria label and alt in the pictogram section.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n imageLabel?: string;\n\n /**\n * Defines the header text of the component.\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n header?: string;\n\n /**\n * Defines the CTA button label\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n button?: string;\n\n /**\n * Defines the CTA button design\n *\n * @default \"UDExButtonDesign.Secondary\"\n * @public\n */\n @property()\n buttonDesign: UDExButtonDesign = UDExButtonDesign.Secondary;\n\n /**\n * Defines the accessible ARIA name of the component.\n *\n * @default undefined\n * @public\n */\n @property()\n accessibleName?: string;\n\n get _showPictogram(): boolean {\n return !!this.icon || !!this.imageUrl;\n }\n\n get _showImage(): boolean {\n return !this.icon && !!this.imageUrl;\n }\n\n get _imageLabel(): string {\n return this.imageLabel || \"\";\n }\n\n handleCTAButtonClick() {\n this.fireDecoratorEvent(\"button-click\");\n }\n}\n\nUDExFeed.define();\n\nexport default UDExFeed;\n"]}
@@ -0,0 +1,114 @@
1
+ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
+ import { UDExTarget } from "./types/common.js";
3
+ import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
4
+ type UDExFeedItemClickEventDetail = {
5
+ originalEvent: Event;
6
+ item: UDExFeedItem;
7
+ };
8
+ export type FeedDate = {
9
+ day: string;
10
+ month: string;
11
+ };
12
+ /**
13
+ * @class
14
+ *
15
+ * <h3 class="comment-api-title">Overview</h3>
16
+ *
17
+ *
18
+ * <h3>Usage</h3>
19
+ *
20
+ * For the <code>udex-feed-item</code>
21
+ * <h3>ES6 Module Import</h3>
22
+ *
23
+ * <code>import "@sapudex/web-components/dist/FeedItem.js";</code>
24
+ *
25
+ * @constructor
26
+ * @extends UI5Element
27
+ * @tagname udex-feed-item
28
+ * @public
29
+ */
30
+ declare class UDExFeedItem extends UI5Element {
31
+ eventDetails: {
32
+ "item-click": UDExFeedItemClickEventDetail;
33
+ };
34
+ /**
35
+ * Defines the link text
36
+ *
37
+ * @default undefined
38
+ * @public
39
+ */
40
+ text?: string;
41
+ /**
42
+ * Defines the link text URL
43
+ *
44
+ * @default ""
45
+ * @public
46
+ */
47
+ href: string;
48
+ /**
49
+ * Defines target for the link
50
+ *
51
+ * @default UDExTarget._self
52
+ * @public
53
+ */
54
+ target: UDExTarget;
55
+ /**
56
+ * Defines the link text details
57
+ *
58
+ * @default undefined
59
+ * @public
60
+ */
61
+ details?: string;
62
+ /**
63
+ * Defines the accessible ARIA name of the link.
64
+ *
65
+ * @default undefined
66
+ * @public
67
+ */
68
+ accessibleName?: string;
69
+ /**
70
+ * Defines the date of the event
71
+ *
72
+ * @default undefined
73
+ * @public
74
+ */
75
+ date?: string;
76
+ /**
77
+ * Defines the location of the event
78
+ *
79
+ * @default undefined
80
+ * @public
81
+ */
82
+ location?: string;
83
+ /**
84
+ * Defines the UI5 icon name
85
+ *
86
+ * @default undefined
87
+ * @public
88
+ */
89
+ icon?: string;
90
+ /**
91
+ * Defines the UI5 icon label
92
+ *
93
+ * @default undefined
94
+ * @public
95
+ */
96
+ iconAccessibleName?: string;
97
+ /**
98
+ * Receives the avatar
99
+ *
100
+ * @slot avatar
101
+ * @public
102
+ */
103
+ avatar: Array<HTMLElement>;
104
+ static i18nBundle: I18nBundle;
105
+ get _date(): FeedDate;
106
+ get _showAvatar(): boolean;
107
+ get _showIcon(): boolean;
108
+ get _showDate(): boolean;
109
+ get locationIconLabel(): string;
110
+ formatDate(d: string | undefined): FeedDate;
111
+ handleLinkClick(e: Event): void;
112
+ }
113
+ export default UDExFeedItem;
114
+ export type { UDExFeedItemClickEventDetail };
@@ -0,0 +1,131 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var UDExFeedItem_1;
8
+ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
9
+ import { UDExTarget } from "./types/common.js";
10
+ import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
11
+ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
12
+ import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
13
+ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
14
+ import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
15
+ import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
16
+ import FeedItemTemplate from "./FeedItemTemplate.js";
17
+ import { LOCATION } from "./generated/i18n/i18n-defaults.js";
18
+ // Styles
19
+ import FeedItemCss from "./generated/themes/FeedItem.css.js";
20
+ /**
21
+ * @class
22
+ *
23
+ * <h3 class="comment-api-title">Overview</h3>
24
+ *
25
+ *
26
+ * <h3>Usage</h3>
27
+ *
28
+ * For the <code>udex-feed-item</code>
29
+ * <h3>ES6 Module Import</h3>
30
+ *
31
+ * <code>import "@sapudex/web-components/dist/FeedItem.js";</code>
32
+ *
33
+ * @constructor
34
+ * @extends UI5Element
35
+ * @tagname udex-feed-item
36
+ * @public
37
+ */
38
+ let UDExFeedItem = UDExFeedItem_1 = class UDExFeedItem extends UI5Element {
39
+ constructor() {
40
+ super(...arguments);
41
+ /**
42
+ * Defines target for the link
43
+ *
44
+ * @default UDExTarget._self
45
+ * @public
46
+ */
47
+ this.target = UDExTarget._self;
48
+ }
49
+ get _date() {
50
+ return this.formatDate(this.date);
51
+ }
52
+ get _showAvatar() {
53
+ return !!this.avatar.length;
54
+ }
55
+ get _showIcon() {
56
+ return !!this.icon && !this._showAvatar;
57
+ }
58
+ get _showDate() {
59
+ return !!this.date && !this._showAvatar && !this._showIcon;
60
+ }
61
+ get locationIconLabel() {
62
+ return UDExFeedItem_1.i18nBundle.getText(LOCATION);
63
+ }
64
+ formatDate(d) {
65
+ if (!d) {
66
+ return { day: "", month: "" };
67
+ }
68
+ const date = new Date(d);
69
+ const day = date.toLocaleString("default", { day: "2-digit" });
70
+ let month = date.toLocaleString("default", { month: "short" });
71
+ month = month.charAt(0).toUpperCase() + month.slice(1);
72
+ return { day, month };
73
+ }
74
+ handleLinkClick(e) {
75
+ this.fireDecoratorEvent("item-click", {
76
+ item: this,
77
+ originalEvent: e,
78
+ });
79
+ }
80
+ };
81
+ __decorate([
82
+ property({ type: String })
83
+ ], UDExFeedItem.prototype, "text", void 0);
84
+ __decorate([
85
+ property({ type: String })
86
+ ], UDExFeedItem.prototype, "href", void 0);
87
+ __decorate([
88
+ property()
89
+ ], UDExFeedItem.prototype, "target", void 0);
90
+ __decorate([
91
+ property({ type: String })
92
+ ], UDExFeedItem.prototype, "details", void 0);
93
+ __decorate([
94
+ property()
95
+ ], UDExFeedItem.prototype, "accessibleName", void 0);
96
+ __decorate([
97
+ property({ type: String })
98
+ ], UDExFeedItem.prototype, "date", void 0);
99
+ __decorate([
100
+ property({ type: String })
101
+ ], UDExFeedItem.prototype, "location", void 0);
102
+ __decorate([
103
+ property({ type: String })
104
+ ], UDExFeedItem.prototype, "icon", void 0);
105
+ __decorate([
106
+ property({ type: String })
107
+ ], UDExFeedItem.prototype, "iconAccessibleName", void 0);
108
+ __decorate([
109
+ slot({ type: HTMLElement })
110
+ ], UDExFeedItem.prototype, "avatar", void 0);
111
+ __decorate([
112
+ i18n("@sapudex/web-components")
113
+ ], UDExFeedItem, "i18nBundle", void 0);
114
+ UDExFeedItem = UDExFeedItem_1 = __decorate([
115
+ customElement({
116
+ tag: "udex-feed-item",
117
+ renderer: jsxRenderer,
118
+ styles: FeedItemCss,
119
+ template: FeedItemTemplate,
120
+ })
121
+ /**
122
+ * Fires when item is clicked
123
+ *
124
+ * @public
125
+ */
126
+ ,
127
+ event("item-click", { bubbles: true, cancelable: true })
128
+ ], UDExFeedItem);
129
+ UDExFeedItem.define();
130
+ export default UDExFeedItem;
131
+ //# sourceMappingURL=FeedItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedItem.js","sourceRoot":"","sources":["../src/FeedItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,SAAS;AACT,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAY7D;;;;;;;;;;;;;;;;;GAiBG;AAeH,IAAM,YAAY,oBAAlB,MAAM,YAAa,SAAQ,UAAU;IAArC;;QAuBE;;;;;WAKG;QAED,WAAM,GAAe,UAAU,CAAC,KAAK,CAAC;IAyG1C,CAAC;IArCC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,CAAC,CAAC,IA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C,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACR;AASjB;IADD,QAAQ,EAAE;oDACe;AASxB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACX;AASd;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACP;AASlB;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACX;AASd;IADD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACG;AAS5B;IADD,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;4CACE;AAGvB;IADN,IAAI,CAAC,yBAAyB,CAAC;sCACF;AAhG1B,YAAY;IAdjB,aAAa,CAAC;QACb,GAAG,EAAE,gBAAgB;QACrB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,WAAW;QACnB,QAAQ,EAAE,gBAAgB;KAC3B,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;GAEnD,YAAY,CAuIjB;AAED,YAAY,CAAC,MAAM,EAAE,CAAC;AAEtB,eAAe,YAAY,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { UDExTarget } from \"./types/common.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport FeedItemTemplate from \"./FeedItemTemplate.js\";\nimport { LOCATION } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport FeedItemCss from \"./generated/themes/FeedItem.css.js\";\n\ntype UDExFeedItemClickEventDetail = {\n originalEvent: Event,\n item: UDExFeedItem,\n}\n\nexport type FeedDate = {\n day: string;\n month: string;\n};\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>udex-feed-item</code>\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@sapudex/web-components/dist/FeedItem.js\";</code>\n *\n * @constructor\n * @extends UI5Element\n * @tagname udex-feed-item\n * @public\n */\n@customElement({\n tag: \"udex-feed-item\",\n renderer: jsxRenderer,\n styles: FeedItemCss,\n template: FeedItemTemplate,\n})\n\n/**\n * Fires when item is clicked\n *\n * @public\n */\n@event(\"item-click\", { bubbles: true, cancelable: true })\n\nclass UDExFeedItem extends UI5Element {\n eventDetails!: {\n \"item-click\": UDExFeedItemClickEventDetail,\n };\n\n /**\n * Defines the link text\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n text?: string;\n\n /**\n * Defines the link text URL\n *\n * @default \"\"\n * @public\n */\n @property({ type: String })\n href!: string;\n\n /**\n * Defines target for the link\n *\n * @default UDExTarget._self\n * @public\n */\n @property()\n target: UDExTarget = UDExTarget._self;\n\n /**\n * Defines the link text details\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n details?: string;\n\n /**\n * Defines the accessible ARIA name of the link.\n *\n * @default undefined\n * @public\n */\n @property()\n accessibleName?: string;\n\n /**\n * Defines the date of the event\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n date?: string;\n\n /**\n * Defines the location of the event\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n location?: string;\n\n /**\n * Defines the UI5 icon name\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n icon?: string;\n\n /**\n * Defines the UI5 icon label\n *\n * @default undefined\n * @public\n */\n @property({ type: String })\n iconAccessibleName?: string;\n\n /**\n * Receives the avatar\n *\n * @slot avatar\n * @public\n */\n @slot({ type: HTMLElement })\n avatar!: Array<HTMLElement>;\n\n @i18n(\"@sapudex/web-components\")\n static i18nBundle: I18nBundle;\n\n get _date(): FeedDate {\n return this.formatDate(this.date);\n }\n\n get _showAvatar(): boolean {\n return !!this.avatar.length;\n }\n\n get _showIcon(): boolean {\n return !!this.icon && !this._showAvatar;\n }\n\n get _showDate(): boolean {\n return !!this.date && !this._showAvatar && !this._showIcon;\n }\n\n get locationIconLabel(): string {\n return UDExFeedItem.i18nBundle.getText(LOCATION);\n }\n\n formatDate(d: string | undefined): FeedDate {\n if (!d) {\n return { day: \"\", month: \"\" };\n }\n const date = new Date(d);\n const day = date.toLocaleString(\"default\", { day: \"2-digit\" });\n let month = date.toLocaleString(\"default\", { month: \"short\" });\n month = month.charAt(0).toUpperCase() + month.slice(1);\n return { day, month };\n }\n\n handleLinkClick(e: Event): void {\n this.fireDecoratorEvent(\"item-click\", {\n item: this,\n originalEvent: e,\n });\n }\n}\n\nUDExFeedItem.define();\n\nexport default UDExFeedItem;\nexport type { UDExFeedItemClickEventDetail };\n"]}