@mgdis/mg-components 5.19.2 → 5.19.3

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 (178) hide show
  1. package/dist/cjs/{components.utils-dc9c8a53.js → components.utils-69435877.js} +2 -2
  2. package/dist/cjs/components.utils-69435877.js.map +1 -0
  3. package/dist/cjs/{index-c042e24b.js → index-60dd0c56.js} +143 -58
  4. package/dist/cjs/index-60dd0c56.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_34.cjs.entry.js +306 -238
  7. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +3 -3
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-item-more.cjs.entry.js +2 -2
  11. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  12. package/dist/collection/assets/icons/index.js +190 -182
  13. package/dist/collection/collection-manifest.json +3 -3
  14. package/dist/collection/components/atoms/mg-button/mg-button.js +15 -0
  15. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  16. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +1 -1
  17. package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +1 -1
  18. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +54 -4
  19. package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +1 -1
  20. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +2 -2
  21. package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +1 -1
  22. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
  23. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +1 -1
  24. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/MgInput.conf.js +8 -0
  26. package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  28. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -2
  29. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +13 -12
  31. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  32. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +4 -10
  33. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +1 -1
  34. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +9 -2
  35. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  36. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +4 -0
  37. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +1 -1
  38. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +11 -4
  39. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  40. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +4 -0
  41. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +1 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +9 -2
  43. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +4 -0
  45. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +1 -1
  46. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +7 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  48. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +4 -0
  49. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +1 -1
  50. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +9 -2
  51. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  52. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +4 -0
  53. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +1 -1
  54. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +0 -4
  55. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  56. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +9 -2
  57. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  58. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +2 -0
  59. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +1 -1
  60. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +9 -2
  61. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  62. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +2 -0
  63. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +1 -1
  64. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +1 -1
  65. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +1 -1
  66. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +1 -1
  67. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  68. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +2 -2
  69. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +1 -1
  70. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  71. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
  72. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  73. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +8 -0
  74. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +1 -1
  75. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +8 -0
  76. package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +1 -1
  77. package/dist/collection/components/molecules/mg-form/mg-form.js +1 -9
  78. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  79. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +44 -29
  80. package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +1 -1
  81. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +1 -1
  82. package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +1 -1
  83. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +1 -1
  84. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +1 -1
  85. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  86. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  87. package/dist/collection/utils/components.utils.js +1 -1
  88. package/dist/collection/utils/components.utils.js.map +1 -1
  89. package/dist/collection/utils/components.utils.spec.js +5 -0
  90. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  91. package/dist/components/MgInput.js +9 -1
  92. package/dist/components/MgInput.js.map +1 -1
  93. package/dist/components/components.utils.js +1 -1
  94. package/dist/components/components.utils.js.map +1 -1
  95. package/dist/components/mg-action-more.js +1 -1
  96. package/dist/components/mg-action-more.js.map +1 -1
  97. package/dist/components/mg-button2.js +15 -0
  98. package/dist/components/mg-button2.js.map +1 -1
  99. package/dist/components/mg-form.js +1 -9
  100. package/dist/components/mg-form.js.map +1 -1
  101. package/dist/components/mg-icon2.js +198 -182
  102. package/dist/components/mg-icon2.js.map +1 -1
  103. package/dist/components/mg-input-checkbox-paginated2.js +2 -2
  104. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  105. package/dist/components/mg-input-checkbox.js +13 -12
  106. package/dist/components/mg-input-checkbox.js.map +1 -1
  107. package/dist/components/mg-input-date.js +9 -3
  108. package/dist/components/mg-input-date.js.map +1 -1
  109. package/dist/components/mg-input-numeric.js +11 -5
  110. package/dist/components/mg-input-numeric.js.map +1 -1
  111. package/dist/components/mg-input-password.js +9 -3
  112. package/dist/components/mg-input-password.js.map +1 -1
  113. package/dist/components/mg-input-radio.js +8 -3
  114. package/dist/components/mg-input-radio.js.map +1 -1
  115. package/dist/components/mg-input-select2.js +9 -3
  116. package/dist/components/mg-input-select2.js.map +1 -1
  117. package/dist/components/mg-input-text2.js +9 -3
  118. package/dist/components/mg-input-text2.js.map +1 -1
  119. package/dist/components/mg-input-textarea.js +9 -3
  120. package/dist/components/mg-input-textarea.js.map +1 -1
  121. package/dist/components/mg-item-more.js.map +1 -1
  122. package/dist/components/mg-menu-item2.js +2 -2
  123. package/dist/components/mg-menu-item2.js.map +1 -1
  124. package/dist/components/mg-message.js +1 -1
  125. package/dist/components/mg-message.js.map +1 -1
  126. package/dist/components/mg-popover-content2.js +1 -1
  127. package/dist/components/mg-popover-content2.js.map +1 -1
  128. package/dist/components/popper.js +6 -12
  129. package/dist/components/popper.js.map +1 -1
  130. package/dist/esm/{components.utils-0f76010d.js → components.utils-6cf27db1.js} +2 -2
  131. package/dist/esm/components.utils-6cf27db1.js.map +1 -0
  132. package/dist/esm/{index-ce01e63b.js → index-0f833068.js} +143 -58
  133. package/dist/esm/index-0f833068.js.map +1 -0
  134. package/dist/esm/loader.js +3 -3
  135. package/dist/esm/mg-action-more_34.entry.js +306 -238
  136. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  137. package/dist/esm/mg-components.js +4 -4
  138. package/dist/esm/mg-components.js.map +1 -1
  139. package/dist/esm/mg-item-more.entry.js +2 -2
  140. package/dist/esm/mg-item-more.entry.js.map +1 -1
  141. package/dist/mg-components/mg-components.css +1 -1
  142. package/dist/mg-components/mg-components.esm.js +1 -1
  143. package/dist/mg-components/mg-components.esm.js.map +1 -1
  144. package/dist/mg-components/p-10ed4425.entry.js +2 -0
  145. package/dist/mg-components/p-10ed4425.entry.js.map +1 -0
  146. package/dist/mg-components/{p-c9e2c669.js → p-36a51c5e.js} +2 -2
  147. package/dist/mg-components/p-36a51c5e.js.map +1 -0
  148. package/dist/mg-components/{p-01ebc95a.entry.js → p-91feda5a.entry.js} +2 -2
  149. package/dist/mg-components/p-91feda5a.entry.js.map +1 -0
  150. package/dist/mg-components/p-9b12021b.js +3 -0
  151. package/dist/mg-components/p-9b12021b.js.map +1 -0
  152. package/dist/types/components/atoms/mg-button/mg-button.d.ts +4 -0
  153. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +7 -0
  154. package/dist/types/components/molecules/inputs/MgInput.d.ts +2 -1
  155. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +4 -2
  156. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -0
  157. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +1 -0
  158. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +1 -0
  159. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +1 -0
  160. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -0
  161. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +1 -6
  162. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +1 -0
  163. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -0
  164. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +1 -1
  165. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +1 -0
  166. package/dist/types/components/molecules/mg-form/mg-form.d.ts +0 -1
  167. package/dist/types/components.d.ts +2 -2
  168. package/package.json +35 -35
  169. package/dist/cjs/components.utils-dc9c8a53.js.map +0 -1
  170. package/dist/cjs/index-c042e24b.js.map +0 -1
  171. package/dist/esm/components.utils-0f76010d.js.map +0 -1
  172. package/dist/esm/index-ce01e63b.js.map +0 -1
  173. package/dist/mg-components/p-01ebc95a.entry.js.map +0 -1
  174. package/dist/mg-components/p-1aa89acf.js +0 -3
  175. package/dist/mg-components/p-1aa89acf.js.map +0 -1
  176. package/dist/mg-components/p-71a5a848.entry.js +0 -2
  177. package/dist/mg-components/p-71a5a848.entry.js.map +0 -1
  178. package/dist/mg-components/p-c9e2c669.js.map +0 -1
