@six-group/ui-library 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/dist/cjs/{form-control-d369af14.js → form-control-9769b310.js} +10 -7
  2. package/dist/cjs/form-control-9769b310.js.map +1 -0
  3. package/dist/cjs/index-900437fc.js +8 -4
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/six-checkbox.cjs.entry.js +6 -3
  6. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  7. package/dist/cjs/six-datepicker.cjs.entry.js +2 -7
  8. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  9. package/dist/cjs/six-dropdown_2.cjs.entry.js +1 -1
  10. package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
  11. package/dist/cjs/six-error.cjs.entry.js +21 -0
  12. package/dist/cjs/six-error.cjs.entry.js.map +1 -0
  13. package/dist/cjs/six-group-label.cjs.entry.js +2 -2
  14. package/dist/cjs/six-group-label.cjs.entry.js.map +1 -1
  15. package/dist/cjs/six-input.cjs.entry.js +6 -3
  16. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  17. package/dist/cjs/six-range.cjs.entry.js +6 -3
  18. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  19. package/dist/cjs/six-select.cjs.entry.js +6 -3
  20. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  21. package/dist/cjs/six-sidebar.cjs.entry.js +1 -1
  22. package/dist/cjs/six-sidebar.cjs.entry.js.map +1 -1
  23. package/dist/cjs/six-switch.cjs.entry.js +22 -4
  24. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  25. package/dist/cjs/six-tag.cjs.entry.js +23 -1
  26. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  27. package/dist/cjs/six-textarea.cjs.entry.js +6 -3
  28. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  29. package/dist/cjs/six-timepicker.cjs.entry.js +4 -9
  30. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  31. package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
  32. package/dist/cjs/six-tooltip.cjs.entry.js.map +1 -1
  33. package/dist/cjs/ui-library.cjs.js +1 -1
  34. package/dist/collection/collection-manifest.json +1 -0
  35. package/dist/collection/components/six-checkbox/six-checkbox.css +1 -1
  36. package/dist/collection/components/six-checkbox/six-checkbox.js +25 -4
  37. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  38. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js +6 -2
  39. package/dist/collection/components/six-checkbox/test/six-checkbox.spec.js.map +1 -1
  40. package/dist/collection/components/six-datepicker/six-datepicker.js +22 -11
  41. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  42. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js +1 -1
  43. package/dist/collection/components/six-datepicker/test/six-datepicker.spec.js.map +1 -1
  44. package/dist/collection/components/six-dropdown/six-dropdown.css +2 -1
  45. package/dist/collection/components/six-error/six-error.css +5 -0
  46. package/dist/collection/components/six-error/six-error.js +25 -0
  47. package/dist/collection/components/six-error/six-error.js.map +1 -0
  48. package/dist/collection/components/six-group-label/six-group-label.css +1 -1
  49. package/dist/collection/components/six-group-label/test/six-group-label.spec.js +3 -1
  50. package/dist/collection/components/six-group-label/test/six-group-label.spec.js.map +1 -1
  51. package/dist/collection/components/six-input/six-input.css +1 -1
  52. package/dist/collection/components/six-input/six-input.js +27 -4
  53. package/dist/collection/components/six-input/six-input.js.map +1 -1
  54. package/dist/collection/components/six-input/test/six-input.spec.js +3 -1
  55. package/dist/collection/components/six-input/test/six-input.spec.js.map +1 -1
  56. package/dist/collection/components/six-range/six-range.css +1 -1
  57. package/dist/collection/components/six-range/six-range.js +24 -3
  58. package/dist/collection/components/six-range/six-range.js.map +1 -1
  59. package/dist/collection/components/six-range/test/six-range.spec.js +3 -1
  60. package/dist/collection/components/six-range/test/six-range.spec.js.map +1 -1
  61. package/dist/collection/components/six-select/six-select.css +1 -1
  62. package/dist/collection/components/six-select/six-select.js +24 -3
  63. package/dist/collection/components/six-select/six-select.js.map +1 -1
  64. package/dist/collection/components/six-select/test/six-select.spec.js +6 -2
  65. package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
  66. package/dist/collection/components/six-sidebar/six-sidebar.css +1 -0
  67. package/dist/collection/components/six-switch/six-switch.css +1 -1
  68. package/dist/collection/components/six-switch/six-switch.js +45 -4
  69. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  70. package/dist/collection/components/six-switch/test/six-switch.spec.js +6 -2
  71. package/dist/collection/components/six-switch/test/six-switch.spec.js.map +1 -1
  72. package/dist/collection/components/six-tag/six-tag.js +23 -1
  73. package/dist/collection/components/six-tag/six-tag.js.map +1 -1
  74. package/dist/collection/components/six-tag/test/six-tag.spec.js +12 -0
  75. package/dist/collection/components/six-tag/test/six-tag.spec.js.map +1 -1
  76. package/dist/collection/components/six-textarea/six-textarea.css +1 -1
  77. package/dist/collection/components/six-textarea/six-textarea.js +25 -4
  78. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  79. package/dist/collection/components/six-textarea/test/six-textarea.spec.js +3 -1
  80. package/dist/collection/components/six-textarea/test/six-textarea.spec.js.map +1 -1
  81. package/dist/collection/components/six-timepicker/six-timepicker.js +24 -12
  82. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  83. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js +15 -15
  84. package/dist/collection/components/six-timepicker/test/six-timepicker.spec.js.map +1 -1
  85. package/dist/collection/components/six-tooltip/six-tooltip.css +1 -1
  86. package/dist/collection/components/six-tooltip/six-tooltip.js +1 -1
  87. package/dist/collection/components/six-tooltip/six-tooltip.js.map +1 -1
  88. package/dist/collection/functional-components/form-control/form-control.js +8 -6
  89. package/dist/collection/functional-components/form-control/form-control.js.map +1 -1
  90. package/dist/components/form-control.js +9 -6
  91. package/dist/components/form-control.js.map +1 -1
  92. package/dist/components/index.js +2 -0
  93. package/dist/components/index.js.map +1 -1
  94. package/dist/components/six-checkbox.js +14 -3
  95. package/dist/components/six-checkbox.js.map +1 -1
  96. package/dist/components/six-datepicker.js +10 -8
  97. package/dist/components/six-datepicker.js.map +1 -1
  98. package/dist/components/six-dropdown2.js +8 -2
  99. package/dist/components/six-dropdown2.js.map +1 -1
  100. package/dist/components/six-error.d.ts +11 -0
  101. package/dist/components/six-error.js +8 -0
  102. package/dist/components/six-error.js.map +1 -0
  103. package/dist/components/six-error2.js +32 -0
  104. package/dist/components/six-error2.js.map +1 -0
  105. package/dist/components/six-group-label.js +8 -2
  106. package/dist/components/six-group-label.js.map +1 -1
  107. package/dist/components/six-header.js +8 -2
  108. package/dist/components/six-header.js.map +1 -1
  109. package/dist/components/six-input2.js +14 -3
  110. package/dist/components/six-input2.js.map +1 -1
  111. package/dist/components/six-range.js +14 -3
  112. package/dist/components/six-range.js.map +1 -1
  113. package/dist/components/six-search-field.js +7 -1
  114. package/dist/components/six-search-field.js.map +1 -1
  115. package/dist/components/six-select.js +33 -16
  116. package/dist/components/six-select.js.map +1 -1
  117. package/dist/components/six-sidebar.js +1 -1
  118. package/dist/components/six-sidebar.js.map +1 -1
  119. package/dist/components/six-switch.js +30 -4
  120. package/dist/components/six-switch.js.map +1 -1
  121. package/dist/components/six-tag2.js +33 -5
  122. package/dist/components/six-tag2.js.map +1 -1
  123. package/dist/components/six-textarea.js +14 -3
  124. package/dist/components/six-textarea.js.map +1 -1
  125. package/dist/components/six-timepicker2.js +12 -10
  126. package/dist/components/six-timepicker2.js.map +1 -1
  127. package/dist/components/six-tooltip2.js +2 -2
  128. package/dist/components/six-tooltip2.js.map +1 -1
  129. package/dist/components.json +419 -48
  130. package/dist/esm/{form-control-32cb533f.js → form-control-b0febe88.js} +10 -7
  131. package/dist/esm/form-control-b0febe88.js.map +1 -0
  132. package/dist/esm/index-8a74f992.js +8 -4
  133. package/dist/esm/loader.js +1 -1
  134. package/dist/esm/six-checkbox.entry.js +6 -3
  135. package/dist/esm/six-checkbox.entry.js.map +1 -1
  136. package/dist/esm/six-datepicker.entry.js +2 -7
  137. package/dist/esm/six-datepicker.entry.js.map +1 -1
  138. package/dist/esm/six-dropdown_2.entry.js +1 -1
  139. package/dist/esm/six-dropdown_2.entry.js.map +1 -1
  140. package/dist/esm/six-error.entry.js +17 -0
  141. package/dist/esm/six-error.entry.js.map +1 -0
  142. package/dist/esm/six-group-label.entry.js +2 -2
  143. package/dist/esm/six-group-label.entry.js.map +1 -1
  144. package/dist/esm/six-input.entry.js +6 -3
  145. package/dist/esm/six-input.entry.js.map +1 -1
  146. package/dist/esm/six-range.entry.js +6 -3
  147. package/dist/esm/six-range.entry.js.map +1 -1
  148. package/dist/esm/six-select.entry.js +6 -3
  149. package/dist/esm/six-select.entry.js.map +1 -1
  150. package/dist/esm/six-sidebar.entry.js +1 -1
  151. package/dist/esm/six-sidebar.entry.js.map +1 -1
  152. package/dist/esm/six-switch.entry.js +22 -4
  153. package/dist/esm/six-switch.entry.js.map +1 -1
  154. package/dist/esm/six-tag.entry.js +23 -1
  155. package/dist/esm/six-tag.entry.js.map +1 -1
  156. package/dist/esm/six-textarea.entry.js +6 -3
  157. package/dist/esm/six-textarea.entry.js.map +1 -1
  158. package/dist/esm/six-timepicker.entry.js +4 -9
  159. package/dist/esm/six-timepicker.entry.js.map +1 -1
  160. package/dist/esm/six-tooltip.entry.js +2 -2
  161. package/dist/esm/six-tooltip.entry.js.map +1 -1
  162. package/dist/esm/ui-library.js +1 -1
  163. package/dist/types/components/six-checkbox/six-checkbox.d.ts +4 -1
  164. package/dist/types/components/six-datepicker/six-datepicker.d.ts +4 -2
  165. package/dist/types/components/six-error/six-error.d.ts +9 -0
  166. package/dist/types/components/six-input/six-input.d.ts +7 -2
  167. package/dist/types/components/six-range/six-range.d.ts +4 -1
  168. package/dist/types/components/six-select/six-select.d.ts +4 -1
  169. package/dist/types/components/six-switch/six-switch.d.ts +8 -1
  170. package/dist/types/components/six-tag/six-tag.d.ts +8 -0
  171. package/dist/types/components/six-textarea/six-textarea.d.ts +4 -1
  172. package/dist/types/components/six-timepicker/six-timepicker.d.ts +5 -2
  173. package/dist/types/components.d.ts +109 -16
  174. package/dist/types/functional-components/form-control/form-control.d.ts +6 -2
  175. package/dist/ui-library/{p-ed381ad9.entry.js → p-14c1ec31.entry.js} +2 -2
  176. package/dist/ui-library/p-14c1ec31.entry.js.map +1 -0
  177. package/dist/ui-library/p-25bb1752.entry.js +2 -0
  178. package/dist/ui-library/p-25bb1752.entry.js.map +1 -0
  179. package/dist/ui-library/p-2a141e10.entry.js +2 -0
  180. package/dist/ui-library/p-2a141e10.entry.js.map +1 -0
  181. package/dist/ui-library/p-4435ff73.entry.js +2 -0
  182. package/dist/ui-library/p-4435ff73.entry.js.map +1 -0
  183. package/dist/ui-library/p-538f3c50.entry.js +2 -0
  184. package/dist/ui-library/p-538f3c50.entry.js.map +1 -0
  185. package/dist/ui-library/p-a457fee8.entry.js +2 -0
  186. package/dist/ui-library/p-a457fee8.entry.js.map +1 -0
  187. package/dist/ui-library/p-ab91c2a9.entry.js +2 -0
  188. package/dist/ui-library/p-ab91c2a9.entry.js.map +1 -0
  189. package/dist/ui-library/p-b57afbe4.entry.js +2 -0
  190. package/dist/ui-library/p-b57afbe4.entry.js.map +1 -0
  191. package/dist/ui-library/p-b6f47c9d.entry.js +2 -0
  192. package/dist/ui-library/p-b6f47c9d.entry.js.map +1 -0
  193. package/dist/ui-library/p-db34a6cc.entry.js +2 -0
  194. package/dist/ui-library/p-db34a6cc.entry.js.map +1 -0
  195. package/dist/ui-library/p-db936ad7.entry.js +2 -0
  196. package/dist/ui-library/{p-d367f4f9.entry.js.map → p-db936ad7.entry.js.map} +1 -1
  197. package/dist/ui-library/p-dc4f41d8.entry.js +2 -0
  198. package/dist/ui-library/p-dc4f41d8.entry.js.map +1 -0
  199. package/dist/ui-library/p-e5020f0d.js +2 -0
  200. package/dist/ui-library/p-e5020f0d.js.map +1 -0
  201. package/dist/ui-library/p-e775dcb4.entry.js +2 -0
  202. package/dist/ui-library/p-e775dcb4.entry.js.map +1 -0
  203. package/dist/ui-library/p-f1dc3a88.entry.js +2 -0
  204. package/dist/ui-library/p-f1dc3a88.entry.js.map +1 -0
  205. package/dist/ui-library/ui-library.esm.js +1 -1
  206. package/dist/ui-library/ui-library.esm.js.map +1 -1
  207. package/package.json +2 -2
  208. package/dist/cjs/form-control-d369af14.js.map +0 -1
  209. package/dist/esm/form-control-32cb533f.js.map +0 -1
  210. package/dist/ui-library/p-02981b91.entry.js +0 -2
  211. package/dist/ui-library/p-02981b91.entry.js.map +0 -1
  212. package/dist/ui-library/p-314b2096.entry.js +0 -2
  213. package/dist/ui-library/p-314b2096.entry.js.map +0 -1
  214. package/dist/ui-library/p-330a4988.entry.js +0 -2
  215. package/dist/ui-library/p-330a4988.entry.js.map +0 -1
  216. package/dist/ui-library/p-3d9de119.entry.js +0 -2
  217. package/dist/ui-library/p-3d9de119.entry.js.map +0 -1
  218. package/dist/ui-library/p-4abed9df.entry.js +0 -2
  219. package/dist/ui-library/p-4abed9df.entry.js.map +0 -1
  220. package/dist/ui-library/p-5d6b7353.entry.js +0 -2
  221. package/dist/ui-library/p-5d6b7353.entry.js.map +0 -1
  222. package/dist/ui-library/p-72254eef.entry.js +0 -2
  223. package/dist/ui-library/p-72254eef.entry.js.map +0 -1
  224. package/dist/ui-library/p-9f0b43f9.entry.js +0 -2
  225. package/dist/ui-library/p-9f0b43f9.entry.js.map +0 -1
  226. package/dist/ui-library/p-b550a258.entry.js +0 -2
  227. package/dist/ui-library/p-b550a258.entry.js.map +0 -1
  228. package/dist/ui-library/p-bf87464b.entry.js +0 -2
  229. package/dist/ui-library/p-bf87464b.entry.js.map +0 -1
  230. package/dist/ui-library/p-d367f4f9.entry.js +0 -2
  231. package/dist/ui-library/p-d42c2025.js +0 -2
  232. package/dist/ui-library/p-d42c2025.js.map +0 -1
  233. package/dist/ui-library/p-ed381ad9.entry.js.map +0 -1
  234. package/dist/ui-library/p-ff90ffd1.entry.js +0 -2
  235. package/dist/ui-library/p-ff90ffd1.entry.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isString","value","isNil","i18nDate","en","months","monthsShort","monthsShortGrouped","weekdays","weekdaysShort","weekdaysMin","de","fr","it","now","Date","removeTime","date","getFullYear","getMonth","getDate","isValidDate","isNaN","getTime","toString","year","Error","month","day","hours","getHours","minutes","getMinutes","seconds","getSeconds","getFirstDayOfTheWeek","weekdayDiff","setDate","getDay","isSameYear","a","b","isSameMonth","isSameDay","isSameWeek","isValidDateString","datestring","format","length","getDateParts","toDate","isInRange","minDate","maxDate","lookAhead","iFormat","match","increment","followingCharacterMatches","charAt","hasProperLength","formatNumber","len","num","String","formatDate","output","FORMATTING_TOKENS","TWO_NUMERICS_REGEX","FOUR_NUMERICS_REGEX","NON_NUMERIC_REGEX","YEAR","MONTH","DAY","HOUR","MINUTE","SECOND","parseFlags","addParseFlag","token","regex","callback","tokens","Array","isArray","func","input","parseInt","forEach","key","cent","Math","floor","getFullInputArray","backupDate","result","backupArr","useBackup","i","undefined","createDate","hour","minute","second","isFinite","setFullYear","makeParser","dateString","mark","parseTo","word","replace","indexOf","substr","parser","exec","obj","Object","assign","getCleanDateString","dirtyDateString","separator","split","map","s","join","inputArray","e","NaN","createCalendarGrid","calendarGridArguments","firstDateOfBox","allowedDates","dateFormat","selectedDate","pointerDate","weekDatePointer","dayDatePointer","calendar","row","display","label","isToday","isSelected","isDisabled","isOutdated","rangeAround","number","range","itemsPerGroup","keys","n","reduce","curr","item","index","push","SixDateFormats","MonthSelection","monthSelectionParams","locale","isSelectedMonth","_a","findIndex","m","h","class","part","onClick","onClickMonthCell","DaySelection","daySelectionParams","weekday","calendarGrid","cell","onClickDateCell","YearSelection","yearSelectionParams","yearSelection","onClickYearCell","sixDatepickerCss","NUMBER_OF_YEARS_SHOWN","MIN_POPUP_HEIGHT","SelectionMode","SixDatepicker","this","eventListeners","EventListeners","previousUnit","selectionMode","previousMonth","previousYear","previousYearGroup","nextUnit","nextMonth","nextYear","nextYearGroup","handleDocumentKeyDown","event","keyboardEvent","open","stopPropagation","closePopup","inputElement","setFocus","handleDocumentMouseDown","path","composedPath","includes","container","handleClearClick","async","select","sixClear","emit","onTimepickerChange","sixTimepickerChange","time","detail","newDate","setHours","updateValue","updatePointerDates","selectedMonth","monthShort","handleInputChange","inputValue","inputValueDate","updateIfChanged","datesOnly","dateAsString","handleOnBlur","sixSelect","_b","formattedDate","sixBlur","getCurrentDateAsPointer","type","DDMMYYY_DOT","DEFAULT_DEBOUNCE_FAST","debounceChanged","debounceEvent","debounce","valueChanged","console","warn","resizeHandler","updateDropdownDirection","moveOpenHoistedPopup","adjustPopupPosition","scrollHandler","movePopup","hoist","popup","wrapper","containingElement","host","options","min","max","isDropDownContentUp","calcIsDropDownContentUp","getMonthStringForIndex","openCalendar","disabled","setupEventListenersForOpenPopup","add","document","inline","remove","getPointerDate","differsFromPointerDate","defaultDate","closeOnSelect","componentWillLoad","componentDidLoad","componentDidRender","renderHeader","viewBox","width","height","d","points","renderBody","renderCustomIcon","icon","hasSlot","name","size","slot","prefix","iconPosition","renderClearable","clearable","tabindex","render","ref","el","placeholder","readonly","required","errorText","errorTextCount","invalid","datepicker__popup","placement","_c","adjustPopupForHoisting","isUp","adjustPopupForSmallScreens","connectedCallback","forward","disconnectedCallback","removeAll"],"sources":["src/utils/type-check.ts","src/utils/date-util.ts","src/components/six-datepicker/six-date-formats.tsx","src/components/six-datepicker/components/month-selection.tsx","src/components/six-datepicker/components/day-selection.tsx","src/components/six-datepicker/components/year-selection.tsx","src/components/six-datepicker/six-datepicker.scss?tag=six-datepicker&encapsulation=shadow","src/components/six-datepicker/six-datepicker.tsx"],"sourcesContent":["export const isString = (value: unknown): value is string => typeof value === 'string';\n\n// only use '==' instead of '===' to also catch undefined and void\nexport const isNil = (value: unknown): value is undefined | null => value == null;\n\nexport const isDate = (value: unknown): value is Date => value instanceof Date;\n","/* eslint-disable */\n// @ts-nocheck\n\nimport { isDate, isNil, isString } from './type-check';\nimport { SixDateFormats } from '../components/six-datepicker/six-date-formats';\nimport { CalendarCell } from '../components/six-datepicker/six-datepicker';\n\nexport type DateLocale = typeof i18nDate.en;\nexport const i18nDate = {\n en: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n monthsShortGrouped: [\n ['Jan', 'Feb', 'Mar', 'Apr'],\n ['May', 'Jun', 'Jul', 'Aug'],\n ['Sep', 'Oct', 'Nov', 'Dec'],\n ],\n weekdays: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],\n weekdaysShort: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n weekdaysMin: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],\n },\n de: {\n months: [\n 'Januar',\n 'Februar',\n 'März',\n 'April',\n 'Mai',\n 'Juni',\n 'Juli',\n 'August',\n 'September',\n 'Oktober',\n 'November',\n 'Dezember',\n ],\n monthsShort: ['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],\n monthsShortGrouped: [\n ['Jan.', 'Feb.', 'März', 'Apr.'],\n ['Mai', 'Juni', 'Juli', 'Aug.'],\n ['Sep.', 'Okt.', 'Nov.', 'Dez.'],\n ],\n weekdays: ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'],\n weekdaysShort: ['Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.', 'So.'],\n weekdaysMin: ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'],\n },\n fr: {\n months: [\n 'janvier',\n 'février',\n 'mars',\n 'avril',\n 'mai',\n 'juin',\n 'juillet',\n 'août',\n 'septembre',\n 'octobre',\n 'novembre',\n 'décembre',\n ],\n monthsShort: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],\n monthsShortGrouped: [\n ['janv.', 'févr.', 'mars', 'avr.'],\n ['mai', 'juin', 'juil.', 'août'],\n ['sept.', 'oct.', 'nov.', 'déc.'],\n ],\n weekdays: ['lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'],\n weekdaysShort: ['lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.', 'dim.'],\n weekdaysMin: ['lu', 'ma', 'me', 'je', 've', 'sa', 'di'],\n },\n it: {\n months: [\n 'gennaio',\n 'febbraio',\n 'marzo',\n 'aprile',\n 'maggio',\n 'giugno',\n 'luglio',\n 'agosto',\n 'settembre',\n 'ottobre',\n 'novembre',\n 'dicembre',\n ],\n monthsShort: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],\n monthsShortGrouped: [\n ['gen', 'feb', 'mar', 'apr'],\n ['mag', 'giu', 'lug', 'ago'],\n ['set', 'ott', 'nov', 'dic'],\n ],\n weekdays: ['lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato', 'domenica'],\n weekdaysShort: ['lun', 'mar', 'mer', 'gio', 'ven', 'sab', 'dom'],\n weekdaysMin: ['lu', 'ma', 'me', 'gi', 've', 'sa', 'do'],\n },\n};\n\n/**\n * Returns a JS Date instance of the exact moment\n *\n * ```typescript\n * const date = now()\n * // Wed Mar 10 2021 20:30:32 GMT+0100 (Central European Standard Time)\n * ```\n */\nexport const now = () => new Date();\n\nexport const removeTime = (date: Date) => new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\nexport const pad = (value: number) => String(value).padStart(2, '0');\n\n/**\n * Returns `true` if the given date is valid\n */\nexport const isValidDate = (value: unknown): boolean => {\n return value instanceof Date && !isNaN(value.getTime()) && new Date(value).toString() !== 'Invalid Date';\n};\n\n/**\n * Returns the year number of the given date\n *\n * ```typescript\n * year(new Date(2020, 0, 1)) // 2020\n * ```\n */\nexport const year = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getFullYear();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the month number of the given date\n *\n * ```typescript\n * month(new Date(2020, 0, 1)) // 0\n * ```\n */\nexport const month = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getMonth();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the day number of the given date\n *\n * ```typescript\n * day(new Date(2020, 0, 1)) // 1\n * ```\n */\nexport const day = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getDate();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the hours of the given date\n */\nexport const hours = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getHours();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the minutes of the given date\n */\nexport const minutes = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getMinutes();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the seconds of the given date\n */\nexport const seconds = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getSeconds();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the first day of the week of the given date.\n */\nexport const getFirstDayOfTheWeek = (date: Date) => {\n const weekdayDiff = [6, 0, 1, 2, 3, 4, 5];\n const day = new Date(date);\n day.setDate(day.getDate() - weekdayDiff[day.getDay()]);\n return day;\n};\n\n/**\n * Returns `true` when the year of the dates are the same\n */\nexport const isSameYear = (a: Date | undefined, b: Date | undefined) => a?.getFullYear() === b?.getFullYear();\n\n/**\n * Returns `true` when the month of the dates are the same\n */\nexport const isSameMonth = (a: Date | undefined, b: Date | undefined) =>\n isSameYear(a, b) && a?.getMonth() === b?.getMonth();\n\n/**\n * Returns `true` when the day of the dates are the same\n */\nexport const isSameDay = (a: Date | undefined, b: Date | undefined) =>\n isSameMonth(a, b) && a?.getDate() === b?.getDate();\n\n/**\n * Returns `true` when the week of the dates are the same\n */\nexport const isSameWeek = (a: Date, b: Date) => isSameDay(getFirstDayOfTheWeek(a), getFirstDayOfTheWeek(b));\n\nconst localDatetime = (date: Date) => new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\n\n/**\n * Returns the ISO string `yyyy-mm-dd` of the given date\n *\n * ```typescript\n * isoString(new Date(2020, 0, 13)) // '2020-01-13'\n * ```\n */\nexport const isoString = (date: Date | undefined): string => {\n if (isNil(date) || Date.toString() === 'Invalid Date') {\n return '';\n }\n\n return `${year(date)}-${pad(month(date) + 1)}-${pad(day(date))}`;\n};\n\n/**\n * Returns the ISO string `yyyy-mm-dd` of the given parameters year, month and day\n *\n * ```typescript\n * newDateString(2020, 0, 13) // '2020-01-13'\n * or\n * newDateString(new Date(2020, 0, 13)) // '2020-01-13'\n * ```\n */\nexport const newDateString = (yearOrDate: Date | number, month?: number, day?: number): string => {\n let date;\n if (isDate(yearOrDate)) {\n date = localDatetime(yearOrDate);\n } else {\n date = new Date(Date.UTC(yearOrDate, (month as number) - 1, day as number));\n }\n\n return isoString(date);\n};\n\n/**\n * Returns `true` if the given datestring is valid\n */\nexport const isValidDateString = (datestring: string | undefined, format: string) => {\n if (!isString(datestring) || !isString(format)) {\n return false;\n }\n\n if (datestring.length < 6 || format.length < 6) {\n return false;\n }\n\n const { day, month } = getDateParts(datestring, format);\n\n if (day > 31 || month > 11 || day <= 0 || month < 0) {\n return false;\n }\n\n const date = toDate(datestring, format);\n\n if (isNil(date)) {\n return false;\n }\n\n return date.toString() !== 'Invalid Date';\n};\n\n/**\n * Returns `true` when the given date is not smaller than the minDate and not bigger than the maxDate.\n *\n * ```typescript\n * isInRange(new Date(2020, 1, 1), new Date(2020, 0, 1), new Date(2020, 2, 1)) // true\n * ```\n */\nexport const isInRange = (date: Date | undefined, minDate: Date | undefined, maxDate: Date | undefined): boolean => {\n if (!date) {\n return true;\n }\n\n if (minDate && date < minDate) {\n return false;\n }\n\n if (maxDate && maxDate < date) {\n return false;\n }\n\n return true;\n};\n\nconst validateTwoDates = (\n first: any,\n second: Date | string | undefined,\n validateFn: (irst: Date, second: Date) => boolean\n) => {\n if (isNil(first) && isNil(second)) {\n return false;\n }\n\n const _first: Date = new Date(first as string | Date);\n const _second: Date = new Date(second as string | Date);\n\n if (!isValidDate(_first) || !isValidDate(_second)) {\n return false;\n }\n\n return validateFn(_first, _second);\n};\n\n/**\n * Returns `true` when the given date is not smaller than the before date.\n *\n * ```typescript\n * isBefore(new Date(2020, 1, 1), new Date(2020, 3, 1)) // true\n * ```\n */\nexport const isBefore = (date: any, beforeDate: Date | string | undefined): boolean =>\n validateTwoDates(date, beforeDate, (first, second) => first < second);\n\n/**\n * Returns `true` when the given date is not smaller than the before date.\n *\n * ```typescript\n * isAfter(new Date(2020, 5, 1), new Date(2020, 3, 1)) // true\n * ```\n */\nexport const isAfter = (date: any, afterDate: Date | string | undefined): boolean =>\n validateTwoDates(date, afterDate, (first, second) => first > second);\n\n/**\n * Increases the year of a date and retunrs the result\n *\n * ```typescript\n * increaseYear(new Date(2020, 0, 1), 1) // 2021\n * ```\n */\nexport const increaseYear = (date: Date, years: number): number => year(date) + years;\n\n/**\n * Decreases the year of a date and retunrs the result\n *\n * ```typescript\n * decreaseYear(new Date(2020, 0, 1), 1) // 2019\n * ```\n */\nexport const decreaseYear = (date: Date, years: number): number => year(date) - years;\n\nconst lookAhead = (iFormat: number, format: string, match: string, length = 2) => {\n const increment = length - 1;\n const followingCharacterMatches = format.charAt(iFormat + increment) === match;\n const hasProperLength = iFormat + increment < format.length;\n return hasProperLength && followingCharacterMatches;\n};\n\nconst formatNumber = (value, len) => {\n let num = String(value);\n\n while (num.length < len) {\n num = '0' + num;\n }\n\n return num;\n};\n\nexport const formatDate = (date: Date | undefined | null, format: string): string => {\n if (date == null) {\n return '';\n }\n\n let output = '';\n\n for (let iFormat = 0; iFormat < format.length; iFormat++) {\n switch (format.charAt(iFormat)) {\n case 'd':\n if (lookAhead(iFormat, format, 'd')) {\n output += formatNumber(date.getDate(), 2);\n iFormat++;\n } else {\n output += String(date.getDate());\n }\n break;\n case 'm':\n if (lookAhead(iFormat, format, 'm')) {\n output += formatNumber(date.getMonth() + 1, 2);\n iFormat++;\n } else {\n output += String(date.getMonth() + 1);\n }\n break;\n case 'y':\n if (lookAhead(iFormat, format, 'y', 4)) {\n iFormat += 3;\n output += date.getFullYear();\n } else {\n output += (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100);\n iFormat++;\n }\n break;\n case 'h':\n if (lookAhead(iFormat, format, 'h')) {\n output += formatNumber(date.getHours(), 2);\n iFormat++;\n } else {\n output += String(date.getHours());\n }\n break;\n case 'M':\n if (lookAhead(iFormat, format, 'M')) {\n output += formatNumber(date.getMinutes(), 2);\n iFormat++;\n } else {\n output += String(date.getMinutes());\n }\n break;\n case 's':\n if (lookAhead(iFormat, format, 's')) {\n output += formatNumber(date.getSeconds(), 2);\n iFormat++;\n } else {\n output += String(date.getSeconds());\n }\n break;\n default:\n output += format.charAt(iFormat);\n }\n }\n return output;\n};\n\nconst daylightSavingAdjust = (date): Date => {\n if (!date) {\n return null;\n }\n\n date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\n\n return date;\n};\n\nconst getDaysCountInMonth = (month: number, year: number) =>\n 32 - daylightSavingAdjust(new Date(year, month, 32)).getDate();\n\nexport const parseDate = (value: any, format: string, locale: string): Date => {\n if (format == null || value == null) {\n throw 'Invalid arguments';\n }\n\n value = typeof value === 'object' ? value.toString() : value + '';\n if (value === '') {\n return null;\n }\n\n let iFormat;\n let dim;\n let extra;\n let iValue = 0;\n let shortYearCutoff = 100;\n let year = -1;\n let month = -1;\n let day = -1;\n let doy = -1;\n let literal = false;\n let date: Date;\n let lookAhead = (match: string, len = 2) => {\n const increment = len - 1;\n let matches = iFormat + increment < format.length && format.charAt(iFormat + increment) === match;\n if (matches) {\n iFormat += increment;\n }\n return matches;\n };\n let getNumber = (match, len = 2) => {\n let isDoubled = lookAhead(match, len),\n size = match === '@' ? 14 : match === '!' ? 20 : match === 'y' && isDoubled ? 4 : match === 'o' ? 3 : 2,\n minSize = match === 'y' ? size : 1,\n digits = new RegExp('^\\\\d{' + minSize + ',' + size + '}'),\n num = value.substring(iValue).match(digits);\n if (!num) {\n throw 'Missing number at position ' + iValue;\n }\n iValue += num[0].length;\n return parseInt(num[0], 10);\n };\n let getName = (match, shortNames, longNames) => {\n let index = -1;\n let arr = lookAhead(match) ? longNames : shortNames;\n let names = [];\n\n for (let i = 0; i < arr.length; i++) {\n names.push([i, arr[i]]);\n }\n names.sort((a, b) => {\n return -(a[1].length - b[1].length);\n });\n\n for (let i = 0; i < names.length; i++) {\n let name = names[i][1];\n if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {\n index = names[i][0];\n iValue += name.length;\n break;\n }\n }\n\n if (index !== -1) {\n return index + 1;\n } else {\n throw 'Unknown name at position ' + iValue;\n }\n };\n let checkLiteral = () => {\n if (value.charAt(iValue) !== format.charAt(iFormat)) {\n throw 'Unexpected literal at position ' + iValue;\n }\n iValue++;\n };\n\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === \"'\" && !lookAhead(\"'\")) {\n literal = false;\n } else {\n checkLiteral();\n }\n } else {\n switch (format.charAt(iFormat)) {\n case 'd':\n day = getNumber('d');\n break;\n case 'D':\n getName('D', i18nDate[locale].weekdaysShort, i18nDate[locale].weekdays);\n break;\n case 'm':\n month = getNumber('m');\n break;\n case 'M':\n month = getName('M', i18nDate[locale].monthsShort, i18nDate[locale].months);\n break;\n case 'y':\n year = getNumber('y', 4);\n break;\n default:\n checkLiteral();\n }\n }\n }\n\n if (iValue < value.length) {\n extra = value.substr(iValue);\n if (!/^\\s+/.test(extra)) {\n throw 'Extra/unparsed characters found in date: ' + extra;\n }\n }\n\n if (year === -1) {\n year = new Date().getFullYear();\n } else if (year < 100) {\n year += new Date().getFullYear() - (new Date().getFullYear() % 100) + (year <= shortYearCutoff ? 0 : -100);\n }\n\n if (doy > -1) {\n month = 1;\n day = doy;\n do {\n dim = getDaysCountInMonth(year, month - 1);\n if (day <= dim) {\n break;\n }\n month++;\n day -= dim;\n } while (true);\n }\n\n date = daylightSavingAdjust(new Date(year, month - 1, day));\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {\n throw 'Invalid date'; // E.g. 31/02/00\n }\n\n return date;\n};\n\nconst FORMATTING_TOKENS = /(\\[[^\\[]*\\])|(mm|dd|yyyy|yy|hh|MM|ss|.)/g;\n\nconst TWO_NUMERICS_REGEX = /\\d\\d/; // 00 - 99\nconst FOUR_NUMERICS_REGEX = /\\d{4}/; // 0000 - 9999\nconst NON_NUMERIC_REGEX = /[^0-9]/g;\n\nconst YEAR = 'year';\nconst MONTH = 'month';\nconst DAY = 'day';\nconst HOUR = 'hour';\nconst MINUTE = 'minute';\nconst SECOND = 'second';\n\ninterface ParseFlagMark {\n year: number;\n month: number;\n day: number;\n hour: number;\n minute: number;\n second: number;\n date: Date;\n}\n\ntype ParseFlagCallBackReturn = any;\n\ntype ParseFlagRegExp = RegExp | ((locale: any) => RegExp);\ntype ParseFlagCallBack = (input: string) => ParseFlagCallBackReturn;\n\ninterface ParseFlag {\n [key: string]: [ParseFlagRegExp, ParseFlagCallBack];\n}\n\nconst parseFlags: ParseFlag = {};\n\nconst addParseFlag = (token: string | string[], regex: ParseFlagRegExp, callback) => {\n const tokens = Array.isArray(token) ? token : [token];\n let func: ParseFlagCallBack;\n if (typeof callback === 'string') {\n func = (input) => {\n const value = parseInt(input, 10);\n return { [callback]: value };\n };\n } else {\n func = callback;\n }\n tokens.forEach((key) => {\n parseFlags[key] = [regex, func];\n });\n};\n\naddParseFlag('yy', TWO_NUMERICS_REGEX, (input) => {\n const year = new Date().getFullYear();\n const cent = Math.floor(year / 100);\n let value = parseInt(input, 10);\n value = (value > 68 ? cent - 1 : cent) * 100 + value;\n return { [YEAR]: value };\n});\naddParseFlag('yyyy', FOUR_NUMERICS_REGEX, YEAR);\naddParseFlag('mm', TWO_NUMERICS_REGEX, (input) => ({ [MONTH]: parseInt(input, 10) - 1 }));\naddParseFlag('dd', TWO_NUMERICS_REGEX, DAY);\naddParseFlag('hh', TWO_NUMERICS_REGEX, HOUR);\naddParseFlag('MM', TWO_NUMERICS_REGEX, MINUTE);\naddParseFlag('ss', TWO_NUMERICS_REGEX, SECOND);\n\ntype DateArgs = [number, number, number, number, number, number];\n\nconst getFullInputArray = (input: Array<number | undefined>, backupDate = new Date()) => {\n const result: DateArgs = [0, 0, 1, 0, 0, 0];\n const backupArr = [\n backupDate.getFullYear(),\n backupDate.getMonth(),\n backupDate.getDate(),\n backupDate.getHours(),\n backupDate.getMinutes(),\n backupDate.getSeconds(),\n ];\n\n let useBackup = true;\n for (let i = 0; i < 7; i++) {\n if (input[i] === undefined) {\n result[i] = useBackup ? backupArr[i] : result[i];\n } else {\n result[i] = input[i]!;\n useBackup = false;\n }\n }\n return result;\n};\n\nconst createDate = (year: number, month: number, day: number, hour: number, minute: number, second: number): Date => {\n if (!(year < 100 && year >= 0)) {\n return new Date(year, month, day, hour, minute, second);\n }\n\n const date = new Date(year + 400, month, day, hour, minute, second);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(year);\n }\n return date;\n};\n\nconst makeParser = (dateString: string, format: string) => {\n const tokens = format.match(FORMATTING_TOKENS);\n if (!tokens) {\n throw new Error();\n }\n const { length } = tokens;\n let mark: Partial<ParseFlagMark> = {};\n for (let i = 0; i < length; i += 1) {\n const token = tokens[i];\n const parseTo = parseFlags[token];\n if (!parseTo) {\n const word = token.replace(/^\\[|\\]$/g, '');\n if (dateString.indexOf(word) === 0) {\n dateString = dateString.substr(word.length);\n } else {\n throw new Error('not match');\n }\n } else {\n const regex = parseTo[0] as RegExp;\n const parser = parseTo[1];\n const value = (regex.exec(dateString) || [])[0];\n const obj = parser(value);\n mark = { ...mark, ...obj };\n dateString = dateString.replace(value, '');\n }\n }\n return mark;\n};\n\nconst getCleanDateString = (dirtyDateString: string, format: string) => {\n if (dirtyDateString.length === format.length) {\n return dirtyDateString;\n }\n\n const separator = dirtyDateString.match(NON_NUMERIC_REGEX)[0];\n\n // pad signle digits to follow supported dateformats\n return dirtyDateString\n .split(separator)\n .map((s) => (s.length === 1 ? '0' + s : s))\n .join(separator);\n};\n\nconst getDateParts: (dirtyDateString: string, format: string) => Partial<ParseFlagMark> = (\n dirtyDateString: string,\n format: string\n) => {\n const dateString = getCleanDateString(dirtyDateString, format);\n\n return makeParser(dateString, format);\n};\n\nexport const toDate = (dirtyDateString: string | undefined, format: string): Date | undefined => {\n try {\n const { backupDate = new Date() } = {};\n const { year, month, day, hour, minute, second, date } = getDateParts(dirtyDateString, format);\n if (date != null) {\n return date;\n }\n const inputArray = [year, month, day, hour, minute, second];\n const result = getFullInputArray(inputArray, backupDate);\n return createDate(...result);\n } catch (e) {\n return new Date(NaN);\n }\n};\n\nexport interface PointerDate {\n year: number;\n month: number;\n day: number;\n hours: number;\n minutes: number;\n seconds: number;\n}\n\nexport interface CalendarGridArgs {\n firstDateOfBox: Date;\n minDate?: Date;\n maxDate?: Date;\n dateFormat: SixDateFormats;\n pointerDate: { month: number; year: number; day: number };\n allowedDates: (date: Date) => boolean;\n locale: 'en' | 'de' | 'fr' | 'it';\n selectedDate?: Date;\n}\n\nexport const createCalendarGrid: (calendarGridArguments: CalendarGridArgs) => CalendarCell[][] = (\n calendarGridArguments: CalendarGridArgs\n) => {\n const { firstDateOfBox, allowedDates, dateFormat, selectedDate, minDate, maxDate, pointerDate } =\n calendarGridArguments;\n\n const weekDatePointer = new Date(firstDateOfBox);\n const dayDatePointer = new Date(firstDateOfBox);\n\n let calendar: CalendarCell[][] = [];\n\n do {\n let row: CalendarCell[] = [];\n do {\n row = [\n ...row,\n {\n date: new Date(dayDatePointer),\n display: formatDate(dayDatePointer, dateFormat),\n dateString: formatDate(dayDatePointer, dateFormat),\n label: day(dayDatePointer).toString(),\n isToday: isSameDay(dayDatePointer, now()),\n isSelected: selectedDate && isSameDay(dayDatePointer, selectedDate),\n isDisabled: !allowedDates(dayDatePointer) || !isInRange(dayDatePointer, minDate, maxDate),\n isOutdated: pointerDate.month !== dayDatePointer.getMonth() || !isInRange(dayDatePointer, minDate, maxDate),\n },\n ];\n dayDatePointer.setDate(dayDatePointer.getDate() + 1);\n } while (isSameWeek(dayDatePointer, weekDatePointer));\n calendar = [...calendar, row];\n weekDatePointer.setDate(weekDatePointer.getDate() + 7);\n } while (isSameMonth(new Date(pointerDate.year, pointerDate.month, pointerDate.day), dayDatePointer));\n return calendar;\n};\n\n/**\n * Returns a range of numbers around the given number grouped into buckets of 5.\n * @param number the given number around which you want to get the other numbers\n * @param range range of numbers to include in the result\n */\nexport function rangeAround(number: number, range: number): number[][] {\n const itemsPerGroup = 5;\n return [...Array(range).keys()]\n .map((n) => n + number - Math.floor(range / 2))\n .reduce((curr, item, index) => {\n if (index % itemsPerGroup === 0) {\n curr.push([]);\n }\n curr[curr.length - 1].push(item);\n return curr;\n }, [] as number[][]);\n}\n","export enum SixDateFormats {\n DDMMYYY_DOT = 'dd.mm.yyyy',\n YYYYMMDD_DASH = 'yyyy-mm-dd',\n DDMMYYYY_DASH = 'dd-mm-yyyy',\n DDMMYYYY_SLASH = 'dd/mm/yyyy',\n YYYYMMDD_SLASH = 'yyyy/mm/dd',\n DDMMYY_DOT = 'dd.mm.yy',\n YYMMDD_DASH = 'yy-mm-dd',\n DDMMYY_DASH = 'dd-mm-yy',\n DDMMYY_SLASH = 'dd/mm/yy',\n YYMMDD_SLASH = 'yy/mm/dd',\n\n DDMMYYY_DOT_TIME = 'dd.mm.yyyy hh:MM:ss',\n YYYYMMDD_DASH_TIME = 'yyyy-mm-dd hh:MM:ss',\n DDMMYYYY_DASH_TIME = 'dd-mm-yyyy hh:MM:ss',\n DDMMYYYY_SLASH_TIME = 'dd/mm/yyyy hh:MM:ss',\n YYYYMMDD_SLASH_TIME = 'yyyy/mm/dd hh:MM:ss',\n DDMMYY_DOT_TIME = 'dd.mm.yy hh:MM:ss',\n YYMMDD_DASH_TIME = 'yy-mm-dd hh:MM:ss',\n DDMMYY_DASH_TIME = 'dd-mm-yy hh:MM:ss',\n DDMMYY_SLASH_TIME = 'dd/mm/yy hh:MM:ss',\n YYMMDD_SLASH_TIME = 'yy/mm/dd hh:MM:ss',\n}\n","import { h } from '@stencil/core';\nimport { DateLocale, now } from '../../../utils/date-util';\n\ninterface MonthSelectionParams {\n locale: DateLocale;\n selectedDate?: Date;\n onClickMonthCell: (month: string) => void;\n}\nexport const MonthSelection = (monthSelectionParams: MonthSelectionParams) => {\n const locale = monthSelectionParams.locale;\n const isToday = (value: string) => locale.monthsShort[now().getMonth()] === value;\n\n const isSelectedMonth = (value: string) =>\n monthSelectionParams.selectedDate?.getMonth() === locale.monthsShort.findIndex((m) => m === value);\n\n return (\n <table class=\"datepicker-table\" part=\"month-selection\">\n <tbody>\n {locale.monthsShortGrouped.map((row: string[]) => (\n <tr class=\"datepicker-table__row\">\n {row.map((month) => (\n <td\n onClick={() => monthSelectionParams.onClickMonthCell(month)}\n class={{\n 'datepicker-table__cell': true,\n 'datepicker-table__cell--is-today': isToday(month),\n 'datepicker-table__cell--is-selected': isSelectedMonth(month),\n }}\n >\n {month}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n","import { h } from '@stencil/core';\nimport { DateLocale } from '../../../utils/date-util';\nimport { CalendarCell } from '../six-datepicker';\n\ninterface DaySelectionParams {\n locale: DateLocale;\n calendarGrid: CalendarCell[][];\n onClickDateCell: (cell: CalendarCell) => void;\n}\nexport const DaySelection = (daySelectionParams: DaySelectionParams) => {\n return (\n <table class=\"datepicker-table\" part=\"day-selection\">\n <thead part=\"weekday-header\">\n {daySelectionParams.locale.weekdaysMin.map((weekday) => (\n <th class=\"datepicker__cell\">{weekday}</th>\n ))}\n </thead>\n <tbody>\n {daySelectionParams.calendarGrid.map((row) => (\n <tr class=\"datepicker-table__row\">\n {row.map((cell) => (\n <td\n data-date={cell.dateString}\n onClick={() => daySelectionParams.onClickDateCell(cell)}\n class={{\n 'datepicker-table__cell': true,\n 'datepicker-table__cell--is-today': cell.isToday,\n 'datepicker-table__cell--is-selected': cell.isSelected,\n 'datepicker-table__cell--is-outdated': cell.isOutdated,\n 'datepicker-table__cell--is-disabled': cell.isDisabled,\n 'datepicker-table__cell--is-selectable': !cell.isDisabled,\n }}\n >\n {cell.label}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n","import { now } from '../../../utils/date-util';\nimport { h } from '@stencil/core';\n\ninterface YearSelectionParams {\n selectedDate?: Date;\n yearSelection: number[][];\n onClickYearCell: (year: number) => void;\n}\nexport const YearSelection = (yearSelectionParams: YearSelectionParams) => {\n return (\n <table class=\"datepicker-table\" part=\"year-selection\">\n <tbody>\n {yearSelectionParams.yearSelection.map((row) => (\n <tr class=\"datepicker-table__row\">\n {row.map((year) => (\n <td\n onClick={() => yearSelectionParams.onClickYearCell(year)}\n class={{\n 'datepicker-table__cell': true,\n 'datepicker-table__cell--is-today': now().getFullYear() === year,\n 'datepicker-table__cell--is-selected': yearSelectionParams.selectedDate?.getFullYear() === year,\n }}\n >\n {year}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n","@import 'src/global/component';\n\n:host {\n display: block;\n font-family: var(--six-font-family);\n}\n\n.datepicker {\n &__container {\n position: relative;\n }\n\n &__popup {\n min-width: 400px;\n background-color: white;\n padding: 0.5em 0.5em 1.5em;\n box-shadow: 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px 0 rgb(0 0 0 / 14%), 0 1px 10px 0 rgb(0 0 0 / 12%);\n user-select: none;\n position: absolute;\n z-index: var(--six-z-index-dropdown);\n right: 0;\n left: 0;\n\n &--is-up {\n bottom: 100%;\n // fix problem where you would need to jump around with the cursor when switching months and\n // its a dropup since not all months have the same height\n min-height: 382px;\n }\n\n &--is-inline {\n position: initial;\n box-shadow: none;\n border: 1px solid var(--six-color-web-rock-400);\n }\n }\n}\n\n.datepicker-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--six-color-web-rock-400);\n padding: 0.5em;\n margin-bottom: 1em;\n\n & svg {\n fill: var(--six-color-web-rock-900);\n stroke: none;\n }\n\n &__btn {\n cursor: pointer;\n width: 2.5em;\n height: 2.5em;\n display: flex;\n vertical-align: middle;\n align-items: center;\n justify-content: center;\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n border-radius: 100%;\n }\n }\n\n &__label {\n display: flex;\n\n & > div {\n cursor: pointer;\n padding: 0.5em;\n display: flex;\n vertical-align: middle;\n align-items: center;\n justify-content: center;\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n }\n }\n }\n}\n\n.datepicker-table {\n width: 100%;\n\n &__cell {\n text-align: center;\n width: 2.5rem;\n height: 2.5rem;\n cursor: pointer;\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n }\n\n &--is-today {\n border: 1px solid var(--six-color-web-rock-400);\n }\n\n &--is-selected {\n background-color: var(--six-color-red);\n color: var(--six-color-white);\n }\n\n &--is-disabled {\n background-color: var(--six-color-web-rock-200);\n cursor: initial;\n\n &:hover {\n background-color: var(--six-color-web-rock-200);\n }\n }\n\n &--is-outdated {\n color: var(--six-color-web-rock-400);\n }\n }\n}\n\n// Clearable\n.datepicker-clear {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n\n &--right {\n right: 0;\n position: absolute;\n }\n\n &--left {\n right: 35px;\n position: absolute;\n }\n}\n\n.input--empty .datepicker-clear {\n visibility: hidden;\n}\n\n// Icon position\n.prefix {\n cursor: pointer;\n\n &--right {\n right: 0;\n display: inline-flex;\n position: absolute;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n margin-right: var(--six-input-spacing-medium);\n transition: var(--six-transition-fast) color;\n }\n}\n\n// time-picker\nsix-timepicker::part(popup) {\n border: none;\n padding: 0.5em 0.5em 0;\n min-height: 0;\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport {\n createCalendarGrid,\n day,\n formatDate,\n getFirstDayOfTheWeek,\n hours,\n i18nDate,\n isValidDate,\n isValidDateString,\n minutes,\n month,\n now,\n PointerDate,\n rangeAround,\n removeTime,\n seconds,\n toDate,\n year,\n} from '../../utils/date-util';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { debounce, debounceEvent, DEFAULT_DEBOUNCE_FAST } from '../../utils/execution-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { SixDateFormats } from './six-date-formats';\nimport { MonthSelection } from './components/month-selection';\nimport { DaySelection } from './components/day-selection';\nimport { YearSelection } from './components/year-selection';\nimport { SixTimepickerChange } from '../six-timepicker/six-timepicker';\nimport {\n adjustPopupForHoisting,\n adjustPopupForSmallScreens,\n calcIsDropDownContentUp,\n movePopup,\n} from '../../utils/popup';\n\nconst NUMBER_OF_YEARS_SHOWN = 25;\n\nconst MIN_POPUP_HEIGHT = 400;\n\nexport type SixDatepickerSelectPayload = Date | undefined | null;\n\nexport interface CalendarCell {\n date: Date;\n dateString: string;\n display: string;\n isDisabled: boolean;\n isOutdated: boolean;\n isSelected: boolean;\n isToday: boolean;\n label: string;\n}\n\nenum SelectionMode {\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define a footer for the date picker.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n */\n@Component({\n tag: 'six-datepicker',\n styleUrl: 'six-datepicker.scss',\n shadow: true,\n})\nexport class SixDatepicker {\n private eventListeners = new EventListeners();\n private inputElement?: HTMLSixInputElement;\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private selectedDate?: Date;\n\n @Element() host!: HTMLSixDatepickerElement;\n\n @State() private pointerDate = SixDatepicker.getCurrentDateAsPointer();\n @State() selectionMode: SelectionMode = SelectionMode.DAY;\n @State() isDropDownContentUp = false;\n\n /**\n * Set the type.\n */\n @Prop() type: 'date' | 'date-time' = 'date';\n\n /**\n * The language used to render the weekdays and months.\n */\n @Prop() locale: 'en' | 'de' | 'fr' | 'it' = 'en';\n\n /** Indicates whether or not the calendar dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether or not the calendar should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a date via the component in the popup, but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Callback to determine which date in the datepicker should be selectable.\n * the callback function will get a datestring as an argument, e.g. '2021-07-04'\n *\n * Usage e.g.:\n * const datepicker = document.getElementById('allowed-date-picker');\n * datepicker.allowedDates = datestring => parseInt(datestring.split('-')[2], 10) % 2 === 0;\n */\n @Prop() allowedDates: (date: Date) => boolean = () => true;\n\n /**\n * The minimum datetime allowed. Value must be a date object\n */\n @Prop() min?: Date;\n\n /**\n * The maximum datetime allowed. Value must be a date object\n */\n @Prop() max?: Date;\n\n /**\n * Closes the datepicker dropdown after selection\n */\n @Prop() closeOnSelect = this.type === 'date';\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Datepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The date to defines where the datepicker popup starts. The prop accepts ISO 8601 date strings (YYYY-MM-DD).\n */\n @Prop() defaultDate?: string;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /**\n * The value of the form field, which accepts a date object.\n */\n @Prop({ mutable: true }) value?: Date;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The dropdown will close when the user interacts outside of this element (e.g. clicking). */\n @Prop() containingElement?: HTMLElement;\n\n /** Define the dateFormat. Valid formats are:\n * 'dd.mm.yyyy'\n * 'yyyy-mm-dd'\n * 'dd-mm-yyyy'\n * 'dd/mm/yyyy'\n * 'yyyy/mm/dd'\n * 'dd.mm.yy'\n * 'yy-mm-dd'\n * 'dd-mm-yy'\n * 'dd/mm/yy'\n * 'yy/mm/dd'\n * */\n @Prop() dateFormat: SixDateFormats = SixDateFormats.DDMMYYY_DOT;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `dateChange` event after each keystroke.\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.sixSelect = debounceEvent(this.sixSelect, this.debounce);\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n if (this.value != null && !isValidDate(this.value)) {\n console.warn('invalid date value: ', this.value);\n this.value = undefined;\n this.sixSelect.emit(this.value);\n }\n this.selectedDate = this.value;\n this.updatePointerDates();\n }\n\n /**\n * Emitted when a option got selected.\n */\n @Event({ eventName: 'six-datepicker-select' }) sixSelect!: EventEmitter<SixDatepickerSelectPayload>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-datepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when a option got selected.\n */\n @Event({ eventName: 'six-datepicker-blur' }) sixBlur!: EventEmitter<SixDatepickerSelectPayload>;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.updateDropdownDirection();\n this.moveOpenHoistedPopup();\n this.adjustPopupPosition();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.updateDropdownDirection();\n this.moveOpenHoistedPopup();\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n get container() {\n return this.containingElement || this.host;\n }\n\n get firstDateOfBox(): Date {\n const date = new Date(this.pointerDate.year, this.pointerDate.month, 1);\n return getFirstDayOfTheWeek(date);\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n get calendarGrid() {\n return createCalendarGrid({\n firstDateOfBox: this.firstDateOfBox,\n allowedDates: this.allowedDates,\n dateFormat: this.dateFormat,\n locale: this.locale,\n selectedDate: this.selectedDate,\n minDate: this.min,\n maxDate: this.max,\n pointerDate: this.pointerDate,\n });\n }\n\n private updateDropdownDirection() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n this.isDropDownContentUp = calcIsDropDownContentUp(this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private getMonthStringForIndex(index: number) {\n return i18nDate[this.locale].months[index];\n }\n\n private previousUnit = () => {\n if (this.selectionMode === SelectionMode.DAY) {\n this.previousMonth();\n } else if (this.selectionMode === SelectionMode.MONTH) {\n this.previousYear();\n } else if (this.selectionMode === SelectionMode.YEAR) {\n this.previousYearGroup();\n }\n };\n\n private previousYear() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year - 1 };\n }\n\n private previousYearGroup() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year - NUMBER_OF_YEARS_SHOWN };\n }\n\n private previousMonth() {\n if (this.pointerDate.month === 0) {\n this.pointerDate = { year: this.pointerDate.year - 1, month: 11, day: 1, hours: 0, minutes: 0, seconds: 0 };\n } else {\n this.pointerDate = {\n year: this.pointerDate.year,\n month: this.pointerDate.month - 1,\n day: 1,\n hours: 0,\n minutes: 0,\n seconds: 0,\n };\n }\n }\n\n private nextUnit = () => {\n if (this.selectionMode === SelectionMode.DAY) {\n this.nextMonth();\n } else if (this.selectionMode === SelectionMode.MONTH) {\n this.nextYear();\n } else if (this.selectionMode === SelectionMode.YEAR) {\n this.nextYearGroup();\n }\n };\n\n private nextMonth() {\n if (this.pointerDate.month === 11) {\n this.pointerDate = { year: this.pointerDate.year + 1, month: 0, day: 1, hours: 0, minutes: 0, seconds: 0 };\n } else {\n this.pointerDate = {\n year: this.pointerDate.year,\n month: this.pointerDate.month + 1,\n day: 1,\n hours: 0,\n minutes: 0,\n seconds: 0,\n };\n }\n }\n\n private nextYear() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year + 1 };\n }\n\n private nextYearGroup() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year + NUMBER_OF_YEARS_SHOWN };\n }\n\n private openCalendar() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.setupEventListenersForOpenPopup();\n }\n }\n\n private setupEventListenersForOpenPopup() {\n this.eventListeners.add(document, 'keydown', this.handleDocumentKeyDown);\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentKeyDown = (event: Event) => {\n const keyboardEvent = event as KeyboardEvent;\n // Close when escape is pressed\n if (this.open && keyboardEvent.key === 'Escape') {\n keyboardEvent.stopPropagation();\n this.closePopup();\n void this.inputElement?.setFocus();\n }\n\n // Handle tabbing\n if (keyboardEvent.key === 'Tab') {\n this.closePopup();\n }\n };\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.container)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = async (event: MouseEvent) => {\n event.stopPropagation();\n await this.select(undefined);\n this.sixClear.emit();\n };\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'keydown', this.handleDocumentKeyDown);\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n this.selectionMode = SelectionMode.DAY;\n }\n\n private updatePointerDates() {\n const date = this.getPointerDate();\n if (this.differsFromPointerDate(date)) {\n this.pointerDate = {\n year: year(date),\n month: month(date),\n day: day(date),\n hours: hours(date),\n minutes: minutes(date),\n seconds: seconds(date),\n };\n }\n }\n\n private differsFromPointerDate(date?: Date): boolean {\n return (\n this.pointerDate.day !== day(date) ||\n this.pointerDate.month !== month(date) ||\n this.pointerDate.year !== year(date) ||\n this.pointerDate.hours !== hours(date) ||\n this.pointerDate.minutes !== minutes(date) ||\n this.pointerDate.seconds !== seconds(date)\n );\n }\n\n private getPointerDate(): Date | undefined {\n if (this.selectedDate !== undefined && this.selectedDate !== null) {\n return this.selectedDate;\n }\n if (this.defaultDate == null) {\n return this.type === 'date' ? removeTime(now()) : now();\n } else {\n return toDate(this.defaultDate, this.dateFormat);\n }\n }\n\n private updateValue(newDate?: Date) {\n this.updateIfChanged(newDate);\n }\n\n private updateIfChanged(newDate?: Date) {\n if (this.value?.getTime() === newDate?.getTime()) {\n return;\n }\n this.value = newDate;\n this.sixSelect.emit(this.value);\n }\n\n /**\n * Selects an option\n */\n @Method()\n async select(datestring?: string) {\n if (datestring == null) {\n this.updateValue(undefined);\n } else {\n const newDate = toDate(datestring, this.dateFormat);\n newDate?.setHours(this.pointerDate.hours, this.pointerDate.minutes, this.pointerDate.seconds);\n this.updateValue(newDate);\n }\n\n this.updatePointerDates();\n\n if (this.closeOnSelect) {\n this.closePopup();\n }\n }\n\n private onTimepickerChange = (sixTimepickerChange: CustomEvent<SixTimepickerChange>) => {\n const time = sixTimepickerChange.detail.value;\n const newDate = new Date();\n\n if (this.selectedDate != null) {\n newDate.setFullYear(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate());\n }\n\n if (time != null) {\n const hours = time.hours;\n const minutes = time.minutes;\n const seconds = time.seconds;\n if (hours != null) {\n newDate.setHours(hours, minutes, seconds);\n }\n }\n\n this.updateValue(newDate);\n this.updatePointerDates();\n };\n\n private onClickDateCell = (cell: CalendarCell) => {\n if (!cell.isDisabled) {\n void this.select(cell.dateString);\n }\n };\n\n private onClickMonthCell = (selectedMonth: string) => {\n const month = i18nDate[this.locale].monthsShort.findIndex((monthShort) => monthShort === selectedMonth);\n this.pointerDate = { ...this.pointerDate, month };\n this.selectionMode = SelectionMode.DAY;\n };\n\n private onClickYearCell = (year: number) => {\n this.pointerDate = { ...this.pointerDate, year };\n this.selectionMode = SelectionMode.DAY;\n };\n\n private handleInputChange = (event: Event) => {\n if (this.inputElement == null) {\n return;\n }\n event.stopPropagation();\n\n const inputValue = this.inputElement.value;\n if (!isValidDateString(inputValue, this.dateFormat)) {\n return;\n }\n\n const inputValueDate = toDate(inputValue, this.dateFormat);\n\n if (inputValueDate === undefined) {\n return;\n }\n\n this.updateIfChanged(inputValueDate);\n const datesOnly = inputValue.replace(/[^\\d]/g, '');\n if (datesOnly.length >= 6) {\n const date = toDate(inputValue, this.dateFormat);\n const dateAsString = formatDate(date, this.dateFormat);\n if (isValidDateString(dateAsString, this.dateFormat)) {\n this.selectedDate = toDate(dateAsString, this.dateFormat);\n this.updatePointerDates();\n this.updateValue(this.selectedDate);\n }\n }\n };\n\n private handleOnBlur = (event: Event) => {\n // clear the value if the user deleted the date\n if (this.inputElement?.value === '' && isValidDate(this.value)) {\n this.value = undefined;\n this.sixSelect.emit(this.value);\n }\n\n event.stopPropagation();\n const inputValue = this.inputElement?.value;\n const inputValueDate = toDate(inputValue, this.dateFormat);\n const formattedDate = formatDate(this.value, this.dateFormat);\n\n if (this.inputElement != null && inputValueDate != null && inputValue !== formattedDate) {\n // properly format date if necessary\n this.inputElement.value = formattedDate;\n }\n\n this.sixBlur.emit(this.value);\n };\n\n componentWillLoad() {\n this.selectedDate = this.value;\n this.updatePointerDates();\n this.updateValue(this.value);\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.setupEventListenersForOpenPopup();\n }\n }\n\n componentDidLoad() {\n if (this.inputElement != null) {\n this.eventListeners.add(this.inputElement, 'six-input-input', debounce(this.handleInputChange, this.debounce));\n this.eventListeners.add(this.inputElement, 'six-input-blur', this.handleOnBlur);\n }\n }\n\n componentDidRender() {\n this.adjustPopupPosition();\n }\n\n private renderHeader() {\n return (\n <header class=\"datepicker-header\" part=\"header\">\n <div class=\"datepicker-header__btn prev\" onClick={this.previousUnit}>\n <svg viewBox=\"0 5 13 13\" width=\"14\" height=\"23\">\n <path d=\"M11.67 3.87L9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z\" />\n </svg>\n </div>\n\n <div class=\"datepicker-header__label\">\n {this.selectionMode === SelectionMode.DAY && (\n <div onClick={() => (this.selectionMode = SelectionMode.MONTH)}>\n <span class=\"datepicker-header__label-month\">{this.getMonthStringForIndex(this.pointerDate.month)}</span>\n <span>\n <svg viewBox=\"-3 -4 24 24\" width=\"20\" height=\"20\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </span>\n </div>\n )}\n\n {this.selectionMode !== SelectionMode.YEAR && (\n <div onClick={() => (this.selectionMode = SelectionMode.YEAR)}>\n <span class=\"datepicker-header__label-year\">{this.pointerDate.year}</span>\n <span>\n <svg viewBox=\"-3 -4 24 24\" width=\"20\" height=\"20\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </span>\n </div>\n )}\n\n {this.selectionMode === SelectionMode.YEAR && (\n <div>\n {this.pointerDate.year - Math.floor(NUMBER_OF_YEARS_SHOWN / 2)} –{' '}\n {this.pointerDate.year + Math.floor(NUMBER_OF_YEARS_SHOWN / 2)}\n </div>\n )}\n </div>\n\n <div class=\"datepicker-header__btn next\" onClick={this.nextUnit}>\n <svg viewBox=\"5 5 13 13\" width=\"14\" height=\"23\">\n <path d=\"M5.88 4.12L13.76 12l-7.88 7.88L8 22l10-10L8 2z\" />\n </svg>\n </div>\n </header>\n );\n }\n\n private renderBody() {\n switch (this.selectionMode) {\n case SelectionMode.DAY:\n return (\n <DaySelection\n locale={i18nDate[this.locale]}\n calendarGrid={this.calendarGrid}\n onClickDateCell={this.onClickDateCell}\n />\n );\n case SelectionMode.MONTH:\n return (\n <MonthSelection\n locale={i18nDate[this.locale]}\n selectedDate={this.selectedDate}\n onClickMonthCell={this.onClickMonthCell}\n />\n );\n case SelectionMode.YEAR:\n return (\n <YearSelection\n selectedDate={this.selectedDate}\n yearSelection={rangeAround(this.pointerDate.year, NUMBER_OF_YEARS_SHOWN)}\n onClickYearCell={this.onClickYearCell}\n />\n );\n }\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>today</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n 'datepicker-clear': true,\n 'datepicker-clear--right': this.iconPosition === 'left',\n 'datepicker-clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n render() {\n this.adjustPopupPosition();\n\n return (\n <div ref={(el) => (this.wrapper = el)} class=\"datepicker__container\">\n <six-input\n part=\"base\"\n value={formatDate(this.value, this.dateFormat)}\n ref={(el) => (this.inputElement = el)}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n name={this.name}\n label={this.label}\n required={this.required}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n invalid={this.invalid}\n onClick={() => this.openCalendar()}\n size={this.size}\n class={{ 'input--empty': this.value == null }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n {hasSlot(this.host, 'error-text') ? (\n <span slot=\"error-text\">\n <slot name=\"error-text\"></slot>\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n part=\"popup\"\n ref={(el) => (this.popup = el)}\n class={{\n datepicker__popup: true,\n 'datepicker__popup--is-up': this.placement != null ? this.placement === 'top' : this.isDropDownContentUp,\n 'datepicker__popup--is-inline': this.inline,\n }}\n >\n {this.renderHeader()}\n {this.renderBody()}\n {this.type === 'date-time' && (\n <six-timepicker\n inline={true}\n onSix-timepicker-change-debounced={(event) => this.onTimepickerChange(event)}\n value={\n this.selectedDate?.getHours() +\n ':' +\n this.selectedDate?.getMinutes() +\n ':' +\n this.selectedDate?.getSeconds()\n }\n ></six-timepicker>\n )}\n <div class=\"datepicker__footer\">\n <slot />\n </div>\n </div>\n )}\n </div>\n );\n }\n\n private adjustPopupPosition() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n adjustPopupForSmallScreens(this.popup);\n }\n\n connectedCallback() {\n this.eventListeners.forward('six-datepicker-select', 'change', this.host);\n this.eventListeners.forward('six-datepicker-blur', 'blur', this.host);\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n private static getCurrentDateAsPointer(): PointerDate {\n return {\n year: year(now()),\n month: month(now()),\n day: day(now()),\n hours: hours(now()),\n minutes: minutes(now()),\n seconds: seconds(now()),\n };\n }\n}\n"],"mappings":"kOAAO,MAAMA,EAAYC,UAA2CA,IAAU,SAGvE,MAAMC,EAASD,GAA8CA,GAAS,KCKtE,MAAME,EAAW,CACtBC,GAAI,CACFC,OAAQ,CACN,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,YAEFC,YAAa,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAC3FC,mBAAoB,CAClB,CAAC,MAAO,MAAO,MAAO,OACtB,CAAC,MAAO,MAAO,MAAO,OACtB,CAAC,MAAO,MAAO,MAAO,QAExBC,SAAU,CAAC,SAAU,UAAW,YAAa,WAAY,SAAU,WAAY,UAC/EC,cAAe,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAC1DC,YAAa,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,OAEpDC,GAAI,CACFN,OAAQ,CACN,SACA,UACA,OACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,YAEFC,YAAa,CAAC,OAAQ,OAAQ,OAAQ,OAAQ,MAAO,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,OAAQ,QACrGC,mBAAoB,CAClB,CAAC,OAAQ,OAAQ,OAAQ,QACzB,CAAC,MAAO,OAAQ,OAAQ,QACxB,CAAC,OAAQ,OAAQ,OAAQ,SAE3BC,SAAU,CAAC,SAAU,WAAY,WAAY,aAAc,UAAW,UAAW,WACjFC,cAAe,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAC1DC,YAAa,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,OAEpDE,GAAI,CACFP,OAAQ,CACN,UACA,UACA,OACA,QACA,MACA,OACA,UACA,OACA,YACA,UACA,WACA,YAEFC,YAAa,CAAC,QAAS,QAAS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ErM,QACEiK,EAAAuB,KAAKnD,gBAAY,MAAA4B,SAAA,SAAAA,EAAEpI,YACnB,MACA2M,EAAAhD,KAAKnD,gBAAY,MAAAmG,SAAA,SAAAA,EAAEzM,cACnB,MACAkR,EAAAzH,KAAKnD,gBAAY,MAAA4K,SAAA,SAAAA,EAAEhR,gBAIzBmI,EAAA,OAAKC,MAAM,sBACTD,EAAA,e,CAQJ,mBAAAoF,GACN0D,EACE1H,KAAKmE,MACLnE,KAAKoE,MACLpE,KAAKkB,aACLlB,KAAKqE,QACLxE,IACC8H,GAAU3H,KAAK2E,oBAAsBgD,IAExCC,EAA2B5H,KAAKoE,M,CAGlC,iBAAAyD,GACE7H,KAAKC,eAAe6H,QAAQ,wBAAyB,SAAU9H,KAAKuE,MACpEvE,KAAKC,eAAe6H,QAAQ,sBAAuB,OAAQ9H,KAAKuE,K,CAGlE,oBAAAwD,GACE/H,KAAKC,eAAe+H,W,CAGd,8BAAO7E,GACb,MAAO,CACLnN,KAAMA,EAAKX,KACXa,MAAOA,EAAMb,KACbc,IAAKA,EAAId,KACTe,MAAOA,EAAMf,KACbiB,QAASA,EAAQjB,KACjBmB,QAASA,EAAQnB,K"}
