@mgdis/mg-components 5.19.0 → 5.19.2

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 (157) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_34.cjs.entry.js +84 -40
  3. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  4. package/dist/cjs/mg-components.cjs.js +1 -1
  5. package/dist/cjs/mg-item-more.cjs.entry.js +2 -1
  6. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
  8. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  9. package/dist/collection/components/atoms/mg-button/mg-button.js +2 -1
  10. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  11. package/dist/collection/components/atoms/mg-card/mg-card.js +4 -4
  12. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  13. package/dist/collection/components/atoms/mg-icon/mg-icon.js +2 -2
  14. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  15. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +19 -1
  16. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +12 -0
  18. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +1 -0
  19. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +1 -5
  20. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +1 -1
  21. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
  22. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  23. package/dist/collection/components/molecules/inputs/MgInput.js +3 -3
  24. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +4 -1
  26. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +19 -1
  28. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +6 -5
  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 +5 -2
  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 +1 -1
  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-numeric/mg-input-numeric.js +5 -4
  37. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  38. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
  39. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  40. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +3 -3
  41. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +3 -2
  43. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +4 -10
  45. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  46. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +1 -1
  48. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  49. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  50. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +78 -2
  51. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  52. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +108 -0
  53. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +1 -0
  54. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +44 -0
  55. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +1 -1
  56. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +1 -1
  57. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  58. package/dist/collection/components/molecules/menu/mg-menu/test/{mg-menu.e2e.js → mg-menu.e2e.playwright.js} +67 -96
  59. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +1 -0
  60. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +100 -0
  61. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +1 -0
  62. package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
  63. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
  64. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  65. package/dist/collection/components/molecules/mg-form/mg-form.js +2 -1
  66. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  67. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +1 -1
  68. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  69. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  70. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  71. package/dist/collection/utils/behaviors.utils.js +2 -1
  72. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  73. package/dist/collection/utils/playwright.e2e.test.utils.js +3 -3
  74. package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
  75. package/dist/collection/utils/unit.test.utils.js +0 -3
  76. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  77. package/dist/components/MgInput.js +3 -3
  78. package/dist/components/MgInput.js.map +1 -1
  79. package/dist/components/mg-action-more.js +1 -1
  80. package/dist/components/mg-action-more.js.map +1 -1
  81. package/dist/components/mg-badge2.js +1 -1
  82. package/dist/components/mg-badge2.js.map +1 -1
  83. package/dist/components/mg-button2.js +2 -1
  84. package/dist/components/mg-button2.js.map +1 -1
  85. package/dist/components/mg-card2.js +4 -4
  86. package/dist/components/mg-card2.js.map +1 -1
  87. package/dist/components/mg-form.js +2 -1
  88. package/dist/components/mg-form.js.map +1 -1
  89. package/dist/components/mg-icon2.js +2 -2
  90. package/dist/components/mg-icon2.js.map +1 -1
  91. package/dist/components/mg-input-checkbox-paginated2.js +9 -4
  92. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  93. package/dist/components/mg-input-checkbox.js +6 -5
  94. package/dist/components/mg-input-checkbox.js.map +1 -1
  95. package/dist/components/mg-input-date.js +1 -1
  96. package/dist/components/mg-input-date.js.map +1 -1
  97. package/dist/components/mg-input-numeric.js +5 -4
  98. package/dist/components/mg-input-numeric.js.map +1 -1
  99. package/dist/components/mg-input-password.js +1 -1
  100. package/dist/components/mg-input-password.js.map +1 -1
  101. package/dist/components/mg-input-select2.js +3 -3
  102. package/dist/components/mg-input-select2.js.map +1 -1
  103. package/dist/components/mg-input-text2.js +2 -2
  104. package/dist/components/mg-input-text2.js.map +1 -1
  105. package/dist/components/mg-input-textarea.js +1 -1
  106. package/dist/components/mg-input-textarea.js.map +1 -1
  107. package/dist/components/mg-input-title2.js +3 -1
  108. package/dist/components/mg-input-title2.js.map +1 -1
  109. package/dist/components/mg-input-toggle.js +41 -3
  110. package/dist/components/mg-input-toggle.js.map +1 -1
  111. package/dist/components/mg-item-more.js +2 -1
  112. package/dist/components/mg-item-more.js.map +1 -1
  113. package/dist/components/mg-menu2.js +1 -1
  114. package/dist/components/mg-menu2.js.map +1 -1
  115. package/dist/components/mg-pagination2.js +1 -1
  116. package/dist/components/mg-pagination2.js.map +1 -1
  117. package/dist/components/mg-panel.js +1 -1
  118. package/dist/components/mg-panel.js.map +1 -1
  119. package/dist/components/mg-tooltip2.js +1 -1
  120. package/dist/components/mg-tooltip2.js.map +1 -1
  121. package/dist/esm/loader.js +1 -1
  122. package/dist/esm/mg-action-more_34.entry.js +84 -40
  123. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  124. package/dist/esm/mg-components.js +1 -1
  125. package/dist/esm/mg-item-more.entry.js +2 -1
  126. package/dist/esm/mg-item-more.entry.js.map +1 -1
  127. package/dist/mg-components/mg-components.esm.js +1 -1
  128. package/dist/mg-components/mg-components.esm.js.map +1 -1
  129. package/dist/mg-components/p-01ebc95a.entry.js +2 -0
  130. package/dist/mg-components/p-01ebc95a.entry.js.map +1 -0
  131. package/dist/mg-components/p-71a5a848.entry.js +2 -0
  132. package/dist/mg-components/p-71a5a848.entry.js.map +1 -0
  133. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +4 -0
  134. package/dist/types/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts +1 -0
  135. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +4 -0
  136. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +1 -4
  137. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +2 -2
  138. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +3 -6
  139. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +2 -2
  140. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +22 -0
  141. package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +1 -0
  142. package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +1 -0
  143. package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +1 -0
  144. package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +1 -3
  145. package/dist/types/components.d.ts +26 -4
  146. package/package.json +6 -6
  147. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.js +0 -18
  148. package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.js.map +0 -1
  149. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.js +0 -125
  150. package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.js.map +0 -1
  151. package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.js.map +0 -1
  152. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.js +0 -119
  153. package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.js.map +0 -1
  154. package/dist/mg-components/p-768fc594.entry.js +0 -2
  155. package/dist/mg-components/p-768fc594.entry.js.map +0 -1
  156. package/dist/mg-components/p-d2d6afec.entry.js +0 -2
  157. package/dist/mg-components/p-d2d6afec.entry.js.map +0 -1
@@ -101,10 +101,13 @@ describe('mg-input-checkbox', () => {
101
101
  expect(err.message).toMatch('<mg-input> prop "labelOnTop" must not be paired with the prop "labelHide".');
102
102
  }
103
103
  });