@@ -287,7 +287,7 @@ const createID = (prefix = '', length = 10) => {
287
287
  const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
288
288
  const charsLength = chars.length;
289
289
  let ID = '';
290
- let now = Date.now();
290
+ let now = Math.floor(globalThis.crypto.getRandomValues(new Uint32Array(1))[0] * Date.now());
291
291
  while (length > 0) {
292
292
  now += Math.pow(10, 6); // Add 1 millisecond to the timestamp
293
293
  const index = now % charsLength;
@@ -437,4 +437,4 @@ exports.localeDate = localeDate;
437
437
  exports.localeNumber = localeNumber;
438
438
  exports.sizes = sizes;
439
439
 
440
- //# sourceMappingURL=components.utils-dc9c8a53.js.map
440
+ //# sourceMappingURL=components.utils-69435877.js.map
@@ -0,0 +1 @@
1
+ {"file":"components.utils-69435877.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAiB,EAAE;KACnB,SAAS,CAAC,KAAK,CAAC;KAChB,UAAU,CAAC,kBAAkB,EAAE,EAAE;;;;;;;;;;;;;;;;;","names":["Direction"],"sources":["src/utils/locale.utils.ts","src/locales/index.ts","src/components/molecules/menu/mg-menu/mg-menu.conf.ts","src/utils/components.utils.ts"],"sourcesContent":["/**\n * Format number to the locale currency\n * @param number - number to format\n * @param locale - locale to apply\n * @param currency - currency to apply\n * @returns formatted currency\n */\nexport const localeCurrency = (number: number, locale: string, currency: string): string => {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);\n};\n\n/**\n * Format number to locale\n * @param number - number to format\n * @param locale - locale to apply\n * @returns formatted number\n */\nexport const localeNumber = (number: number, locale: string): string => {\n return new Intl.NumberFormat(locale).format(number);\n};\n\n/**\n * Date RegExp\n */\nexport const dateRegExp = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\n\n/**\n * Locale date format\n * @param date - date to format\n * @param locale - locale to apply\n * @returns formatted date\n */\nexport const localeDate = (date: string, locale: string): string => {\n if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {\n return '';\n }\n return new Intl.DateTimeFormat(locale).format(new Date(date));\n};\n\n/**\n * Get locale and messages\n * We load the defined locale but for now we only support the first subtag for messages\n * @param element - element we need to get the language\n * @param messages - messages to use\n * @param defaultLocale - default messages locale\n * @returns messages object\n */\nexport const getLocaleMessages = (element: HTMLElement, messages: unknown, defaultLocale: string): { locale: string; messages: Record<string, unknown> } => {\n // Get local\n const closestLangAttribute: HTMLElement = element.closest('[lang]');\n const closestLang: string[] = Intl.NumberFormat.supportedLocalesOf(closestLangAttribute?.lang);\n const locale = closestLang.length > 0 ? closestLang[0] : navigator.language || defaultLocale;\n // Only keep first subtag\n const localeSubtag = locale.split('-').shift();\n // Return\n return {\n locale,\n messages: messages[localeSubtag] || messages[defaultLocale],\n };\n};\n","import en from './en/messages.json';\nimport fr from './fr/messages.json';\nimport { getLocaleMessages } from '../utils/locale.utils';\n\nconst defaultLocale = 'en';\nconst messages = { en, fr };\n\n/**\n * Get Intl object\n * @param element - element we need to get the language\n * @returns messages object\n */\nexport const initLocales = (element: HTMLElement): { locale: string; messages: Record<string, unknown> } => getLocaleMessages(element, messages, defaultLocale);\n","import { MgItemMore } from '../../mg-item-more/mg-item-more';\n\n/**\n * Menu direction type\n */\nexport enum Direction {\n VERTICAL = 'vertical',\n HORIZONTAL = 'horizontal',\n}\n\n/**\n * ItemMore prop type\n */\nexport type ItemMoreType = Pick<MgItemMore, 'icon' | 'slotlabel' | 'size'>;\n\n/**\n * List of all possibles sizes\n */\nexport const sizes = ['regular', 'medium', 'large'] as const;\n\n/**\n * item Size from sizes\n */\nexport type MenuSizeType = (typeof sizes)[number];\n","/**\n * Create random ID\n * @param prefix - add prefix to created ID\n * @param length - ID length\n * @returns ID\n */\nexport const createID = (prefix = '', length = 10): string => {\n const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';\n const charsLength = chars.length;\n\n let ID = '';\n let now = Math.floor(globalThis.crypto.getRandomValues(new Uint32Array(1))[0] * Date.now());\n while (length > 0) {\n now += Math.pow(10, 6); // Add 1 millisecond to the timestamp\n const index = now % charsLength;\n ID += chars.charAt(index);\n length--;\n }\n return (prefix !== '' ? `${prefix}-` : '') + ID;\n};\n\n/**\n * Class to manage component classlist\n * Set() are not working when imported in project\n */\nexport class ClassList {\n /**\n * Available classes\n */\n classes: string[];\n\n constructor(classlist: string[] = []) {\n this.classes = classlist;\n }\n\n /**\n * Add class\n * @param className - class name to add\n */\n add = (className: string): void => {\n if (!this.has(className)) {\n this.classes.push(className);\n }\n };\n\n /**\n * Delete class\n * @param className - class name to delete\n */\n delete = (className: string): void => {\n const index = this.classes.indexOf(className);\n if (index > -1) {\n this.classes.splice(index, 1);\n }\n };\n\n /**\n * Check if class exist in list\n * @param className - class name to check\n * @returns class name is in the list\n */\n has = (className: string): boolean => {\n return this.classes.includes(className);\n };\n\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n join = (): string => {\n return this.classes.join(' ');\n };\n}\n\n/**\n * Check if all items are string\n * @param items - items to check\n * @returns all items are string\n */\nexport const allItemsAreString = (items: unknown): items is string[] => Array.isArray(items) && items.every(item => typeof item === 'string');\n\n/**\n * Check if element is a heading\n * @param element - slotted element\n * @param tagNames - allowed tag names list\n * @returns element is a heading\n */\nexport const isTagName = (element: Element, tagNames: string[]): boolean => {\n return tagNames.includes(element?.tagName.toLowerCase());\n};\n\n/**\n * Focusable elements query selector\n */\nexport const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier]';\n\n/**\n * Get windows\n * @param localWindow - the window we are lookink for other windows\n * @returns The list of windows found\n */\nexport const getWindows = (localWindow: Window): Window[] => {\n const parentWindows = getParentWindows(localWindow);\n const childWindows = getChildWindows(localWindow);\n return [localWindow, ...parentWindows, ...childWindows];\n};\n\n/**\n * Get parent windows\n * @param localWindow - the window we are lookink for parents\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nexport const getParentWindows = (localWindow: Window, windows: Window[] = []): Window[] => {\n // Check if is in iframe\n if (localWindow.self !== localWindow.top) {\n // Check if we have permission to access parent\n try {\n const parentWindow: Window = localWindow.parent;\n windows.push(parentWindow);\n return getParentWindows(parentWindow, windows);\n } catch (err) {\n console.error('Different hosts between iframes:', err);\n return windows;\n }\n }\n return windows;\n};\n\n/**\n * Get child windows\n * @param localWindow - the window we are lookink for children\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nconst getChildWindows = (localWindow: Window, windows: Window[] = []): Window[] => {\n if (localWindow.frames.length > 0) {\n for (const childWindow of Array.from(localWindow.frames)) {\n windows.push(childWindow);\n getChildWindows(childWindow, windows);\n }\n }\n return windows;\n};\n\n/**\n * Validate string\n * @param value - value to check\n * @returns if string is valid\n */\nexport const isValidString = (value: unknown): boolean => typeof value === 'string' && value.trim() !== '';\n\n/**\n * Clean string caraters\n * @param text - text to cliean\n * @returns cleanded string\n */\nexport const cleanString = (text: string): string =>\n typeof text === 'string' &&\n text\n .toLocaleLowerCase()\n .normalize('NFD')\n .replaceAll(/[\\u0300-\\u036f]/g, '');\n"],"version":3}
@@ -689,7 +689,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
689
689
  parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
690
690
  // remove the old original location comment entirely
691
691
  // later on the patch function will know what to do
692
- // and move this to the correct spot in need be
692
+ // and move this to the correct spot if need be
693
693
  childNode['s-ol'].remove();
694
694
  childNode['s-ol'] = undefined;
695
695
  checkSlotRelocate = true;
@@ -1107,30 +1107,37 @@ const patch = (oldVNode, newVNode) => {
1107
1107
  elm.data = text;
1108
1108
  }
1109
1109
  };
1110
+ /**
1111
+ * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1112
+ * are slot fallbacks nodes.
1113
+ *
1114
+ * A slot fallback node should be visible by default. Then, it should be
1115
+ * conditionally hidden if:
1116
+ *
1117
+ * - it has a sibling with a `slot` property set to its slot name or if
1118
+ * - it is a default fallback slot node, in which case we hide if it has any
1119
+ * content
1120
+ *
1121
+ * @param elm the element of interest
1122
+ */
1110
1123
  const updateFallbackSlotVisibility = (elm) => {
1111
- // tslint:disable-next-line: prefer-const
1112
1124
  const childNodes = elm.childNodes;
1113
- let childNode;
1114
- let i;
1115
- let ilen;
1116
- let j;
1117
- let slotNameAttr;
1118
- let nodeType;
1119
- for (i = 0, ilen = childNodes.length; i < ilen; i++) {
1120
- childNode = childNodes[i];
1125
+ for (const childNode of childNodes) {
1121
1126
  if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1122
1127
  if (childNode['s-sr']) {
1123
1128
  // this is a slot fallback node
1124
1129
  // get the slot name for this slot reference node
1125
- slotNameAttr = childNode['s-sn'];
1130
+ const slotName = childNode['s-sn'];
1126
1131
  // by default always show a fallback slot node
1127
1132
  // then hide it if there are other slots in the light dom
1128
1133
  childNode.hidden = false;
1129
- for (j = 0; j < ilen; j++) {
1130
- nodeType = childNodes[j].nodeType;
1131
- if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
1132
- // this sibling node is from a different component OR is a named fallback slot node
1133
- if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
1134
+ // we need to check all of its sibling nodes in order to see if
1135
+ // `childNode` should be hidden
1136
+ for (const siblingNode of childNodes) {
1137
+ if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1138
+ // this sibling node is from a different component OR is a named
1139
+ // fallback slot node
1140
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ && slotName === siblingNode.getAttribute('slot')) {
1134
1141
  childNode.hidden = true;
1135
1142
  break;
1136
1143
  }
@@ -1139,8 +1146,8 @@ const updateFallbackSlotVisibility = (elm) => {
1139
1146
  // this is a default fallback slot node
1140
1147
  // any element or text node (with content)
1141
1148
  // should hide the default fallback slot node
1142
- if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1143
- (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
1149
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1150
+ (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1144
1151
  childNode.hidden = true;
1145
1152
  break;
1146
1153
  }
@@ -1152,42 +1159,55 @@ const updateFallbackSlotVisibility = (elm) => {
1152
1159
  }
1153
1160
  }
1154
1161
  };
1162
+ /**
1163
+ * Component-global information about nodes which are either currently being
1164
+ * relocated or will be shortly.
1165
+ */
1155
1166
  const relocateNodes = [];
1156
- const relocateSlotContent = (elm) => {
1167
+ /**
1168
+ * Mark the contents of a slot for relocation via adding references to them to
1169
+ * the {@link relocateNodes} data structure. The actual work of relocating them
1170
+ * will then be handled in {@link renderVdom}.
1171
+ *
1172
+ * @param elm a render node whose child nodes need to be relocated
1173
+ */
1174
+ const markSlotContentForRelocation = (elm) => {
1157
1175
  // tslint:disable-next-line: prefer-const
1158
- let childNode;
1159
1176
  let node;
1160
1177
  let hostContentNodes;
1161
- let slotNameAttr;
1162
- let relocateNodeData;
1163
1178
  let j;
1164
- let i = 0;
1165
- const childNodes = elm.childNodes;
1166
- const ilen = childNodes.length;
1167
- for (; i < ilen; i++) {
1168
- childNode = childNodes[i];
1179
+ for (const childNode of elm.childNodes) {
1180
+ // we need to find child nodes which are slot references so we can then try
1181
+ // to match them up with nodes that need to be relocated
1169
1182
  if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1170
- // first got the content reference comment node
1171
- // then we got it's parent, which is where all the host content is in now
1183
+ // first get the content reference comment node ('s-cr'), then we get
1184
+ // its parent, which is where all the host content is now
1172
1185
  hostContentNodes = node.parentNode.childNodes;
1173
- slotNameAttr = childNode['s-sn'];
1186
+ const slotName = childNode['s-sn'];
1187
+ // iterate through all the nodes under the location where the host was
1188
+ // originally rendered
1174
1189
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1175
1190
  node = hostContentNodes[j];
1191
+ // check that the node is not a content reference node or a node
1192
+ // reference and then check that the host name does not match that of
1193
+ // childNode
1176
1194
  if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
1177
- // let's do some relocating to its new home
1178
- // but never relocate a content reference node
1179
- // that is suppose to always represent the original content location
1180
- if (isNodeLocatedInSlot(node, slotNameAttr)) {
1195
+ // if `node` is located in the slot that `childNode` refers to (via the
1196
+ // `'s-sn'` property) then we need to relocate it from it's current spot
1197
+ // (under the host element parent) to the right slot location
1198
+ if (isNodeLocatedInSlot(node, slotName)) {
1181
1199
  // it's possible we've already decided to relocate this node
1182
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1200
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1183
1201
  // made some changes to slots
1184
1202
  // let's make sure we also double check
1185
1203
  // fallbacks are correctly hidden or shown
1186
1204
  checkSlotFallbackVisibility = true;
1187
- node['s-sn'] = node['s-sn'] || slotNameAttr;
1205
+ // ensure that the slot-name attr is correct
1206
+ node['s-sn'] = node['s-sn'] || slotName;
1188
1207
  if (relocateNodeData) {
1189
- // previously we never found a slot home for this node
1190
- // but turns out we did, so let's remember it now
1208
+ // we marked this node for relocation previously but didn't find
1209
+ // out the slot reference node to which it needs to be relocated
1210
+ // so write it down now!
1191
1211
  relocateNodeData.$slotRefNode$ = childNode;
1192
1212
  }
1193
1213
  else {
@@ -1209,8 +1229,10 @@ const relocateSlotContent = (elm) => {
1209
1229
  }
1210
1230
  }
1211
1231
  else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1212
- // so far this element does not have a slot home, not setting slotRefNode on purpose
1213
- // if we never find a home for this element then we'll need to hide it
1232
+ // the node is not found within the slot (`childNode`) that we're
1233
+ // currently looking at, so we stick it into `relocateNodes` to
1234
+ // handle later. If we never find a home for this element then
1235
+ // we'll need to hide it
1214
1236
  relocateNodes.push({
1215
1237
  $nodeToRelocate$: node,
1216
1238
  });
@@ -1218,30 +1240,41 @@ const relocateSlotContent = (elm) => {
1218
1240
  }
1219
1241
  }
1220
1242
  }
1243
+ // if we're dealing with any type of element (capable of itself being a
1244
+ // slot reference or containing one) then we recur
1221
1245
  if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1222
- relocateSlotContent(childNode);
1246
+ markSlotContentForRelocation(childNode);
1223
1247
  }
1224
1248
  }
1225
1249
  };
1226
- const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
1250
+ /**
1251
+ * Check whether a node is located in a given named slot.
1252
+ *
1253
+ * @param nodeToRelocate the node of interest
1254
+ * @param slotName the slot name to check
1255
+ * @returns whether the node is located in the slot or not
1256
+ */
1257
+ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1227
1258
  if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1228
- if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
1259
+ if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1260
+ // if the node doesn't have a slot attribute, and the slot we're checking
1261
+ // is not a named slot, then we assume the node should be within the slot
1229
1262
  return true;
1230
1263
  }
1231
- if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
1264
+ if (nodeToRelocate.getAttribute('slot') === slotName) {
1232
1265
  return true;
1233
1266
  }
1234
1267
  return false;
1235
1268
  }
1236
- if (nodeToRelocate['s-sn'] === slotNameAttr) {
1269
+ if (nodeToRelocate['s-sn'] === slotName) {
1237
1270
  return true;
1238
1271
  }
1239
- return slotNameAttr === '';
1272
+ return slotName === '';
1240
1273
  };
1241
1274
  /**
1242
- * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
1243
- * calling them with `null`. This signals that the DOM element corresponding to
1244
- * the VDom node has been removed from the DOM.
1275
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1276
+ * them with `null`. This signals that the DOM element corresponding to the VDom
1277
+ * node has been removed from the DOM.
1245
1278
  *
1246
1279
  * @param vNode a virtual DOM node
1247
1280
  */
@@ -1320,7 +1353,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1320
1353
  // the disconnectCallback from working
1321
1354
  plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1322
1355
  if (checkSlotRelocate) {
1323
- relocateSlotContent(rootVnode.$elm$);
1356
+ markSlotContentForRelocation(rootVnode.$elm$);
1324
1357
  let relocateData;
1325
1358
  let nodeToRelocate;
1326
1359
  let orgLocationNode;
@@ -1556,6 +1589,10 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1556
1589
  */
1557
1590
  const callRender = (hostRef, instance, elm, isInitialLoad) => {
1558
1591
  try {
1592
+ /**
1593
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
1594
+ * method, so we can call the method immediately. If not, check before calling it.
1595
+ */
1559
1596
  instance = instance.render && instance.render();
1560
1597
  {
1561
1598
  hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
@@ -1638,6 +1675,16 @@ const appDidLoad = (who) => {
1638
1675
  }
1639
1676
  nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1640
1677
  };
1678
+ /**
1679
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1680
+ * e.g. custom element node. If a build figures out that e.g. no component
1681
+ * has a `componentDidLoad` method, the instance method gets removed from the
1682
+ * output bundle and this function returns `undefined`.
1683
+ * @param instance any object that may or may not contain methods
1684
+ * @param method method name
1685
+ * @param arg single arbitrary argument
1686
+ * @returns result of method call if it exists, otherwise `undefined`
1687
+ */
1641
1688
  const safeCall = (instance, method, arg) => {
1642
1689
  if (instance && instance[method]) {
1643
1690
  try {
@@ -1838,7 +1885,18 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1838
1885
  }
1839
1886
  return Cstr;
1840
1887
  };
1841
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1888
+ /**
1889
+ * Initialize a Stencil component given a reference to its host element, its
1890
+ * runtime bookkeeping data structure, runtime metadata about the component,
1891
+ * and (optionally) an HMR version ID.
1892
+ *
1893
+ * @param elm a host element
1894
+ * @param hostRef the element's runtime bookkeeping object
1895
+ * @param cmpMeta runtime metadata for the Stencil component
1896
+ * @param hmrVersionId an (optional) HMR version ID
1897
+ */
1898
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1899
+ let Cstr;
1842
1900
  // initializeComponent
1843
1901
  if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1844
1902
  // Let the runtime know that the component has been initialized
@@ -2159,13 +2217,40 @@ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !==
2159
2217
  * @returns void
2160
2218
  */
2161
2219
  const setNonce = (nonce) => (plt.$nonce$ = nonce);
2220
+ /**
2221
+ * A WeakMap mapping runtime component references to their corresponding host reference
2222
+ * instances.
2223
+ */
2162
2224
  const hostRefs = /*@__PURE__*/ new WeakMap();
2225
+ /**
2226
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2227
+ *
2228
+ * @param ref the runtime ref of interest
2229
+ * @returns the Host reference (if found) or undefined
2230
+ */
2163
2231
  const getHostRef = (ref) => hostRefs.get(ref);
2232
+ /**
2233
+ * Register a lazy instance with the {@link hostRefs} object so it's
2234
+ * corresponding {@link d.HostRef} can be retrieved later.
2235
+ *
2236
+ * @param lazyInstance the lazy instance of interest
2237
+ * @param hostRef that instances `HostRef` object
2238
+ * @returns a reference to the host ref WeakMap
2239
+ */
2164
2240
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2165
- const registerHost = (elm, cmpMeta) => {
2241
+ /**
2242
+ * Register a host element for a Stencil component, setting up various metadata
2243
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
2244
+ * metadata.
2245
+ *
2246
+ * @param hostElement the host element to register
2247
+ * @param cmpMeta runtime metadata for that component
2248
+ * @returns a reference to the host ref WeakMap
2249
+ */
2250
+ const registerHost = (hostElement, cmpMeta) => {
2166
2251
  const hostRef = {
2167
2252
  $flags$: 0,
2168
- $hostElement$: elm,
2253
+ $hostElement$: hostElement,
2169
2254
  $cmpMeta$: cmpMeta,
2170
2255
  $instanceValues$: new Map(),
2171
2256
  };
@@ -2174,11 +2259,11 @@ const registerHost = (elm, cmpMeta) => {
2174
2259
  }
2175
2260
  {
2176
2261
  hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2177
- elm['s-p'] = [];
2178
- elm['s-rc'] = [];
2262
+ hostElement['s-p'] = [];
2263
+ hostElement['s-rc'] = [];
2179
2264
  }
2180
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2181
- return hostRefs.set(elm, hostRef);
2265
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
2266
+ return hostRefs.set(hostElement, hostRef);
2182
2267
  };
2183
2268
  const isMemberInElement = (elm, memberName) => memberName in elm;
2184
2269
  const consoleError = (e, el) => (0, console.error)(e, el);
@@ -2295,4 +2380,4 @@ exports.promiseResolve = promiseResolve;
2295
2380
  exports.registerInstance = registerInstance;
2296
2381
  exports.setNonce = setNonce;
2297
2382
 
2298
- //# sourceMappingURL=index-c042e24b.js.map
2383
+ //# sourceMappingURL=index-60dd0c56.js.map