@aquera/nile-elements 0.0.13 → 0.0.15

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 (176) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js +12 -10
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +3 -3
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js +32 -22
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js +1 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.d.ts +1 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js +15 -8
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js +10 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -1
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.d.ts +8 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js +56 -6
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.d.ts +5 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.js +5 -0
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.js.map +1 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js +2 -0
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.d.ts +5 -0
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.js +5 -0
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.js.map +1 -0
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js +7 -0
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js.map +1 -1
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +11 -0
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +10 -1
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +2 -1
  34. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +31 -18
  35. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  36. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  37. package/demo/filenames.txt +1 -1
  38. package/dist/index.cjs.js +1 -1
  39. package/dist/index.esm.js +1 -1
  40. package/dist/index.iife.js +112 -64
  41. package/dist/nile-badge/index.cjs.js +1 -1
  42. package/dist/nile-badge/index.esm.js +1 -1
  43. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  44. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  45. package/dist/nile-badge/nile-badge.esm.js +1 -1
  46. package/dist/nile-button/index.cjs.js +1 -1
  47. package/dist/nile-button/index.esm.js +1 -1
  48. package/dist/nile-button/nile-button.cjs.js +1 -1
  49. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  50. package/dist/nile-button/nile-button.esm.js +1 -1
  51. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  52. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  53. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  54. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  55. package/dist/nile-calendar/nile-calendar.css.esm.js +14 -12
  56. package/dist/nile-calendar/nile-calendar.esm.js +3 -3
  57. package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
  58. package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
  59. package/dist/nile-content-editor/nile-content-editor.esm.js +3 -3
  60. package/dist/nile-dialog/index.cjs.js +1 -1
  61. package/dist/nile-dialog/index.esm.js +1 -1
  62. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  63. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  64. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  65. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  66. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  67. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  68. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  69. package/dist/nile-error-message/nile-error-message.css.esm.js +1 -0
  70. package/dist/nile-error-message/nile-error-message.esm.js +13 -10
  71. package/dist/nile-form-help-text/index.cjs.js +1 -1
  72. package/dist/nile-form-help-text/index.esm.js +1 -1
  73. package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
  74. package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
  75. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js +1 -1
  76. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js.map +1 -1
  77. package/dist/nile-form-help-text/nile-form-help-text.css.esm.js +10 -0
  78. package/dist/nile-form-help-text/nile-form-help-text.esm.js +16 -5
  79. package/dist/nile-icon/icons/svg/array-loop.cjs.js +2 -0
  80. package/dist/nile-icon/icons/svg/array-loop.cjs.js.map +1 -0
  81. package/dist/nile-icon/icons/svg/array-loop.esm.js +1 -0
  82. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  83. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  84. package/dist/nile-icon/icons/svg/integer.cjs.js +2 -0
  85. package/dist/nile-icon/icons/svg/integer.cjs.js.map +1 -0
  86. package/dist/nile-icon/icons/svg/integer.esm.js +1 -0
  87. package/dist/nile-icon/index.cjs.js +1 -1
  88. package/dist/nile-icon/index.cjs.js.map +1 -1
  89. package/dist/nile-icon/index.esm.js +2 -2
  90. package/dist/nile-icon-button/index.cjs.js +1 -1
  91. package/dist/nile-icon-button/index.esm.js +1 -1
  92. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  93. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  94. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  95. package/dist/nile-input/index.cjs.js +1 -1
  96. package/dist/nile-input/index.esm.js +1 -1
  97. package/dist/nile-input/nile-input.cjs.js +1 -1
  98. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  99. package/dist/nile-input/nile-input.esm.js +1 -1
  100. package/dist/nile-menu-item/index.cjs.js +1 -1
  101. package/dist/nile-menu-item/index.esm.js +1 -1
  102. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  103. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  104. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  105. package/dist/nile-option/index.cjs.js +1 -1
  106. package/dist/nile-option/index.esm.js +1 -1
  107. package/dist/nile-option/nile-option.cjs.js +1 -1
  108. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  109. package/dist/nile-option/nile-option.esm.js +1 -1
  110. package/dist/nile-select/index.cjs.js +1 -1
  111. package/dist/nile-select/index.esm.js +1 -1
  112. package/dist/nile-select/nile-select.cjs.js +1 -1
  113. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  114. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  115. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  116. package/dist/nile-select/nile-select.css.esm.js +11 -0
  117. package/dist/nile-select/nile-select.esm.js +8 -2
  118. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  119. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  120. package/dist/nile-switcher/nile-switcher.esm.js +42 -38
  121. package/dist/nile-tag/index.cjs.js +1 -1
  122. package/dist/nile-tag/index.esm.js +1 -1
  123. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  124. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  125. package/dist/nile-tag/nile-tag.esm.js +1 -1
  126. package/dist/src/nile-calendar/nile-calendar.css.js +12 -10
  127. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  128. package/dist/src/nile-calendar/nile-calendar.js +3 -3
  129. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  130. package/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
  131. package/dist/src/nile-content-editor/nile-content-editor.js +32 -22
  132. package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
  133. package/dist/src/nile-error-message/nile-error-message.css.js +1 -0
  134. package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  135. package/dist/src/nile-error-message/nile-error-message.d.ts +1 -0
  136. package/dist/src/nile-error-message/nile-error-message.js +15 -8
  137. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  138. package/dist/src/nile-form-help-text/nile-form-help-text.css.js +10 -0
  139. package/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -1
  140. package/dist/src/nile-form-help-text/nile-form-help-text.d.ts +8 -0
  141. package/dist/src/nile-form-help-text/nile-form-help-text.js +56 -6
  142. package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  143. package/dist/src/nile-icon/icons/svg/array-loop.d.ts +5 -0
  144. package/dist/src/nile-icon/icons/svg/array-loop.js +5 -0
  145. package/dist/src/nile-icon/icons/svg/array-loop.js.map +1 -0
  146. package/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  147. package/dist/src/nile-icon/icons/svg/index.js +2 -0
  148. package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  149. package/dist/src/nile-icon/icons/svg/integer.d.ts +5 -0
  150. package/dist/src/nile-icon/icons/svg/integer.js +5 -0
  151. package/dist/src/nile-icon/icons/svg/integer.js.map +1 -0
  152. package/dist/src/nile-option/nile-option.js +7 -0
  153. package/dist/src/nile-option/nile-option.js.map +1 -1
  154. package/dist/src/nile-select/nile-select.css.js +11 -0
  155. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  156. package/dist/src/nile-select/nile-select.js +10 -1
  157. package/dist/src/nile-select/nile-select.js.map +1 -1
  158. package/dist/src/nile-switcher/nile-switcher.d.ts +2 -1
  159. package/dist/src/nile-switcher/nile-switcher.js +31 -18
  160. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  161. package/dist/tsconfig.tsbuildinfo +1 -1
  162. package/package.json +1 -1
  163. package/src/nile-calendar/nile-calendar.css.ts +12 -10
  164. package/src/nile-calendar/nile-calendar.ts +3 -3
  165. package/src/nile-content-editor/nile-content-editor.ts +37 -23
  166. package/src/nile-error-message/nile-error-message.css.ts +1 -0
  167. package/src/nile-error-message/nile-error-message.ts +17 -9
  168. package/src/nile-form-help-text/nile-form-help-text.css.ts +10 -0
  169. package/src/nile-form-help-text/nile-form-help-text.ts +73 -26
  170. package/src/nile-icon/icons/svg/array-loop.ts +5 -0
  171. package/src/nile-icon/icons/svg/index.ts +2 -0
  172. package/src/nile-icon/icons/svg/integer.ts +5 -0
  173. package/src/nile-option/nile-option.ts +9 -0
  174. package/src/nile-select/nile-select.css.ts +11 -0
  175. package/src/nile-select/nile-select.ts +10 -1
  176. package/src/nile-switcher/nile-switcher.ts +48 -23
