@mgdis/mg-components 6.19.0 → 6.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_37.cjs.entry.js +63 -76
  3. package/dist/cjs/mg-components.cjs.js +1 -1
  4. package/dist/cjs/mg-input-combobox.cjs.entry.js +16 -12
  5. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +15 -11
  6. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +72 -84
  7. package/dist/components/mg-card2.js +1 -1
  8. package/dist/components/mg-input-combobox.js +16 -12
  9. package/dist/components/mg-input-textarea.js +1 -1
  10. package/dist/components/mg-input-toggle.js +60 -75
  11. package/dist/components/mg-message2.js +1 -1
  12. package/dist/components/mg-modal.js +1 -1
  13. package/dist/components/mg-panel.js +1 -1
  14. package/dist/components/mg-popover-content2.js +1 -1
  15. package/dist/components/mg-popover2.js +1 -1
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/mg-action-more_37.entry.js +63 -76
  18. package/dist/esm/mg-components.js +1 -1
  19. package/dist/esm/mg-input-combobox.entry.js +16 -12
  20. package/dist/mg-components/mg-components.esm.js +1 -1
  21. package/dist/mg-components/p-7132bca1.entry.js +1 -0
  22. package/dist/mg-components/p-cd061b38.entry.js +1 -0
  23. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +13 -16
  24. package/dist/types/components.d.ts +6 -8
  25. package/ide/intellij/web-types.json +18 -15
  26. package/ide/vscode/css-custom-data.json +12 -0
  27. package/ide/vscode/custom.css-data.json +425 -0
  28. package/ide/vscode/html-custom-data.json +3 -3
  29. package/package.json +20 -20
  30. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +0 -1
  31. package/dist/mg-components/p-66a1cb83.entry.js +0 -1
  32. package/dist/mg-components/p-6efd819f.entry.js +0 -1
  33. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +0 -8
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from '../../../../stencil-public-runtime';
2
2
  import { ClassList } from '@mgdis/core-ui-helpers/dist/utils';
3
- import { ToggleValue } from './mg-input-toggle.conf';
3
+ import { Option as ToggleOption } from '../../../../types';
4
4
  import { type TooltipPosition } from '../mg-input/mg-input.conf';
5
5
  /**
6
6
  * @slot item-1 - Left option toggle content
@@ -24,13 +24,13 @@ export declare class MgInputToggle {
24
24
  /**
25
25
  * Component value
26
26
  */
27
- value: any;
28
- handleValue(newValue: any): void;
27
+ value: ToggleOption['value'];
28
+ watchValue(newValue: MgInputToggle['value'], oldValue?: MgInputToggle['value']): void;
29
29
  /**
30
30
  * Items are the possible options to select
31
31
  */
32
- items: string[] | ToggleValue[];
33
- validateItems(newValue: MgInputToggle['items']): void;
32
+ items: string[] | ToggleOption[];
33
+ watchItems(newValue: MgInputToggle['items']): void;
34
34
  /**
35
35
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
36
36
  */
