@mgdis/mg-components 6.22.1 → 6.23.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.
- package/dist/cjs/{index-Dz2LAZQT.js → index-BEF-cqV9.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_36.cjs.entry.js +162 -71
- package/dist/cjs/mg-alert.cjs.entry.js +6 -2
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-fieldset.cjs.entry.js +4 -3
- package/dist/cjs/mg-input-combobox.cjs.entry.js +4 -3
- package/dist/cjs/mg-input-file.cjs.entry.js +5 -4
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +7489 -6389
- package/dist/cjs/mg-input.conf-wgTh7iBb.js +84 -0
- package/dist/cjs/mg-loader.cjs.entry.js +1 -1
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +5 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +10 -2
- package/dist/collection/components/atoms/mg-button/mg-button.js +3 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +14 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +8 -5
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +7 -2
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +11 -11
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +3 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +4 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +4 -2
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +5 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +3 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +3 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +3 -1
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +3 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +54 -26
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +5 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +3 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +3 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +4 -2
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +25 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +3 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +3 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +4 -2
- package/dist/collection/components/molecules/mg-message/mg-message.js +39 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +16 -4
- package/dist/components/index3.js +1 -1
- package/dist/components/index4.js +1 -0
- package/dist/components/mg-action-more.js +1 -1
- package/dist/components/mg-alert.js +1 -1
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-breadcrumb.js +1 -1
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-divider2.js +1 -1
- package/dist/components/mg-fieldset.js +1 -1
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-icon2.js +1 -1
- package/dist/components/mg-input-checkbox.js +1 -1
- package/dist/components/mg-input-combobox.js +1 -1
- package/dist/components/mg-input-date.js +1 -1
- package/dist/components/mg-input-file.js +1 -1
- package/dist/components/mg-input-numeric.js +1 -1
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +1 -1
- package/dist/components/mg-input-rich-text-editor.js +284 -284
- package/dist/components/mg-input-select2.js +1 -1
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-input-title2.js +1 -1
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-input2.js +1 -1
- package/dist/components/mg-item-more2.js +1 -1
- package/dist/components/mg-loader2.js +1 -1
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-message2.js +1 -1
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-table.js +1 -1
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/custom-elements.json +8828 -0
- package/dist/esm/{index-C3jUhxdI.js → index-DshvCiTL.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_36.entry.js +162 -71
- package/dist/esm/mg-alert.entry.js +6 -2
- package/dist/esm/mg-breadcrumb.entry.js +1 -1
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-fieldset.entry.js +4 -3
- package/dist/esm/mg-input-combobox.entry.js +4 -3
- package/dist/esm/mg-input-file.entry.js +5 -4
- package/dist/esm/mg-input-rich-text-editor.entry.js +7489 -6389
- package/dist/esm/mg-input.conf-DOi9lJXy.js +73 -0
- package/dist/esm/mg-loader.entry.js +1 -1
- package/dist/esm/mg-progress.entry.js +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-661da56b.entry.js → p-13feb37a.entry.js} +1 -1
- package/dist/mg-components/{p-c1aeb277.entry.js → p-236bb1d2.entry.js} +1 -1
- package/dist/mg-components/p-79265ad3.entry.js +1 -0
- package/dist/mg-components/{p-8e256086.entry.js → p-7c63e469.entry.js} +1 -1
- package/dist/mg-components/p-7fd3e519.entry.js +1 -0
- package/dist/mg-components/p-DOi9lJXy.js +1 -0
- package/dist/mg-components/p-a0e2c886.entry.js +1 -0
- package/dist/mg-components/p-cdb01923.entry.js +1 -0
- package/dist/mg-components/p-d0b6d8f5.entry.js +1 -0
- package/dist/mg-components/p-d698fa67.entry.js +1658 -0
- package/dist/types/assets/icons/index.d.ts +2 -0
- package/dist/types/components/atoms/internals/mg-input-title/mg-input-title.d.ts +4 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +12 -6
- package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +4 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +6 -0
- package/dist/types/components.d.ts +22 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/ide/intellij/web-types.json +207 -3472
- package/ide/vscode/css-custom-data.json +1 -1
- package/ide/vscode/html-custom-data.json +58 -314
- package/package.json +29 -24
- package/dist/cjs/mg-input.conf-BNpeATnq.js +0 -35
- package/dist/esm/mg-input.conf-C9rmNQIL.js +0 -25
- package/dist/mg-components/p-06fbdb2f.entry.js +0 -1
- package/dist/mg-components/p-188b9ca9.entry.js +0 -1
- package/dist/mg-components/p-4667078d.entry.js +0 -1
- package/dist/mg-components/p-5a859ecf.entry.js +0 -1658
- package/dist/mg-components/p-C9rmNQIL.js +0 -1
- package/dist/mg-components/p-b0b8c58f.entry.js +0 -1
- package/dist/mg-components/p-bbcef41c.entry.js +0 -1
- /package/dist/mg-components/{p-C3jUhxdI.js → p-DshvCiTL.js} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Retrieve Component Storybook URL from file path
|
|
5
|
+
* @param storybookBaseUrl - Storybook Base URL
|
|
6
|
+
* @param filePath - Component file path
|
|
7
|
+
* @returns Component Storybook URL
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Per the HTML spec, a boolean attribute is `true` whenever it is present on the
|
|
12
|
+
* element, regardless of its value (including `="false"`). Stencil's default Prop
|
|
13
|
+
* parser converts the string `"false"` to the boolean `false`, which breaks this
|
|
14
|
+
* contract for consumers writing markup. Call this helper from `componentWillLoad`
|
|
15
|
+
* to re-normalize every present attribute that maps to a boolean-typed Prop.
|
|
16
|
+
*
|
|
17
|
+
* Iterates the host element's attributes and, for each one whose camelCase name
|
|
18
|
+
* matches a `typeof === 'boolean'` Prop on the instance, rewrites the attribute
|
|
19
|
+
* to `''` — Stencil's parser then turns that into `true` via the standard
|
|
20
|
+
* attribute → prop pipeline (no need for `mutable: true` on the Prop, since the
|
|
21
|
+
* write goes through Stencil's internal setter, not through user code).
|
|
22
|
+
*
|
|
23
|
+
* Non-boolean Props and non-Prop attributes (`class`, `id`, ...) are skipped
|
|
24
|
+
* naturally by the type check.
|
|
25
|
+
*
|
|
26
|
+
* @param target - the component instance (must expose `element` via `@Element()`)
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* @Component({ tag: 'my-input' })
|
|
31
|
+
* export class MyInput {
|
|
32
|
+
* @Element() element: HTMLMyInputElement;
|
|
33
|
+
* @Prop() readonly = false;
|
|
34
|
+
* @Prop() disabled = false;
|
|
35
|
+
*
|
|
36
|
+
* componentWillLoad() {
|
|
37
|
+
* normalizeBooleanAttributes(this);
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
const normalizeBooleanAttributes = (target) => {
|
|
43
|
+
for (const attr of Array.from(target.element.attributes)) {
|
|
44
|
+
const propName = attr.name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
45
|
+
if (typeof target[propName] === 'boolean') {
|
|
46
|
+
target.element.setAttribute(attr.name, '');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Possible input width
|
|
53
|
+
*/
|
|
54
|
+
const widths = [2, 4, 16, 'full'];
|
|
55
|
+
/**
|
|
56
|
+
* Possible tootltip postions
|
|
57
|
+
*/
|
|
58
|
+
const tooltipPositions = ['input', 'label'];
|
|
59
|
+
/**
|
|
60
|
+
* Possible label headings
|
|
61
|
+
*/
|
|
62
|
+
const labelHeadings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
63
|
+
/**
|
|
64
|
+
* Is HTMLMgInputElement an HTMLMgInputFileElement
|
|
65
|
+
* @param input - input element
|
|
66
|
+
* @returns true if input is an mg-input-file element
|
|
67
|
+
*/
|
|
68
|
+
const isMgInputFile = (input) => input.nodeName === 'MG-INPUT-FILE';
|
|
69
|
+
const classFieldset = 'mg-c-input--fieldset';
|
|
70
|
+
const classDisabled = 'mg-c-input--disabled';
|
|
71
|
+
const classReadonly = 'mg-c-input--readonly';
|
|
72
|
+
const classVerticalList = 'mg-c-input--vertical-list';
|
|
73
|
+
const classDisplayCharacterLeft = 'mg-c-input--display-character-left';
|
|
74
|
+
|
|
75
|
+
exports.classDisabled = classDisabled;
|
|
76
|
+
exports.classDisplayCharacterLeft = classDisplayCharacterLeft;
|
|
77
|
+
exports.classFieldset = classFieldset;
|
|
78
|
+
exports.classReadonly = classReadonly;
|
|
79
|
+
exports.classVerticalList = classVerticalList;
|
|
80
|
+
exports.isMgInputFile = isMgInputFile;
|
|
81
|
+
exports.labelHeadings = labelHeadings;
|
|
82
|
+
exports.normalizeBooleanAttributes = normalizeBooleanAttributes;
|
|
83
|
+
exports.tooltipPositions = tooltipPositions;
|
|
84
|
+
exports.widths = widths;
|