104
- test('Should not render with invalid value property: %s', async () => {
104
+ test.each([
105
+ { identifier: 'identifier', type, label: 'label', value: undefined },
106
+ { identifier: 'identifier', type, label: 'label', value: ['batman', 'joker', 'bane'] },
107
+ ])('Should not render with invalid value property: %s', async (args) => {
105
108
  expect.assertions(1);
106
109
  try {
107
- await getPage({ identifier: 'identifier', type, label: 'label', value: ['batman', 'joker', 'bane'] });
110
+ await getPage(args);
108
111
  }
109
112
  catch (err) {
110
113
  expect(err.message).toMatch('<mg-input-checkbox> prop "value" is required and all values must be the same type, CheckboxItem.');
@@ -1 +1 @@
1
- {"version":3,"file":"mg-input-checkbox.spec.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.tsx"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC9H,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAiB,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAE7F,gBAAgB,EAAE,CAAC;AACnB,gBAAgB,EAAE,CAAC;AAEnB,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE;EACrB,MAAM,IAAI,GAAG,WAAW,CAAC;IACvB,UAAU,EAA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AAC,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;MACrC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;MAEpC,MAAM,KAAK,GAAG,eAAe,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;MAChE,KAAK,CAAC,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;MACjC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;MAErB,KAAK,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;MACjE,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;MAE5B,MAAM,kBAAkB,GAAG,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,iDAAiD,CAAC,CAAC;MAC1H,MAAM,iBAAiB,GAAG,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,gDAAgD,CAAC,CAAC;MAExH,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;MAC7C,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;MAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { cloneDeep, mockConsoleError, mockWindowFrames, setupResizeObserverMock } from '../../../../../utils/unit.test.utils';\nimport { MgInputCheckbox } from '../mg-input-checkbox';\nimport messages from '../../../../../locales/en/messages.json';\nimport { CheckboxValue, checkboxTypes } from '../mg-input-checkbox.conf';\nimport { MgPopover } from '../../../mg-popover/mg-popover';\nimport { MgInputText } from '../../mg-input-text/mg-input-text';\nimport { MgMessage } from '../../../mg-message/mg-message';\nimport { MgPagination } from '../../../mg-pagination/mg-pagination';\nimport { MgButton } from '../../../../atoms/mg-button/mg-button';\nimport { MgInputCheckboxPaginated } from '../mg-input-checkbox-paginated/mg-input-checkbox-paginated';\nimport { MgPopoverContent } from '../../../mg-popover/mg-popover-content/mg-popover-content';\n\nmockWindowFrames();\nmockConsoleError();\n\nconst getPage = args => {\n const page = newSpecPage({\n components: [MgInputCheckbox, MgPopover, MgPopoverContent, MgInputText, MgMessage, MgPagination, MgButton, MgInputCheckboxPaginated],\n template: () => <mg-input-checkbox {...args}></mg-input-checkbox>,\n });\n\n jest.runAllTimers();\n return page;\n};\n\ndescribe('mg-input-checkbox', () => {\n beforeEach(() => {\n jest.useFakeTimers();\n setupResizeObserverMock({\n observe: () => null,\n disconnect: () => null,\n });\n });\n\n afterEach(() => jest.runOnlyPendingTimers());\n\n const items: CheckboxValue[] = [\n { title: 'batman', value: true },\n { title: 'robin', value: false, disabled: true },\n { title: 'joker', value: false },\n { title: 'bane', value: null },\n ];\n\n describe.each([...checkboxTypes, undefined])('render by type %s', type => {\n let testValues: unknown[] = [\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, readonly: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, labelOnTop: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, labelHide: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, inputVerticalList: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, required: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, required: true, readonly: true, helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, required: true, disabled: true, helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, readonly: true, labelOnTop: true, tooltip: 'Tooltip message' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, disabled: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, tooltip: 'Batman is a DC Comics license' },\n ];\n if (type === 'multi') {\n testValues = [\n ...testValues,\n ...[true, false].flatMap(displaySelectedValues =>\n [\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', readonly: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', disabled: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', tooltip: 'Batman is a DC Comics license' },\n ].map(args => ({ ...args, displaySelectedValues })),\n ),\n ];\n }\n test.each(testValues)('Should render with args %s:', async args => {\n const { root } = await getPage(args);\n expect(root).toMatchSnapshot();\n });\n\n test.each(['', ' ', undefined])('Should not render with invalid identifier property: %s', async identifier => {\n expect.assertions(1);\n try {\n await getPage({ identifier, type, value: cloneDeep(items) });\n } catch (err) {\n expect(err.message).toMatch('<mg-input> prop \"identifier\" is required.');\n }\n });\n\n test.each(['', ' ', undefined])('Should not render with invalid label property: %s', async label => {\n expect.assertions(1);\n try {\n await getPage({ identifier: 'identifier', type, label, value: cloneDeep(items) });\n } catch (err) {\n expect(err.message).toMatch('<mg-input> prop \"label\" is required.');\n }\n });\n\n test('Should not render when using labelOnTop and labelHide: %s', async () => {\n expect.assertions(1);\n try {\n await getPage({ identifier: 'identifier', type, label: 'label', value: cloneDeep(items), labelOnTop: true, labelHide: true });\n } catch (err) {\n expect(err.message).toMatch('<mg-input> prop \"labelOnTop\" must not be paired with the prop \"labelHide\".');\n }\n });\n\n test('Should not render with invalid value property: %s', async () => {\n expect.assertions(1);\n try {\n await getPage({ identifier: 'identifier', type, label: 'label', value: ['batman', 'joker', 'bane'] });\n } catch (err) {\n expect(err.message).toMatch('<mg-input-checkbox> prop \"value\" is required and all values must be the same type, CheckboxItem.');\n }\n });\n\n test.each([true, false])('Should trigger events, case validity check %s', async validity => {\n const value = items.map((item, index) => ({ ...item, value: false, id: index, required: item.required, disabled: item.disabled, hero: 'batman' }));\n value[0].value = !validity;\n const page = await getPage({ label: 'label', type, identifier: 'identifier', helpText: 'My help text', value, required: true });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n const index = validity ? 2 : 0;\n const input = allInputs[index];\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => validity);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing: !validity,\n })),\n });\n });\n\n jest.spyOn(page.rootInstance.valueChange, 'emit');\n\n input.dispatchEvent(new CustomEvent('focus', { bubbles: true }));\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot(); //Snapshot on focus\n\n input.checked = validity;\n input.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n\n const emittedValue = value;\n emittedValue[index].value = input.checked;\n await page.waitForChanges();\n expect(page.rootInstance.valueChange.emit).toHaveBeenCalledWith(emittedValue);\n\n input.dispatchEvent(new CustomEvent('blur', { bubbles: true }));\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot(); //Snapshot on blur\n });\n\n describe.each(['readonly', 'disabled'])('validity, case next state is %s', nextState => {\n test.each([\n { validity: true, valueMissing: false },\n { validity: false, valueMissing: true },\n { validity: false, valueMissing: false },\n ])('validity (%s), valueMissing (%s)', async ({ validity, valueMissing }) => {\n const value = items.map((item, index) => ({ ...item, value: !valueMissing && index === 1 }));\n const args = { label: 'label', identifier: 'identifier', type, value, helpText: 'My help text', required: true };\n const page = await getPage(args);\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n const input = allInputs[0];\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => validity);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing,\n })),\n });\n });\n\n input.dispatchEvent(new CustomEvent('blur', { bubbles: true }));\n await page.waitForChanges();\n\n if (validity) {\n expect(page.rootInstance.errorMessage).toBeUndefined();\n } else if (valueMissing) {\n expect(page.rootInstance.errorMessage).toEqual(messages.errors.required);\n }\n expect(page.rootInstance.valid).toEqual(validity);\n expect(page.rootInstance.invalid).toEqual(!validity);\n\n if (valueMissing) {\n expect(page.root).toMatchSnapshot(); //Snapshot with readonly/disabled FALSE\n element[nextState] = true;\n await page.waitForChanges();\n expect(page.root).toMatchSnapshot(); //Snapshot with readonly/disabled TRUE\n }\n });\n });\n test.each([\n {\n valid: true,\n errorMessage: 'Override error',\n },\n {\n valid: false,\n errorMessage: 'Override error',\n },\n ])(\"should display override error with setError component's public method\", async params => {\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value: cloneDeep(items), helpText: 'My help text', required: true });\n\n expect(page.root).toMatchSnapshot();\n\n const element = page.doc.querySelector('mg-input-checkbox');\n const inputs = Array.from(element.shadowRoot.querySelectorAll('input'));\n\n //mock validity\n inputs.forEach(input => {\n Object.defineProperty(input, 'validity', {\n get: () => ({}),\n });\n });\n\n await element.setError(params.valid, params.errorMessage);\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each([\n {\n valid: '',\n errorMessage: 'Override error',\n error: '<mg-input-checkbox> method \"setError()\" param \"valid\" must be a boolean',\n },\n {\n valid: undefined,\n errorMessage: 'Override error',\n error: '<mg-input-checkbox> method \"setError()\" param \"valid\" must be a boolean',\n },\n {\n valid: true,\n errorMessage: ' ',\n error: '<mg-input-checkbox> method \"setError()\" param \"errorMessage\" must be a string',\n },\n {\n valid: true,\n errorMessage: true,\n error: '<mg-input-checkbox> method \"setError()\" param \"errorMessage\" must be a string',\n },\n ])(\"shloud throw error with setError component's public method invalid params\", async params => {\n expect.assertions(1);\n try {\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value: cloneDeep(items), helpText: 'My help text', required: true });\n const element = page.doc.querySelector('mg-input-checkbox');\n\n await element.setError(params.valid as unknown as boolean, params.errorMessage as unknown as string);\n await page.waitForChanges();\n } catch (err) {\n expect(err.message).toMatch(params.error);\n }\n });\n\n test(\"display error with displayError component's public method\", async () => {\n const value = cloneDeep(items);\n value[0].value = false;\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value, helpText: 'My help text', required: true });\n\n expect(page.root).toMatchSnapshot();\n\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => false);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing: true,\n })),\n });\n });\n\n await element.displayError();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each(['fr', 'xx'])('Should render component error with locale: %s', async lang => {\n const value = cloneDeep(items);\n value[0].value = false;\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value, helpText: 'My help text', required: true, lang });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => false);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing: true,\n })),\n });\n });\n\n await element.displayError();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each([[[true, false].flatMap(value => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(item => ({ title: item.toString(), value })))]])(\n 'Should render component with locale \"fr\"',\n async value => {\n const page = await getPage({ label: 'label', identifier: 'identifier', value, lang: 'fr' });\n\n expect(page.root).toMatchSnapshot();\n },\n );\n\n test('Should remove error on input when required change dynamically', async () => {\n const page = await getPage({\n label: 'label',\n identifier: 'identifier',\n value: [\n { title: 'batman', value: false },\n { title: 'robin', value: false },\n ],\n required: true,\n type,\n });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n\n //mock validity\n allInputs[0].checkValidity = jest\n .fn()\n .mockReturnValueOnce(false) //1\n .mockReturnValueOnce(false) //1\n .mockReturnValueOnce(true) //2\n .mockReturnValueOnce(true) //2\n .mockReturnValueOnce(false) //3\n .mockReturnValueOnce(false); //3\n allInputs[1].checkValidity = jest.fn().mockReturnValueOnce(true).mockReturnValueOnce(true); //2\n Object.defineProperty(allInputs[0], 'validity', {\n get: jest\n .fn()\n .mockReturnValueOnce({\n valueMissing: true, //1\n })\n .mockReturnValueOnce({\n valueMissing: false, //2\n })\n .mockReturnValueOnce({\n valueMissing: true, //3\n }),\n });\n\n await element.displayError();\n await page.waitForChanges();\n\n expect(page.rootInstance.hasDisplayedError).toEqual(true);\n expect(page.rootInstance.errorMessage).toEqual(messages.errors.required);\n\n element.required = false;\n await page.waitForChanges();\n\n // Error message should disapear and change the hasDisplayedError status\n expect(page.rootInstance.hasDisplayedError).toEqual(false);\n expect(page.rootInstance.errorMessage).toBeUndefined();\n\n element.required = true;\n await page.waitForChanges();\n\n // If back on required the message is still not displayed\n expect(page.rootInstance.hasDisplayedError).toEqual(false);\n expect(page.rootInstance.errorMessage).toBeUndefined();\n });\n\n test('should enable \"displaySearchInput\" when value list is greater than 10', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const { root } = await getPage({ label: 'label', identifier: 'identifier', value, type });\n expect(root).toMatchSnapshot();\n });\n });\n\n describe('navigation', () => {\n test('should NOT manage keyboard \"tab\" navigation on \"checkbox\" type', async () => {\n const page = await getPage({ label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'checkbox', tooltip: 'Tooltip message' });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = Array.from(element.shadowRoot.querySelectorAll('input'));\n\n allInputs.forEach(input => input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' })));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n\n allInputs[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each(['next', 'prev'])('should manage keyboard \"tab\" navigation on \"multi\" type', async direction => {\n const page = await getPage({\n label: 'label',\n identifier: 'identifier',\n value: [1, 2, 3, 4, 5, 6, 7, 8, 9].map(item => ({\n title: `item ${item}`,\n value: false,\n })),\n type: 'multi',\n tooltip: 'Tooltip message',\n });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = Array.from(element.shadowRoot.querySelectorAll('input'));\n const button = element.shadowRoot.querySelector('mg-button');\n const popover = element.shadowRoot.querySelector('mg-popover');\n\n button.dispatchEvent(new CustomEvent('click', { bubbles: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(true);\n\n if (direction === 'next') for await (const input of allInputs) input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' }));\n else if (direction === 'prev') allInputs[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab', shiftKey: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(false);\n });\n\n test('should manage keyboard \"shift+tab\" navigation on \"multi\" type', async () => {\n const page = await getPage({\n label: 'label',\n identifier: 'identifier',\n value: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(item => ({\n title: `item ${item}`,\n value: false,\n })),\n type: 'multi',\n tooltip: 'Tooltip message',\n });\n const element = page.doc.querySelector('mg-input-checkbox');\n const searchInput = element.shadowRoot.querySelector('mg-input-text').shadowRoot.querySelector('input');\n const button = element.shadowRoot.querySelector('mg-button');\n const popover = element.shadowRoot.querySelector('mg-popover');\n\n button.dispatchEvent(new CustomEvent('click', { bubbles: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(true);\n\n searchInput.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab', shiftKey: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(false);\n });\n });\n\n test.each([' ', 'batman'])('Should not render with invalid type property: %s', async type => {\n expect.assertions(1);\n try {\n await getPage({ identifier: 'identifier', type, label: 'label', value: cloneDeep(items) });\n } catch (err) {\n expect(err.message).toMatch('<mg-input-checkbox> prop \"type\" must be a CheckboxType.');\n }\n });\n\n test.each([undefined, 'checkbox'])('Should not render with invalid displaySelectedValues and type configuration', async type => {\n expect.assertions(1);\n try {\n await getPage({ label: 'label', identifier: 'identifier', type, value: cloneDeep(items), displaySelectedValues: true });\n } catch (err) {\n expect(err.message).toMatch('<mg-input-checkbox> prop \"displaySelectedValues\" can only be used with prop type \"multi\".');\n }\n });\n\n describe('multi search', () => {\n test('should enable return search result and update pagination', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('li'));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const searchInput = mgInputCheckbox.shadowRoot.querySelector('mg-input-text');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.length).toEqual(10);\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '2' }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(4);\n expect(page.root).toMatchSnapshot();\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '11' }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(1);\n expect(page.root).toMatchSnapshot();\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '111' }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(0);\n expect(page.root).toMatchSnapshot();\n\n mgPopover.display = false;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n expect(searchInput.value).toEqual('');\n expect(page.root).toMatchSnapshot();\n });\n\n test('should search and update values', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const searchInput = mgInputCheckbox.shadowRoot.querySelector('mg-input-text');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '2' }));\n await page.waitForChanges();\n\n const input = mgInputCheckbox.shadowRoot.querySelector('input');\n input.checkValidity = () => true;\n input.checked = true;\n\n input.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n await page.waitForChanges();\n\n expect(mgInputCheckbox.value.find(item => item.value)).toHaveProperty('title', 'item 2');\n expect(page.root).toMatchSnapshot();\n\n mgPopover.display = false;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test('should navigate across paginated list with mg-pagination', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('li'));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const mgPagination = mgInputCheckbox.shadowRoot.querySelector('mg-pagination');\n const mgPaginationNext = mgPagination.shadowRoot.querySelector('mg-button:last-of-type');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.length).toEqual(10);\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(10);\n expect(page.root).toMatchSnapshot();\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(1);\n expect(page.root).toMatchSnapshot();\n });\n\n test('should update all values with mass actions', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('input'));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.filter(item => item.value === 'true').length).toEqual(0);\n expect(mgInputCheckbox.value.filter(item => item.value).length).toEqual(0);\n expect(page.root).toMatchSnapshot();\n\n const selectAllButton = mgInputCheckbox.shadowRoot.querySelector('mg-input-checkbox-paginated:last-of-type mg-button');\n selectAllButton.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.filter(item => item.value === 'true').length).toEqual(10);\n expect(mgInputCheckbox.value.filter(item => item.value).length).toEqual(21);\n expect(page.root).toMatchSnapshot();\n\n const unselectAllButton = Array.from(\n mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated .mg-c-input__input-checkbox-multi-section-header mg-button:last-of-type'),\n ).find(button => button.textContent === 'Unselect all');\n unselectAllButton.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.filter(item => item.value === 'true').length).toEqual(0);\n expect(mgInputCheckbox.value.filter(item => item.value).length).toEqual(0);\n expect(page.root).toMatchSnapshot();\n });\n\n test('should toggle selected items section', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map((item, index) => ({\n title: `item ${item}`,\n value: [5, 12, 13, 17].some(item => item === index),\n }));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n const sections = Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated'));\n\n expect(sections.length).toEqual(2);\n\n for (const [i, section] of sections.entries()) {\n const firstButton = section.querySelector('mg-button');\n const sectionContent = section.querySelector('.mg-c-input__input-checkbox-multi-section-content');\n expect(sectionContent).not.toHaveAttribute('hidden');\n\n firstButton.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n if (i !== 0) {\n expect(sectionContent).not.toHaveAttribute('hidden');\n } else {\n expect(sectionContent).toHaveAttribute('hidden');\n }\n expect(page.root).toMatchSnapshot();\n }\n });\n\n test('should go to previous page when last item is checked', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('input'));\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const mgPagination = mgInputCheckbox.shadowRoot.querySelector('mg-pagination:last-of-type');\n const mgPaginationNext = mgPagination.shadowRoot.querySelector('mg-button:last-of-type');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.length).toEqual(10);\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated:last-of-type input'));\n expect(resultList.length).toEqual(1);\n expect(page.root).toMatchSnapshot();\n\n const input = mgInputCheckbox.shadowRoot.querySelector('input');\n input.checkValidity = () => true;\n input.checked = true;\n\n input.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n await page.waitForChanges();\n\n const firstSectionInputs = mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated:first-of-type input');\n const lastSectionInputs = mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated:last-of-type input');\n\n expect(firstSectionInputs.length).toEqual(1);\n expect(lastSectionInputs.length).toEqual(10);\n expect(page.root).toMatchSnapshot();\n });\n });\n});\n"]}
1
+ {"version":3,"file":"mg-input-checkbox.spec.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox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,CAAC;MAChE,KAAK,CAAC,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;MACjC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;MAErB,KAAK,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;MACjE,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;MAE5B,MAAM,kBAAkB,GAAG,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,iDAAiD,CAAC,CAAC;MAC1H,MAAM,iBAAiB,GAAG,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,gDAAgD,CAAC,CAAC;MAExH,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;MAC7C,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;MAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { cloneDeep, mockConsoleError, mockWindowFrames, setupResizeObserverMock } from '../../../../../utils/unit.test.utils';\nimport { MgInputCheckbox } from '../mg-input-checkbox';\nimport messages from '../../../../../locales/en/messages.json';\nimport { CheckboxValue, checkboxTypes } from '../mg-input-checkbox.conf';\nimport { MgPopover } from '../../../mg-popover/mg-popover';\nimport { MgInputText } from '../../mg-input-text/mg-input-text';\nimport { MgMessage } from '../../../mg-message/mg-message';\nimport { MgPagination } from '../../../mg-pagination/mg-pagination';\nimport { MgButton } from '../../../../atoms/mg-button/mg-button';\nimport { MgInputCheckboxPaginated } from '../mg-input-checkbox-paginated/mg-input-checkbox-paginated';\nimport { MgPopoverContent } from '../../../mg-popover/mg-popover-content/mg-popover-content';\n\nmockWindowFrames();\nmockConsoleError();\n\nconst getPage = args => {\n const page = newSpecPage({\n components: [MgInputCheckbox, MgPopover, MgPopoverContent, MgInputText, MgMessage, MgPagination, MgButton, MgInputCheckboxPaginated],\n template: () => <mg-input-checkbox {...args}></mg-input-checkbox>,\n });\n\n jest.runAllTimers();\n return page;\n};\n\ndescribe('mg-input-checkbox', () => {\n beforeEach(() => {\n jest.useFakeTimers();\n setupResizeObserverMock({\n observe: () => null,\n disconnect: () => null,\n });\n });\n\n afterEach(() => jest.runOnlyPendingTimers());\n\n const items: CheckboxValue[] = [\n { title: 'batman', value: true },\n { title: 'robin', value: false, disabled: true },\n { title: 'joker', value: false },\n { title: 'bane', value: null },\n ];\n\n describe.each([...checkboxTypes, undefined])('render by type %s', type => {\n let testValues: unknown[] = [\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, readonly: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, labelOnTop: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, labelHide: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, inputVerticalList: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, required: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, required: true, readonly: true, helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, required: true, disabled: true, helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, readonly: true, labelOnTop: true, tooltip: 'Tooltip message' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, disabled: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type, tooltip: 'Batman is a DC Comics license' },\n ];\n if (type === 'multi') {\n testValues = [\n ...testValues,\n ...[true, false].flatMap(displaySelectedValues =>\n [\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', readonly: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', disabled: true },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', helpText: 'Hello joker' },\n { label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'multi', tooltip: 'Batman is a DC Comics license' },\n ].map(args => ({ ...args, displaySelectedValues })),\n ),\n ];\n }\n test.each(testValues)('Should render with args %s:', async args => {\n const { root } = await getPage(args);\n expect(root).toMatchSnapshot();\n });\n\n test.each(['', ' ', undefined])('Should not render with invalid identifier property: %s', async identifier => {\n expect.assertions(1);\n try {\n await getPage({ identifier, type, value: cloneDeep(items) });\n } catch (err) {\n expect(err.message).toMatch('<mg-input> prop \"identifier\" is required.');\n }\n });\n\n test.each(['', ' ', undefined])('Should not render with invalid label property: %s', async label => {\n expect.assertions(1);\n try {\n await getPage({ identifier: 'identifier', type, label, value: cloneDeep(items) });\n } catch (err) {\n expect(err.message).toMatch('<mg-input> prop \"label\" is required.');\n }\n });\n\n test('Should not render when using labelOnTop and labelHide: %s', async () => {\n expect.assertions(1);\n try {\n await getPage({ identifier: 'identifier', type, label: 'label', value: cloneDeep(items), labelOnTop: true, labelHide: true });\n } catch (err) {\n expect(err.message).toMatch('<mg-input> prop \"labelOnTop\" must not be paired with the prop \"labelHide\".');\n }\n });\n\n test.each([\n { identifier: 'identifier', type, label: 'label', value: undefined },\n { identifier: 'identifier', type, label: 'label', value: ['batman', 'joker', 'bane'] },\n ])('Should not render with invalid value property: %s', async args => {\n expect.assertions(1);\n try {\n await getPage(args);\n } catch (err) {\n expect(err.message).toMatch('<mg-input-checkbox> prop \"value\" is required and all values must be the same type, CheckboxItem.');\n }\n });\n\n test.each([true, false])('Should trigger events, case validity check %s', async validity => {\n const value = items.map((item, index) => ({ ...item, value: false, id: index, required: item.required, disabled: item.disabled, hero: 'batman' }));\n value[0].value = !validity;\n const page = await getPage({ label: 'label', type, identifier: 'identifier', helpText: 'My help text', value, required: true });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n const index = validity ? 2 : 0;\n const input = allInputs[index];\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => validity);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing: !validity,\n })),\n });\n });\n\n jest.spyOn(page.rootInstance.valueChange, 'emit');\n\n input.dispatchEvent(new CustomEvent('focus', { bubbles: true }));\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot(); //Snapshot on focus\n\n input.checked = validity;\n input.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n\n const emittedValue = value;\n emittedValue[index].value = input.checked;\n await page.waitForChanges();\n expect(page.rootInstance.valueChange.emit).toHaveBeenCalledWith(emittedValue);\n\n input.dispatchEvent(new CustomEvent('blur', { bubbles: true }));\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot(); //Snapshot on blur\n });\n\n describe.each(['readonly', 'disabled'])('validity, case next state is %s', nextState => {\n test.each([\n { validity: true, valueMissing: false },\n { validity: false, valueMissing: true },\n { validity: false, valueMissing: false },\n ])('validity (%s), valueMissing (%s)', async ({ validity, valueMissing }) => {\n const value = items.map((item, index) => ({ ...item, value: !valueMissing && index === 1 }));\n const args = { label: 'label', identifier: 'identifier', type, value, helpText: 'My help text', required: true };\n const page = await getPage(args);\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n const input = allInputs[0];\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => validity);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing,\n })),\n });\n });\n\n input.dispatchEvent(new CustomEvent('blur', { bubbles: true }));\n await page.waitForChanges();\n\n if (validity) {\n expect(page.rootInstance.errorMessage).toBeUndefined();\n } else if (valueMissing) {\n expect(page.rootInstance.errorMessage).toEqual(messages.errors.required);\n }\n expect(page.rootInstance.valid).toEqual(validity);\n expect(page.rootInstance.invalid).toEqual(!validity);\n\n if (valueMissing) {\n expect(page.root).toMatchSnapshot(); //Snapshot with readonly/disabled FALSE\n element[nextState] = true;\n await page.waitForChanges();\n expect(page.root).toMatchSnapshot(); //Snapshot with readonly/disabled TRUE\n }\n });\n });\n test.each([\n {\n valid: true,\n errorMessage: 'Override error',\n },\n {\n valid: false,\n errorMessage: 'Override error',\n },\n ])(\"should display override error with setError component's public method\", async params => {\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value: cloneDeep(items), helpText: 'My help text', required: true });\n\n expect(page.root).toMatchSnapshot();\n\n const element = page.doc.querySelector('mg-input-checkbox');\n const inputs = Array.from(element.shadowRoot.querySelectorAll('input'));\n\n //mock validity\n inputs.forEach(input => {\n Object.defineProperty(input, 'validity', {\n get: () => ({}),\n });\n });\n\n await element.setError(params.valid, params.errorMessage);\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each([\n {\n valid: '',\n errorMessage: 'Override error',\n error: '<mg-input-checkbox> method \"setError()\" param \"valid\" must be a boolean',\n },\n {\n valid: undefined,\n errorMessage: 'Override error',\n error: '<mg-input-checkbox> method \"setError()\" param \"valid\" must be a boolean',\n },\n {\n valid: true,\n errorMessage: ' ',\n error: '<mg-input-checkbox> method \"setError()\" param \"errorMessage\" must be a string',\n },\n {\n valid: true,\n errorMessage: true,\n error: '<mg-input-checkbox> method \"setError()\" param \"errorMessage\" must be a string',\n },\n ])(\"shloud throw error with setError component's public method invalid params\", async params => {\n expect.assertions(1);\n try {\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value: cloneDeep(items), helpText: 'My help text', required: true });\n const element = page.doc.querySelector('mg-input-checkbox');\n\n await element.setError(params.valid as unknown as boolean, params.errorMessage as unknown as string);\n await page.waitForChanges();\n } catch (err) {\n expect(err.message).toMatch(params.error);\n }\n });\n\n test(\"display error with displayError component's public method\", async () => {\n const value = cloneDeep(items);\n value[0].value = false;\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value, helpText: 'My help text', required: true });\n\n expect(page.root).toMatchSnapshot();\n\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => false);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing: true,\n })),\n });\n });\n\n await element.displayError();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each(['fr', 'xx'])('Should render component error with locale: %s', async lang => {\n const value = cloneDeep(items);\n value[0].value = false;\n const page = await getPage({ label: 'label', identifier: 'identifier', type, value, helpText: 'My help text', required: true, lang });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n\n //mock validity\n allInputs.forEach(input => {\n input.checkValidity = jest.fn(() => false);\n Object.defineProperty(input, 'validity', {\n get: jest.fn(() => ({\n valueMissing: true,\n })),\n });\n });\n\n await element.displayError();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each([[[true, false].flatMap(value => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(item => ({ title: item.toString(), value })))]])(\n 'Should render component with locale \"fr\"',\n async value => {\n const page = await getPage({ label: 'label', identifier: 'identifier', value, lang: 'fr' });\n\n expect(page.root).toMatchSnapshot();\n },\n );\n\n test('Should remove error on input when required change dynamically', async () => {\n const page = await getPage({\n label: 'label',\n identifier: 'identifier',\n value: [\n { title: 'batman', value: false },\n { title: 'robin', value: false },\n ],\n required: true,\n type,\n });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = element.shadowRoot.querySelectorAll('input');\n\n //mock validity\n allInputs[0].checkValidity = jest\n .fn()\n .mockReturnValueOnce(false) //1\n .mockReturnValueOnce(false) //1\n .mockReturnValueOnce(true) //2\n .mockReturnValueOnce(true) //2\n .mockReturnValueOnce(false) //3\n .mockReturnValueOnce(false); //3\n allInputs[1].checkValidity = jest.fn().mockReturnValueOnce(true).mockReturnValueOnce(true); //2\n Object.defineProperty(allInputs[0], 'validity', {\n get: jest\n .fn()\n .mockReturnValueOnce({\n valueMissing: true, //1\n })\n .mockReturnValueOnce({\n valueMissing: false, //2\n })\n .mockReturnValueOnce({\n valueMissing: true, //3\n }),\n });\n\n await element.displayError();\n await page.waitForChanges();\n\n expect(page.rootInstance.hasDisplayedError).toEqual(true);\n expect(page.rootInstance.errorMessage).toEqual(messages.errors.required);\n\n element.required = false;\n await page.waitForChanges();\n\n // Error message should disapear and change the hasDisplayedError status\n expect(page.rootInstance.hasDisplayedError).toEqual(false);\n expect(page.rootInstance.errorMessage).toBeUndefined();\n\n element.required = true;\n await page.waitForChanges();\n\n // If back on required the message is still not displayed\n expect(page.rootInstance.hasDisplayedError).toEqual(false);\n expect(page.rootInstance.errorMessage).toBeUndefined();\n });\n\n test('should enable \"displaySearchInput\" when value list is greater than 10', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const { root } = await getPage({ label: 'label', identifier: 'identifier', value, type });\n expect(root).toMatchSnapshot();\n });\n });\n\n describe('navigation', () => {\n test('should NOT manage keyboard \"tab\" navigation on \"checkbox\" type', async () => {\n const page = await getPage({ label: 'label', identifier: 'identifier', value: cloneDeep(items), type: 'checkbox', tooltip: 'Tooltip message' });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = Array.from(element.shadowRoot.querySelectorAll('input'));\n\n allInputs.forEach(input => input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' })));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n\n allInputs[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test.each(['next', 'prev'])('should manage keyboard \"tab\" navigation on \"multi\" type', async direction => {\n const page = await getPage({\n label: 'label',\n identifier: 'identifier',\n value: [1, 2, 3, 4, 5, 6, 7, 8, 9].map(item => ({\n title: `item ${item}`,\n value: false,\n })),\n type: 'multi',\n tooltip: 'Tooltip message',\n });\n const element = page.doc.querySelector('mg-input-checkbox');\n const allInputs = Array.from(element.shadowRoot.querySelectorAll('input'));\n const button = element.shadowRoot.querySelector('mg-button');\n const popover = element.shadowRoot.querySelector('mg-popover');\n\n button.dispatchEvent(new CustomEvent('click', { bubbles: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(true);\n\n if (direction === 'next') for await (const input of allInputs) input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' }));\n else if (direction === 'prev') allInputs[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab', shiftKey: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(false);\n });\n\n test('should manage keyboard \"shift+tab\" navigation on \"multi\" type', async () => {\n const page = await getPage({\n label: 'label',\n identifier: 'identifier',\n value: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(item => ({\n title: `item ${item}`,\n value: false,\n })),\n type: 'multi',\n tooltip: 'Tooltip message',\n });\n const element = page.doc.querySelector('mg-input-checkbox');\n const searchInput = element.shadowRoot.querySelector('mg-input-text').shadowRoot.querySelector('input');\n const button = element.shadowRoot.querySelector('mg-button');\n const popover = element.shadowRoot.querySelector('mg-popover');\n\n button.dispatchEvent(new CustomEvent('click', { bubbles: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(true);\n\n searchInput.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab', shiftKey: true }));\n jest.runOnlyPendingTimers();\n await page.waitForChanges();\n\n expect(popover.display).toEqual(false);\n });\n });\n\n test.each([' ', 'batman'])('Should not render with invalid type property: %s', async type => {\n expect.assertions(1);\n try {\n await getPage({ identifier: 'identifier', type, label: 'label', value: cloneDeep(items) });\n } catch (err) {\n expect(err.message).toMatch('<mg-input-checkbox> prop \"type\" must be a CheckboxType.');\n }\n });\n\n test.each([undefined, 'checkbox'])('Should not render with invalid displaySelectedValues and type configuration', async type => {\n expect.assertions(1);\n try {\n await getPage({ label: 'label', identifier: 'identifier', type, value: cloneDeep(items), displaySelectedValues: true });\n } catch (err) {\n expect(err.message).toMatch('<mg-input-checkbox> prop \"displaySelectedValues\" can only be used with prop type \"multi\".');\n }\n });\n\n describe('multi search', () => {\n test('should enable return search result and update pagination', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('li'));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const searchInput = mgInputCheckbox.shadowRoot.querySelector('mg-input-text');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.length).toEqual(10);\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '2' }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(4);\n expect(page.root).toMatchSnapshot();\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '11' }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(1);\n expect(page.root).toMatchSnapshot();\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '111' }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(0);\n expect(page.root).toMatchSnapshot();\n\n mgPopover.display = false;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n expect(searchInput.value).toEqual('');\n expect(page.root).toMatchSnapshot();\n });\n\n test('should search and update values', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const searchInput = mgInputCheckbox.shadowRoot.querySelector('mg-input-text');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n searchInput.dispatchEvent(new CustomEvent('value-change', { detail: '2' }));\n await page.waitForChanges();\n\n const input = mgInputCheckbox.shadowRoot.querySelector('input');\n input.checkValidity = () => true;\n input.checked = true;\n\n input.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n await page.waitForChanges();\n\n expect(mgInputCheckbox.value.find(item => item.value)).toHaveProperty('title', 'item 2');\n expect(page.root).toMatchSnapshot();\n\n mgPopover.display = false;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n expect(page.root).toMatchSnapshot();\n });\n\n test('should navigate across paginated list with mg-pagination', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('li'));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const mgPagination = mgInputCheckbox.shadowRoot.querySelector('mg-pagination');\n const mgPaginationNext = mgPagination.shadowRoot.querySelector('mg-button:last-of-type');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.length).toEqual(10);\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(10);\n expect(page.root).toMatchSnapshot();\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.length).toEqual(1);\n expect(page.root).toMatchSnapshot();\n });\n\n test('should update all values with mass actions', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('input'));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n expect(page.root).toMatchSnapshot();\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.filter(item => item.value === 'true').length).toEqual(0);\n expect(mgInputCheckbox.value.filter(item => item.value).length).toEqual(0);\n expect(page.root).toMatchSnapshot();\n\n const selectAllButton = mgInputCheckbox.shadowRoot.querySelector('mg-input-checkbox-paginated:last-of-type mg-button');\n selectAllButton.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.filter(item => item.value === 'true').length).toEqual(10);\n expect(mgInputCheckbox.value.filter(item => item.value).length).toEqual(21);\n expect(page.root).toMatchSnapshot();\n\n const unselectAllButton = Array.from(\n mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated .mg-c-input__input-checkbox-multi-section-header mg-button:last-of-type'),\n ).find(button => button.textContent === 'Unselect all');\n unselectAllButton.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = getResultList(mgInputCheckbox);\n expect(resultList.filter(item => item.value === 'true').length).toEqual(0);\n expect(mgInputCheckbox.value.filter(item => item.value).length).toEqual(0);\n expect(page.root).toMatchSnapshot();\n });\n\n test('should toggle selected items section', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map((item, index) => ({\n title: `item ${item}`,\n value: [5, 12, 13, 17].some(item => item === index),\n }));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n const sections = Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated'));\n\n expect(sections.length).toEqual(2);\n\n for (const [i, section] of sections.entries()) {\n const firstButton = section.querySelector('mg-button');\n const sectionContent = section.querySelector('.mg-c-input__input-checkbox-multi-section-content');\n expect(sectionContent).not.toHaveAttribute('hidden');\n\n firstButton.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n if (i !== 0) {\n expect(sectionContent).not.toHaveAttribute('hidden');\n } else {\n expect(sectionContent).toHaveAttribute('hidden');\n }\n expect(page.root).toMatchSnapshot();\n }\n });\n\n test('should go to previous page when last item is checked', async () => {\n const value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21].map(item => ({\n title: `item ${item}`,\n value: false,\n }));\n const page = await getPage({ label: 'label', identifier: 'identifier', value });\n const getResultList = (mgInputCheckbox: HTMLMgInputCheckboxElement) => Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('input'));\n\n const mgInputCheckbox = page.doc.querySelector('mg-input-checkbox');\n const mgPopover = mgInputCheckbox.shadowRoot.querySelector('mg-popover');\n const mgPagination = mgInputCheckbox.shadowRoot.querySelector('mg-pagination:last-of-type');\n const mgPaginationNext = mgPagination.shadowRoot.querySelector('mg-button:last-of-type');\n\n mgPopover.display = true;\n await page.waitForChanges();\n jest.runOnlyPendingTimers();\n\n let resultList = getResultList(mgInputCheckbox);\n\n expect(resultList.length).toEqual(10);\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n mgPaginationNext.dispatchEvent(new MouseEvent('click', { bubbles: true }));\n await page.waitForChanges();\n\n resultList = Array.from(mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated:last-of-type input'));\n expect(resultList.length).toEqual(1);\n expect(page.root).toMatchSnapshot();\n\n const input = mgInputCheckbox.shadowRoot.querySelector('input');\n input.checkValidity = () => true;\n input.checked = true;\n\n input.dispatchEvent(new CustomEvent('input', { bubbles: true }));\n await page.waitForChanges();\n\n const firstSectionInputs = mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated:first-of-type input');\n const lastSectionInputs = mgInputCheckbox.shadowRoot.querySelectorAll('mg-input-checkbox-paginated:last-of-type input');\n\n expect(firstSectionInputs.length).toEqual(1);\n expect(lastSectionInputs.length).toEqual(10);\n expect(page.root).toMatchSnapshot();\n });\n });\n});\n"]}
@@ -195,7 +195,7 @@ export class MgInputDate {
195
195
  * @returns HTML Element
196
196
  */
197
197
  render() {
198
- return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: localeDate(this.value, this.locale), tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "date", class: "mg-c-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
198
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: undefined, disabled: this.disabled, value: this.value, readonlyValue: localeDate(this.value, this.locale), tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "date", class: "mg-c-input__box", min: this.min, max: this.max, value: this.value, id: this.identifier, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
199
199
  if (el !== null)
200
200
  this.input = el;
201
201
  } })));
@@ -1 +1 @@
1
- {"version":3,"file":"mg-input-date.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-date/mg-input-date.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOlD,MAAM,OAAO,WAAW;;IAYtB,8CAA8C;IACtC,sBAAiB,GAAG,KAAK,CAAC;IAqLlC;;OAEG;IACK,gBAAW,GAAG,GAAS,EAAE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,CAAC,GAAG,EACb,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,EAAE,EAAE,IAAI,CAAC,UAAU,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,GAAG,EAAE,CAAC,EAAoB,EAAE,EAAE;UAC5B,IAAI,EAAE,KAAK,IAAI;YAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QACnC,CAAC,GACD,CACM,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, State, Watch, Method } from '@stencil/core';\nimport { MgInput } from '../MgInput';\nimport { InputError } from './mg-input-date.conf';\nimport { ClassList, isValidString } from '../../../../utils/components.utils';\nimport { localeDate, dateRegExp } from '../../../../utils/locale.utils';\nimport { initLocales } from '../../../../locales';\n\n@Component({\n tag: 'mg-input-date',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-date.css',\n shadow: true,\n})\nexport class MgInputDate {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private input: HTMLInputElement;\n\n // Locales\n private messages;\n private locale: string;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputDateElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true, reflect: true }) value: string;\n @Watch('value')\n validateValue(newValue: MgInputDate['value']): void {\n // When the input is not fully completed or has been cleared, the value becomes an empty string.\n if (newValue === '') newValue = null;\n if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !dateRegExp.test(newValue))) {\n throw new Error(\"<mg-input-date> props 'value' doesn't match pattern: yyyy-mm-dd\");\n } else {\n this.valueChange.emit(newValue);\n }\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop: boolean;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip: string;\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText: string;\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Define input minimum date\n * format: yyyy-mm-dd\n */\n @Prop() min: string;\n\n /**\n * Define input maximum date\n * format: yyyy-mm-dd\n */\n @Prop() max: string;\n @Watch('min')\n @Watch('max')\n validateMinMax(newValue: string): void {\n if (newValue?.length === 0 || (newValue?.length > 0 && !(typeof newValue === 'string' && dateRegExp.test(newValue)))) {\n throw new Error(\"<mg-input-date> props 'min/max' doesn't match pattern: yyyy-mm-dd\");\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--date']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<string>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<boolean>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n async displayError(): Promise<void> {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputDate['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-date> method \"setError()\" param \"valid\" must be a boolean');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-date> method \"setError()\" param \"errorMessage\" must be a string');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputDate['valid']) {\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n this.inputValid.emit(this.valid);\n }\n\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n this.value = this.input.value;\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n this.displayError();\n };\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || (this.input?.checkValidity !== undefined ? this.input.checkValidity() : true));\n };\n\n /**\n * get input error code\n * @returns error code\n */\n private getInputError = (): null | InputError => {\n let inputError = null;\n\n // required\n if (this.input.validity.valueMissing) {\n inputError = InputError.REQUIRED;\n }\n // min & max\n else if ((this.input.validity.rangeUnderflow || this.input.validity.rangeOverflow) && this.min?.length > 0 && this.max?.length > 0) {\n inputError = InputError.MINMAX;\n }\n // min\n else if (this.input.validity.rangeUnderflow) {\n inputError = InputError.MIN;\n }\n //max\n else if (this.input.validity.rangeOverflow) {\n inputError = InputError.MAX;\n }\n\n return inputError;\n };\n\n /**\n * Check input errors\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n const inputError = this.getInputError();\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // required\n else if (inputError === InputError.REQUIRED) {\n this.errorMessage = this.messages.errors[inputError];\n }\n // min, max & minMax\n else if ([InputError.MIN, InputError.MAX, InputError.MINMAX].includes(inputError)) {\n this.errorMessage = this.messages.errors.date[inputError].replace('{min}', localeDate(this.min, this.locale)).replace('{max}', localeDate(this.max, this.locale));\n }\n // wrong date format\n // element.validity.badInput is default error message\n else {\n this.errorMessage = this.messages.errors.date.badInput.replace('{min}', this.min?.length > 0 ? localeDate(this.min, this.locale) : localeDate('1900-01-01', this.locale));\n }\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n const locales = initLocales(this.element);\n this.locale = locales.locale;\n this.messages = locales.messages;\n // Validate\n this.validateValue(this.value);\n this.validateMinMax(this.min);\n this.validateMinMax(this.max);\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <MgInput\n identifier={this.identifier}\n classCollection={this.classCollection}\n ariaDescribedbyIDs={[]}\n label={this.label}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n readonly={this.readonly}\n mgWidth={undefined}\n disabled={this.disabled}\n value={this.value}\n readonlyValue={localeDate(this.value, this.locale)}\n tooltip={this.tooltip}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n isFieldset={false}\n >\n <input\n type=\"date\"\n class=\"mg-c-input__box\"\n min={this.min}\n max={this.max}\n value={this.value}\n id={this.identifier}\n name={this.name}\n disabled={this.disabled}\n required={this.required}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n </MgInput>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"mg-input-date.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-date/mg-input-date.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOlD,MAAM,OAAO,WAAW;;IAYtB,8CAA8C;IAC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jB,aACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,iBAAiB,EACvB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,EAAE,EAAE,IAAI,CAAC,UAAU,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,kBACT,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,EAChD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,GAAG,EAAE,CAAC,EAAoB,EAAE,EAAE;UAC5B,IAAI,EAAE,KAAK,IAAI;YAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QACnC,CAAC,GACD,CACM,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Prop, State, Watch, Method } from '@stencil/core';\nimport { MgInput } from '../MgInput';\nimport { InputError } from './mg-input-date.conf';\nimport { ClassList, isValidString } from '../../../../utils/components.utils';\nimport { localeDate, dateRegExp } from '../../../../utils/locale.utils';\nimport { initLocales } from '../../../../locales';\n\n@Component({\n tag: 'mg-input-date',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-date.css',\n shadow: true,\n})\nexport class MgInputDate {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private input: HTMLInputElement;\n\n // Locales\n private messages;\n private locale: string;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputDateElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true, reflect: true }) value: string;\n @Watch('value')\n validateValue(newValue: MgInputDate['value']): void {\n // When the input is not fully completed or has been cleared, the value becomes an empty string.\n if (newValue === '') newValue = null;\n if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !dateRegExp.test(newValue))) {\n throw new Error(\"<mg-input-date> props 'value' doesn't match pattern: yyyy-mm-dd\");\n } else {\n this.valueChange.emit(newValue);\n }\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop: boolean;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip: string;\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText: string;\n\n /**\n * Define input valid state\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input invalid state\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Define input minimum date\n * format: yyyy-mm-dd\n */\n @Prop() min: string;\n\n /**\n * Define input maximum date\n * format: yyyy-mm-dd\n */\n @Prop() max: string;\n @Watch('min')\n @Watch('max')\n validateMinMax(newValue: string): void {\n if (newValue?.length === 0 || (newValue?.length > 0 && !(typeof newValue === 'string' && dateRegExp.test(newValue)))) {\n throw new Error(\"<mg-input-date> props 'min/max' doesn't match pattern: yyyy-mm-dd\");\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--date']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<string>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<boolean>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n async displayError(): Promise<void> {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputDate['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-date> method \"setError()\" param \"valid\" must be a boolean');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-date> method \"setError()\" param \"errorMessage\" must be a string');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputDate['valid']) {\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n this.inputValid.emit(this.valid);\n }\n\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n this.value = this.input.value;\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n this.displayError();\n };\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || (this.input?.checkValidity !== undefined ? this.input.checkValidity() : true));\n };\n\n /**\n * get input error code\n * @returns error code\n */\n private getInputError = (): null | InputError => {\n let inputError = null;\n\n // required\n if (this.input.validity.valueMissing) {\n inputError = InputError.REQUIRED;\n }\n // min & max\n else if ((this.input.validity.rangeUnderflow || this.input.validity.rangeOverflow) && this.min?.length > 0 && this.max?.length > 0) {\n inputError = InputError.MINMAX;\n }\n // min\n else if (this.input.validity.rangeUnderflow) {\n inputError = InputError.MIN;\n }\n //max\n else if (this.input.validity.rangeOverflow) {\n inputError = InputError.MAX;\n }\n\n return inputError;\n };\n\n /**\n * Check input errors\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n const inputError = this.getInputError();\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n }\n // required\n else if (inputError === InputError.REQUIRED) {\n this.errorMessage = this.messages.errors[inputError];\n }\n // min, max & minMax\n else if ([InputError.MIN, InputError.MAX, InputError.MINMAX].includes(inputError)) {\n this.errorMessage = this.messages.errors.date[inputError].replace('{min}', localeDate(this.min, this.locale)).replace('{max}', localeDate(this.max, this.locale));\n }\n // wrong date format\n // element.validity.badInput is default error message\n else {\n this.errorMessage = this.messages.errors.date.badInput.replace('{min}', this.min?.length > 0 ? localeDate(this.min, this.locale) : localeDate('1900-01-01', this.locale));\n }\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n const locales = initLocales(this.element);\n this.locale = locales.locale;\n this.messages = locales.messages;\n // Validate\n this.validateValue(this.value);\n this.validateMinMax(this.min);\n this.validateMinMax(this.max);\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <MgInput\n identifier={this.identifier}\n classCollection={this.classCollection}\n ariaDescribedbyIDs={[]}\n label={this.label}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n readonly={this.readonly}\n mgWidth={undefined}\n disabled={this.disabled}\n value={this.value}\n readonlyValue={localeDate(this.value, this.locale)}\n tooltip={this.tooltip}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n isFieldset={false}\n >\n <input\n type=\"date\"\n class=\"mg-c-input__box\"\n min={this.min}\n max={this.max}\n value={this.value}\n id={this.identifier}\n name={this.name}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n onInput={this.handleInput}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n </MgInput>\n );\n }\n}\n"]}
@@ -133,7 +133,7 @@ export class MgInputNumeric {
133
133
  // has input value is always render as string we get a stringified value or a '' for nullish value, so we test string type
134
134
  if (typeof newValue === 'string') {
135
135
  // Split number and decimal
136
- const [integer, decimal = ''] = newValue.replace('-', '').split(/[\.,]/);
136
+ const [integer, decimal = ''] = newValue.replace('-', '').split(/[.,]/);
137
137
  // Regex
138
138
  const regex = this.type === 'integer' ? /^-?\d+$/ : /^-?\d+(?:[.,]\d*)?$/;
139
139
  // Filter input
@@ -220,14 +220,15 @@ export class MgInputNumeric {
220
220
  * @returns Returns true if the value is valid, otherwise false.
221
221
  */
222
222
  isValidValue(value, regex, integer, decimal) {
223
- return ['', '-'].includes(value) || (value.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength));
223
+ return (['', '-'].includes(value) || (regex.exec(value) !== null && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength)));
224
224
  }
225
225
  /**
226
226
  * Handles invalid input values and returns a corrected value.
227
227
  * @returns The corrected value.
228
228
  */
229
229
  handleInvalidValue() {
230
- return this.storedValue !== undefined ? this.storedValue : null;
230
+ var _a;
231
+ return (_a = this.storedValue) !== null && _a !== void 0 ? _a : null;
231
232
  }
232
233
  /**
233
234
  * Updates the component values based on the validated input value.
@@ -280,7 +281,7 @@ export class MgInputNumeric {
280
281
  * @returns HTML Element
281
282
  */
282
283
  render() {
283
- return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "text", class: "mg-c-input__box", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
284
+ return (h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "text", class: "mg-c-input__box", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
284
285
  if (el !== null)
285
286
  this.input = el;
286
287
  } }), h("slot", { name: "append-input" })));
@@ -1 +1 @@
1
- {"version":3,"file":"mg-input-numeric.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-numeric/mg-input-numeric.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAO9E,MAAM,OAAO,cAAc;;IAiBzB,8CAA8C;IACtC,sBAAiB,GAAG,KAAK,CAAC;IAuRlC;;OAEG;IACK,gBAAW,GAAG,GAAS,EAAE;MAC/B,iBAAiB;MACjB,IAAI,CAAC,aAAa,EAAE,CAAC;MACrB,IAAI,IAAI,CAAC,iBAAiB,EAAE;QAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;OACxB;MACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAChC,CAAC,CAAC;IAEF;;OAEG;IACK,gBAAW,GAAG,GAAS,EAAE;MAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC,CAAC;IAEF;;OAEG;IACK,eAAU,GAAG,GAAS,EAAE;MAC9B,IAAI,IAAI,CAAC,KAAK,KAAK,GAAG;QAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;M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AAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,GAAG,EAAE,CAAC,EAAoB,EAAE,EAAE;UAC5B,IAAI,EAAE,KAAK,IAAI;YAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QACnC,CAAC,GACD;MACF,YAAM,IAAI,EAAC,cAAc,GAAQ,CACzB,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, h, Prop, EventEmitter, State, Watch, Method } from '@stencil/core';\nimport { MgInput } from '../MgInput';\nimport { Width } from '../MgInput.conf';\nimport { types, InputError } from './mg-input-numeric.conf';\nimport { ClassList, isValidString } from '../../../../utils/components.utils';\nimport { initLocales } from '../../../../locales/';\nimport { localeCurrency, localeNumber } from '../../../../utils/locale.utils';\n\n@Component({\n tag: 'mg-input-numeric',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-numeric.css',\n shadow: true,\n})\nexport class MgInputNumeric {\n /************\n * Internal *\n ************/\n\n // Manage different values\n private storedValue: string;\n private numericValue: number;\n private readonlyValue: string;\n\n // HTML selector\n private input: HTMLInputElement;\n\n // Locales\n private locale: string;\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputNumericElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true, reflect: true }) value: string;\n @Watch('value')\n validateValue(newValue: MgInputNumeric['value']): void {\n // has input value is always render as string we get a stringified value or a '' for nullish value, so we test string type\n if (typeof newValue === 'string') {\n // Split number and decimal\n const [integer, decimal = ''] = newValue.replace('-', '').split(/[\\.,]/);\n // Regex\n const regex = this.type === 'integer' ? /^-?\\d+$/ : /^-?\\d+(?:[.,]\\d*)?$/;\n // Filter input\n if (this.isValidValue(newValue, regex, integer, decimal)) {\n this.storedValue = newValue;\n } else {\n newValue = this.handleInvalidValue();\n }\n // Set value and input value\n this.updateValues(newValue);\n }\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop: boolean;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n */\n @Prop() placeholder: string;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width;\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip: string;\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText: string;\n\n /**\n * Define numeric type\n */\n @Prop() type: string = types[0];\n @Watch('type')\n validateType(newValue: MgInputNumeric['type']): void {\n if (!types.includes(newValue)) {\n throw new Error(`<mg-input-numeric> prop \"type\" must be one of: ${types.join(', ')}`);\n }\n }\n\n /**\n * Define currency\n */\n @Prop() currency = 'USD';\n\n /**\n * Maximum value\n */\n @Prop() max: number;\n\n /**\n * Minimum value\n */\n @Prop() min: number;\n\n /**\n * Override integer length\n * integer is the number before the decimal point\n */\n @Prop() integerLength = 13;\n @Watch('integerLength')\n validateIntegerLength(newValue: MgInputNumeric['integerLength']): void {\n if (newValue < 1) {\n throw new Error(`<mg-input-numeric> prop \"integer-length\" must be a positive number.`);\n }\n }\n\n /**\n * Override decimal length\n * decimal is the number after the decimal point\n */\n @Prop() decimalLength = 2;\n @Watch('decimalLength')\n validateDecimalLength(newValue: MgInputNumeric['decimalLength']): void {\n if (newValue < 1) {\n throw new Error(`<mg-input-numeric> prop \"decimal-length\" must be a positive number, consider using prop \"type\" to \"integer\" instead.`);\n }\n }\n\n /**\n * Define input pattern to validate\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input pattern error message\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--numeric']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Define if input has focus\n */\n @State() hasFocus = false;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<number>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<boolean>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n async displayError(): Promise<void> {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputNumeric['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-numeric> method \"setError()\" param \"valid\" must be a boolean');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-numeric> method \"setError()\" param \"errorMessage\" must be a string');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputNumeric['valid']) {\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n this.inputValid.emit(this.valid);\n }\n\n /**\n * Checks if the given value is valid according to the defined rules.\n * @param value - The input value to validate.\n * @param regex - The regular expression for validation.\n * @param integer - The integer part of the value.\n * @param decimal - The decimal part of the value.\n * @returns Returns true if the value is valid, otherwise false.\n */\n private isValidValue(value: string, regex: RegExp, integer: string, decimal: string): boolean {\n return ['', '-'].includes(value) || (value.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength));\n }\n\n /**\n * Handles invalid input values and returns a corrected value.\n * @returns The corrected value.\n */\n private handleInvalidValue(): string | null {\n return this.storedValue !== undefined ? this.storedValue : null;\n }\n\n /**\n * Updates the component values based on the validated input value.\n * @param newValue - The validated input value.\n */\n private updateValues(newValue: string | null): void {\n this.value = newValue;\n if (this.input !== undefined) this.input.value = this.value;\n\n this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;\n this.valueChange.emit(this.numericValue);\n\n this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';\n }\n\n /**\n * Displayed value in input\n * Change on focus/blur\n * @returns display value\n */\n private displayValue(): MgInputNumeric['value'] | MgInputNumeric['readonlyValue'] {\n return this.hasFocus ? this.value : this.readonlyValue;\n }\n\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n // Check validity\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n this.value = this.input.value;\n };\n\n /**\n * Handle focus event\n */\n private handleFocus = (): void => {\n this.hasFocus = true;\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n if (this.value === '-') this.value = '';\n // Display Error\n this.displayError();\n this.hasFocus = false;\n };\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || this.getInputError() === null);\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n const inputError = this.getInputError();\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n } else if (inputError === InputError.REQUIRED) {\n this.errorMessage = this.messages.errors[inputError];\n } else {\n this.errorMessage = this.messages.errors.numeric[inputError].replace('{min}', `${this.formatValue(this.min)}`).replace('{max}', `${this.formatValue(this.max)}`);\n }\n }\n };\n\n /**\n * Get input error code\n * @returns error code\n */\n private getInputError = (): null | InputError => {\n let inputError = null;\n const hasNotEmptyValues = (toControl: unknown[]) => !toControl.some(value => [null, undefined].includes(value));\n\n if (!hasNotEmptyValues([this.input])) return inputError;\n\n // required\n if (!this.input.checkValidity() && this.input.validity.valueMissing) {\n inputError = InputError.REQUIRED;\n }\n // Min & Max\n else if (hasNotEmptyValues([this.min, this.numericValue]) && this.numericValue < this.min && this.max === undefined) {\n // Only a min value is set\n inputError = InputError.MIN;\n } else if (hasNotEmptyValues([this.max, this.numericValue]) && this.numericValue > this.max && this.min === undefined) {\n // Only a max value is set\n inputError = InputError.MAX;\n } else if (hasNotEmptyValues([this.min, this.max, this.numericValue]) && (this.numericValue < this.min || this.numericValue > this.max)) {\n // both min and max values are set\n inputError = InputError.MINMAX;\n }\n return inputError;\n };\n\n /**\n * Format value based on type\n * @param value - value to format\n * @returns formated local value\n */\n private formatValue = (value: number): string => (this.type === 'currency' ? localeCurrency(value, this.locale, this.currency) : localeNumber(value, this.locale));\n\n /**\n * Validate append slot\n */\n private validateAppendSlot = (): void => {\n const slotAppendInput: HTMLSlotElement = this.element.querySelector('[slot=\"append-input\"]');\n if (slotAppendInput !== null) {\n this.classCollection.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-c-input--is-input-group-append' : 'mg-c-input--is-append-input-slot-content');\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n const locales = initLocales(this.element);\n this.locale = locales.locale;\n this.messages = locales.messages;\n // Validate component config\n this.validateType(this.type);\n this.validateIntegerLength(this.integerLength);\n this.validateDecimalLength(this.decimalLength);\n // validate value\n this.validateValue(this.value);\n this.validateAppendSlot();\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <MgInput\n identifier={this.identifier}\n classCollection={this.classCollection}\n ariaDescribedbyIDs={[]}\n label={this.label}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n readonly={this.readonly}\n mgWidth={this.mgWidth}\n disabled={this.disabled}\n value={this.value}\n readonlyValue={this.readonlyValue}\n tooltip={this.tooltip}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n isFieldset={false}\n >\n <input\n type=\"text\"\n class=\"mg-c-input__box\"\n value={this.displayValue()}\n id={this.identifier}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n <slot name=\"append-input\"></slot>\n </MgInput>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"mg-input-numeric.js","sourceRoot":"","sources":["../../../../../src/components/molecules/inputs/mg-input-numeric/mg-input-numeric.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAO9E,MAAM,OAAO,cAAc;;IAiBzB,8CAA8C;IACtC,sBAAiB,GAAG,KAAK,CAAC;IAyRlC;;OAEG;IACK,gBAAW,GAAG,GAAS,EAAE;MAC/B,iBAAiB;MACjB,IAAI,CAAC,aAAa,EAAE,CAAC;MACrB,IAAI,IAAI,CAAC,iBAAiB,EAAE;QAC1B,IAAI,CAAC,eAAe,EAAE,CAAC;OACxB;MACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAChC,CAAC,CAAC;IAEF;;OAEG;IACK,gBAAW,GAAG,GAAS,EAAE;MAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC,C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CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,KAAK,EAAE,IAAI,CAAC,WAAW,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,kBACT,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,QAAQ,EAAE,EAChD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,GAAG,EAAE,CAAC,EAAoB,EAAE,EAAE;UAC5B,IAAI,EAAE,KAAK,IAAI;YAAE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QACnC,CAAC,GACD;MACF,YAAM,IAAI,EAAC,cAAc,GAAQ,CACzB,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, h, Prop, EventEmitter, State, Watch, Method } from '@stencil/core';\nimport { MgInput } from '../MgInput';\nimport { Width } from '../MgInput.conf';\nimport { types, InputError } from './mg-input-numeric.conf';\nimport { ClassList, isValidString } from '../../../../utils/components.utils';\nimport { initLocales } from '../../../../locales/';\nimport { localeCurrency, localeNumber } from '../../../../utils/locale.utils';\n\n@Component({\n tag: 'mg-input-numeric',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-input-numeric.css',\n shadow: true,\n})\nexport class MgInputNumeric {\n /************\n * Internal *\n ************/\n\n // Manage different values\n private storedValue: string;\n private numericValue: number;\n private readonlyValue: string;\n\n // HTML selector\n private input: HTMLInputElement;\n\n // Locales\n private locale: string;\n private messages;\n\n // hasDisplayedError (triggered by blur event)\n private hasDisplayedError = false;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgInputNumericElement;\n\n /**\n * Component value\n */\n @Prop({ mutable: true, reflect: true }) value: string;\n @Watch('value')\n validateValue(newValue: MgInputNumeric['value']): void {\n // has input value is always render as string we get a stringified value or a '' for nullish value, so we test string type\n if (typeof newValue === 'string') {\n // Split number and decimal\n const [integer, decimal = ''] = newValue.replace('-', '').split(/[.,]/);\n // Regex\n const regex = this.type === 'integer' ? /^-?\\d+$/ : /^-?\\d+(?:[.,]\\d*)?$/;\n // Filter input\n if (this.isValidValue(newValue, regex, integer, decimal)) {\n this.storedValue = newValue;\n } else {\n newValue = this.handleInvalidValue();\n }\n // Set value and input value\n this.updateValues(newValue);\n }\n }\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n */\n @Prop() identifier!: string;\n\n /**\n * Input name\n * If not set the value equals the identifier\n */\n @Prop() name: string = this.identifier;\n\n /**\n * Input label\n */\n @Prop() label!: string;\n\n /**\n * Define if label is displayed on top\n */\n @Prop() labelOnTop: boolean;\n\n /**\n * Define if label is visible\n */\n @Prop() labelHide = false;\n\n /**\n * Input placeholder.\n * It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n */\n @Prop() placeholder: string;\n\n /**\n * Define if input is required\n */\n @Prop() required = false;\n\n /**\n * Define if input is readonly\n */\n @Prop() readonly = false;\n\n /**\n * Define if input is disabled\n */\n @Prop() disabled = false;\n @Watch('required')\n @Watch('readonly')\n @Watch('disabled')\n handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void {\n if (this.input !== undefined) {\n this.input[prop] = newValue;\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n this.hasDisplayedError = false;\n }\n }\n }\n\n /**\n * Define input width\n */\n @Prop() mgWidth: Width;\n\n /**\n * Add a tooltip message next to the input\n */\n @Prop() tooltip: string;\n\n /**\n * Add a help text under the input, usually expected data format and example\n */\n @Prop() helpText: string;\n\n /**\n * Define numeric type\n */\n @Prop() type: string = types[0];\n @Watch('type')\n validateType(newValue: MgInputNumeric['type']): void {\n if (!types.includes(newValue)) {\n throw new Error(`<mg-input-numeric> prop \"type\" must be one of: ${types.join(', ')}`);\n }\n }\n\n /**\n * Define currency\n */\n @Prop() currency = 'USD';\n\n /**\n * Maximum value\n */\n @Prop() max: number;\n\n /**\n * Minimum value\n */\n @Prop() min: number;\n\n /**\n * Override integer length\n * integer is the number before the decimal point\n */\n @Prop() integerLength = 13;\n @Watch('integerLength')\n validateIntegerLength(newValue: MgInputNumeric['integerLength']): void {\n if (newValue < 1) {\n throw new Error(`<mg-input-numeric> prop \"integer-length\" must be a positive number.`);\n }\n }\n\n /**\n * Override decimal length\n * decimal is the number after the decimal point\n */\n @Prop() decimalLength = 2;\n @Watch('decimalLength')\n validateDecimalLength(newValue: MgInputNumeric['decimalLength']): void {\n if (newValue < 1) {\n throw new Error(`<mg-input-numeric> prop \"decimal-length\" must be a positive number, consider using prop \"type\" to \"integer\" instead.`);\n }\n }\n\n /**\n * Define input pattern to validate\n */\n @Prop({ mutable: true }) valid: boolean;\n\n /**\n * Define input pattern error message\n */\n @Prop({ mutable: true }) invalid: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-input--numeric']);\n\n /**\n * Error message to display\n */\n @State() errorMessage: string;\n\n /**\n * Define if input has focus\n */\n @State() hasFocus = false;\n\n /**\n * Emited event when value change\n */\n @Event({ eventName: 'value-change' }) valueChange: EventEmitter<number>;\n\n /**\n * Emited event when checking validity\n */\n @Event({ eventName: 'input-valid' }) inputValid: EventEmitter<boolean>;\n\n /**\n * Display input error if it exists.\n */\n @Method()\n async displayError(): Promise<void> {\n this.checkValidity();\n this.setErrorMessage();\n this.hasDisplayedError = this.invalid;\n }\n\n /**\n * Set an error and display a custom error message.\n * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\n * It must be paired with an error message to display for the given context.\n * When used to set validity to `false`, you should use this method again to reset the validity to `true`.\n * @param valid - value indicating the validity\n * @param errorMessage - the error message to display\n */\n @Method()\n async setError(valid: MgInputNumeric['valid'], errorMessage: string): Promise<void> {\n if (typeof valid !== 'boolean') {\n throw new Error('<mg-input-numeric> method \"setError()\" param \"valid\" must be a boolean');\n } else if (!isValidString(errorMessage)) {\n throw new Error('<mg-input-numeric> method \"setError()\" param \"errorMessage\" must be a string');\n } else {\n this.setValidity(valid);\n this.setErrorMessage(valid ? undefined : errorMessage);\n this.hasDisplayedError = this.invalid;\n }\n }\n\n /**\n * Method to set validity values\n * @param newValue - valid new value\n */\n private setValidity(newValue: MgInputNumeric['valid']) {\n this.valid = newValue;\n this.invalid = !this.valid;\n // We need to send valid event even if it is the same value\n this.inputValid.emit(this.valid);\n }\n\n /**\n * Checks if the given value is valid according to the defined rules.\n * @param value - The input value to validate.\n * @param regex - The regular expression for validation.\n * @param integer - The integer part of the value.\n * @param decimal - The decimal part of the value.\n * @returns Returns true if the value is valid, otherwise false.\n */\n private isValidValue(value: string, regex: RegExp, integer: string, decimal: string): boolean {\n return (\n ['', '-'].includes(value) || (regex.exec(value) !== null && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength))\n );\n }\n\n /**\n * Handles invalid input values and returns a corrected value.\n * @returns The corrected value.\n */\n private handleInvalidValue(): string | null {\n return this.storedValue ?? null;\n }\n\n /**\n * Updates the component values based on the validated input value.\n * @param newValue - The validated input value.\n */\n private updateValues(newValue: string | null): void {\n this.value = newValue;\n if (this.input !== undefined) this.input.value = this.value;\n\n this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;\n this.valueChange.emit(this.numericValue);\n\n this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';\n }\n\n /**\n * Displayed value in input\n * Change on focus/blur\n * @returns display value\n */\n private displayValue(): MgInputNumeric['value'] | MgInputNumeric['readonlyValue'] {\n return this.hasFocus ? this.value : this.readonlyValue;\n }\n\n /**\n * Handle input event\n */\n private handleInput = (): void => {\n // Check validity\n this.checkValidity();\n if (this.hasDisplayedError) {\n this.setErrorMessage();\n }\n this.value = this.input.value;\n };\n\n /**\n * Handle focus event\n */\n private handleFocus = (): void => {\n this.hasFocus = true;\n };\n\n /**\n * Handle blur event\n */\n private handleBlur = (): void => {\n if (this.value === '-') this.value = '';\n // Display Error\n this.displayError();\n this.hasFocus = false;\n };\n\n /**\n * Check if input is valid\n */\n private checkValidity = (): void => {\n this.setValidity(this.readonly || this.disabled || this.getInputError() === null);\n };\n\n /**\n * Set input error message\n * @param errorMessage - errorMessage override\n */\n private setErrorMessage = (errorMessage?: string): void => {\n // Set error message\n this.errorMessage = undefined;\n if (!this.valid) {\n const inputError = this.getInputError();\n if (errorMessage !== undefined) {\n this.errorMessage = errorMessage;\n } else if (inputError === InputError.REQUIRED) {\n this.errorMessage = this.messages.errors[inputError];\n } else {\n this.errorMessage = this.messages.errors.numeric[inputError].replace('{min}', `${this.formatValue(this.min)}`).replace('{max}', `${this.formatValue(this.max)}`);\n }\n }\n };\n\n /**\n * Get input error code\n * @returns error code\n */\n private getInputError = (): null | InputError => {\n let inputError = null;\n const hasNotEmptyValues = (toControl: unknown[]) => !toControl.some(value => [null, undefined].includes(value));\n\n if (!hasNotEmptyValues([this.input])) return inputError;\n\n // required\n if (!this.input.checkValidity() && this.input.validity.valueMissing) {\n inputError = InputError.REQUIRED;\n }\n // Min & Max\n else if (hasNotEmptyValues([this.min, this.numericValue]) && this.numericValue < this.min && this.max === undefined) {\n // Only a min value is set\n inputError = InputError.MIN;\n } else if (hasNotEmptyValues([this.max, this.numericValue]) && this.numericValue > this.max && this.min === undefined) {\n // Only a max value is set\n inputError = InputError.MAX;\n } else if (hasNotEmptyValues([this.min, this.max, this.numericValue]) && (this.numericValue < this.min || this.numericValue > this.max)) {\n // both min and max values are set\n inputError = InputError.MINMAX;\n }\n return inputError;\n };\n\n /**\n * Format value based on type\n * @param value - value to format\n * @returns formated local value\n */\n private formatValue = (value: number): string => (this.type === 'currency' ? localeCurrency(value, this.locale, this.currency) : localeNumber(value, this.locale));\n\n /**\n * Validate append slot\n */\n private validateAppendSlot = (): void => {\n const slotAppendInput: HTMLSlotElement = this.element.querySelector('[slot=\"append-input\"]');\n if (slotAppendInput !== null) {\n this.classCollection.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-c-input--is-input-group-append' : 'mg-c-input--is-append-input-slot-content');\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n * @returns timeout\n */\n componentWillLoad(): ReturnType<typeof setTimeout> {\n // Get locales\n const locales = initLocales(this.element);\n this.locale = locales.locale;\n this.messages = locales.messages;\n // Validate component config\n this.validateType(this.type);\n this.validateIntegerLength(this.integerLength);\n this.validateDecimalLength(this.decimalLength);\n // validate value\n this.validateValue(this.value);\n this.validateAppendSlot();\n // Check validity when component is ready\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n this.checkValidity();\n }, 0);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <MgInput\n identifier={this.identifier}\n classCollection={this.classCollection}\n ariaDescribedbyIDs={[]}\n label={this.label}\n labelOnTop={this.labelOnTop}\n labelHide={this.labelHide}\n required={this.required}\n readonly={this.readonly}\n mgWidth={this.mgWidth}\n disabled={this.disabled}\n value={this.value}\n readonlyValue={this.readonlyValue}\n tooltip={this.tooltip}\n helpText={this.helpText}\n errorMessage={this.errorMessage}\n isFieldset={false}\n >\n <input\n type=\"text\"\n class=\"mg-c-input__box\"\n value={this.displayValue()}\n id={this.identifier}\n name={this.name}\n placeholder={this.placeholder}\n title={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={(this.invalid === true).toString()}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n ref={(el: HTMLInputElement) => {\n if (el !== null) this.input = el;\n }}\n />\n <slot name=\"append-input\"></slot>\n </MgInput>\n );\n }\n}\n"]}