@@ -0,0 +1,2 @@
1
+ import{r,h as o}from"./p-6153045b.js";const s=".six-error-container{text-align:left;color:var(--six-color-danger-800);width:100%}";const t=class{constructor(o){r(this,o)}render(){return o("div",{class:"six-error-container"},o("slot",null))}};t.style=s;export{t as six_error};
2
+ //# sourceMappingURL=p-25bb1752.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixErrorCss","SixError","render","h","class"],"sources":["src/components/six-error/six-error.scss?tag=six-error&encapsulation=shadow","src/components/six-error/six-error.tsx"],"sourcesContent":[".six-error-container {\n text-align: left;\n color: var(--six-color-danger-800);\n width: 100%;\n}\n","import { Component, h } from '@stencil/core';\n\n/**\n * @since 4.0\n * @status beta\n *\n * @slot default - The error's message content\n */\n\n@Component({\n tag: 'six-error',\n styleUrl: 'six-error.scss',\n shadow: true,\n})\nexport class SixError {\n render() {\n return (\n <div class=\"six-error-container\">\n <slot />\n </div>\n );\n }\n}\n"],"mappings":"sCAAA,MAAMA,EAAc,qF,MCcPC,EAAQ,M,yBACnB,MAAAC,GACE,OACEC,EAAA,OAAKC,MAAM,uBACTD,EAAA,a"}
@@ -0,0 +1,2 @@
1
+ import{r as i,c as s,h as t}from"./p-6153045b.js";import{s as e}from"./p-1f18768a.js";const o=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{display:block;height:100%}.sidebar__container{height:100%;overflow:auto}.sidebar__container.sidebar--open{box-shadow:var(--six-elevation-1dp);padding:0 var(--six-spacing-small)}.sidebar__container:not(.sidebar--visible){position:absolute;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;pointer-events:none;visibility:hidden}.sidebar--left{color:var(--six-sidebar-color);background-color:var(--six-sidebar-background-color);transition:var(--six-transition-medium) margin-left;background-size:300vw 70%;background-position:bottom;background-repeat:no-repeat}.sidebar--right{transition:var(--six-transition-medium) margin-right}.sidebar--open.sidebar--left{margin-right:2px}.sidebar--open.sidebar--right{margin-left:2px}";const n=i=>{var s;return((s=i===null||i===void 0?void 0:i.tagName)===null||s===void 0?void 0:s.toLowerCase())==="six-sidebar-item-group"};const r=class{constructor(t){i(this,t);this.sixShow=s(this,"six-sidebar-show",7);this.sixAfterShow=s(this,"six-sidebar-after-show",7);this.sixHide=s(this,"six-sidebar-hide",7);this.sixAfterHide=s(this,"six-sidebar-after-hide",7);this.sixInitialFocus=s(this,"six-sidebar-initial-focus",7);this.willShow=false;this.willHide=false;this.handleTransitionEnd=i=>{const s=i.target;if(i.type==="transitionend"&&s.classList.contains("sidebar__container")){this.resetTransitionVariables()}};this.closeSiblingDetailsOnShow=i=>{const s=i.target;if(this.sidebar!=null){e(s,this.sidebar)}const t=i=>{var t;let e=s;while(i(e)!=null){e=i(e);if(n(e)){const i=(t=e===null||e===void 0?void 0:e.shadowRoot)===null||t===void 0?void 0:t.querySelector("six-details");if(i!=null){i.open=false}}}};t((i=>i===null||i===void 0?void 0:i.previousElementSibling));t((i=>i===null||i===void 0?void 0:i.nextElementSibling))};this.isVisible=false;this.position="left";this.open=false;this.width="16rem";this.toggled=false}handleOpenChange(){this.open?this.show():this.hide()}componentWillLoad(){if(this.open){void this.show();this.resetTransitionVariables()}}componentDidRender(){this.setupTogglableMenuItems()}disconnectedCallback(){var i;(i=this.sidebar)===null||i===void 0?void 0:i.removeEventListener("six-details-show",this.closeSiblingDetailsOnShow)}setupTogglableMenuItems(){if(!this.toggled||this.sidebar==null)return;this.markAllMenuItemsAsSelectableEmpty();this.sidebar.addEventListener("six-details-show",this.closeSiblingDetailsOnShow)}markAllMenuItemsAsSelectableEmpty(){var i;const s=(i=this.sidebar)===null||i===void 0?void 0:i.querySelector("slot");const t=(s===null||s===void 0?void 0:s.assignedElements())||[];const e=[];while(t.length>0){const i=t.pop();if((i===null||i===void 0?void 0:i.shadowRoot)==null){continue}const s=i.shadowRoot.querySelectorAll("six-details");e.push(...s);const o=Array.from(i.children).filter(n);t.push(...o)}e.forEach((i=>i.selectableEmpty=true))}async toggle(){if(this.willShow||this.willHide){return}if(this.open){await this.hide()}else{await this.show()}}async show(){if(this.willShow){return}const i=this.sixShow.emit();if(i.defaultPrevented){this.open=false;return}this.willShow=true;this.isVisible=true;this.open=true}async hide(){if(this.willHide){return}const i=this.sixHide.emit();if(i.defaultPrevented){this.open=true;return}this.willHide=true;this.open=false}async selectItemByIndex(i){if(this.sidebar==null)return;const s=this.sidebar.querySelector("slot");const t=((s===null||s===void 0?void 0:s.assignedElements())||[]).flatMap((i=>{var s;const t=(s=i.shadowRoot)===null||s===void 0?void 0:s.querySelector("six-details");if(t==null){return[]}return[t]}));if(i<0||i>t.length-1){console.error(`Tried to access sidebar menu item by index, but provided index out of range. Provided index: ${i}`);return}await t[i].show()}async selectItemByName(i){var s,t,e;const o=(s=this.sidebar)===null||s===void 0?void 0:s.querySelector("slot");const n=o===null||o===void 0?void 0:o.assignedElements();if(n==null){return}const r=n.findIndex((s=>(s===null||s===void 0?void 0:s.name)===i));const a=(e=(t=n.at(r))===null||t===void 0?void 0:t.shadowRoot)===null||e===void 0?void 0:e.querySelector("six-details");await(a===null||a===void 0?void 0:a.show())}resetTransitionVariables(){this.isVisible=this.open;this.willShow=false;this.willHide=false;this.open?this.sixAfterShow.emit():this.sixAfterHide.emit()}render(){return t("host",{class:"six-sidebar"},t("div",{class:{sidebar__container:true,"sidebar--visible":this.isVisible,"sidebar--open":this.open,"sidebar--left":this.position==="left","sidebar--right":this.position==="right"},style:{width:this.width,[`margin-${this.position}`]:this.open?"0":`calc(1rem - ${this.width})`},ref:i=>this.sidebar=i,"aria-hidden":this.open?"false":"true",onTransitionEnd:this.handleTransitionEnd},t("slot",null)))}static get watchers(){return{open:["handleOpenChange"]}}};r.style=o;export{r as six_sidebar};
2
+ //# sourceMappingURL=p-2a141e10.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixSidebarCss","isSidebarItemGroup","node","_a","tagName","toLowerCase","SixSidebar","this","willShow","willHide","handleTransitionEnd","event","target","type","classList","contains","resetTransitionVariables","closeSiblingDetailsOnShow","clickedMenuItem","sidebar","scrollIntoView","closeAllSiblingsBySiblingProperty","getSibling","detailsElement","shadowRoot","querySelector","open","previousElementSibling","nextElementSibling","handleOpenChange","show","hide","componentWillLoad","componentDidRender","setupTogglableMenuItems","disconnectedCallback","removeEventListener","toggled","markAllMenuItemsAsSelectableEmpty","addEventListener","slot","nodes","assignedElements","menuItems","length","pop","menuItemsForCurrentNode","querySelectorAll","push","newItemGroups","Array","from","children","filter","forEach","details","selectableEmpty","toggle","sixShow","emit","defaultPrevented","isVisible","sixHide","selectItemByIndex","index","menuItemsOnRootLevel","flatMap","el","console","error","selectItemByName","value","sidebarItemGroups","indexOfSelectedElement","findIndex","name","selectedItem","_c","_b","at","sixAfterShow","sixAfterHide","render","h","class","sidebar__container","position","style","width","ref","onTransitionEnd"],"sources":["src/components/six-sidebar/six-sidebar.scss?tag=six-sidebar&encapsulation=shadow","src/components/six-sidebar/six-sidebar.tsx"],"sourcesContent":["@import 'src/global/component';\n@import 'src/global/mixins/hidden';\n@import 'src/global/mixins/scrollbar';\n\n:host {\n display: block;\n height: 100%;\n}\n\n.sidebar {\n &__container {\n // scroll\n height: 100%;\n overflow: auto;\n\n &.sidebar--open {\n box-shadow: var(--six-elevation-1dp);\n padding: 0 var(--six-spacing-small);\n }\n\n &:not(.sidebar--visible) {\n @include hidden;\n }\n }\n\n &--left {\n color: var(--six-sidebar-color);\n background-color: var(--six-sidebar-background-color);\n // collapse\n transition: var(--six-transition-medium) margin-left;\n // six background\n background-size: 300vw 70%;\n background-position: bottom;\n background-repeat: no-repeat;\n }\n\n &--right {\n // collapse\n transition: var(--six-transition-medium) margin-right;\n }\n\n // if the sidebar is embedded within six-root it cuts-off the border styling, for thus we need to guarante a margin\n &--open {\n &.sidebar--left {\n margin-right: 2px;\n }\n\n &.sidebar--right {\n margin-left: 2px;\n }\n }\n}\n","import { Component, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { scrollIntoView } from '../../utils/scroll';\n\nconst isSidebarItemGroup = (node?: Element | null): boolean =>\n node?.tagName?.toLowerCase() === 'six-sidebar-item-group';\n\n/**\n * @since 1.0\n * @status stable\n *\n * @slot - Used to define the nested side bar [group] items.\n */\n\n@Component({\n tag: 'six-sidebar',\n styleUrl: 'six-sidebar.scss',\n shadow: true,\n})\nexport class SixSidebar {\n private willShow = false;\n private willHide = false;\n\n private sidebar?: HTMLElement;\n\n @State() isVisible = false;\n\n /** Sidebar position */\n @Prop() position: 'left' | 'right' = 'left';\n\n /** Indicates whether the sidebar is open. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Sidebar width */\n @Prop() width = '16rem';\n\n /** Define whether sidebar is toggled meaning only one menu can be open at the same time*/\n @Prop() toggled = false;\n\n /** Emitted when the sidebar opens. Calling `event.preventDefault()` will prevent it from being opened. */\n @Event({ eventName: 'six-sidebar-show' }) sixShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the sidebar opens and all transitions are complete. */\n @Event({ eventName: 'six-sidebar-after-show' }) sixAfterShow!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the sidebar closes. Calling `event.preventDefault()` will prevent it from being closed. */\n @Event({ eventName: 'six-sidebar-hide' }) sixHide!: EventEmitter<EmptyPayload>;\n\n /** Emitted after the sidebar closes and all transitions are complete. */\n @Event({ eventName: 'six-sidebar-after-hide' }) sixAfterHide!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when the sidebar opens and the panel gains focus. Calling `event.preventDefault()` will prevent focus and\n * allow you to set it on a different element in the sidebar, such as an input or button.\n */\n @Event({ eventName: 'six-sidebar-initial-focus' }) sixInitialFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('open')\n handleOpenChange() {\n this.open ? this.show() : this.hide();\n }\n\n private handleTransitionEnd = (event: TransitionEvent) => {\n const target = event.target as HTMLElement;\n\n // Ensure we only emit one event when the target element is no longer visible\n if (event.type === 'transitionend' && target.classList.contains('sidebar__container')) {\n this.resetTransitionVariables();\n }\n };\n\n componentWillLoad() {\n // Show on init if open\n if (this.open) {\n void this.show();\n // if the sidebar is open by default we need to manually reset the\n // transition variables since there will be no transition event\n this.resetTransitionVariables();\n }\n }\n\n componentDidRender() {\n this.setupTogglableMenuItems();\n }\n\n disconnectedCallback() {\n this.sidebar?.removeEventListener('six-details-show', this.closeSiblingDetailsOnShow);\n }\n\n private closeSiblingDetailsOnShow = (event: Event) => {\n const clickedMenuItem = event.target as HTMLElement;\n if (this.sidebar != null) {\n scrollIntoView(clickedMenuItem, this.sidebar);\n }\n\n const closeAllSiblingsBySiblingProperty = (\n getSibling: (node: Element | null | undefined) => Element | null | undefined\n ) => {\n let node: Element | null | undefined = clickedMenuItem;\n while (getSibling(node) != null) {\n node = getSibling(node);\n if (isSidebarItemGroup(node)) {\n const detailsElement = node?.shadowRoot?.querySelector('six-details');\n if (detailsElement != null) {\n detailsElement.open = false;\n }\n }\n }\n };\n\n // close all previous siblings\n closeAllSiblingsBySiblingProperty((node) => node?.previousElementSibling);\n // close all further siblings\n closeAllSiblingsBySiblingProperty((node) => node?.nextElementSibling);\n };\n\n private setupTogglableMenuItems() {\n if (!this.toggled || this.sidebar == null) return;\n this.markAllMenuItemsAsSelectableEmpty();\n this.sidebar.addEventListener('six-details-show', this.closeSiblingDetailsOnShow);\n }\n\n private markAllMenuItemsAsSelectableEmpty() {\n // when you have a toggled menu you also want to close other menu items when you click on an item without children\n // nice benefit this item will then also be highlighted\n const slot = this.sidebar?.querySelector('slot');\n const nodes = slot?.assignedElements() || [];\n\n // since we don't just want to make the top level empty menuItems selectable in toggled mode,\n // but also nested items we need to traverse the whole menu item tree\n const menuItems = [];\n while (nodes.length > 0) {\n const node = nodes.pop();\n if (node?.shadowRoot == null) {\n continue;\n }\n\n // collect six-details in the current shadowDOM\n const menuItemsForCurrentNode = node.shadowRoot.querySelectorAll('six-details');\n menuItems.push(...menuItemsForCurrentNode);\n\n // collect all six-sidebar-item-group children of the current node to afterwards check their shadowDOM too\n const newItemGroups = Array.from(node.children).filter(isSidebarItemGroup);\n nodes.push(...newItemGroups);\n }\n\n menuItems.forEach((details) => (details.selectableEmpty = true));\n }\n\n /** Toggles whether the sidebar should be shown or hidden */\n @Method()\n async toggle() {\n if (this.willShow || this.willHide) {\n return;\n }\n\n if (this.open) {\n await this.hide();\n } else {\n await this.show();\n }\n }\n\n /** Shows the sidebar */\n @Method()\n async show() {\n if (this.willShow) {\n return;\n }\n\n const sixShow = this.sixShow.emit();\n if (sixShow.defaultPrevented) {\n this.open = false;\n return;\n }\n\n this.willShow = true;\n this.isVisible = true;\n this.open = true;\n }\n\n /** Hides the sidebar */\n @Method()\n async hide() {\n if (this.willHide) {\n return;\n }\n\n const sixHide = this.sixHide.emit();\n if (sixHide.defaultPrevented) {\n this.open = true;\n return;\n }\n\n this.willHide = true;\n this.open = false;\n }\n\n /** Allows to select a menu item programmatically by index */\n @Method()\n async selectItemByIndex(index: number) {\n if (this.sidebar == null) return;\n\n const slot = this.sidebar.querySelector('slot');\n const menuItemsOnRootLevel: HTMLSixDetailsElement[] = (slot?.assignedElements() || []).flatMap((el) => {\n const detailsElement = el.shadowRoot?.querySelector('six-details');\n if (detailsElement == null) {\n return [];\n }\n return [detailsElement];\n });\n if (index < 0 || index > menuItemsOnRootLevel.length - 1) {\n console.error(\n `Tried to access sidebar menu item by index, but provided index out of range. Provided index: ${index}`\n );\n return;\n }\n await menuItemsOnRootLevel[index].show();\n }\n\n /** Allows to select a menu item programmatically by name */\n @Method()\n async selectItemByName(value: string) {\n const slot = this.sidebar?.querySelector('slot');\n const sidebarItemGroups = slot?.assignedElements() as HTMLSixSidebarItemGroupElement[];\n if (sidebarItemGroups == null) {\n return;\n }\n\n const indexOfSelectedElement = sidebarItemGroups.findIndex((el) => el?.name === value);\n const selectedItem = sidebarItemGroups.at(indexOfSelectedElement)?.shadowRoot?.querySelector('six-details');\n await selectedItem?.show();\n }\n\n private resetTransitionVariables() {\n this.isVisible = this.open;\n this.willShow = false;\n this.willHide = false;\n this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();\n }\n\n render() {\n return (\n <host class=\"six-sidebar\">\n <div\n class={{\n sidebar__container: true,\n 'sidebar--visible': this.isVisible,\n 'sidebar--open': this.open,\n 'sidebar--left': this.position === 'left',\n 'sidebar--right': this.position === 'right',\n }}\n style={{\n width: this.width,\n [`margin-${this.position}`]: this.open ? '0' : `calc(1rem - ${this.width})`,\n }}\n ref={(el) => (this.sidebar = el)}\n aria-hidden={this.open ? 'false' : 'true'}\n onTransitionEnd={this.handleTransitionEnd}\n >\n <slot />\n </div>\n </host>\n );\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAAgB,y1BCItB,MAAMC,EAAsBC,IAAqB,IAAAC,EAC/C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AAUjF,KAAK+E,YAAa/E,KAAKmB,KAAO,IAAM,eAAenB,KAAKiF,UAErEC,IAAMtB,GAAQ5D,KAAKY,QAAUgD,EAAG,cACnB5D,KAAKmB,KAAO,QAAU,OACnCgE,gBAAiBnF,KAAKG,qBAEtByE,EAAA,c"}
@@ -0,0 +1,2 @@
1
+ import{r as o,c as t,h as r,g as i}from"./p-6153045b.js";import{F as e}from"./p-e5020f0d.js";import{h as a}from"./p-15559d38.js";import{E as s}from"./p-7d95def3.js";const l=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{--thumb-size:14px;--tooltip-offset-y:10px;--track-color:var(--six-color-web-rock-900);--thumb-color:var(--six-color-web-rock-900);--track-height:3px;display:block}.range{position:relative}.range .range__control{-webkit-appearance:none;width:100%;height:var(--six-input-height-medium);background:transparent;line-height:var(--six-input-height-medium);vertical-align:middle}.range .range__control::-webkit-slider-runnable-track{width:100%;height:var(--track-height);border-radius:3px;border:none}.range .range__control::-webkit-slider-thumb{border:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);-webkit-appearance:none;margin-top:calc(var(--thumb-size) / -2 + var(--track-height) / 2);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-webkit-slider-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-webkit-slider-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-webkit-slider-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control::-moz-focus-outer{border:0}.range .range__control::-moz-range-track{width:100%;height:var(--track-height);background-color:var(--six-progress-track-color);border-radius:3px;border:none}.range .range__control::-moz-range-progress{height:var(--track-height);border-radius:3px;background-color:var(--track-color);border:none}.range .range__control::-moz-range-thumb{border:none;height:var(--thumb-size);width:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-moz-range-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-moz-range-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-moz-range-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control:focus{outline:none}.range .range__control:disabled::-webkit-slider-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range .range__control:disabled::-moz-range-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range__tooltip{position:absolute;z-index:var(--six-z-index-tooltip);left:1px;border-radius:var(--six-border-radius-medium);background-color:var(--six-color-web-rock-900);font-family:var(--six-font-family);font-size:var(--six-tooltip-font-size);font-weight:var(--six-tooltip-font-weight);line-height:var(--six-tooltip-line-height);color:var(--six-color-white);opacity:0;padding:var(--six-spacing-xxx-small) var(--six-spacing-xx-small);transition:var(--six-transition-fast) opacity;pointer-events:none}.range__tooltip::after{content:"";position:absolute;width:0;height:0;left:50%;margin-left:calc(-1 * var(--six-tooltip-arrow-size))}.range--tooltip-visible .range__tooltip{opacity:1}.range--tooltip-top .range__tooltip{top:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-top .range__tooltip::after{border-top:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;top:100%}.range--tooltip-bottom .range__tooltip{bottom:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-bottom .range__tooltip::after{border-bottom:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;bottom:100%}';let n=0;const h=class{constructor(r){o(this,r);this.sixChange=t(this,"six-range-change",7);this.sixBlur=t(this,"six-range-blur",7);this.sixFocus=t(this,"six-range-focus",7);this.inputId=`input-${++n}`;this.labelId=`input-label-${n}`;this.helpTextId=`input-help-text-${n}`;this.errorTextId=`input-error-text-${n}`;this.eventListeners=new s;this.handleInput=()=>{if(this.nativeInput!=null){this.update(parseFloat(this.nativeInput.value))}requestAnimationFrame((()=>{this.sixChange.emit()}))};this.handleBlur=()=>{var o;this.hasFocus=false;this.hasTooltip=false;this.sixBlur.emit();if(this.nativeInput!=null){(o=this.resizeObserver)===null||o===void 0?void 0:o.unobserve(this.nativeInput)}};this.handleFocus=()=>{var o;this.hasFocus=true;this.hasTooltip=true;this.sixFocus.emit();if(this.nativeInput!=null){(o=this.resizeObserver)===null||o===void 0?void 0:o.observe(this.nativeInput)}};this.handleSlotChange=()=>{this.hasHelpTextSlot=a(this.host,"help-text");this.hasLabelSlot=a(this.host,"label");this.hasErrorTextSlot=a(this.host,"error-text")};this.handleTouchStart=()=>{this.setFocus()};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasErrorTextSlot=false;this.hasLabelSlot=false;this.hasTooltip=false;this.name="";this.value=0;this.required=false;this.helpText="";this.disabled=false;this.label="";this.errorText="";this.errorTextCount=undefined;this.invalid=false;this.min=0;this.max=100;this.step=1;this.tooltip="top";this.tooltipFormatter=o=>o.toString()}handleLabelChange(){this.handleSlotChange()}handleValueChange(){this.update()}connectedCallback(){var o;(o=this.host.shadowRoot)===null||o===void 0?void 0:o.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){this.update();this.handleSlotChange()}componentDidLoad(){const o=this.nativeInput;if(o==null){return}this.update();this.resizeObserver=new ResizeObserver((()=>this.update()))}disconnectedCallback(){var o;(o=this.host.shadowRoot)===null||o===void 0?void 0:o.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(o){var t;(t=this.nativeInput)===null||t===void 0?void 0:t.focus(o)}async removeFocus(){var o;(o=this.nativeInput)===null||o===void 0?void 0:o.blur()}syncTooltip(o,t,r){if(this.tooltip!=="none"&&this.nativeInput!=null&&this.output!=null){const i=Math.max(0,(r-o)/(t-o));const e=this.nativeInput.offsetWidth;const a=this.output.offsetWidth;const s=getComputedStyle(this.nativeInput).getPropertyValue("--thumb-size");const l=`calc(${e*i}px - calc(calc(${i} * ${s}) - calc(${s} / 2)))`;this.output.style.transform=`translateX(${l})`;this.output.style.marginLeft=`-${a/2}px`}}isFirefox(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}update(o){var t,r;if(o!=null){this.value=o}const i=(t=Number(this.min))!==null&&t!==void 0?t:0;const e=(r=Number(this.max))!==null&&r!==void 0?r:0;let a;const s=parseFloat(this.value);if(isNaN(s)){a=this.getDefaultValue(i,e)}else{a=s}if(this.nativeInput!=null){this.nativeInput.value=a.toString();this.value=parseFloat(this.nativeInput.value)}else{this.value=a}this.calculateColorRunnableTrack(i,e,this.value);this.syncTooltip(i,e,this.value)}getDefaultValue(o,t){return t<o?o:o+(t-o)/2}calculateColorRunnableTrack(o,t,r){if(!this.isFirefox()&&this.nativeInput!=null){const i=Math.ceil((r-o)/(t-o)*100);this.nativeInput.style.background="-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) "+i+"%, var(--six-color-web-rock-300) "+i+"%)"}}render(){return r(e,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,size:"medium",errorTextId:this.errorTextId,errorText:this.errorText,hasErrorTextSlot:this.hasErrorTextSlot,errorTextCount:this.errorTextCount,disabled:this.disabled,required:this.required,displayError:this.invalid},r("div",{part:"base",class:{range:true,"range--disabled":this.disabled,"range--focused":this.hasFocus,"range--tooltip-visible":this.hasTooltip,"range--tooltip-top":this.tooltip==="top","range--tooltip-bottom":this.tooltip==="bottom"},onTouchStart:this.handleTouchStart},r("input",{part:"input",ref:o=>this.nativeInput=o,type:"range",class:"range__control",name:this.name,disabled:this.disabled,min:this.min,max:this.max,step:this.step,value:this.value,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),this.tooltip!=="none"&&r("output",{part:"tooltip",ref:o=>this.output=o,class:"range__tooltip"},this.tooltipFormatter(this.value))))}get host(){return i(this)}static get watchers(){return{label:["handleLabelChange"],errorText:["handleLabelChange"],helpText:["handleLabelChange"],value:["handleValueChange"],min:["handleValueChange"],max:["handleValueChange"]}}};h.style=l;export{h as six_range};
2
+ //# sourceMappingURL=p-4435ff73.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixRangeCss","id","SixRange","this","inputId","labelId","helpTextId","errorTextId","eventListeners","EventListeners","handleInput","nativeInput","update","parseFloat","value","requestAnimationFrame","sixChange","emit","handleBlur","hasFocus","hasTooltip","sixBlur","_a","resizeObserver","unobserve","handleFocus","sixFocus","observe","handleSlotChange","hasHelpTextSlot","hasSlot","host","hasLabelSlot","hasErrorTextSlot","handleTouchStart","setFocus","toString","handleLabelChange","handleValueChange","connectedCallback","shadowRoot","addEventListener","componentWillLoad","componentDidLoad","ResizeObserver","disconnectedCallback","removeEventListener","removeAll","options","focus","removeFocus","blur","syncTooltip","min","max","tooltip","output","percent","Math","inputWidth","offsetWidth","tooltipWidth","thumbSize","getComputedStyle","getPropertyValue","x","style","transform","marginLeft","isFirefox","navigator","userAgent","toLowerCase","indexOf","updateValue","Number","_b","parsedValue","isNaN","getDefaultValue","calculateColorRunnableTrack","ceil","background","render","h","FormControl","label","helpText","size","errorText","errorTextCount","disabled","required","displayError","invalid","part","class","range","onTouchStart","ref","el","type","name","step","onInput","onFocus","onBlur","tooltipFormatter"],"sources":["src/components/six-range/six-range.scss?tag=six-range&encapsulation=shadow","src/components/six-range/six-range.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n --thumb-size: 14px;\n --tooltip-offset-y: 10px;\n --track-color: var(--six-color-web-rock-900);\n --thumb-color: var(--six-color-web-rock-900);\n --track-height: 3px;\n\n display: block;\n}\n\n.range {\n position: relative;\n\n .range__control {\n -webkit-appearance: none;\n width: 100%;\n height: var(--six-input-height-medium);\n background: transparent;\n line-height: var(--six-input-height-medium);\n vertical-align: middle;\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: var(--track-height);\n border-radius: 3px;\n border: none;\n }\n\n &::-webkit-slider-thumb {\n border: none;\n width: var(--thumb-size);\n height: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n -webkit-appearance: none;\n margin-top: calc(var(--thumb-size) / -2 + var(--track-height) / 2);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-webkit-slider-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-webkit-slider-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-webkit-slider-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // Firefox\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-track {\n width: 100%;\n height: var(--track-height);\n background-color: var(--six-progress-track-color);\n border-radius: 3px;\n border: none;\n }\n\n &::-moz-range-progress {\n height: var(--track-height);\n border-radius: 3px;\n background-color: var(--track-color);\n border: none;\n }\n\n &::-moz-range-thumb {\n border: none;\n height: var(--thumb-size);\n width: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-moz-range-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-moz-range-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-moz-range-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // States\n &:focus {\n outline: none;\n }\n\n &:disabled {\n &::-webkit-slider-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n\n &::-moz-range-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n }\n }\n}\n\n// Tooltip\n.range__tooltip {\n position: absolute;\n z-index: var(--six-z-index-tooltip);\n left: 1px;\n border-radius: var(--six-border-radius-medium);\n background-color: var(--six-color-web-rock-900);\n font-family: var(--six-font-family);\n font-size: var(--six-tooltip-font-size);\n font-weight: var(--six-tooltip-font-weight);\n line-height: var(--six-tooltip-line-height);\n color: var(--six-color-white);\n opacity: 0;\n padding: var(--six-spacing-xxx-small) var(--six-spacing-xx-small);\n transition: var(--six-transition-fast) opacity;\n pointer-events: none;\n\n &::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n left: 50%;\n margin-left: calc(-1 * var(--six-tooltip-arrow-size));\n }\n}\n\n.range--tooltip-visible .range__tooltip {\n opacity: 1;\n}\n\n// Tooltip on top\n.range--tooltip-top .range__tooltip {\n top: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-top: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n top: 100%;\n }\n}\n\n// Tooltip on bottom\n.range--tooltip-bottom .range__tooltip {\n bottom: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-bottom: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n bottom: 100%;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part input - The native range input.\n * @part tooltip - The range tooltip.\n */\n@Component({\n tag: 'six-range',\n styleUrl: 'six-range.scss',\n shadow: true,\n})\nexport class SixRange {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private eventListeners = new EventListeners();\n private resizeObserver?: ResizeObserver;\n\n private output?: HTMLElement;\n private nativeInput?: HTMLInputElement;\n\n @Element() host!: HTMLSixRangeElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasErrorTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasTooltip = false;\n\n /** The input's name attribute. */\n @Prop() name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true }) value = 0;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The range's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Set to true to disable the input. */\n @Prop() disabled = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's min attribute. */\n @Prop() min = 0;\n\n /** The input's max attribute. */\n @Prop() max = 100;\n\n /** The input's step attribute. */\n @Prop() step = 1;\n\n /** The preferred placedment of the tooltip. */\n @Prop() tooltip: 'top' | 'bottom' | 'none' = 'top';\n\n /** A function used to format the tooltip's value. */\n @Prop() tooltipFormatter = (value: number) => value.toString();\n\n /** Emitted when the control's value changes. */\n @Event({ eventName: 'six-range-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-range-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-range-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('label')\n @Watch('errorText')\n @Watch('helpText')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n @Watch('min')\n @Watch('max')\n handleValueChange() {\n this.update();\n }\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n componentWillLoad() {\n this.update();\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n this.update();\n this.resizeObserver = new ResizeObserver(() => this.update());\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n private handleInput = () => {\n if (this.nativeInput != null) {\n this.update(parseFloat(this.nativeInput.value));\n }\n requestAnimationFrame(() => {\n this.sixChange.emit();\n });\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.hasTooltip = false;\n this.sixBlur.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.unobserve(this.nativeInput);\n }\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.hasTooltip = true;\n this.sixFocus.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.observe(this.nativeInput);\n }\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n };\n\n private handleTouchStart = () => {\n this.setFocus();\n };\n\n private syncTooltip(min: number, max: number, value: number) {\n if (this.tooltip !== 'none' && this.nativeInput != null && this.output != null) {\n const percent = Math.max(0, (value - min) / (max - min));\n const inputWidth = this.nativeInput.offsetWidth;\n const tooltipWidth = this.output.offsetWidth;\n const thumbSize = getComputedStyle(this.nativeInput).getPropertyValue('--thumb-size');\n const x = `calc(${inputWidth * percent}px - calc(calc(${percent} * ${thumbSize}) - calc(${thumbSize} / 2)))`;\n this.output.style.transform = `translateX(${x})`;\n this.output.style.marginLeft = `-${tooltipWidth / 2}px`;\n }\n }\n\n private isFirefox() {\n return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n }\n\n private update(updateValue?: number) {\n if (updateValue != null) {\n this.value = updateValue;\n }\n\n const min = Number(this.min) ?? 0;\n const max = Number(this.max) ?? 0;\n let value;\n const parsedValue = parseFloat(this.value as never);\n if (isNaN(parsedValue)) {\n value = this.getDefaultValue(min, max);\n } else {\n value = parsedValue;\n }\n\n if (this.nativeInput != null) {\n // The value may have constraints, so we set the native control's\n // value and sync it back to ensure it adheres to min, max, and step\n // properly.\n this.nativeInput.value = value.toString();\n this.value = parseFloat(this.nativeInput.value);\n } else {\n this.value = value;\n }\n this.calculateColorRunnableTrack(min, max, this.value);\n this.syncTooltip(min, max, this.value);\n }\n\n /**\n * from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range#value\n */\n private getDefaultValue(min: number, max: number): number {\n return max < min ? min : min + (max - min) / 2;\n }\n\n /**\n * For Firefox this functionality is not needed because it is supported by standard CSS.\n */\n private calculateColorRunnableTrack(min: number, max: number, value: number) {\n if (!this.isFirefox() && this.nativeInput != null) {\n const percent = Math.ceil(((value - min) / (max - min)) * 100);\n this.nativeInput.style.background =\n '-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) ' +\n percent +\n '%, var(--six-color-web-rock-300) ' +\n percent +\n '%)';\n }\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n size=\"medium\"\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n errorTextCount={this.errorTextCount}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n range: true,\n\n // States\n 'range--disabled': this.disabled,\n 'range--focused': this.hasFocus,\n 'range--tooltip-visible': this.hasTooltip,\n 'range--tooltip-top': this.tooltip === 'top',\n 'range--tooltip-bottom': this.tooltip === 'bottom',\n }}\n onTouchStart={this.handleTouchStart}\n >\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n type=\"range\"\n class=\"range__control\"\n name={this.name}\n disabled={this.disabled}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.value}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n {this.tooltip !== 'none' && (\n <output part=\"tooltip\" ref={(el) => (this.output = el)} class=\"range__tooltip\">\n {this.tooltipFormatter(this.value)}\n </output>\n )}\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"qKAAA,MAAMA,EAAc,y8MCMpB,IAAIC,EAAK,E,MAqBIC,EAAQ,M,uJACXC,KAAAC,QAAU,WAAWH,IACrBE,KAAAE,QAAU,eAAeJ,IACzBE,KAAAG,WAAa,mBAAmBL,IAChCE,KAAAI,YAAc,oBAAoBN,IAClCE,KAAAK,eAAiB,IAAIC,EAkHrBN,KAAAO,YAAc,KACpB,GAAIP,KAAKQ,aAAe,KAAM,CAC5BR,KAAKS,OAAOC,WAAWV,KAAKQ,YAAYG,O,CAE1CC,uBAAsB,KACpBZ,KAAKa,UAAUC,MAAM,GACrB,EAGId,KAAAe,WAAa,K,MACnBf,KAAKgB,S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ACXX,SAAUxF,KAAKwF,SACftC,IAAKlD,KAAKkD,IACVC,IAAKnD,KAAKmD,IACViD,KAAMpG,KAAKoG,KACXzF,MAAOX,KAAKW,MACZ0F,QAASrG,KAAKO,YACd+F,QAAStG,KAAKsB,YACdiF,OAAQvG,KAAKe,aAEdf,KAAKoD,UAAY,QAChB6B,EAAA,UAAQW,KAAK,UAAUI,IAAMC,GAAQjG,KAAKqD,OAAS4C,EAAKJ,MAAM,kBAC3D7F,KAAKwG,iBAAiBxG,KAAKW,S"}
@@ -0,0 +1,2 @@
1
+ import{r as i,c as t,h as o,g as r}from"./p-6153045b.js";import{F as s}from"./p-e5020f0d.js";import{h as e}from"./p-15559d38.js";import{E as n}from"./p-7d95def3.js";import{s as l}from"./p-8c0971e0.js";const a=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.input{display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.input--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.input:hover:not(.input--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.input:hover:not(.input--disabled) .input__control{color:var(--six-input-color-hover)}.input.input--focused:not(.input--disabled){background-color:var(--six-input-background-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.input.input--focused:not(.input--disabled):not(.input--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.input.input--focused:not(.input--disabled) .input__control{color:var(--six-input-color-focus)}.input.input--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.input.input--disabled .input__control{color:var(--six-input-color-disabled)}.input.input--disabled .input__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.input.input--invalid:not(.input--disabled):not(.input--focused){border-bottom-color:var(--six-input-border-color-danger)}.input.input--invalid:not(.input--disabled):not(.input--focused):not(.input--line){border-color:var(--six-input-border-color-danger)}.input__control{flex:1 1 auto;font-family:inherit;font-size:inherit;font-weight:inherit;min-width:0;color:var(--six-input-color);border:none;background:none;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--six-color-primary-500)}.input__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.input__control::-ms-reveal{display:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default}.input__prefix ::slotted(six-icon),.input__suffix ::slotted(six-icon){color:var(--six-input-icon-color)}.input.input--disabled ::slotted(six-icon){cursor:not-allowed}.input--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);height:var(--six-height-small)}.input--small .input__control{height:calc(var(--six-height-small) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-small)}.input--small .input__control__prefix{margin:0 var(--six-input-prefix-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{margin-right:var(--six-input-spacing-small)}.input--small .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-small)}.input--small .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-small)}.input--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);height:var(--six-height-medium)}.input--medium .input__control{height:calc(var(--six-height-medium) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-medium)}.input--medium .input__control__prefix{margin:0 var(--six-input-prefix-spacing-medium)}.input--medium .input__clear,.input--medium .input__password-toggle{margin-right:var(--six-input-spacing-medium)}.input--medium .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-medium)}.input--medium .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-medium)}.input--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);height:var(--six-height-large)}.input--large .input__control{height:calc(var(--six-height-large) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-large)}.input--large .input__control__prefix{margin:0 var(--six-input-prefix-spacing-large)}.input--large .input__clear,.input--large .input__password-toggle{margin-right:var(--six-input-spacing-large)}.input--large .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-large)}.input--large .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-large)}.input--pill.input--small{border-radius:var(--six-height-small)}.input--pill.input--medium{border-radius:var(--six-height-medium)}.input--pill.input--large{border-radius:var(--six-height-large)}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.input__clear:hover,.input__password-toggle:hover{color:var(--six-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}';const u={large:"medium",medium:"small",small:"xSmall"};let p=0;const h=class{constructor(o){i(this,o);this.sixChange=t(this,"six-input-change",7);this.sixClear=t(this,"six-input-clear",7);this.sixInput=t(this,"six-input-input",7);this.sixFocus=t(this,"six-input-focus",7);this.sixBlur=t(this,"six-input-blur",7);this.inputId=`input-${++p}`;this.labelId=`input-label-${p}`;this.helpTextId=`input-help-text-${p}`;this.errorTextId=`input-error-text-${p}`;this.eventListeners=new n;this.handleChange=i=>{i.stopPropagation();if(this.nativeInput!=null){this.value=this.nativeInput.value;this.sixChange.emit()}};this.handleInput=i=>{i.stopPropagation();if(this.nativeInput!=null){this.value=this.nativeInput.value;this.sixInput.emit()}};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleClearClick=i=>{this.value="";this.sixClear.emit();this.sixInput.emit();this.sixChange.emit();if(this.nativeInput!=null){this.nativeInput.focus()}i.stopPropagation()};this.handleKeyDown=i=>{const t=i.metaKey||i.ctrlKey||i.shiftKey||i.altKey;if(i.key==="Enter"&&!t){setTimeout((()=>{if(!i.defaultPrevented&&!i.isComposing){l(this.host)}}))}};this.handlePasswordToggle=()=>{this.isPasswordVisible=!this.isPasswordVisible};this.handleSlotChange=()=>{this.hasHelpTextSlot=e(this.host,"help-text");this.hasLabelSlot=e(this.host,"label");this.hasErrorSlot=e(this.host,"error-text")};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.hasErrorSlot=false;this.isPasswordVisible=false;this.type="text";this.size="medium";this.name="";this.value="";this.pill=false;this.helpText="";this.placeholder=undefined;this.disabled=false;this.readonly=false;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.step=undefined;this.pattern=undefined;this.required=false;this.autocapitalize="off";this.autocorrect="off";this.autocomplete="off";this.autofocus=false;this.spellcheck=false;this.label="";this.errorText="";this.errorTextCount=undefined;this.invalid=false;this.clearable=false;this.togglePassword=false;this.inputmode=undefined;this.line=false}handleLabelChange(){this.handleSlotChange()}handleValueChange(){this.value=this.getValue();if(this.nativeInput!=null&&this.nativeInput.value!==this.value){this.nativeInput.value=this.value}}connectedCallback(){var i;(i=this.host.shadowRoot)===null||i===void 0?void 0:i.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-input-input","input",this.host);this.eventListeners.forward("six-input-change","change",this.host);this.eventListeners.forward("six-input-focus","focus",this.host);this.eventListeners.forward("six-input-blur","blur",this.host)}componentWillLoad(){this.handleSlotChange()}disconnectedCallback(){var i;(i=this.host.shadowRoot)===null||i===void 0?void 0:i.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(i){var t;(t=this.nativeInput)===null||t===void 0?void 0:t.focus(i)}async removeFocus(){var i;(i=this.nativeInput)===null||i===void 0?void 0:i.blur()}async select(){var i;return(i=this.nativeInput)===null||i===void 0?void 0:i.select()}async setSelectionRange(i,t,o="none"){var r;return(r=this.nativeInput)===null||r===void 0?void 0:r.setSelectionRange(i,t,o)}async setRangeText(i,t,o,r="preserve"){if(this.nativeInput==null){return}this.nativeInput.setRangeText(i,t,o,r);if(this.getValue()!==this.nativeInput.value){this.value=this.nativeInput.value;this.sixChange.emit();this.sixInput.emit()}}getValue(){var i;return((i=this.value)!==null&&i!==void 0?i:"").toString()}render(){return o(s,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.errorText,errorTextCount:this.errorTextCount,hasErrorTextSlot:this.hasErrorSlot,size:this.size,disabled:this.disabled,required:this.required,displayError:this.invalid},o("div",{part:"base",class:{input:true,"input--small":this.size==="small","input--medium":this.size==="medium","input--large":this.size==="large","input--line":this.line,"input--pill":this.pill,"input--disabled":this.disabled,"input--focused":this.hasFocus,"input--empty":this.getValue().length===0,"input--invalid":this.invalid}},o("span",{part:"prefix",class:"input__prefix"},o("slot",{name:"prefix"})),o("input",{part:"input",ref:i=>this.nativeInput=i,id:this.inputId,size:1,class:{input__control:true,input__control__prefix:e(this.host,"prefix")},type:this.type==="password"&&this.isPasswordVisible?"text":this.type,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,minLength:this.minlength,maxLength:this.maxlength,min:this.min,max:this.max,step:this.step,value:this.getValue(),autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,spellcheck:this.spellcheck,pattern:this.pattern,required:this.required,inputMode:this.inputmode,"aria-labelledby":this.labelId,"aria-describedby":this.helpTextId,"aria-invalid":this.invalid?"true":"false",onChange:this.handleChange,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,"data-testid":"input-control"}),this.clearable&&o("button",{part:"clear-button",class:"input__clear",type:"button",onClick:this.handleClearClick,tabindex:"-1","data-testid":"input-clear-button"},o("slot",{name:"clear-icon"},o("six-icon",{size:u[this.size]},"clear"))),this.togglePassword&&o("button",{part:"password-toggle-button",class:"input__password-toggle",type:"button",onClick:this.handlePasswordToggle,tabindex:"-1"},this.isPasswordVisible?o("slot",{name:"show-password-icon"},o("six-icon",{size:u[this.size]},"visibility_off")):o("slot",{name:"hide-password-icon"},o("six-icon",{size:u[this.size]},"visibility"))),o("span",{part:"suffix",class:"input__suffix"},o("slot",{name:"suffix"}))))}get host(){return r(this)}static get watchers(){return{helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],value:["handleValueChange"]}}};h.style=a;export{h as six_input};
2
+ //# sourceMappingURL=p-538f3c50.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixInputCss","ICON_SIZES","large","medium","small","id","SixInput","this","inputId","labelId","helpTextId","errorTextId","eventListeners","EventListeners","handleChange","event","stopPropagation","nativeInput","value","sixChange","emit","handleInput","sixInput","handleBlur","hasFocus","sixBlur","handleFocus","sixFocus","handleClearClick","sixClear","focus","handleKeyDown","hasModifier","metaKey","ctrlKey","shiftKey","altKey","key","setTimeout","defaultPrevented","isComposing","submitForm","host","handlePasswordToggle","isPasswordVisible","handleSlotChange","hasHelpTextSlot","hasSlot","hasLabelSlot","hasErrorSlot","handleLabelChange","handleValueChange","getValue","connectedCallback","_a","shadowRoot","addEventListener","forward","componentWillLoad","disconnectedCallback","removeEventListener","removeAll","setFocus","options","removeFocus","blur","select","setSelectionRange","selectionStart","selectionEnd","selectionDirection","setRangeText","replacement","start","end","selectMode","toString","render","h","FormControl","label","helpText","errorText","errorTextCount","hasErrorTextSlot","size","disabled","required","displayError","invalid","part","class","input","line","pill","length","name","ref","el","input__control","input__control__prefix","type","placeholder","readonly","minLength","minlength","maxLength","maxlength","min","max","step","autoCapitalize","autocapitalize","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","autofocus","spellcheck","pattern","inputMode","inputmode","onChange","onInput","onFocus","onBlur","onKeyDown","clearable","onClick","tabindex","togglePassword"],"sources":["src/components/six-input/six-input.scss?tag=six-input&encapsulation=shadow","src/components/six-input/six-input.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.input {\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &:hover:not(.input--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .input__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &.input--focused:not(.input--disabled) {\n background-color: var(--six-input-background-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n\n .input__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.input--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .input__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n\n &.input--invalid:not(.input--disabled):not(.input--focused) {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n color: var(--six-input-color);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n box-shadow: 0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;\n -webkit-text-fill-color: var(--six-color-primary-500);\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::-ms-reveal {\n display: none;\n }\n}\n\n.input__prefix,\n.input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n\n ::slotted(six-icon) {\n color: var(--six-input-icon-color);\n }\n}\n\n.input {\n &.input--disabled {\n ::slotted(six-icon) {\n cursor: not-allowed;\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n height: var(--six-height-small);\n\n .input__control {\n height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-small);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-small);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-small);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-small);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-small);\n }\n}\n\n.input--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n height: var(--six-height-medium);\n\n .input__control {\n height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-medium);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-medium);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-medium);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-medium);\n }\n}\n\n.input--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n height: var(--six-height-large);\n\n .input__control {\n height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-large);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-large);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-large);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-large);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--pill {\n &.input--small {\n border-radius: var(--six-height-small);\n }\n\n &.input--medium {\n border-radius: var(--six-height-medium);\n }\n\n &.input--large {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Clearable + Password Toggle\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input__clear,\n.input__password-toggle {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.input--empty .input__clear {\n visibility: hidden;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { submitForm } from '../../utils/form';\n\nconst ICON_SIZES: Record<'small' | 'medium' | 'large', 'xSmall' | 'small' | 'medium'> = {\n large: 'medium',\n medium: 'small',\n small: 'xSmall',\n};\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot prefix - Used to prepend an icon or similar element to the input.\n * @slot suffix - Used to append an icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, input, error-text and help-text.\n * @part label - The input label.\n * @part input - The input control.\n * @part prefix - The input prefix container.\n * @part clear-button - The clear button.\n * @part password-toggle-button - The password toggle button.\n * @part suffix - The input suffix container.\n * @part help-text - The input help text.\n * @part error-text - The input error text.\n */\n\n@Component({\n tag: 'six-input',\n styleUrl: 'six-input.scss',\n shadow: true,\n})\nexport class SixInput {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixInputElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasErrorSlot = false;\n @State() isPasswordVisible = false;\n\n /** The input's type. */\n @Prop({ reflect: true }) type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** Set to true to draw a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder?: string;\n\n /** Set to true to disable the input. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true to make the input readonly. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The input's minimum value. */\n @Prop({ reflect: true }) min?: number;\n\n /** The input's maximum value. */\n @Prop({ reflect: true }) max?: number;\n\n /** The input's step attribute. */\n @Prop({ reflect: true }) step?: number;\n\n /** A pattern to validate input against. */\n @Prop({ reflect: true }) pattern?: string;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The input's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The input's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The input's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The input's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** Enables spell checking on the input. */\n @Prop() spellcheck = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set to true to add a password toggle button for password inputs. */\n @Prop() togglePassword = false;\n\n /** The input's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to render as line */\n @Prop() line = false;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeInput != null && this.nativeInput.value !== this.value) {\n this.nativeInput.value = this.value;\n }\n }\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-input-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-input-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-input-input', 'input', this.host);\n this.eventListeners.forward('six-input-change', 'change', this.host);\n this.eventListeners.forward('six-input-focus', 'focus', this.host);\n this.eventListeners.forward('six-input-blur', 'blur', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeInput?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeInput?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeInput.value) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n this.value = '';\n this.sixClear.emit();\n this.sixInput.emit();\n this.sixChange.emit();\n if (this.nativeInput != null) {\n this.nativeInput.focus();\n }\n event.stopPropagation();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n submitForm(this.host);\n }\n });\n }\n };\n\n private handlePasswordToggle = () => {\n this.isPasswordVisible = !this.isPasswordVisible;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorSlot = hasSlot(this.host, 'error-text');\n };\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--line': this.line,\n 'input--pill': this.pill,\n 'input--disabled': this.disabled,\n 'input--focused': this.hasFocus,\n 'input--empty': this.getValue().length === 0,\n 'input--invalid': this.invalid,\n }}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n size={1} // needed for firefox to overrule the default of 20\n class={{\n input__control: true,\n input__control__prefix: hasSlot(this.host, 'prefix'),\n }}\n type={this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n minLength={this.minlength}\n maxLength={this.maxlength}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n pattern={this.pattern}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-invalid={this.invalid ? 'true' : 'false'}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeyDown}\n data-testid=\"input-control\"\n />\n\n {this.clearable && (\n <button\n part=\"clear-button\"\n class=\"input__clear\"\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n data-testid=\"input-clear-button\"\n >\n <slot name=\"clear-icon\">\n <six-icon size={ICON_SIZES[this.size]}>clear</six-icon>\n </slot>\n </button>\n )}\n\n {this.togglePassword && (\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n onClick={this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n {this.isPasswordVisible ? (\n <slot name=\"show-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility_off</six-icon>\n </slot>\n ) : (\n <slot name=\"hide-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility</six-icon>\n </slot>\n )}\n </button>\n )}\n\n <span part=\"suffix\" class=\"input__suffix\">\n <slot name=\"suffix\" />\n </span>\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"yMAAA,MAAMA,EAAc,67PCOpB,MAAMC,EAAkF,CACtFC,MAAO,SACPC,OAAQ,QACRC,MAAO,UAGT,IAAIC,EAAK,E,MAkCIC,EAAQ,M,2OACXC,KAAAC,QAAU,WAAWH,IACrBE,KAAAE,QAAU,eAAeJ,IACzBE,KAAAG,WAAa,mBAAmBL,IAChCE,KAAAI,YAAc,oBAAoBN,IAElCE,KAAAK,eAAiB,IAAIC,EA+LrBN,KAAAO,aAAgBC,IACtBA,EAAMC,kBACN,GAAIT,KAAKU,aAAe,KAAM,CAC5BV,KAAKW,MAAQX,KAAKU,YAAYC,MAC9BX,KAAKY,UAAUC,M,GAIXb,KAAAc,YAAeN,IACrBA,EAAMC,kBACN,GAAIT,KAAKU,aAAe,KAAM,CAC5BV,KAAKW,MAAQX,KAAKU,YAAYC,MAC9BX,KAAKe,SAASF,M,GAIVb,KAAAgB,WAAa,KACnBhB,KAAKiB,SAAW,MAChBjB,KAAKkB,QAAQL,MAAM,EAGbb,KAAAmB,YAAc,KACpBnB,KAAKiB,SAAW,KAChBjB,KAAKoB,SAASP,MAAM,EAGdb,KAAAqB,iBAAoBb,IAC1BR,KAAKW,MAAQ,G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C,QAASjH,KAAKiH,QACdjC,SAAUhF,KAAKgF,SACfkC,UAAWlH,KAAKmH,UAAS,kBACRnH,KAAKE,QAAO,mBACXF,KAAKG,WAAU,eACnBH,KAAKkF,QAAU,OAAS,QACtCkC,SAAUpH,KAAKO,aACf8G,QAASrH,KAAKc,YACdwG,QAAStH,KAAKmB,YACdoG,OAAQvH,KAAKgB,WACbwG,UAAWxH,KAAKwB,cAAa,cACjB,kBAGbxB,KAAKyH,WACJlD,EAAA,UACEY,KAAK,eACLC,MAAM,eACNU,KAAK,SACL4B,QAAS1H,KAAKqB,iBACdsG,SAAS,KAAI,cACD,sBAEZpD,EAAA,QAAMkB,KAAK,cACTlB,EAAA,YAAUO,KAAMpF,EAAWM,KAAK8E,OAAK,WAK1C9E,KAAK4H,gBACJrD,EAAA,UACEY,KAAK,yBACLC,MAAM,yBACNU,KAAK,SACL4B,QAAS1H,KAAKoC,qBACduF,SAAS,MAER3H,KAAKqC,kBACJkC,EAAA,QAAMkB,KAAK,sBACTlB,EAAA,YAAUO,KAAMpF,EAAWM,KAAK8E,OAAK,mBAGvCP,EAAA,QAAMkB,KAAK,sBACTlB,EAAA,YAAUO,KAAMpF,EAAWM,KAAK8E,OAAK,gBAM7CP,EAAA,QAAMY,KAAK,SAASC,MAAM,iBACxBb,EAAA,QAAMkB,KAAK,a"}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,h as r,g as o}from"./p-6153045b.js";import{F as i}from"./p-e5020f0d.js";import{h as a}from"./p-15559d38.js";import{E as s}from"./p-7d95def3.js";const l=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.textarea{display:flex;align-items:center;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);line-height:var(--six-line-height-normal);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.textarea:hover:not(.textarea--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.textarea:hover:not(.textarea--disabled) .textarea__control{color:var(--six-input-color-hover)}.textarea.textarea--focused:not(.textarea--disabled){background-color:var(--six-input-background-color-focus);box-shadow:var(--six-input-focus-shadow);border-color:var(--six-input-border-color-focus);color:var(--six-input-color-focus)}.textarea.textarea--focused:not(.textarea--disabled) .textarea__control{color:var(--six-input-color-focus)}.textarea.textarea--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.textarea.textarea--disabled .textarea__control{color:var(--six-input-color-disabled)}.textarea.textarea--disabled .textarea__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.textarea__control{flex:1 1 auto;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.4;color:var(--sl-input-color);border:none;background:none;box-shadow:none;cursor:inherit;-webkit-appearance:none}.textarea__control::-webkit-search-decoration,.textarea__control::-webkit-search-cancel-button,.textarea__control::-webkit-search-results-button,.textarea__control::-webkit-search-results-decoration{-webkit-appearance:none}.textarea__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.textarea__control:focus{outline:none}.textarea--invalid:not(.textarea--disabled):not(.textarea--focused){border-color:var(--six-input-border-color-danger)}.textarea--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small)}.textarea--small .textarea__control{padding:0.5em var(--six-input-spacing-small)}.textarea--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium)}.textarea--medium .textarea__control{padding:0.5em var(--six-input-spacing-medium)}.textarea--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large)}.textarea--large .textarea__control{padding:0.5em var(--six-input-spacing-large)}.textarea--resize-none .textarea__control{resize:none}.textarea--resize-vertical .textarea__control{resize:vertical}.textarea--resize-auto .textarea__control{height:auto;resize:none}';let n=0;const h=class{constructor(r){t(this,r);this.sixChange=e(this,"six-textarea-change",7);this.sixInput=e(this,"six-textarea-input",7);this.sixFocus=e(this,"six-textarea-focus",7);this.sixBlur=e(this,"six-textarea-blur",7);this.inputId=`textarea-${++n}`;this.labelId=`textarea-label-${n}`;this.helpTextId=`textarea-help-text-${n}`;this.errorTextId=`input-error-text-${n}`;this.eventListeners=new s;this.resizeObserver=new ResizeObserver((()=>this.setTextareaHeight()));this.handleChange=()=>{if(this.nativeTextarea!=null){this.value=this.nativeTextarea.value;this.sixChange.emit()}};this.handleInput=()=>{if(this.nativeTextarea!=null){this.value=this.nativeTextarea.value;this.setTextareaHeight();this.sixInput.emit()}};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleSlotChange=()=>{this.hasLabelSlot=a(this.host,"label");this.hasHelpTextSlot=a(this.host,"help-text");this.hasErrorTextSlot=a(this.host,"error-text")};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.hasErrorTextSlot=false;this.size="medium";this.name="";this.value="";this.helpText="";this.placeholder=undefined;this.rows=4;this.resize="vertical";this.disabled=false;this.readonly=false;this.minlength=undefined;this.maxlength=undefined;this.required=false;this.label="";this.errorText="";this.errorTextCount=undefined;this.invalid=false;this.autocapitalize="off";this.autocorrect="off";this.autocomplete="off";this.autofocus=false;this.spellcheck=false;this.inputmode=undefined}handleLabelChange(){this.handleSlotChange()}handleRowsChange(){this.setTextareaHeight()}handleValueChange(){this.value=this.getValue();if(this.nativeTextarea!=null){if(this.nativeTextarea.value!==this.value){this.nativeTextarea.value=this.value}}}connectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-textarea-input","input",this.host);this.eventListeners.forward("six-textarea-change","change",this.host);this.eventListeners.forward("six-textarea-focus","focus",this.host);this.eventListeners.forward("six-textarea-blur","blur",this.host)}componentWillLoad(){this.handleSlotChange()}componentDidLoad(){this.setTextareaHeight();if(this.nativeTextarea!=null){this.resizeObserver.observe(this.nativeTextarea)}}disconnectedCallback(){var t;if(this.nativeTextarea!=null){this.resizeObserver.unobserve(this.nativeTextarea)}(t=this.host.shadowRoot)===null||t===void 0?void 0:t.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(t){var e;(e=this.nativeTextarea)===null||e===void 0?void 0:e.focus(t)}async removeFocus(){var t;(t=this.nativeTextarea)===null||t===void 0?void 0:t.blur()}async select(){var t;return(t=this.nativeTextarea)===null||t===void 0?void 0:t.select()}async setSelectionRange(t,e,r="none"){var o;return(o=this.nativeTextarea)===null||o===void 0?void 0:o.setSelectionRange(t,e,r)}async setRangeText(t,e,r,o="preserve"){if(this.nativeTextarea==null)return;this.nativeTextarea.setRangeText(t,e,r,o);if(this.getValue()!==this.nativeTextarea.value){this.value=this.nativeTextarea.value;this.setTextareaHeight();this.sixChange.emit();this.sixInput.emit()}}setTextareaHeight(){if(this.nativeTextarea==null)return;if(this.resize==="auto"){this.nativeTextarea.style.height="auto";this.nativeTextarea.style.height=this.nativeTextarea.scrollHeight+"px"}else{this.nativeTextarea.style.height=undefined}}getValue(){var t;return((t=this.value)!==null&&t!==void 0?t:"").toString()}render(){return r(i,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.errorText,errorTextCount:this.errorTextCount,hasErrorTextSlot:this.hasErrorTextSlot,size:this.size,disabled:this.disabled,required:this.required,displayError:this.invalid},r("div",{part:"base",class:{textarea:true,"textarea--small":this.size==="small","textarea--medium":this.size==="medium","textarea--large":this.size==="large","textarea--disabled":this.disabled,"textarea--focused":this.hasFocus,"textarea--empty":this.getValue().length===0,"textarea--invalid":this.invalid,"textarea--resize-none":this.resize==="none","textarea--resize-vertical":this.resize==="vertical","textarea--resize-auto":this.resize==="auto"}},r("textarea",{part:"textarea",ref:t=>this.nativeTextarea=t,id:this.inputId,class:"textarea__control",name:this.name,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,rows:this.rows,minLength:this.minlength,maxLength:this.maxlength,value:this.getValue(),autoCapitalize:this.autocapitalize,autoCorrect:this.autocorrect,autoFocus:this.autofocus,spellcheck:this.spellcheck,required:this.required,inputMode:this.inputmode,"aria-labelledby":this.labelId,onChange:this.handleChange,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur})))}get host(){return o(this)}static get watchers(){return{helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],rows:["handleRowsChange"],value:["handleValueChange"]}}};h.style=l;export{h as six_textarea};
2
+ //# sourceMappingURL=p-a457fee8.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixTextareaCss","id","SixTextarea","this","inputId","labelId","helpTextId","errorTextId","eventListeners","EventListeners","resizeObserver","ResizeObserver","setTextareaHeight","handleChange","nativeTextarea","value","sixChange","emit","handleInput","sixInput","handleBlur","hasFocus","sixBlur","handleFocus","sixFocus","handleSlotChange","hasLabelSlot","hasSlot","host","hasHelpTextSlot","hasErrorTextSlot","handleLabelChange","handleRowsChange","handleValueChange","getValue","connectedCallback","_a","shadowRoot","addEventListener","forward","componentWillLoad","componentDidLoad","observe","disconnectedCallback","unobserve","removeEventListener","removeAll","setFocus","options","focus","removeFocus","blur","select","setSelectionRange","selectionStart","selectionEnd","selectionDirection","setRangeText","replacement","start","end","selectMode","resize","style","height","scrollHeight","undefined","toString","render","h","FormControl","label","helpText","errorText","errorTextCount","size","disabled","required","displayError","invalid","part","class","textarea","length","ref","el","name","placeholder","readOnly","readonly","rows","minLength","minlength","maxLength","maxlength","autoCapitalize","autocapitalize","autoCorrect","autocorrect","autoFocus","autofocus","spellcheck","inputMode","inputmode","onChange","onInput","onFocus","onBlur"],"sources":["src/components/six-textarea/six-textarea.scss?tag=six-textarea&encapsulation=shadow","src/components/six-textarea/six-textarea.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.textarea {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n line-height: var(--six-line-height-normal);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &:hover:not(.textarea--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .textarea__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &.textarea--focused:not(.textarea--disabled) {\n background-color: var(--six-input-background-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n border-color: var(--six-input-border-color-focus);\n color: var(--six-input-color-focus);\n\n .textarea__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.textarea--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .textarea__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n}\n\n.textarea__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: 1.4;\n color: var(--sl-input-color);\n border: none;\n background: none;\n box-shadow: none;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.textarea--invalid:not(.textarea--disabled):not(.textarea--focused) {\n border-color: var(--six-input-border-color-danger);\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.textarea--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-small);\n }\n}\n\n.textarea--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-medium);\n }\n}\n\n.textarea--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n\n .textarea__control {\n padding: 0.5em var(--six-input-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Resize types\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.textarea--resize-none .textarea__control {\n resize: none;\n}\n\n.textarea--resize-vertical .textarea__control {\n resize: vertical;\n}\n\n.textarea--resize-auto .textarea__control {\n height: auto;\n resize: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { EmptyPayload } from '../../utils/types';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The textarea's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the input.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, textarea, and help text.\n * @part label - The textarea label.\n * @part textarea - The textarea control.\n * @part help-text - The textarea help text.\n */\n@Component({\n tag: 'six-textarea',\n styleUrl: 'six-textarea.scss',\n shadow: true,\n})\nexport class SixTextarea {\n private inputId = `textarea-${++id}`;\n private labelId = `textarea-label-${id}`;\n private helpTextId = `textarea-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeTextarea?: HTMLTextAreaElement;\n private eventListeners = new EventListeners();\n private resizeObserver = new ResizeObserver(() => this.setTextareaHeight());\n\n @Element() host!: HTMLSixTextareaElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasErrorTextSlot = false;\n\n /** The textarea's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The textarea's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The textarea's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** The textarea's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The textarea's placeholder text. */\n @Prop() placeholder?: string;\n\n /** The number of rows to display by default. */\n @Prop() rows = 4;\n\n /** Controls how the textarea can be resized. */\n @Prop() resize: 'none' | 'vertical' | 'auto' = 'vertical';\n\n /** Set to true to disable the textarea. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true for a readonly textarea. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The textarea's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The textarea's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The textarea's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The textarea's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** The textarea's spellcheck attribute. */\n @Prop() spellcheck = false;\n\n /** The textarea's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-textarea-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-textarea-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('rows')\n handleRowsChange() {\n this.setTextareaHeight();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeTextarea != null) {\n if (this.nativeTextarea.value !== this.value) {\n this.nativeTextarea.value = this.value;\n }\n }\n }\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-textarea-input', 'input', this.host);\n this.eventListeners.forward('six-textarea-change', 'change', this.host);\n this.eventListeners.forward('six-textarea-focus', 'focus', this.host);\n this.eventListeners.forward('six-textarea-blur', 'blur', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n this.setTextareaHeight();\n if (this.nativeTextarea != null) {\n this.resizeObserver.observe(this.nativeTextarea);\n }\n }\n\n disconnectedCallback() {\n if (this.nativeTextarea != null) {\n this.resizeObserver.unobserve(this.nativeTextarea);\n }\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the textarea. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeTextarea?.focus(options);\n }\n\n /** Removes focus fromt the textarea. */\n @Method()\n async removeFocus() {\n this.nativeTextarea?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeTextarea?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeTextarea?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeTextarea == null) return;\n\n this.nativeTextarea.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeTextarea.value) {\n this.value = this.nativeTextarea.value;\n this.setTextareaHeight();\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n private handleChange = () => {\n if (this.nativeTextarea != null) {\n this.value = this.nativeTextarea.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = () => {\n if (this.nativeTextarea != null) {\n this.value = this.nativeTextarea.value;\n this.setTextareaHeight();\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleSlotChange = () => {\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n };\n\n private setTextareaHeight() {\n if (this.nativeTextarea == null) return;\n\n if (this.resize === 'auto') {\n this.nativeTextarea.style.height = 'auto';\n this.nativeTextarea.style.height = this.nativeTextarea.scrollHeight + 'px';\n } else {\n (this.nativeTextarea.style.height as string | undefined) = undefined;\n }\n }\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n textarea: true,\n\n // Sizes\n 'textarea--small': this.size === 'small',\n 'textarea--medium': this.size === 'medium',\n 'textarea--large': this.size === 'large',\n\n // States\n 'textarea--disabled': this.disabled,\n 'textarea--focused': this.hasFocus,\n 'textarea--empty': this.getValue().length === 0,\n 'textarea--invalid': this.invalid,\n\n // Modifiers\n 'textarea--resize-none': this.resize === 'none',\n 'textarea--resize-vertical': this.resize === 'vertical',\n 'textarea--resize-auto': this.resize === 'auto',\n }}\n >\n <textarea\n part=\"textarea\"\n ref={(el) => (this.nativeTextarea = el)}\n id={this.inputId}\n class=\"textarea__control\"\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readOnly={this.readonly}\n rows={this.rows}\n minLength={this.minlength}\n maxLength={this.maxlength}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"qKAAA,MAAMA,EAAiB,svKCMvB,IAAIC,EAAK,E,MAuBIC,EAAW,M,6MACdC,KAAAC,QAAU,cAAcH,IACxBE,KAAAE,QAAU,kBAAkBJ,IAC5BE,KAAAG,WAAa,sBAAsBL,IACnCE,KAAAI,YAAc,oBAAoBN,IAElCE,KAAAK,eAAiB,IAAIC,EACrBN,KAAAO,eAAiB,IAAIC,gBAAe,IAAMR,KAAKS,sBAuL/CT,KAAAU,aAAe,KACrB,GAAIV,KAAKW,gBAAkB,KAAM,CAC/BX,KAAKY,MAAQZ,KAAKW,eAAeC,MACjCZ,KAAKa,UAAUC,M,GAIXd,KAAAe,YAAc,KAC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