@@ -93,7 +93,7 @@ export declare class MgInputToggle {
93
93
  /**
94
94
  * Formated items for display
95
95
  */
96
- options: ToggleValue[];
96
+ options: ToggleOption[];
97
97
  /**
98
98
  * Error message to display
99
99
  */
@@ -102,11 +102,6 @@ export declare class MgInputToggle {
102
102
  * Define input valid state
103
103
  */
104
104
  valid: boolean;
105
- /**
106
- * Checked internal value
107
- */
108
- checked: boolean;
109
- handleChecked(newValue: MgInputToggle['checked']): void;
110
105
  /**
111
106
  * Emited event when value change
112
107
  */
@@ -138,9 +133,9 @@ export declare class MgInputToggle {
138
133
  */
139
134
  private setErrorMessage;
140
135
  /**
141
- * Change checked value
136
+ * Handle switch button to update value
142
137
  */
143
- private toggleChecked;
138
+ private handleSwitchButton;
144
139
  /**
145
140
  * Slots validation
146
141
  */
@@ -150,11 +145,13 @@ export declare class MgInputToggle {
150
145
  * @param checked - checked item
151
146
  * @returns toggle value
152
147
  */
153
- private getCheckedItem;
148
+ private getCurrentOptionIndex;
154
149
  /**
155
- * set checked state
150
+ * Check if value is checked
151
+ * @param value - toggle value
152
+ * @returns truthy if value is checked
156
153
  */
157
- private setChecked;
154
+ private isChecked;
158
155
  /*************
159
156
  * Lifecycle *
160
157
  *************/
@@ -15,7 +15,7 @@ import { AriaRoleType, RequiredMessageStatusType } from "./components/molecules/
15
15
  import { IconSizeType, IconType, IconVariantStyleType, IconVariantType } from "./components/atoms/mg-icon/mg-icon.conf";
16
16
  import { IllustratedMessageDirectionType, IllustratedMessageSizeType } from "./components/molecules/mg-illustrated-message/mg-illustrated-message.conf";
17
17
  import { CheckboxItem, CheckboxType, CheckboxValue } from "./components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf";
18
- import { Direction, Option } from "./types";
18
+ import { Direction, Option, Option as ToggleOption } from "./types";
19
19
  import { RequestMappingType, ResponseMappingType } from "./components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf";
20
20
  import { Format, NumericType } from "./components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf";
21
21
  import { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
@@ -23,7 +23,6 @@ import { EditorOptionsType } from "./components/molecules/inputs/mg-input-rich-t
23
23
  import { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
24
24
  import { OptionType, TextType } from "./components/molecules/inputs/mg-input-text/mg-input-text.conf";
25
25
  import { IconType as IconType1 } from "./components";
26
- import { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf";
27
26
  import { IconType as IconType2, SizeType as SizeType1, SlotLabelType } from "./components/molecules/internals/mg-item-more/mg-item-more.conf";
28
27
  import { ItemMoreType, MenuSizeType } from "./components/molecules/menus/mg-menu/mg-menu.conf";
29
28
  import { MgMenuStatusType, TargetType } from "./components/molecules/menus/mg-menu-item/mg-menu-item.conf";
@@ -47,7 +46,7 @@ export { AriaRoleType, RequiredMessageStatusType } from "./components/molecules/
47
46
  export { IconSizeType, IconType, IconVariantStyleType, IconVariantType } from "./components/atoms/mg-icon/mg-icon.conf";
48
47
  export { IllustratedMessageDirectionType, IllustratedMessageSizeType } from "./components/molecules/mg-illustrated-message/mg-illustrated-message.conf";
49
48
  export { CheckboxItem, CheckboxType, CheckboxValue } from "./components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf";
50
- export { Direction, Option } from "./types";
49
+ export { Direction, Option, Option as ToggleOption } from "./types";
51
50
  export { RequestMappingType, ResponseMappingType } from "./components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf";
52
51
  export { Format, NumericType } from "./components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf";
53
52
  export { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
@@ -55,7 +54,6 @@ export { EditorOptionsType } from "./components/molecules/inputs/mg-input-rich-t
55
54
  export { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
56
55
  export { OptionType, TextType } from "./components/molecules/inputs/mg-input-text/mg-input-text.conf";
57
56
  export { IconType as IconType1 } from "./components";
58
- export { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf";
59
57
  export { IconType as IconType2, SizeType as SizeType1, SlotLabelType } from "./components/molecules/internals/mg-item-more/mg-item-more.conf";
60
58
  export { ItemMoreType, MenuSizeType } from "./components/molecules/menus/mg-menu/mg-menu.conf";
61
59
  export { MgMenuStatusType, TargetType } from "./components/molecules/menus/mg-menu-item/mg-menu-item.conf";
@@ -1615,7 +1613,7 @@ export namespace Components {
1615
1613
  /**
1616
1614
  * Items are the possible options to select
1617
1615
  */
1618
- "items": string[] | ToggleValue[];
1616
+ "items": string[] | ToggleOption[];
1619
1617
  /**
1620
1618
  * Input label
1621
1619
  */
@@ -1666,7 +1664,7 @@ export namespace Components {
1666
1664
  /**
1667
1665
  * Component value
1668
1666
  */
1669
- "value": any;
1667
+ "value": ToggleOption['value'];
1670
1668
  }
1671
1669
  interface MgItemMore {
1672
1670
  /**
@@ -4153,7 +4151,7 @@ declare namespace LocalJSX {
4153
4151
  /**
4154
4152
  * Items are the possible options to select
4155
4153
  */
4156
- "items": string[] | ToggleValue[];
4154
+ "items": string[] | ToggleOption[];
4157
4155
  /**
4158
4156
  * Input label
4159
4157
  */
@@ -4198,7 +4196,7 @@ declare namespace LocalJSX {
4198
4196
  /**
4199
4197
  * Component value
4200
4198
  */
4201
- "value"?: any;
4199
+ "value"?: ToggleOption['value'];
4202
4200
  }
4203
4201
  interface MgItemMore {
4204
4202
  /**
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@mgdis/mg-components",
4
- "version": "6.19.0",
4
+ "version": "6.20.0",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -693,6 +693,10 @@
693
693
  "name": "--mg-c-card-color-background-default",
694
694
  "description": "Defines the default background property for the card. Default value: `--mg-b-color-light`."
695
695
  },
696
+ {
697
+ "name": "--mg-c-card-max-height",
698
+ "description": "Defines the max-height property for the card. Unset by default."
699
+ },
696
700
  {
697
701
  "name": "--mg-c-card-max-width",
698
702
  "description": "Defines the max-width property for the card. Unset by default."
@@ -5665,7 +5669,7 @@
5665
5669
  },
5666
5670
  {
5667
5671
  "name": "mg-input-toggle",
5668
- "description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `is-icon`: Define if toggle display icon\n- `is-on-off`: Define if toggle have on/off style,\nthe left icon is hidden.\nOnly available in combination with the \"isIcon\" prop.\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if input is readonly\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `value`: Component value\n\nProperties:\n- `items`: Items are the possible options to select\n\nMethods:\n- `reset`: Reset value, validity, error and visual state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emited event when value change\n\nSlots:\n- `item-1`: Left option toggle content\n- `item-2`: Right option toggle content\n\n",
5672
+ "description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `is-icon`: Define if toggle display icon\n- `is-on-off`: Define if toggle have on/off style,\nthe left icon is hidden.\nOnly available in combination with the \"isIcon\" prop.\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if input is readonly\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n\nProperties:\n- `items`: Items are the possible options to select\n- `value`: Component value\n\nMethods:\n- `reset`: Reset value, validity, error and visual state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emited event when value change\n\nSlots:\n- `item-1`: Left option toggle content\n- `item-2`: Right option toggle content\n\n",
5669
5673
  "doc-url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-toggle--docs",
5670
5674
  "attributes": [
5671
5675
  {
@@ -5783,15 +5787,6 @@
5783
5787
  "default": "'input'",
5784
5788
  "required": false
5785
5789
  }
5786
- },
5787
- {
5788
- "name": "value",
5789
- "description": "Component value\n\nType: `any`",
5790
- "doc-url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-toggle--docs",
5791
- "value": {
5792
- "type": "any",
5793
- "required": false
5794
- }
5795
5790
  }
5796
5791
  ],
5797
5792
  "js": {
@@ -5846,10 +5841,10 @@
5846
5841
  },
5847
5842
  {
5848
5843
  "name": "items",
5849
- "description": "Items are the possible options to select\n\nType: `ToggleValue[] | string[]`",
5844
+ "description": "Items are the possible options to select\n\nType: `Option[] | string[]`",
5850
5845
  "doc-url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-toggle--docs",
5851
5846
  "value": {
5852
- "type": "ToggleValue[] | string[]",
5847
+ "type": "Option[] | string[]",
5853
5848
  "required": true
5854
5849
  }
5855
5850
  },
@@ -5923,10 +5918,10 @@
5923
5918
  },
5924
5919
  {
5925
5920
  "name": "value",
5926
- "description": "Component value\n\nType: `any`",
5921
+ "description": "Component value\n\nType: `unknown`",
5927
5922
  "doc-url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-toggle--docs",
5928
5923
  "value": {
5929
- "type": "any",
5924
+ "type": "unknown",
5930
5925
  "required": false
5931
5926
  }
5932
5927
  }
@@ -6950,6 +6945,10 @@
6950
6945
  "name": "--mg-c-popover-color-text",
6951
6946
  "description": "Defines the font color of the popover. Default value: `--mg-b-color-font-dark`."
6952
6947
  },
6948
+ {
6949
+ "name": "--mg-c-popover-max-height",
6950
+ "description": "Defines the max-height of the popover. Default value: `unset`."
6951
+ },
6953
6952
  {
6954
6953
  "name": "--mg-c-popover-max-width",
6955
6954
  "description": "Defines the max-width of the popover. Default value: `--mg-b-size-floating-element-max-width`."
@@ -6958,6 +6957,10 @@
6958
6957
  "name": "--mg-c-popover-min-width",
6959
6958
  "description": "Defines the min-width of the popover. Default value: `unset`."
6960
6959
  },
6960
+ {
6961
+ "name": "--mg-c-popover-overflow",
6962
+ "description": "Defines the overflow property for the popover. Unset by default, fallback on `--mg-c-card-overflow`."
6963
+ },
6961
6964
  {
6962
6965
  "name": "--mg-c-popover-padding-horizontal",
6963
6966
  "description": "Defines the horizontal padding of the popover. Default value: `unset`, fallback to `--mg-b-size-16`."
@@ -201,6 +201,10 @@
201
201
  "name": "--mg-c-card-color-background-default",
202
202
  "description": "Defines the default background property for the card. Default value: `--mg-b-color-light`."
203
203
  },
204
+ {
205
+ "name": "--mg-c-card-max-height",
206
+ "description": "Defines the max-height property for the card. Unset by default."
207
+ },
204
208
  {
205
209
  "name": "--mg-c-card-max-width",
206
210
  "description": "Defines the max-width property for the card. Unset by default."
@@ -341,6 +345,10 @@
341
345
  "name": "--mg-c-popover-color-text",
342
346
  "description": "Defines the font color of the popover. Default value: `--mg-b-color-font-dark`."
343
347
  },
348
+ {
349
+ "name": "--mg-c-popover-max-height",
350
+ "description": "Defines the max-height of the popover. Default value: `unset`."
351
+ },
344
352
  {
345
353
  "name": "--mg-c-popover-max-width",
346
354
  "description": "Defines the max-width of the popover. Default value: `--mg-b-size-floating-element-max-width`."
@@ -349,6 +357,10 @@
349
357
  "name": "--mg-c-popover-min-width",
350
358
  "description": "Defines the min-width of the popover. Default value: `unset`."
351
359
  },
360
+ {
361
+ "name": "--mg-c-popover-overflow",
362
+ "description": "Defines the overflow property for the popover. Unset by default, fallback on `--mg-c-card-overflow`."
363
+ },
352
364
  {
353
365
  "name": "--mg-c-popover-padding-horizontal",
354
366
  "description": "Defines the horizontal padding of the popover. Default value: `unset`, fallback to `--mg-b-size-16`."