@@ -1 +1 @@
1
- {"version":3,"file":"nile-calendar.js","sourceRoot":"","sources":["../../../src/nile-calendar/nile-calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAA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aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA8gBxB;SA9gBY,YAAY;AAghBzB,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-calendar.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-calendar\n *\n */\n@customElement('nile-calendar')\nexport class NileCalendar extends NileElement {\n /**\n * The styles for NileCalendar\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n // console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n\n\n\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n private getDaysArray(year: number, month: number): number[] {\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n return Array.from({ length: daysInMonth }, (_, i) => i + 1);\n }\n\n private nextMonth(): void {\n\n if (this.currentMonth === 11) {\n this.currentMonth = 0;\n this.currentYear++;\n } else {\n this.currentMonth++;\n }\n this.requestUpdate();\n }\n\n private prevMonth(): void {\n\n if (this.currentMonth === 0) {\n this.currentMonth = 11;\n this.currentYear--;\n } else {\n this.currentMonth--;\n }\n this.requestUpdate();\n }\n\n private selectDate(day: number, month: number, year: number): void {\n const selectedDate = new Date(year, month, day);\n\n if (this.range) {\n if (this.startDate && this.endDate) {\n this.startDate = null;\n this.endDate = null;\n }\n\n if (this.isSelectingStart) {\n this.startDate = selectedDate;\n if (this.endDate && selectedDate > this.endDate) {\n this.endDate = null;\n }\n this.isSelectingStart = false;\n } else {\n this.isSelectingStart = true;\n\n if (this.startDate && selectedDate < this.startDate) {\n this.startDate = selectedDate;\n this.endDate = null;\n this.isSelectingStart = false;\n } else {\n this.endDate = selectedDate;\n }\n }\n } else {\n this.value = selectedDate;\n this.emit('nile-changed', { value: this.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n this.requestUpdate();\n }\n\n private confimRange() {\n if (this.startDate && this.endDate) {\n this.emit('nile-changed', {\n startDate: this.startDate,\n endDate: this.endDate,\n });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n }\n }\n\n private renderMonth(\n year: number,\n month: number,\n daysArray: number[]\n ): TemplateResult {\n const firstDay = new Date(year, month, 1).getDay();\n const lastDay = new Date(year, month + 1, 0).getDay();\n const prevMonthDays = this.getDaysArray(\n month === 0 ? year - 1 : year,\n month === 0 ? 11 : month - 1\n );\n const nextMonthDays = this.getDaysArray(\n month === 11 ? year + 1 : year,\n month === 11 ? 0 : month + 1\n );\n const fillerDaysBefore = prevMonthDays.slice(\n prevMonthDays.length - firstDay\n );\n const fillerDaysAfter = nextMonthDays.slice(0, 6 - lastDay);\n const allDays = [...fillerDaysBefore, ...daysArray, ...fillerDaysAfter];\n\n const isSelectedDate = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return '';\n\n if (!this.range && this.value) {\n const isSelected =\n day === this.value.getDate() &&\n month === this.value.getMonth() &&\n year === this.value.getFullYear();\n if (isSelected) return 'selected-date';\n }\n\n const isStartDate =\n this.startDate &&\n day === this.startDate.getDate() &&\n month === this.startDate.getMonth() &&\n year === this.startDate.getFullYear();\n const isEndDate =\n this.endDate &&\n day === this.endDate.getDate() &&\n month === this.endDate.getMonth() &&\n year === this.endDate.getFullYear();\n\n return isStartDate ? 'range-start' : isEndDate ? 'range-end' : '';\n };\n\n const isInRange = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return false;\n if (this.startDate && this.endDate) {\n const date = new Date(year, month, day);\n return date >= this.startDate && date <= this.endDate;\n }\n return false;\n };\n\n return html`\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowleft\" color=\"black\" @click=\"${this.prevMonth}\">\n </nile-icon>\n <span\n >${new Date(year, month).toLocaleString('default', {\n month: 'long',\n })}\n ${year}</span\n >\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowright\" color=\"black\" @click=\"${this.nextMonth}\">\n </nile-icon>\n </div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ${allDays.map((day, index) => {\n const isCurrentMonth =\n index >= fillerDaysBefore.length &&\n index < fillerDaysBefore.length + daysArray.length;\n return html` <div\n class=\"day ${isSelectedDate(\n day,\n month,\n year,\n isCurrentMonth\n )} ${isInRange(day, month, year, isCurrentMonth)\n ? 'in-range'\n : ''} ${!isCurrentMonth ? 'filler' : ''}\"\n @click=\"${() => {\n if (isCurrentMonth) {\n this.selectDate(day, month, year);\n }\n }}\"\n >\n ${day}\n </div>`;\n })}\n </div>\n </div>\n `;\n }\n\n private formatDate(date: Date | null): string {\n if (!date) return '';\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n return `${day}/${month}/${year}`;\n }\n\n private formatDateRange(value: { startDate: Date | null, endDate: Date | null }): string {\n if(!value){\n return value;\n }\n if (!value.startDate || !value.endDate) return '';\n return `${this.formatDate(value.startDate)} - ${this.formatDate(value.endDate)}`;\n }\n\n private handleStartDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.startDate = null;\n }\n if (date && (!this.endDate || date <= this.endDate)) {\n this.startDate = date;\n } else {\n this.startDate = null;\n this.endDate = null;\n }\n this.requestUpdate();\n }\n\n private handleEndDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.endDate = null;\n }\n if (date && (!this.startDate || date >= this.startDate)) {\n this.endDate = date;\n } else {\n this.endDate = null;\n\n }\n this.requestUpdate();\n }\n\n private parseDate(dateString: string): Date | null {\n const [day, month, year] = dateString.split('/').map(Number);\n const date = new Date(year, month - 1, day);\n return !isNaN(date.getTime()) ? date : null;\n }\n\n private isValidDateInput(input: any): boolean {\n const regex = /^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[0-2])\\/\\d{4}$/;\n return regex.test(input);\n }\n\n private formatTime(date: Date | null): string {\n if (!date) return '';\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n return `${hours}:${minutes}:${seconds}`;\n }\n\n // Validate time in HH:MM:SS format\n private isValidTimeInput(input: string): boolean {\n const regex = /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/;\n return regex.test(input);\n }\n\n// Parse time string to a Date object\nprivate parseTime(input: string, date: Date): Date | null {\n if (!this.isValidTimeInput(input)) {\n return null;\n }\n const [hour, minute, second] = input.split(':').map(Number);\n const newDate = new Date(date.getTime());\n newDate.setHours(hour, minute, second);\n return newDate;\n}\n\nprivate handleStartTimeInput(event: CustomEvent): void {\n if (!this.startDate) {\n this.startDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.startDate);\n if (time) {\n this.startDate = time;\n } else {\n this.startDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n}\n\nprivate handleEndTimeInput(event: CustomEvent): void {\n if (!this.endDate) {\n this.endDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.endDate);\n if (time) {\n this.endDate = time;\n } else {\n this.endDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n}\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n const daysArray = this.getDaysArray(this.currentYear, this.currentMonth);\n const nextMonth = (this.currentMonth + 1) % 12;\n const nextYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n const nextMonthDaysArray = this.getDaysArray(nextYear, nextMonth);\n\n return html`\n\n <div class=\"base${this.range ? '__range' : ''}\">\n <div class=\"calendar-wrapper\" >\n <div class=\"calendar-container ${this.range ? 'with-margin' : ''}\">\n ${this.renderMonth(\n this.currentYear,\n this.currentMonth,\n this.getDaysArray(this.currentYear, this.currentMonth)\n )}\n </div>\n ${this.range\n ? html`\n <div class=\"calendar-container\">\n ${this.renderMonth(\n this.currentYear,\n (this.currentMonth + 1) % 12,\n this.getDaysArray(\n this.currentYear,\n (this.currentMonth + 1) % 12\n )\n )}\n </div>\n `\n : ''}\n\n </div>\n ${this.range\n ? html`\n <div class=\"calender-input\">\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.startDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleStartDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.startDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleStartTimeInput}\"> </nile-input>\n\n </div>\n<br>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.endDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleEndDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.endDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleEndTimeInput}\"> </nile-input>\n </div>\n <div class=\"button-contaner\">\n <nile-button class=\"apply-button\" ?disabled=\"${\n !this.startDate || !this.endDate\n }\" @click=\"${this.confimRange}\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n `\n : ''}\n </div>\n `;\n }\n}\n\nexport default NileCalendar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-calendar': NileCalendar;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-calendar.js","sourceRoot":"","sources":["../../../src/nile-calendar/nile-calendar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,qB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AAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA8gBxB;SA9gBY,YAAY;AAghBzB,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-calendar.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-calendar\n *\n */\n@customElement('nile-calendar')\nexport class NileCalendar extends NileElement {\n /**\n * The styles for NileCalendar\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\n\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n this.value = null;\n } catch (e) {\n // console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date;\n\n date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n\n\n\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n private getDaysArray(year: number, month: number): number[] {\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n return Array.from({ length: daysInMonth }, (_, i) => i + 1);\n }\n\n private nextMonth(): void {\n\n if (this.currentMonth === 11) {\n this.currentMonth = 0;\n this.currentYear++;\n } else {\n this.currentMonth++;\n }\n this.requestUpdate();\n }\n\n private prevMonth(): void {\n\n if (this.currentMonth === 0) {\n this.currentMonth = 11;\n this.currentYear--;\n } else {\n this.currentMonth--;\n }\n this.requestUpdate();\n }\n\n private selectDate(day: number, month: number, year: number): void {\n const selectedDate = new Date(year, month, day);\n\n if (this.range) {\n if (this.startDate && this.endDate) {\n this.startDate = null;\n this.endDate = null;\n }\n\n if (this.isSelectingStart) {\n this.startDate = selectedDate;\n if (this.endDate && selectedDate > this.endDate) {\n this.endDate = null;\n }\n this.isSelectingStart = false;\n } else {\n this.isSelectingStart = true;\n\n if (this.startDate && selectedDate < this.startDate) {\n this.startDate = selectedDate;\n this.endDate = null;\n this.isSelectingStart = false;\n } else {\n this.endDate = selectedDate;\n }\n }\n } else {\n this.value = selectedDate;\n this.emit('nile-changed', { value: this.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n this.requestUpdate();\n }\n\n private confimRange() {\n if (this.startDate && this.endDate) {\n this.emit('nile-changed', {\n startDate: this.startDate,\n endDate: this.endDate,\n });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n }\n }\n\n private renderMonth(\n year: number,\n month: number,\n daysArray: number[]\n ): TemplateResult {\n const firstDay = new Date(year, month, 1).getDay();\n const lastDay = new Date(year, month + 1, 0).getDay();\n const prevMonthDays = this.getDaysArray(\n month === 0 ? year - 1 : year,\n month === 0 ? 11 : month - 1\n );\n const nextMonthDays = this.getDaysArray(\n month === 11 ? year + 1 : year,\n month === 11 ? 0 : month + 1\n );\n const fillerDaysBefore = prevMonthDays.slice(\n prevMonthDays.length - firstDay\n );\n const fillerDaysAfter = nextMonthDays.slice(0, 6 - lastDay);\n const allDays = [...fillerDaysBefore, ...daysArray, ...fillerDaysAfter];\n\n const isSelectedDate = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return '';\n\n if (!this.range && this.value) {\n const isSelected =\n day === this.value.getDate() &&\n month === this.value.getMonth() &&\n year === this.value.getFullYear();\n if (isSelected) return 'selected-date';\n }\n\n const isStartDate =\n this.startDate &&\n day === this.startDate.getDate() &&\n month === this.startDate.getMonth() &&\n year === this.startDate.getFullYear();\n const isEndDate =\n this.endDate &&\n day === this.endDate.getDate() &&\n month === this.endDate.getMonth() &&\n year === this.endDate.getFullYear();\n\n return isStartDate ? 'range-start' : isEndDate ? 'range-end' : '';\n };\n\n const isInRange = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return false;\n if (this.startDate && this.endDate) {\n const date = new Date(year, month, day);\n return date >= this.startDate && date <= this.endDate;\n }\n return false;\n };\n\n return html`\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowleft\" color=\"black\" @click=\"${this.prevMonth}\">\n </nile-icon>\n <span\n >${new Date(year, month).toLocaleString('default', {\n month: 'long',\n })}\n ${year}</span\n >\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowright\" color=\"black\" @click=\"${this.nextMonth}\">\n </nile-icon>\n </div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ${allDays.map((day, index) => {\n const isCurrentMonth =\n index >= fillerDaysBefore.length &&\n index < fillerDaysBefore.length + daysArray.length;\n return html` <div\n class=\"day ${isSelectedDate(\n day,\n month,\n year,\n isCurrentMonth\n )} ${isInRange(day, month, year, isCurrentMonth)\n ? 'in-range'\n : ''} ${!isCurrentMonth ? 'filler' : ''}\"\n @click=\"${() => {\n if (isCurrentMonth) {\n this.selectDate(day, month, year);\n }\n }}\"\n >\n ${day}\n </div>`;\n })}\n </div>\n </div>\n `;\n }\n\n private formatDate(date: Date | null): string {\n if (!date) return '';\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n return `${day}/${month}/${year}`;\n }\n\n private formatDateRange(value: { startDate: Date | null, endDate: Date | null }): string {\n if(!value){\n return value;\n }\n if (!value.startDate || !value.endDate) return '';\n return `${this.formatDate(value.startDate)} - ${this.formatDate(value.endDate)}`;\n }\n\n private handleStartDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.startDate = null;\n }\n if (date && (!this.endDate || date <= this.endDate)) {\n this.startDate = date;\n } else {\n this.startDate = null;\n this.endDate = null;\n }\n this.requestUpdate();\n }\n\n private handleEndDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.endDate = null;\n }\n if (date && (!this.startDate || date >= this.startDate)) {\n this.endDate = date;\n } else {\n this.endDate = null;\n\n }\n this.requestUpdate();\n }\n\n private parseDate(dateString: string): Date | null {\n const [day, month, year] = dateString.split('/').map(Number);\n const date = new Date(year, month - 1, day);\n return !isNaN(date.getTime()) ? date : null;\n }\n\n private isValidDateInput(input: any): boolean {\n const regex = /^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[0-2])\\/\\d{4}$/;\n return regex.test(input);\n }\n\n private formatTime(date: Date | null): string {\n if (!date) return '';\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n return `${hours}:${minutes}:${seconds}`;\n }\n\n // Validate time in HH:MM:SS format\n private isValidTimeInput(input: string): boolean {\n const regex = /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/;\n return regex.test(input);\n }\n\n// Parse time string to a Date object\nprivate parseTime(input: string, date: Date): Date | null {\n if (!this.isValidTimeInput(input)) {\n return null;\n }\n const [hour, minute, second] = input.split(':').map(Number);\n const newDate = new Date(date.getTime());\n newDate.setHours(hour, minute, second);\n return newDate;\n}\n\nprivate handleStartTimeInput(event: CustomEvent): void {\n if (!this.startDate) {\n this.startDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.startDate);\n if (time) {\n this.startDate = time;\n } else {\n this.startDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n}\n\nprivate handleEndTimeInput(event: CustomEvent): void {\n if (!this.endDate) {\n this.endDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.endDate);\n if (time) {\n this.endDate = time;\n } else {\n this.endDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n}\n\n\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n const daysArray = this.getDaysArray(this.currentYear, this.currentMonth);\n const nextMonth = (this.currentMonth + 1) % 12;\n const nextYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n const nextMonthDaysArray = this.getDaysArray(nextYear, nextMonth);\n\n return html`\n\n <div class=\"base ${this.range ? 'base__range' : ''}\">\n <div class=\"calendar-wrapper\" >\n <div class=\"calendar-container ${this.range ? 'with-margin' : ''}\">\n ${this.renderMonth(\n this.currentYear,\n this.currentMonth,\n this.getDaysArray(this.currentYear, this.currentMonth)\n )}\n </div>\n <!-- ${this.range\n ? html`\n <div class=\"calendar-container\">\n ${this.renderMonth(\n this.currentYear,\n (this.currentMonth + 1) % 12,\n this.getDaysArray(\n this.currentYear,\n (this.currentMonth + 1) % 12\n )\n )}\n </div>\n `\n : ''} -->\n\n </div>\n ${this.range\n ? html`\n <div class=\"calender-input\">\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.startDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleStartDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.startDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleStartTimeInput}\"> </nile-input>\n\n </div>\n<br>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.endDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleEndDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.endDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleEndTimeInput}\"> </nile-input>\n </div>\n <div class=\"button-contaner\">\n <nile-button class=\"apply-button\" ?disabled=\"${\n !this.startDate || !this.endDate\n }\" @click=\"${this.confimRange}\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n `\n : ''}\n </div>\n `;\n }\n}\n\nexport default NileCalendar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-calendar': NileCalendar;\n }\n}\n"]}
@@ -51,6 +51,7 @@ export declare class NileContentEditor extends NileElement {
51
51
  filterOptions(): void;
52
52
  generateValuesFromHTMLTags(string: any): string;
53
53
  generateHTMLTagsWithValues(string: any): string;
54
+ setError(option: any): string;
54
55
  emitInputChange(): void;
55
56
  insertNodes(parentNode: Node, childNodes: NodeList, autoOptionsTag?: Node): void;
56
57
  handleOptions(option: any): void;
@@ -70,20 +70,23 @@ let NileContentEditor = class NileContentEditor extends NileElement {
70
70
  }
71
71
  async handleClipboardEvent(event) {
72
72
  const selectedText = window?.getSelection()?.toString();
73
- if (!!selectedText) {
74
- switch (event.type) {
75
- case 'cut':
76
- case 'copy':
73
+ switch (event.type) {
74
+ case 'cut':
75
+ case 'copy':
76
+ if (!!selectedText)
77
77
  await navigator.clipboard.writeText(selectedText);
78
- document.execCommand(event.type);
79
- break;
80
- case 'paste':
81
- const pastedText = await navigator.clipboard.readText();
82
- document.execCommand('insertText', false, pastedText);
83
- break;
84
- default:
85
- break;
86
- }
78
+ document.execCommand(event.type);
79
+ break;
80
+ case 'paste':
81
+ event.preventDefault();
82
+ let pastedText = await navigator.clipboard.readText();
83
+ pastedText = pastedText
84
+ .replace(/<(|\/)(html|body|meta|span)[^>]*?>/gi, '')
85
+ .trim();
86
+ document.execCommand('insertText', false, pastedText);
87
+ break;
88
+ default:
89
+ break;
87
90
  }
88
91
  setTimeout(() => {
89
92
  this.emitInputChange();
@@ -110,7 +113,8 @@ let NileContentEditor = class NileContentEditor extends NileElement {
110
113
  event.preventDefault();
111
114
  return;
112
115
  }
113
- if ([KeyCode.CUT, KeyCode.COPY, KeyCode.PASTE].includes(event.code)) {
116
+ if ([KeyCode.CUT, KeyCode.COPY, KeyCode.PASTE].includes(event.code) &&
117
+ (event.ctrlKey || event.metaKey)) {
114
118
  return;
115
119
  }
116
120
  if (event.code === KeyCode.ESCAPE) {
@@ -129,12 +133,12 @@ let NileContentEditor = class NileContentEditor extends NileElement {
129
133
  else {
130
134
  this.toggleDropdown(false);
131
135
  }
132
- });
136
+ }, 10);
133
137
  }
134
138
  filterOptions() {
135
139
  this.filteredOptions = this.options;
136
140
  if (!!this.options.length && !!this.filteredValue) {
137
- this.filteredOptions = this.options.filter(item => item.startsWith(this.filteredValue));
141
+ this.filteredOptions = this.options.filter(item => item.includes(this.filteredValue));
138
142
  }
139
143
  else {
140
144
  this.filteredOptions = this.options;
@@ -152,12 +156,16 @@ let NileContentEditor = class NileContentEditor extends NileElement {
152
156
  var result = string.replace(pattern, (match, option) => {
153
157
  return this.options.includes(option)
154
158
  ? '<span class="chips" contenteditable="false">' + option + '</span>'
155
- : '<span class="chips chip-error" contenteditable="false">' +
156
- option +
157
- '</span>';
159
+ : this.setError(option);
158
160
  });
159
161
  return result;
160
162
  }
163
+ setError(option) {
164
+ this.error = true;
165
+ return ('<span class="chips chip-error" contenteditable="false">' +
166
+ option +
167
+ '</span>');
168
+ }
161
169
  emitInputChange() {
162
170
  if (this.contentEditor) {
163
171
  let fieldValue = this.contentEditor.innerHTML;
@@ -165,7 +173,7 @@ let NileContentEditor = class NileContentEditor extends NileElement {
165
173
  fieldValue = this.generateValuesFromHTMLTags(fieldValue);
166
174
  }
167
175
  fieldValue = fieldValue.replace(/&nbsp;/g, ' ');
168
- fieldValue = fieldValue === '<br>' ? '' : fieldValue?.trim();
176
+ fieldValue = fieldValue.replace('<br>', '');
169
177
  this.emit('nile-change', {
170
178
  value: this.generateValuesFromHTMLTags(fieldValue),
171
179
  });
@@ -254,6 +262,7 @@ let NileContentEditor = class NileContentEditor extends NileElement {
254
262
  : ''}
255
263
  <div
256
264
  contenteditable="${!readonly}"
265
+ spellcheck="false"
257
266
  class=${classMap({
258
267
  'content-editable-input': true,
259
268
  error: hasError || hasErrorMessage,
@@ -275,8 +284,9 @@ let NileContentEditor = class NileContentEditor extends NileElement {
275
284
  `
276
285
  : ``}
277
286
  </div>
278
-
279
- ${this.renderAutoOptions()}
287
+ ${this.filteredOptions && !!this.filteredOptions.length
288
+ ? this.renderAutoOptions()
289
+ : null}
280
290
  </nile-popup>
281
291
  `;
282
292
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nile-content-editor.js","sourceRoot":"","sources":["../../../src/nile-content-editor/nile-content-editor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,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ADC,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;yDAG7C;AA7GU,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAkT7B;SAlTY,iBAAiB;AAoT9B,eAAe,iBAAiB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, TemplateResult } from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-content-editor.css';\nimport { CSSResultGroup } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\nimport { KeyCode } from '../internal/enum';\nimport { live } from 'lit/directives/live.js';\n\n/**\n * Nile icon component.\n *\n * @tag nile-attribute-expression\n *\n */\n@customElement('nile-content-editor')\nexport class NileContentEditor extends NileElement {\n /**\n * @summary Allows you to handle both input and dropdown selection\n\n * @dependency nile-option\n \n * @event nile-change - Emitted when the control's value changes. \n */\n\n @property() value: string = '';\n\n @property() options: Array<any>;\n\n @property() filteredOptions: Array<any>;\n\n @property() showLabel: boolean = true;\n\n @property() labelText = '';\n\n @property() type = 'text|text-area';\n\n @property() required: boolean = true;\n\n @query('.content-editable-input') contentEditor: HTMLInputElement;\n @query('.nile-options-container') autoOptions: HTMLInputElement;\n\n @state() openDropdown = false;\n\n tagIdentifier = '$';\n\n filteredValue = '';\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ attribute: 'readonly' }) readonly = false;\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n @property({ attribute: 'error' }) error = false;\n\n static styles: CSSResultGroup = styles;\n\n connectedCallback() {\n this.handleOutsideClick = this.handleOutsideClick.bind(this);\n this.handleClipboardEvent = this.handleClipboardEvent.bind(this);\n super.connectedCallback();\n this.emit('nile-init');\n this.addOpenListeners();\n this.setInitialValues();\n }\n\n setInitialValues() {\n this.updateComplete.then(res => {\n if (res && !!this.value)\n this.contentEditor.innerHTML = this.generateHTMLTagsWithValues(\n this.value\n );\n });\n }\n\n addOpenListeners() {\n window.addEventListener('click', this.handleOutsideClick);\n window.addEventListener('cut', this.handleClipboardEvent);\n window.addEventListener('copy', this.handleClipboardEvent);\n window.addEventListener('paste', this.handleClipboardEvent);\n }\n\n removeOpenListeners() {\n window.removeEventListener('click', this.handleOutsideClick);\n window.removeEventListener('cut', this.handleClipboardEvent);\n window.removeEventListener('copy', this.handleClipboardEvent);\n window.removeEventListener('paste', this.handleClipboardEvent);\n }\n\n async handleClipboardEvent(event: Event) {\n const selectedText = window?.getSelection()?.toString();\n if (!!selectedText) {\n switch (event.type) {\n case 'cut':\n case 'copy':\n await navigator.clipboard.writeText(selectedText);\n document.execCommand(event.type);\n break;\n case 'paste':\n const pastedText = await navigator.clipboard.readText();\n document.execCommand('insertText', false, pastedText);\n break;\n default:\n break;\n }\n }\n setTimeout(() => {\n this.emitInputChange();\n });\n }\n\n toggleDropdown(value: boolean) {\n this.openDropdown = value;\n }\n\n handleOutsideClick(event: Event) {\n if (event && event.target) {\n this.toggleDropdown(false);\n }\n }\n\n @watch('type', { waitUntilFirstUpdate: true })\n handleTypeChange() {\n this.contentEditor.innerHTML = this.generateHTMLTagsWithValues(this.value);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.emit('nile-destroy');\n }\n\n private handlekeyDown(event: any) {\n if (event.code === KeyCode.ENTER && this.type === 'text') {\n event.preventDefault();\n return;\n }\n if ([KeyCode.CUT, KeyCode.COPY, KeyCode.PASTE].includes(event.code)) {\n return;\n }\n if (event.code === KeyCode.ESCAPE) {\n event.preventDefault();\n this.toggleDropdown(false);\n return;\n }\n setTimeout(() => {\n const value = this.contentEditor.innerText;\n this.emitInputChange();\n if (value.includes(this.tagIdentifier)) {\n this.insertNodes(this.contentEditor, this.contentEditor.childNodes);\n this.filterOptions();\n this.toggleDropdown(true);\n } else {\n this.toggleDropdown(false);\n }\n });\n }\n\n filterOptions() {\n this.filteredOptions = this.options;\n if (!!this.options.length && !!this.filteredValue) {\n this.filteredOptions = this.options.filter(item =>\n item.startsWith(this.filteredValue)\n );\n } else {\n this.filteredOptions = this.options;\n }\n }\n\n generateValuesFromHTMLTags(string: any): string {\n var pattern =\n /<span class=\"chips(?: chip-error)?\" contenteditable=\"false\">(.*?)<\\/span>/g;\n var result = string.replace(pattern, (match: any, option: any) => {\n return '{{' + option + '}}';\n });\n return result;\n }\n\n generateHTMLTagsWithValues(string: any): string {\n var pattern = /{{(.*?)}}/g;\n var result = string.replace(pattern, (match: any, option: any) => {\n return this.options.includes(option)\n ? '<span class=\"chips\" contenteditable=\"false\">' + option + '</span>'\n : '<span class=\"chips chip-error\" contenteditable=\"false\">' +\n option +\n '</span>';\n });\n return result;\n }\n\n emitInputChange(): void {\n if (this.contentEditor) {\n let fieldValue = this.contentEditor.innerHTML;\n if (this.contentEditor.innerText !== '') {\n fieldValue = this.generateValuesFromHTMLTags(fieldValue);\n }\n fieldValue = fieldValue.replace(/&nbsp;/g, ' ');\n fieldValue = fieldValue === '<br>' ? '' : fieldValue?.trim();\n this.emit('nile-change', {\n value: this.generateValuesFromHTMLTags(fieldValue),\n });\n }\n }\n\n insertNodes(parentNode: Node, childNodes: NodeList, autoOptionsTag?: Node) {\n [...childNodes].forEach((node: Node, index: number) => {\n if (node.hasChildNodes()) {\n if (autoOptionsTag) {\n this.insertNodes(node, node.childNodes, autoOptionsTag);\n } else {\n this.insertNodes(node, node.childNodes);\n }\n } else {\n if (node.nodeValue?.includes(this.tagIdentifier)) {\n if (autoOptionsTag) {\n parentNode.childNodes[index].nodeValue = node.nodeValue?.replace(\n this.tagIdentifier + this.filteredValue,\n ''\n );\n parentNode.childNodes[index].after(autoOptionsTag);\n }\n this.filteredValue =\n parentNode?.childNodes[index]?.nodeValue\n ?.split(this.tagIdentifier)\n .slice(1)\n .join() || '';\n return;\n }\n }\n });\n }\n\n handleOptions(option: any): void {\n this.toggleDropdown(false);\n let autoOptionsTag = document.createElement('span');\n autoOptionsTag.setAttribute('class', 'chips');\n autoOptionsTag.setAttribute('contentEditable', 'false');\n autoOptionsTag.innerText = option;\n this.insertNodes(\n this.contentEditor,\n this.contentEditor.childNodes,\n autoOptionsTag\n );\n this.filteredOptions = this.options;\n this.filteredValue = '';\n this.emitInputChange();\n }\n\n public renderAutoOptions(): TemplateResult {\n return html`<div\n class=\"${classMap({\n 'nile-options-container': true,\n 'dropdown-position': this.type === 'text-area',\n })}\"\n >\n ${this.filteredOptions &&\n this.filteredOptions.map((option: any) => {\n return html` <nile-option\n .value=\"${option}\"\n @click=\"${(event: Event) => {\n this.handleOptions(option);\n }}\"\n >${option}\n </nile-option>`;\n })}\n </div>`;\n }\n\n public render(): TemplateResult {\n const hasHelpText = this.helpText ? true : false;\n const hasError = !!this.error;\n const hasErrorMessage = !!this.errorMessage;\n const readonly = !!this.readonly;\n const type = this.type;\n return html`\n <nile-popup\n .active=\"${live(this.openDropdown)}\"\n sync=\"width\"\n strategy=\"fixed\"\n placement=\"bottom\"\n class=${classMap({\n dropdown: true,\n 'dropdown--open': true,\n popup: true,\n })}\n >\n <div class=\"content-editable-wrapper\" slot=\"anchor\">\n ${this.showLabel && this.labelText\n ? html`<label class=\"ods-label\">${this.labelText} </label> ${this\n .required\n ? html`<span class=\"asterik\">*</span>`\n : ''}`\n : ''}\n <div\n contenteditable=\"${!readonly}\"\n class=${classMap({\n 'content-editable-input': true,\n error: hasError || hasErrorMessage,\n 'read-only': readonly,\n 'text-area': type === 'text-area' ? true : false,\n })}\n @keydown=${this.handlekeyDown}\n ></div>\n ${hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``}\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n </div>\n\n ${this.renderAutoOptions()}\n </nile-popup>\n `;\n }\n}\n\nexport default NileContentEditor;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-content-editor': NileContentEditor;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-content-editor.js","sourceRoot":"","sources":["../../../src/nile-content-editor/nile-content-editor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAkB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C;;;;;GAKG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,WAAW;IAA3C;QACL;;;;;;SAMC;;QAEW,UAAK,GAAW,EAAE,CAAC;QAMnB,cAAS,GAAY,IAAI,CAAC;QAE1B,cAAS,GAAG,EAAE,CAAC;QAEf,SAAI,GAAG,gBAAgB,CAAC;QAExB,aAAQ,GAAY,IAAI,CAAC;QAK5B,iBAAY,GAAG,KAAK,CAAC;QAE9B,kBAAa,GAAG,GAAG,CAAC;QAEpB,kBAAa,GAAG,EAAE,CAAC;QAEmB,aAAQ,GAAG,EAAE,CAAC;QAEf,aAAQ,GAAG,KAAK,CAAC;QAEZ,iBAAY,GAAG,EAAE,CAAC;QAE1B,UAAK,GAAG,KAAK,CAAC;IA0RlD,CAAC;IAtRC,iBAAiB;QACf,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,IA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MAAM,CAAC;AA/B3B;IAAX,QAAQ,EAAE;gDAAoB;AAEnB;IAAX,QAAQ,EAAE;kDAAqB;AAEpB;IAAX,QAAQ,EAAE;0DAA6B;AAE5B;IAAX,QAAQ,EAAE;oDAA2B;AAE1B;IAAX,QAAQ,EAAE;oDAAgB;AAEf;IAAX,QAAQ,EAAE;+CAAyB;AAExB;IAAX,QAAQ,EAAE;mDAA0B;AAEH;IAAjC,KAAK,CAAC,yBAAyB,CAAC;wDAAiC;AAChC;IAAjC,KAAK,CAAC,yBAAyB,CAAC;sDAA+B;AAEvD;IAAR,KAAK,EAAE;uDAAsB;AAMQ;IAArC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;mDAAe;AAEf;IAApC,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;mDAAkB;AAEZ;IAAzC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAAmB;AAE1B;IAAjC,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;gDAAe;AAuEhD;IADC,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;yDAG7C;AA/GU,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAgU7B;SAhUY,iBAAiB;AAkU9B,eAAe,iBAAiB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, TemplateResult } from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-content-editor.css';\nimport { CSSResultGroup } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\nimport { KeyCode } from '../internal/enum';\nimport { live } from 'lit/directives/live.js';\n\n/**\n * Nile icon component.\n *\n * @tag nile-attribute-expression\n *\n */\n@customElement('nile-content-editor')\nexport class NileContentEditor extends NileElement {\n /**\n * @summary Allows you to handle both input and dropdown selection\n\n * @dependency nile-option\n \n * @event nile-change - Emitted when the control's value changes. \n */\n\n @property() value: string = '';\n\n @property() options: Array<any>;\n\n @property() filteredOptions: Array<any>;\n\n @property() showLabel: boolean = true;\n\n @property() labelText = '';\n\n @property() type = 'text|text-area';\n\n @property() required: boolean = true;\n\n @query('.content-editable-input') contentEditor: HTMLInputElement;\n @query('.nile-options-container') autoOptions: HTMLInputElement;\n\n @state() openDropdown = false;\n\n tagIdentifier = '$';\n\n filteredValue = '';\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ attribute: 'readonly' }) readonly = false;\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n @property({ attribute: 'error' }) error = false;\n\n static styles: CSSResultGroup = styles;\n\n connectedCallback() {\n this.handleOutsideClick = this.handleOutsideClick.bind(this);\n this.handleClipboardEvent = this.handleClipboardEvent.bind(this);\n super.connectedCallback();\n this.emit('nile-init');\n this.addOpenListeners();\n this.setInitialValues();\n }\n\n setInitialValues() {\n this.updateComplete.then(res => {\n if (res && !!this.value)\n this.contentEditor.innerHTML = this.generateHTMLTagsWithValues(\n this.value\n );\n });\n }\n\n addOpenListeners() {\n window.addEventListener('click', this.handleOutsideClick);\n window.addEventListener('cut', this.handleClipboardEvent);\n window.addEventListener('copy', this.handleClipboardEvent);\n window.addEventListener('paste', this.handleClipboardEvent);\n }\n\n removeOpenListeners() {\n window.removeEventListener('click', this.handleOutsideClick);\n window.removeEventListener('cut', this.handleClipboardEvent);\n window.removeEventListener('copy', this.handleClipboardEvent);\n window.removeEventListener('paste', this.handleClipboardEvent);\n }\n\n async handleClipboardEvent(event: Event) {\n const selectedText = window?.getSelection()?.toString();\n switch (event.type) {\n case 'cut':\n case 'copy':\n if (!!selectedText) await navigator.clipboard.writeText(selectedText);\n document.execCommand(event.type);\n break;\n case 'paste':\n event.preventDefault();\n let pastedText = await navigator.clipboard.readText();\n pastedText = pastedText\n .replace(/<(|\\/)(html|body|meta|span)[^>]*?>/gi, '')\n .trim();\n document.execCommand('insertText', false, pastedText);\n break;\n default:\n break;\n }\n setTimeout(() => {\n this.emitInputChange();\n });\n }\n\n toggleDropdown(value: boolean) {\n this.openDropdown = value;\n }\n\n handleOutsideClick(event: Event) {\n if (event && event.target) {\n this.toggleDropdown(false);\n }\n }\n\n @watch('type', { waitUntilFirstUpdate: true })\n handleTypeChange() {\n this.contentEditor.innerHTML = this.generateHTMLTagsWithValues(this.value);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.emit('nile-destroy');\n }\n\n private handlekeyDown(event: any) {\n if (event.code === KeyCode.ENTER && this.type === 'text') {\n event.preventDefault();\n return;\n }\n if (\n [KeyCode.CUT, KeyCode.COPY, KeyCode.PASTE].includes(event.code) &&\n (event.ctrlKey || event.metaKey)\n ) {\n return;\n }\n if (event.code === KeyCode.ESCAPE) {\n event.preventDefault();\n this.toggleDropdown(false);\n return;\n }\n setTimeout(() => {\n const value = this.contentEditor.innerText;\n this.emitInputChange();\n if (value.includes(this.tagIdentifier)) {\n this.insertNodes(this.contentEditor, this.contentEditor.childNodes);\n this.filterOptions();\n this.toggleDropdown(true);\n } else {\n this.toggleDropdown(false);\n }\n }, 10);\n }\n\n filterOptions() {\n this.filteredOptions = this.options;\n if (!!this.options.length && !!this.filteredValue) {\n this.filteredOptions = this.options.filter(item =>\n item.includes(this.filteredValue)\n );\n } else {\n this.filteredOptions = this.options;\n }\n }\n\n generateValuesFromHTMLTags(string: any): string {\n var pattern =\n /<span class=\"chips(?: chip-error)?\" contenteditable=\"false\">(.*?)<\\/span>/g;\n var result = string.replace(pattern, (match: any, option: any) => {\n return '{{' + option + '}}';\n });\n return result;\n }\n\n generateHTMLTagsWithValues(string: any): string {\n var pattern = /{{(.*?)}}/g;\n var result = string.replace(pattern, (match: any, option: any) => {\n return this.options.includes(option)\n ? '<span class=\"chips\" contenteditable=\"false\">' + option + '</span>'\n : this.setError(option);\n });\n return result;\n }\n\n setError(option: any) {\n this.error = true;\n return (\n '<span class=\"chips chip-error\" contenteditable=\"false\">' +\n option +\n '</span>'\n );\n }\n\n emitInputChange(): void {\n if (this.contentEditor) {\n let fieldValue = this.contentEditor.innerHTML;\n if (this.contentEditor.innerText !== '') {\n fieldValue = this.generateValuesFromHTMLTags(fieldValue);\n }\n fieldValue = fieldValue.replace(/&nbsp;/g, ' ');\n fieldValue = fieldValue.replace('<br>', '');\n this.emit('nile-change', {\n value: this.generateValuesFromHTMLTags(fieldValue),\n });\n }\n }\n\n insertNodes(parentNode: Node, childNodes: NodeList, autoOptionsTag?: Node) {\n [...childNodes].forEach((node: Node, index: number) => {\n if (node.hasChildNodes()) {\n if (autoOptionsTag) {\n this.insertNodes(node, node.childNodes, autoOptionsTag);\n } else {\n this.insertNodes(node, node.childNodes);\n }\n } else {\n if (node.nodeValue?.includes(this.tagIdentifier)) {\n if (autoOptionsTag) {\n parentNode.childNodes[index].nodeValue = node.nodeValue?.replace(\n this.tagIdentifier + this.filteredValue,\n ''\n );\n parentNode.childNodes[index].after(autoOptionsTag);\n }\n this.filteredValue =\n parentNode?.childNodes[index]?.nodeValue\n ?.split(this.tagIdentifier)\n .slice(1)\n .join() || '';\n return;\n }\n }\n });\n }\n\n handleOptions(option: any): void {\n this.toggleDropdown(false);\n let autoOptionsTag = document.createElement('span');\n autoOptionsTag.setAttribute('class', 'chips');\n autoOptionsTag.setAttribute('contentEditable', 'false');\n autoOptionsTag.innerText = option;\n this.insertNodes(\n this.contentEditor,\n this.contentEditor.childNodes,\n autoOptionsTag\n );\n this.filteredOptions = this.options;\n this.filteredValue = '';\n this.emitInputChange();\n }\n\n public renderAutoOptions(): TemplateResult {\n return html`<div\n class=\"${classMap({\n 'nile-options-container': true,\n 'dropdown-position': this.type === 'text-area',\n })}\"\n >\n ${this.filteredOptions &&\n this.filteredOptions.map((option: any) => {\n return html` <nile-option\n .value=\"${option}\"\n @click=\"${(event: Event) => {\n this.handleOptions(option);\n }}\"\n >${option}\n </nile-option>`;\n })}\n </div>`;\n }\n\n public render(): TemplateResult {\n const hasHelpText = this.helpText ? true : false;\n const hasError = !!this.error;\n const hasErrorMessage = !!this.errorMessage;\n const readonly = !!this.readonly;\n const type = this.type;\n return html`\n <nile-popup\n .active=\"${live(this.openDropdown)}\"\n sync=\"width\"\n strategy=\"fixed\"\n placement=\"bottom\"\n class=${classMap({\n dropdown: true,\n 'dropdown--open': true,\n popup: true,\n })}\n >\n <div class=\"content-editable-wrapper\" slot=\"anchor\">\n ${this.showLabel && this.labelText\n ? html`<label class=\"ods-label\">${this.labelText} </label> ${this\n .required\n ? html`<span class=\"asterik\">*</span>`\n : ''}`\n : ''}\n <div\n contenteditable=\"${!readonly}\"\n spellcheck=\"false\"\n class=${classMap({\n 'content-editable-input': true,\n error: hasError || hasErrorMessage,\n 'read-only': readonly,\n 'text-area': type === 'text-area' ? true : false,\n })}\n @keydown=${this.handlekeyDown}\n ></div>\n ${hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``}\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n </div>\n ${this.filteredOptions && !!this.filteredOptions.length\n ? this.renderAutoOptions()\n : null}\n </nile-popup>\n `;\n }\n}\n\nexport default NileContentEditor;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-content-editor': NileContentEditor;\n }\n}\n"]}
@@ -28,6 +28,7 @@ export const styles = css `
28
28
 
29
29
  .nile-error-message__response {
30
30
  color: var(--nile-colors-dark-500);
31
+ margin-top:6px;
31
32
  }
32
33
 
33
34
  .nile-error-message__icon {
@@ -1 +1 @@
1
- {"version":3,"file":"nile-error-message.css.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsExB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * ErrorMessage CSS\n */\nexport const styles = css`\n :host {\n }\n\n .nile-error-message {\n width: 100%;\n word-break: break-all;\n font-size: var(--nile-font-size-small);\n letter-spacing: 0.2px;\n font-weight: var(--nile-font-weight-regular);\n line-height: var(--nile-font-size-small);\n }\n\n .nile-error-message__error {\n color: var(--nile-colors-red-500);\n word-break: break-word;\n }\n\n .nile-error-message__response {\n color: var(--nile-colors-dark-500);\n }\n\n .nile-error-message__icon {\n vertical-align: middle;\n margin-right:2px;\n }\n\n .nile-error-message__more-button {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n white-space: nowrap;\n }\n\n .nile-error-message__response-expanded {\n height: auto;\n border: 1px solid var(--nile-colors-red-500);\n border-left: 6px solid var(--nile-colors-red-500);\n border-radius: 4px;\n margin-top: 12px;\n padding: 12px;\n background: var(--nile-colors-neutral-100);\n }\n\n .nile-error-message__response-expanded {\n max-height: 100px;\n overflow-y: auto;\n border: 1px solid var(--nile-colors-red-500);\n border-left: 6px solid var(--nile-colors-red-500);\n border-radius: 4px;\n margin-top: 12px;\n padding: 12px;\n background: var(--nile-colors-neutral-100);\n transition: max-height 0.3s ease-in-out;\n flex-shrink: 0;\n }\n\n .nile-error-message__response-expanded.collapsed {\n max-height: 0;\n overflow: hidden;\n transition: max-height 0.3s ease-in-out;\n visibility: hidden;\n padding: 0 12px;\n }\n\n .nile-error-message__response-expanded.expanded {\n max-height: 100px;\n transition: max-height 0.3s ease-in-out;\n visibility: visible;\n padding: 12px;\n }\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-error-message.css.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuExB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * ErrorMessage CSS\n */\nexport const styles = css`\n :host {\n }\n\n .nile-error-message {\n width: 100%;\n word-break: break-all;\n font-size: var(--nile-font-size-small);\n letter-spacing: 0.2px;\n font-weight: var(--nile-font-weight-regular);\n line-height: var(--nile-font-size-small);\n }\n\n .nile-error-message__error {\n color: var(--nile-colors-red-500);\n word-break: break-word;\n }\n\n .nile-error-message__response {\n color: var(--nile-colors-dark-500);\n margin-top:6px;\n }\n\n .nile-error-message__icon {\n vertical-align: middle;\n margin-right:2px;\n }\n\n .nile-error-message__more-button {\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n white-space: nowrap;\n }\n\n .nile-error-message__response-expanded {\n height: auto;\n border: 1px solid var(--nile-colors-red-500);\n border-left: 6px solid var(--nile-colors-red-500);\n border-radius: 4px;\n margin-top: 12px;\n padding: 12px;\n background: var(--nile-colors-neutral-100);\n }\n\n .nile-error-message__response-expanded {\n max-height: 100px;\n overflow-y: auto;\n border: 1px solid var(--nile-colors-red-500);\n border-left: 6px solid var(--nile-colors-red-500);\n border-radius: 4px;\n margin-top: 12px;\n padding: 12px;\n background: var(--nile-colors-neutral-100);\n transition: max-height 0.3s ease-in-out;\n flex-shrink: 0;\n }\n\n .nile-error-message__response-expanded.collapsed {\n max-height: 0;\n overflow: hidden;\n transition: max-height 0.3s ease-in-out;\n visibility: hidden;\n padding: 0 12px;\n }\n\n .nile-error-message__response-expanded.expanded {\n max-height: 100px;\n transition: max-height 0.3s ease-in-out;\n visibility: visible;\n padding: 12px;\n }\n`;\n\nexport default [styles];\n"]}
@@ -7,6 +7,7 @@ export declare class NileErrorMessage extends LitElement {
7
7
  static get styles(): CSSResultArray;
8
8
  errorMessage: string;
9
9
  errorResponse: string;
10
+ errorResponseLong: string;
10
11
  isExpanded: boolean;
11
12
  private readonly MAX_LENGTH;
12
13
  /**
@@ -48,14 +48,18 @@ let NileErrorMessage = class NileErrorMessage extends LitElement {
48
48
 
49
49
 
50
50
  ${this.errorResponse
51
- ? html ` <span class="nile-error-message__response"
52
- >${this.getTruncatedResponse()}</span
53
- >
51
+ ? html `
52
+ <div class="nile-error-message__response">
53
+ ${this.errorResponse}
54
+ ${this.errorResponseLong
55
+ ? html `
54
56
  <span
55
- class="nile-error-message__more-button"
56
- @click=${this.toggleExpanded}
57
- >${this.isExpanded ? 'View Less' : 'View More'}</span
58
- >`
57
+ class="nile-error-message__more-button"
58
+ @click=${this.toggleExpanded}
59
+ >${this.isExpanded ? 'View Less' : 'View More'}</span
60
+ >` : ``}
61
+ </div>
62
+ `
59
63
  : ``}
60
64
 
61
65
  <div
@@ -63,7 +67,7 @@ let NileErrorMessage = class NileErrorMessage extends LitElement {
63
67
  ? 'expanded'
64
68
  : 'collapsed'}"
65
69
  >
66
- ${this.errorResponse}
70
+ ${this.errorResponseLong}
67
71
  </div>
68
72
  </div>
69
73
  `;
@@ -75,6 +79,9 @@ __decorate([
75
79
  __decorate([
76
80
  property({ type: String })
77
81
  ], NileErrorMessage.prototype, "errorResponse", void 0);
82
+ __decorate([
83
+ property({ type: String })
84
+ ], NileErrorMessage.prototype, "errorResponseLong", void 0);
78
85
  __decorate([
79
86
  property({ type: Boolean })
80
87
  ], NileErrorMessage.prototype, "isExpanded", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-error-message.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD;;;GAGG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QAKL,4DAA4D;QAE5D,iBAAY,GAAW,EAAE,CAAC;QAO1B,eAAU,GAAY,KAAK,CAAC;QAE5B,wCAAwC;QACvB,eAAU,GAAW,GAAG,CAAC;IAsD5C,CAAC;IAtEQ,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAgBD;;;OAGG;IACH,oBAAoB;QAClB,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE;YAC/C,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;SACjE;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;IACrC,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAA;;;;;;;;;kDASmC,IAAI,CAAC,YAAY;;;UAGzD,IAAI,CAAC,aAAa;YAClB,CAAC,CAAC,IAAI,CAAA;mBACG,IAAI,CAAC,oBAAoB,EAAE;;;;yBAIrB,IAAI,CAAC,cAAc;mBACzB,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;gBAC9C;YACN,CAAC,CAAC,EAAE;;;yDAG2C,IAAI,CAAC,UAAU;YAC5D,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,WAAW;;YAEb,IAAI,CAAC,aAAa;;;KAGzB,CAAC;IACJ,CAAC;CACF,CAAA;AAhEC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACD;AAI1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDACL;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACA;AAdjB,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAuE5B;SAvEY,gBAAgB","sourcesContent":["import {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-error-message.css';\n\n/**\n * A custom error message component that displays error information to the user.\n * @customElement nile-error-message\n */\n@customElement('nile-error-message')\nexport class NileErrorMessage extends LitElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n // Represents the error message to be displayed to the user.\n @property({ type: String })\n errorMessage: string = '';\n\n // Represents additional details about the error, like stack trace or other info.\n @property({ type: String })\n errorResponse: string;\n\n @property({ type: Boolean })\n isExpanded: boolean = false;\n\n // The maximum length before truncation.\n private readonly MAX_LENGTH: number = 100;\n\n /**\n * Get a truncated version of the errorResponse if it's too long.\n * @returns {string}\n */\n getTruncatedResponse(): string {\n if (this.errorResponse.length > this.MAX_LENGTH) {\n return `${this.errorResponse.substring(0, this.MAX_LENGTH)}...`;\n }\n return this.errorResponse;\n }\n\n /**\n * Toggle the expanded state of the error response.\n */\n toggleExpanded() {\n this.isExpanded = !this.isExpanded;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"nile-error-message\" part=\"base\">\n <nile-icon\n name=\"info2\"\n size=\"14\"\n class=\"nile-error-message__icon\"\n part=\"icon\"\n color=\"#E5434D\"\n ></nile-icon>\n <span class=\"nile-error-message__error\">${this.errorMessage}</span>\n\n\n ${this.errorResponse\n ? html` <span class=\"nile-error-message__response\"\n >${this.getTruncatedResponse()}</span\n >\n <span\n class=\"nile-error-message__more-button\"\n @click=${this.toggleExpanded}\n >${this.isExpanded ? 'View Less' : 'View More'}</span\n >`\n : ``}\n\n <div\n class=\"nile-error-message__response-expanded ${this.isExpanded\n ? 'expanded'\n : 'collapsed'}\"\n >\n ${this.errorResponse}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-error-message': NileErrorMessage;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-error-message.js","sourceRoot":"","sources":["../../../src/nile-error-message/nile-error-message.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD;;;GAGG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QAKL,4DAA4D;QAE5D,iBAAY,GAAW,EAAE,CAAC;QAW1B,eAAU,GAAY,KAAK,CAAC;QAE5B,wCAAwC;QACvB,eAAU,GAAW,GAAG,CAAC;IA0D5C,CAAC;IA9EQ,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAoBD;;;OAGG;IACH,oBAAoB;QAClB,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE;YAC/C,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;SACjE;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;IACrC,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAA;;;;;;;;;kDASmC,IAAI,CAAC,YAAY;;;UAGzD,IAAI,CAAC,aAAa;YACpB,CAAC,CAAC,IAAI,CAAA;;cAEA,IAAI,CAAC,aAAa;cAClB,IAAI,CAAC,iBAAiB;gBACpB,CAAC,CAAC,IAAI,CAAA;;;uBAGC,IAAI,CAAC,cAAc;iBACzB,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW;cAC9C,CAAA,CAAC,CAAA,EAAE;;aAEJ;YACL,CAAC,CAAC,EAAE;;;yDAG6C,IAAI,CAAC,UAAU;YAC5D,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,WAAW;;YAEb,IAAI,CAAC,iBAAiB;;;KAG7B,CAAC;IACJ,CAAC;CACF,CAAA;AAxEC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACD;AAI1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDACL;AAItB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DACD;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDACA;AAlBjB,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CA+E5B;SA/EY,gBAAgB","sourcesContent":["import {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-error-message.css';\n\n/**\n * A custom error message component that displays error information to the user.\n * @customElement nile-error-message\n */\n@customElement('nile-error-message')\nexport class NileErrorMessage extends LitElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n // Represents the error message to be displayed to the user.\n @property({ type: String })\n errorMessage: string = '';\n\n // Represents additional details about the error, like stack trace or other info.\n @property({ type: String })\n errorResponse: string;\n\n // Extended error information\n @property({ type: String })\n errorResponseLong: string;\n\n @property({ type: Boolean })\n isExpanded: boolean = false;\n\n // The maximum length before truncation.\n private readonly MAX_LENGTH: number = 100;\n\n /**\n * Get a truncated version of the errorResponse if it's too long.\n * @returns {string}\n */\n getTruncatedResponse(): string {\n if (this.errorResponse.length > this.MAX_LENGTH) {\n return `${this.errorResponse.substring(0, this.MAX_LENGTH)}...`;\n }\n return this.errorResponse;\n }\n\n /**\n * Toggle the expanded state of the error response.\n */\n toggleExpanded() {\n this.isExpanded = !this.isExpanded;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"nile-error-message\" part=\"base\">\n <nile-icon\n name=\"info2\"\n size=\"14\"\n class=\"nile-error-message__icon\"\n part=\"icon\"\n color=\"#E5434D\"\n ></nile-icon>\n <span class=\"nile-error-message__error\">${this.errorMessage}</span>\n\n\n ${this.errorResponse\n ? html`\n <div class=\"nile-error-message__response\">\n ${this.errorResponse}\n ${this.errorResponseLong\n ? html`\n <span\n class=\"nile-error-message__more-button\"\n @click=${this.toggleExpanded}\n >${this.isExpanded ? 'View Less' : 'View More'}</span\n >`:``}\n </div>\n `\n : ``}\n\n <div\n class=\"nile-error-message__response-expanded ${this.isExpanded\n ? 'expanded'\n : 'collapsed'}\"\n >\n ${this.errorResponseLong}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-error-message': NileErrorMessage;\n }\n}\n"]}
@@ -24,8 +24,18 @@ export const styles = css `
24
24
  line-height: 12px;
25
25
  letter-spacing: 0.2px;
26
26
  margin-top: 6px;
27
+ margin-right: 4px;
28
+ width: auto;
27
29
  }
28
30
 
31
+ .nile-form-help-text__more-button {
32
+ display: inline-flex;
33
+ gap: 4px;
34
+ color: var(--nile-colors-primary-600);
35
+ cursor: pointer;
36
+ white-space: nowrap;
37
+ align-items: center
38
+ }
29
39
  `;
30
40
  export default [styles];
31
41
  //# sourceMappingURL=nile-form-help-text.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-form-help-text.css.js","sourceRoot":"","sources":["../../../src/nile-form-help-text/nile-form-help-text.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkBxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit-element';\n\n/**\n * FormHelpText CSS\n */\nexport const styles = css`\n\t:host {\n\n\t}\n\n .nile-form-help-text {\n display: flex;\n align-items: center;\n color: var(--nile-colors-dark-500);\n font-family: Colfax-regular;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 12px;\n letter-spacing: 0.2px;\n margin-top: 6px;\n }\n\n`;\n\nexport default [styles];\n"]}
1
+ {"version":3,"file":"nile-form-help-text.css.js","sourceRoot":"","sources":["../../../src/nile-form-help-text/nile-form-help-text.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2023\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit-element';\n\n/**\n * FormHelpText CSS\n */\nexport const styles = css`\n\t:host {\n\n\t}\n\n .nile-form-help-text {\n display: flex;\n align-items: center;\n color: var(--nile-colors-dark-500);\n font-family: Colfax-regular;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 12px;\n letter-spacing: 0.2px;\n margin-top: 6px;\n margin-right: 4px;\n width: auto;\n }\n\n .nile-form-help-text__more-button {\n display: inline-flex;\n gap: 4px;\n color: var(--nile-colors-primary-600);\n cursor: pointer;\n white-space: nowrap;\n align-items: center\n }\n`;\n\nexport default [styles];\n"]}
@@ -17,6 +17,14 @@ export declare class NileFormHelpText extends LitElement {
17
17
  * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
18
18
  */
19
19
  static get styles(): CSSResultArray;
20
+ isExpanded: boolean;
21
+ fullText: string;
22
+ displayedText: string;
23
+ slotElement: HTMLSlotElement;
24
+ connectedCallback(): void;
25
+ firstUpdated(): void;
26
+ handleSlotChange(): void;
27
+ toggleExpanded(): void;
20
28
  /**
21
29
  * Render method
22
30
  * @slot This is a slot test
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { __decorate } from "tslib";
8
- import { LitElement, html } from 'lit-element';
9
- import { customElement } from 'lit/decorators.js';
8
+ import { LitElement, html, property } from 'lit-element';
9
+ import { customElement, query } from 'lit/decorators.js';
10
10
  import { styles } from './nile-form-help-text.css';
11
11
  /**
12
12
  * Nile icon component.
@@ -15,6 +15,12 @@ import { styles } from './nile-form-help-text.css';
15
15
  *
16
16
  */
17
17
  let NileFormHelpText = class NileFormHelpText extends LitElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.isExpanded = false;
21
+ this.fullText = '';
22
+ this.displayedText = '';
23
+ }
18
24
  /**
19
25
  * The styles for FormHelpText
20
26
  * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
@@ -22,6 +28,25 @@ let NileFormHelpText = class NileFormHelpText extends LitElement {
22
28
  static get styles() {
23
29
  return [styles];
24
30
  }
31
+ connectedCallback() {
32
+ super.connectedCallback();
33
+ requestAnimationFrame(() => {
34
+ this.slotElement?.addEventListener('slotchange', this.handleSlotChange.bind(this));
35
+ });
36
+ }
37
+ firstUpdated() {
38
+ this.handleSlotChange();
39
+ }
40
+ handleSlotChange() {
41
+ const nodes = this.slotElement.assignedNodes({ flatten: true });
42
+ const textContent = nodes.map(node => node.textContent).join('');
43
+ this.fullText = textContent;
44
+ this.displayedText = textContent.length > 50 ? `${textContent.substring(0, 47)}...` : textContent;
45
+ }
46
+ toggleExpanded() {
47
+ this.isExpanded = !this.isExpanded;
48
+ this.displayedText = this.isExpanded ? this.fullText : `${this.fullText.substring(0, 47)}...`;
49
+ }
25
50
  /* #endregion */
26
51
  /* #region Methods */
27
52
  /**
@@ -29,13 +54,38 @@ let NileFormHelpText = class NileFormHelpText extends LitElement {
29
54
  * @slot This is a slot test
30
55
  */
31
56
  render() {
57
+ const showMoreButton = this.fullText.length > 50;
58
+ const iconName = this.isExpanded ? 'arrowup' : 'arrowdown';
32
59
  return html `
33
- <div class="nile-form-help-text">
34
- <slot> </slot>
35
- </div>
36
- `;
60
+ <div class="nile-form-help-text" part="container">
61
+ <slot hidden></slot>
62
+ <div part="text">${this.displayedText}
63
+ ${showMoreButton ? html `
64
+ <span
65
+ class="nile-form-help-text__more-button"
66
+ part="toggle-button"
67
+ @click=${this.toggleExpanded}
68
+ >${this.isExpanded ? 'View Less' : 'View More'}
69
+ <nile-icon color="#005EA6" part="icon" size="14" name="${iconName}"></nile-icon>
70
+ </span>
71
+ ` : ''}
72
+ </div>
73
+ </div>
74
+ `;
37
75
  }
38
76
  };
77
+ __decorate([
78
+ property({ type: Boolean })
79
+ ], NileFormHelpText.prototype, "isExpanded", void 0);
80
+ __decorate([
81
+ property({ type: String })
82
+ ], NileFormHelpText.prototype, "fullText", void 0);
83
+ __decorate([
84
+ property({ type: String })
85
+ ], NileFormHelpText.prototype, "displayedText", void 0);
86
+ __decorate([
87
+ query('slot')
88
+ ], NileFormHelpText.prototype, "slotElement", void 0);
39
89
  NileFormHelpText = __decorate([
40
90
  customElement('nile-form-help-text')
41
91
  ], NileFormHelpText);