@limetech/lime-elements 34.1.1-next.4 → 34.2.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{checkbox.template-312308d8.js → checkbox.template-50eb8b76.js} +8 -3
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +23 -9
- package/dist/cjs/limel-list_3.cjs.entry.js +2 -2
- package/dist/cjs/limel-menu-list.cjs.entry.js +1 -1
- package/dist/cjs/limel-tooltip_2.cjs.entry.js +20 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/checkbox/checkbox.css +9 -21
- package/dist/collection/components/checkbox/checkbox.js +43 -8
- package/dist/collection/components/checkbox/checkbox.template.js +8 -3
- package/dist/collection/components/list/list.css +9 -21
- package/dist/collection/components/menu-list/menu-list.css +9 -21
- package/dist/collection/components/tooltip/tooltip-content.css +18 -3
- package/dist/collection/components/tooltip/tooltip-content.js +35 -6
- package/dist/collection/components/tooltip/tooltip.js +37 -11
- package/dist/esm/{checkbox.template-4be69ce6.js → checkbox.template-50f7c07b.js} +8 -3
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-checkbox.entry.js +23 -9
- package/dist/esm/limel-list_3.entry.js +2 -2
- package/dist/esm/limel-menu-list.entry.js +1 -1
- package/dist/esm/limel-tooltip_2.entry.js +20 -4
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-a78f0623.entry.js → p-208f76f3.entry.js} +1 -1
- package/dist/lime-elements/p-250f55be.js +1 -0
- package/dist/lime-elements/p-80cc0936.entry.js +73 -0
- package/dist/lime-elements/{p-a497ef59.entry.js → p-dc0542ca.entry.js} +1 -1
- package/dist/lime-elements/p-dfe0a58b.entry.js +1 -0
- package/dist/types/components/checkbox/checkbox.d.ts +6 -1
- package/dist/types/components/checkbox/checkbox.template.d.ts +1 -0
- package/dist/types/components/tooltip/tooltip-content.d.ts +7 -5
- package/dist/types/components/tooltip/tooltip.d.ts +12 -5
- package/dist/types/components.d.ts +31 -7
- package/package.json +2 -2
- package/dist/lime-elements/p-0c121e2f.js +0 -1
- package/dist/lime-elements/p-4bc5d3fc.entry.js +0 -1
- package/dist/lime-elements/p-b4a8bcbc.entry.js +0 -73
|
@@ -7,9 +7,15 @@ const randomString = require('./random-string-4c3b7f1c.js');
|
|
|
7
7
|
|
|
8
8
|
const tooltipCss = ".trigger-anchor{position:relative}";
|
|
9
9
|
|
|
10
|
+
const DEFAULT_MAX_LENGTH = 50;
|
|
10
11
|
let Tooltip = class {
|
|
11
12
|
constructor(hostRef) {
|
|
12
13
|
index.registerInstance(this, hostRef);
|
|
14
|
+
/**
|
|
15
|
+
* The maximum amount of characters before rendering 'label' and
|
|
16
|
+
* 'helperLabel' in two rows.
|
|
17
|
+
*/
|
|
18
|
+
this.maxlength = DEFAULT_MAX_LENGTH;
|
|
13
19
|
this.showTooltip = () => {
|
|
14
20
|
const tooltipDelay = 500;
|
|
15
21
|
this.showTooltipTimeoutHandle = window.setTimeout(() => {
|
|
@@ -35,7 +41,7 @@ let Tooltip = class {
|
|
|
35
41
|
return (index.h("div", { class: "trigger-anchor" }, index.h("limel-portal", { visible: this.open, containerId: this.portalId, containerStyle: {
|
|
36
42
|
'z-index': tooltipZIndex,
|
|
37
43
|
'pointer-events': 'none',
|
|
38
|
-
} }, index.h("limel-tooltip-content", { label: this.label, helperLabel: this.helperLabel, role: "tooltip", "aria-hidden": !this.open, id: this.tooltipId }))));
|
|
44
|
+
} }, index.h("limel-tooltip-content", { label: this.label, helperLabel: this.helperLabel, maxlength: this.maxlength, role: "tooltip", "aria-hidden": !this.open, id: this.tooltipId }))));
|
|
39
45
|
}
|
|
40
46
|
setOwnerAriaLabel() {
|
|
41
47
|
const owner = this.getOwnerElement();
|
|
@@ -67,16 +73,26 @@ let Tooltip = class {
|
|
|
67
73
|
};
|
|
68
74
|
Tooltip.style = tooltipCss;
|
|
69
75
|
|
|
70
|
-
const tooltipContentCss = ":host{animation:display-tooltip 0.2s ease;display:flex;
|
|
76
|
+
const tooltipContentCss = ":host{animation:display-tooltip 0.2s ease;display:flex;border-radius:0.25rem;padding:0.25rem 0.5rem;background-color:rgb(var(--contrast-1300));box-shadow:var(--shadow-depth-16)}text{font-size:0.875rem;line-height:1.25;display:flex;column-gap:1rem}text.has-column-layout{display:table-cell;width:fit-content;max-width:min(var(--tooltip-max-width-of-text), 80vw)}text.has-column-layout .label{padding-bottom:0.5rem}text.has-column-layout .helper-label{padding-bottom:0.25rem}.label{color:rgb(var(--contrast-200))}.helper-label{color:rgb(var(--contrast-800))}.helper-label:empty{display:none}@keyframes display-tooltip{0%{opacity:0;transform:translate3d(0, 0, 0) scale(0.94)}100%{opacity:1;transform:translate3d(0, 0, 0) scale(1)}}";
|
|
71
77
|
|
|
72
78
|
let TooltipContent = class {
|
|
73
79
|
constructor(hostRef) {
|
|
74
80
|
index.registerInstance(this, hostRef);
|
|
75
81
|
}
|
|
76
82
|
render() {
|
|
83
|
+
let isLabelsTextLong = false;
|
|
84
|
+
if (this.helperLabel && this.maxlength) {
|
|
85
|
+
isLabelsTextLong =
|
|
86
|
+
this.label.length + this.helperLabel.length > this.maxlength;
|
|
87
|
+
}
|
|
88
|
+
const props = {};
|
|
89
|
+
if (this.maxlength) {
|
|
90
|
+
props.style = {
|
|
91
|
+
'--tooltip-max-width-of-text': `${this.maxlength}` + 'ch',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
77
94
|
return [
|
|
78
|
-
index.h("div", { class: "label" }, this.label),
|
|
79
|
-
index.h("div", { class: "helper-label" }, this.helperLabel),
|
|
95
|
+
index.h("text", Object.assign({ class: { 'has-column-layout': isLabelsTextLong } }, props), index.h("div", { class: "label" }, this.label), index.h("div", { class: "helper-label" }, this.helperLabel)),
|
|
80
96
|
];
|
|
81
97
|
}
|
|
82
98
|
};
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["limel-color-picker.cjs",[[1,"limel-color-picker",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"tooltipLabel":[513,"tooltip-label"],"required":[516],"readonly":[516],"isOpen":[32]}]]],["limel-picker.cjs",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"helperText":[513,"helper-text"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"actions":[16],"actionPosition":[1,"action-position"],"actionScrollBehavior":[1,"action-scroll-behavior"],"badgeIcons":[516,"badge-icons"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-date-picker.cjs",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formattedValue":[32],"internalFormat":[32],"showPortal":[32]}]]],["limel-button-group.cjs",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]}]]],["limel-select.cjs",[[1,"limel-select",{"disabled":[516],"readonly":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"value":[16],"options":[16],"multiple":[4],"menuOpen":[32]}]]],["limel-tab-panel.cjs",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-file.cjs",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-menu.cjs",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}]]],["limel-button.cjs",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516]}]]],["limel-collapsible-section.cjs",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[513],"actions":[16]}]]],["limel-dialog.cjs",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-progress-flow.cjs",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-banner.cjs",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-table.cjs",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[1],"pageSize":[2,"page-size"],"totalRows":[2,"total-rows"],"sorting":[16],"activeRow":[1040],"movableColumns":[4,"movable-columns"],"loading":[4],"page":[2],"emptyMessage":[1,"empty-message"]}]]],["limel-checkbox.cjs",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"helperText":[513,"helper-text"],"checked":[516],"required":[516],"modified":[32]}]]],["limel-circular-progress.cjs",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["limel-code-editor.cjs",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"colorScheme":[1,"color-scheme"],"random":[32]}]]],["limel-config.cjs",[[1,"limel-config",{"config":[16]}]]],["limel-flex-container.cjs",[[1,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["limel-form.cjs",[[1,"limel-form",{"schema":[16],"value":[16],"disabled":[4],"propsFactory":[16],"transformErrors":[16]}]]],["limel-grid.cjs",[[1,"limel-grid"]]],["limel-linear-progress.cjs",[[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["limel-slider.cjs",[[1,"limel-slider",{"disabled":[516],"readonly":[516],"factor":[514],"label":[513],"helperText":[513,"helper-text"],"unit":[513],"value":[514],"valuemax":[514],"valuemin":[514],"step":[514],"percentageClass":[32]}]]],["limel-snackbar.cjs",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-switch.cjs",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-tab-bar.cjs",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-header.cjs",[[1,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"]}]]],["limel-progress-flow-item.cjs",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4]}]]],["limel-flatpickr-adapter.cjs",[[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1]}]]],["limel-menu-list.cjs",[[1,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}]]],["limel-popover-surface.cjs",[[1,"limel-popover-surface",{"contentCollection":[16]}]]],["limel-icon.cjs",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-input-field.cjs",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[513],"trailingIcon":[513,"trailing-icon"],"leadingIcon":[513,"leading-icon"],"pattern":[513],"type":[513],"formatNumber":[516,"format-number"],"step":[520],"max":[514],"min":[514],"maxlength":[514],"minlength":[514],"completions":[16],"showLink":[516,"show-link"],"isFocused":[32],"isModified":[32],"showCompletions":[32]}]]],["limel-color-picker-palette_2.cjs",[[1,"limel-color-picker-palette",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"required":[516]}],[1,"limel-popover",{"open":[4]}]]],["limel-badge.cjs",[[1,"limel-badge",{"label":[514]}]]],["limel-chip-set.cjs",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"helperText":[513,"helper-text"],"disabled":[516],"readonly":[516],"maxItems":[514,"max-items"],"required":[516],"searchLabel":[513,"search-label"],"emptyInputOnBlur":[516,"empty-input-on-blur"],"clearAllButton":[4,"clear-all-button"],"leadingIcon":[513,"leading-icon"],"delimiter":[513],"language":[1],"editMode":[32],"textValue":[32],"blurred":[32],"inputChipIndexSelected":[32],"getEditMode":[64],"setFocus":[64],"emptyInput":[64]}]]],["limel-icon-button.cjs",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516],"relayout":[64]}]]],["limel-spinner.cjs",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-list_3.cjs",[[1,"limel-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}],[1,"limel-menu-surface",{"open":[4],"allowClicksElement":[16]}],[1,"limel-portal",{"openDirection":[1,"open-direction"],"position":[1],"containerId":[1,"container-id"],"containerStyle":[16],"parent":[16],"inheritParentWidth":[4,"inherit-parent-width"],"visible":[4]}]]],["limel-tooltip_2.cjs",[[1,"limel-tooltip",{"label":[513],"helperLabel":[513,"helper-label"],"
|
|
17
|
+
return index.bootstrapLazy([["limel-color-picker.cjs",[[1,"limel-color-picker",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"tooltipLabel":[513,"tooltip-label"],"required":[516],"readonly":[516],"isOpen":[32]}]]],["limel-picker.cjs",[[1,"limel-picker",{"disabled":[4],"readonly":[516],"label":[1],"searchLabel":[1,"search-label"],"helperText":[513,"helper-text"],"leadingIcon":[1,"leading-icon"],"emptyResultMessage":[1,"empty-result-message"],"required":[4],"value":[16],"searcher":[16],"multiple":[4],"delimiter":[513],"actions":[16],"actionPosition":[1,"action-position"],"actionScrollBehavior":[1,"action-scroll-behavior"],"badgeIcons":[516,"badge-icons"],"items":[32],"textValue":[32],"loading":[32],"chips":[32]}]]],["limel-date-picker.cjs",[[1,"limel-date-picker",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[16],"type":[513],"format":[513],"language":[513],"formattedValue":[32],"internalFormat":[32],"showPortal":[32]}]]],["limel-button-group.cjs",[[1,"limel-button-group",{"value":[16],"disabled":[516],"selectedButtonId":[32]}]]],["limel-select.cjs",[[1,"limel-select",{"disabled":[516],"readonly":[516],"invalid":[516],"required":[516],"label":[513],"helperText":[513,"helper-text"],"value":[16],"options":[16],"multiple":[4],"menuOpen":[32]}]]],["limel-tab-panel.cjs",[[1,"limel-tab-panel",{"tabs":[1040]}]]],["limel-file.cjs",[[1,"limel-file",{"value":[16],"label":[513],"required":[516],"disabled":[516],"readonly":[516],"accept":[513],"language":[1],"isDraggingOverDropZone":[32]}]]],["limel-menu.cjs",[[1,"limel-menu",{"items":[16],"disabled":[516],"openDirection":[513,"open-direction"],"open":[1540],"badgeIcons":[516,"badge-icons"],"gridLayout":[516,"grid-layout"]}]]],["limel-button.cjs",[[1,"limel-button",{"label":[513],"primary":[516],"outlined":[516],"icon":[513],"disabled":[516],"loading":[516]}]]],["limel-collapsible-section.cjs",[[1,"limel-collapsible-section",{"isOpen":[1540,"is-open"],"header":[513],"actions":[16]}]]],["limel-dialog.cjs",[[1,"limel-dialog",{"heading":[1],"fullscreen":[516],"open":[1540],"closingActions":[16]}]]],["limel-progress-flow.cjs",[[1,"limel-progress-flow",{"flowItems":[16],"disabled":[4],"readonly":[4]}]]],["limel-banner.cjs",[[1,"limel-banner",{"message":[513],"icon":[513],"isOpen":[32],"open":[64],"close":[64]}]]],["limel-table.cjs",[[1,"limel-table",{"data":[16],"columns":[16],"mode":[1],"pageSize":[2,"page-size"],"totalRows":[2,"total-rows"],"sorting":[16],"activeRow":[1040],"movableColumns":[4,"movable-columns"],"loading":[4],"page":[2],"emptyMessage":[1,"empty-message"]}]]],["limel-checkbox.cjs",[[1,"limel-checkbox",{"disabled":[516],"readonly":[516],"label":[513],"helperText":[513,"helper-text"],"checked":[516],"indeterminate":[516],"required":[516],"modified":[32]}]]],["limel-circular-progress.cjs",[[1,"limel-circular-progress",{"value":[2],"maxValue":[2,"max-value"],"suffix":[1],"displayPercentageColors":[4,"display-percentage-colors"],"size":[513]}]]],["limel-code-editor.cjs",[[1,"limel-code-editor",{"value":[1],"language":[1],"readonly":[4],"lineNumbers":[4,"line-numbers"],"colorScheme":[1,"color-scheme"],"random":[32]}]]],["limel-config.cjs",[[1,"limel-config",{"config":[16]}]]],["limel-flex-container.cjs",[[1,"limel-flex-container",{"direction":[513],"justify":[513],"align":[513],"reverse":[516]}]]],["limel-form.cjs",[[1,"limel-form",{"schema":[16],"value":[16],"disabled":[4],"propsFactory":[16],"transformErrors":[16]}]]],["limel-grid.cjs",[[1,"limel-grid"]]],["limel-linear-progress.cjs",[[1,"limel-linear-progress",{"value":[2],"indeterminate":[4]}]]],["limel-slider.cjs",[[1,"limel-slider",{"disabled":[516],"readonly":[516],"factor":[514],"label":[513],"helperText":[513,"helper-text"],"unit":[513],"value":[514],"valuemax":[514],"valuemin":[514],"step":[514],"percentageClass":[32]}]]],["limel-snackbar.cjs",[[1,"limel-snackbar",{"message":[1],"timeout":[2],"actionText":[1,"action-text"],"dismissible":[4],"multiline":[4],"language":[1],"show":[64]}]]],["limel-switch.cjs",[[1,"limel-switch",{"label":[513],"disabled":[516],"readonly":[516],"value":[516],"fieldId":[32]}]]],["limel-tab-bar.cjs",[[1,"limel-tab-bar",{"tabs":[1040],"canScrollLeft":[32],"canScrollRight":[32]},[[9,"resize","handleWindowResize"]]]]],["limel-header.cjs",[[1,"limel-header",{"icon":[1],"heading":[1],"subheading":[1],"supportingText":[1,"supporting-text"]}]]],["limel-progress-flow-item.cjs",[[0,"limel-progress-flow-item",{"item":[16],"disabled":[4],"readonly":[4]}]]],["limel-flatpickr-adapter.cjs",[[1,"limel-flatpickr-adapter",{"value":[16],"type":[1],"format":[1],"isOpen":[4,"is-open"],"inputElement":[16],"language":[1]}]]],["limel-menu-list.cjs",[[1,"limel-menu-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}]]],["limel-popover-surface.cjs",[[1,"limel-popover-surface",{"contentCollection":[16]}]]],["limel-icon.cjs",[[1,"limel-icon",{"size":[513],"name":[513],"badge":[516]}]]],["limel-input-field.cjs",[[1,"limel-input-field",{"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"helperText":[513,"helper-text"],"required":[516],"value":[513],"trailingIcon":[513,"trailing-icon"],"leadingIcon":[513,"leading-icon"],"pattern":[513],"type":[513],"formatNumber":[516,"format-number"],"step":[520],"max":[514],"min":[514],"maxlength":[514],"minlength":[514],"completions":[16],"showLink":[516,"show-link"],"isFocused":[32],"isModified":[32],"showCompletions":[32]}]]],["limel-color-picker-palette_2.cjs",[[1,"limel-color-picker-palette",{"value":[513],"label":[513],"helperText":[513,"helper-text"],"required":[516]}],[1,"limel-popover",{"open":[4]}]]],["limel-badge.cjs",[[1,"limel-badge",{"label":[514]}]]],["limel-chip-set.cjs",[[1,"limel-chip-set",{"value":[16],"type":[513],"label":[513],"helperText":[513,"helper-text"],"disabled":[516],"readonly":[516],"maxItems":[514,"max-items"],"required":[516],"searchLabel":[513,"search-label"],"emptyInputOnBlur":[516,"empty-input-on-blur"],"clearAllButton":[4,"clear-all-button"],"leadingIcon":[513,"leading-icon"],"delimiter":[513],"language":[1],"editMode":[32],"textValue":[32],"blurred":[32],"inputChipIndexSelected":[32],"getEditMode":[64],"setFocus":[64],"emptyInput":[64]}]]],["limel-icon-button.cjs",[[1,"limel-icon-button",{"icon":[513],"elevated":[516],"label":[513],"disabled":[516],"relayout":[64]}]]],["limel-spinner.cjs",[[1,"limel-spinner",{"size":[513],"limeBranded":[4,"lime-branded"]}]]],["limel-list_3.cjs",[[1,"limel-list",{"items":[16],"badgeIcons":[4,"badge-icons"],"iconSize":[1,"icon-size"],"type":[1],"maxLinesSecondaryText":[2,"max-lines-secondary-text"]}],[1,"limel-menu-surface",{"open":[4],"allowClicksElement":[16]}],[1,"limel-portal",{"openDirection":[1,"open-direction"],"position":[1],"containerId":[1,"container-id"],"containerStyle":[16],"parent":[16],"inheritParentWidth":[4,"inherit-parent-width"],"visible":[4]}]]],["limel-tooltip_2.cjs",[[1,"limel-tooltip",{"elementId":[513,"element-id"],"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514],"open":[32]}],[1,"limel-tooltip-content",{"label":[513],"helperLabel":[513,"helper-label"],"maxlength":[514]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -764,28 +764,28 @@
|
|
|
764
764
|
display: flex;
|
|
765
765
|
flex-wrap: wrap;
|
|
766
766
|
}
|
|
767
|
+
.mdc-form-field .mdc-checkbox .mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background, .mdc-form-field .mdc-checkbox .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
|
|
768
|
+
background-color: rgb(var(--contrast-300));
|
|
769
|
+
}
|
|
767
770
|
.mdc-form-field .mdc-checkbox.mdc-checkbox--invalid .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
|
|
768
771
|
border-color: var(--lime-error-text-color);
|
|
769
772
|
}
|
|
770
|
-
.mdc-form-field .mdc-checkbox
|
|
773
|
+
.mdc-form-field .mdc-checkbox .mdc-checkbox__native-control:focus-visible + .mdc-checkbox__background:after {
|
|
771
774
|
content: "";
|
|
772
775
|
display: block;
|
|
773
776
|
position: absolute;
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
bottom: -0.75rem;
|
|
777
|
-
left: -0.75rem;
|
|
778
|
-
border-radius: 50%;
|
|
777
|
+
inset: -0.25rem;
|
|
778
|
+
border-radius: 0.25rem;
|
|
779
779
|
box-shadow: var(--shadow-depth-8-focused);
|
|
780
780
|
}
|
|
781
|
+
.mdc-form-field .mdc-checkbox--disabled {
|
|
782
|
+
opacity: 0.5;
|
|
783
|
+
}
|
|
781
784
|
.mdc-form-field label {
|
|
782
785
|
cursor: pointer;
|
|
783
786
|
line-height: normal;
|
|
784
787
|
padding-left: 0;
|
|
785
788
|
}
|
|
786
|
-
.mdc-form-field label.mdc-checkbox--disabled {
|
|
787
|
-
opacity: 0.37;
|
|
788
|
-
}
|
|
789
789
|
.mdc-form-field label.mdc-checkbox--required::after {
|
|
790
790
|
margin-left: 0.0625rem;
|
|
791
791
|
content: "*";
|
|
@@ -794,18 +794,6 @@
|
|
|
794
794
|
color: var(--lime-error-text-color);
|
|
795
795
|
}
|
|
796
796
|
|
|
797
|
-
.mdc-form-field .mdc-checkbox.mdc-ripple-upgraded .mdc-checkbox__ripple:before {
|
|
798
|
-
animation: fade-out-focus-style 1s ease forwards;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
@keyframes fade-out-focus-style {
|
|
802
|
-
0% {
|
|
803
|
-
opacity: 0.12;
|
|
804
|
-
}
|
|
805
|
-
100% {
|
|
806
|
-
opacity: 0;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
797
|
/*
|
|
810
798
|
* This file is imported into every component!
|
|
811
799
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MDCCheckbox } from '@material/checkbox';
|
|
2
2
|
import { MDCFormField } from '@material/form-field';
|
|
3
|
-
import { Component, Element, Event, h, Prop, State, } from '@stencil/core';
|
|
3
|
+
import { Component, Element, Event, h, Prop, State, Watch, } from '@stencil/core';
|
|
4
4
|
import { createRandomString } from '../../util/random-string';
|
|
5
5
|
import { CheckboxTemplate } from './checkbox.template';
|
|
6
6
|
/**
|
|
@@ -23,13 +23,28 @@ export class Checkbox {
|
|
|
23
23
|
* The value of the checkbox. Set to `true` to make the checkbox checked.
|
|
24
24
|
*/
|
|
25
25
|
this.checked = false;
|
|
26
|
+
/**
|
|
27
|
+
* Enables indeterminate state. Set to `true` to signal indeterminate check.
|
|
28
|
+
*/
|
|
29
|
+
this.indeterminate = false;
|
|
26
30
|
/**
|
|
27
31
|
* Set to `true` to indicate that the checkbox must be checked.
|
|
28
32
|
*/
|
|
29
33
|
this.required = false;
|
|
30
34
|
this.modified = false;
|
|
31
35
|
this.id = createRandomString();
|
|
32
|
-
this.onChange =
|
|
36
|
+
this.onChange = (event) => {
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
this.change.emit(this.mdcCheckbox.checked);
|
|
39
|
+
this.modified = true;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
handleCheckedChange(newValue) {
|
|
43
|
+
this.mdcCheckbox.checked = newValue;
|
|
44
|
+
}
|
|
45
|
+
handleIndeterminateChange(newValue) {
|
|
46
|
+
this.mdcCheckbox.checked = this.checked;
|
|
47
|
+
this.mdcCheckbox.indeterminate = newValue;
|
|
33
48
|
}
|
|
34
49
|
connectedCallback() {
|
|
35
50
|
this.initialize();
|
|
@@ -52,12 +67,7 @@ export class Checkbox {
|
|
|
52
67
|
(_b = this.formField) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
53
68
|
}
|
|
54
69
|
render() {
|
|
55
|
-
return (h(CheckboxTemplate, { disabled: this.disabled || this.readonly, label: this.label, helperText: this.helperText, checked: this.checked, required: this.required, invalid: this.required && this.modified && !this.checked, onChange: this.onChange, id: this.id }));
|
|
56
|
-
}
|
|
57
|
-
onChange(event) {
|
|
58
|
-
event.stopPropagation();
|
|
59
|
-
this.change.emit(this.mdcCheckbox.checked);
|
|
60
|
-
this.modified = true;
|
|
70
|
+
return (h(CheckboxTemplate, { disabled: this.disabled || this.readonly, label: this.label, helperText: this.helperText, checked: this.checked || this.indeterminate, indeterminate: this.indeterminate, required: this.required, invalid: this.required && this.modified && !this.checked, onChange: this.onChange, id: this.id }));
|
|
61
71
|
}
|
|
62
72
|
static get is() { return "limel-checkbox"; }
|
|
63
73
|
static get encapsulation() { return "shadow"; }
|
|
@@ -156,6 +166,24 @@ export class Checkbox {
|
|
|
156
166
|
"reflect": true,
|
|
157
167
|
"defaultValue": "false"
|
|
158
168
|
},
|
|
169
|
+
"indeterminate": {
|
|
170
|
+
"type": "boolean",
|
|
171
|
+
"mutable": false,
|
|
172
|
+
"complexType": {
|
|
173
|
+
"original": "boolean",
|
|
174
|
+
"resolved": "boolean",
|
|
175
|
+
"references": {}
|
|
176
|
+
},
|
|
177
|
+
"required": false,
|
|
178
|
+
"optional": false,
|
|
179
|
+
"docs": {
|
|
180
|
+
"tags": [],
|
|
181
|
+
"text": "Enables indeterminate state. Set to `true` to signal indeterminate check."
|
|
182
|
+
},
|
|
183
|
+
"attribute": "indeterminate",
|
|
184
|
+
"reflect": true,
|
|
185
|
+
"defaultValue": "false"
|
|
186
|
+
},
|
|
159
187
|
"required": {
|
|
160
188
|
"type": "boolean",
|
|
161
189
|
"mutable": false,
|
|
@@ -195,4 +223,11 @@ export class Checkbox {
|
|
|
195
223
|
}
|
|
196
224
|
}]; }
|
|
197
225
|
static get elementRef() { return "limelCheckbox"; }
|
|
226
|
+
static get watchers() { return [{
|
|
227
|
+
"propName": "checked",
|
|
228
|
+
"methodName": "handleCheckedChange"
|
|
229
|
+
}, {
|
|
230
|
+
"propName": "indeterminate",
|
|
231
|
+
"methodName": "handleIndeterminateChange"
|
|
232
|
+
}]; }
|
|
198
233
|
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
export const CheckboxTemplate = (props) => {
|
|
3
|
+
const inputProps = {};
|
|
4
|
+
if (props.indeterminate) {
|
|
5
|
+
inputProps['data-indeterminate'] = 'true';
|
|
6
|
+
}
|
|
3
7
|
return (h("div", { class: "mdc-form-field " },
|
|
4
8
|
h("div", { class: {
|
|
5
9
|
'mdc-checkbox': true,
|
|
6
10
|
'mdc-checkbox--invalid': props.invalid,
|
|
7
11
|
'mdc-checkbox--disabled': props.disabled,
|
|
8
12
|
'mdc-checkbox--required': props.required,
|
|
13
|
+
'mdc-checkbox--indeterminate': props.indeterminate,
|
|
9
14
|
} },
|
|
10
|
-
h("input", { type: "checkbox", class: "mdc-checkbox__native-control", id: props.id, checked: props.checked, disabled: props.disabled, required: props.required, onChange: props.onChange }),
|
|
15
|
+
h("input", Object.assign({ type: "checkbox", class: "mdc-checkbox__native-control", id: props.id, checked: props.checked, disabled: props.disabled, required: props.required, onChange: props.onChange }, inputProps)),
|
|
11
16
|
h("div", { class: "mdc-checkbox__background" },
|
|
12
17
|
h("svg", { class: "mdc-checkbox__checkmark", viewBox: "0 0 24 24" },
|
|
13
18
|
h("path", { class: "mdc-checkbox__checkmark-path", fill: "none", d: "M1.73,12.91 8.1,19.28 22.79,4.59" })),
|
|
14
|
-
h("div", { class: "mdc-checkbox__mixedmark" })),
|
|
15
|
-
h("div", { class: "mdc-checkbox__ripple" })),
|
|
19
|
+
h("div", { class: "mdc-checkbox__mixedmark" }))),
|
|
16
20
|
h("label", { class: {
|
|
17
21
|
'mdc-checkbox--invalid': props.invalid,
|
|
18
22
|
'mdc-checkbox--disabled': props.disabled,
|
|
19
23
|
'mdc-checkbox--required': props.required,
|
|
24
|
+
'mdc-checkbox--indeterminate': props.indeterminate,
|
|
20
25
|
}, htmlFor: props.id }, props.label),
|
|
21
26
|
h(HelperText, { text: props.helperText })));
|
|
22
27
|
};
|
|
@@ -4030,28 +4030,28 @@ a.mdc-list-item {
|
|
|
4030
4030
|
display: flex;
|
|
4031
4031
|
flex-wrap: wrap;
|
|
4032
4032
|
}
|
|
4033
|
+
.mdc-form-field .mdc-checkbox .mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background, .mdc-form-field .mdc-checkbox .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
|
|
4034
|
+
background-color: rgb(var(--contrast-300));
|
|
4035
|
+
}
|
|
4033
4036
|
.mdc-form-field .mdc-checkbox.mdc-checkbox--invalid .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
|
|
4034
4037
|
border-color: var(--lime-error-text-color);
|
|
4035
4038
|
}
|
|
4036
|
-
.mdc-form-field .mdc-checkbox
|
|
4039
|
+
.mdc-form-field .mdc-checkbox .mdc-checkbox__native-control:focus-visible + .mdc-checkbox__background:after {
|
|
4037
4040
|
content: "";
|
|
4038
4041
|
display: block;
|
|
4039
4042
|
position: absolute;
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
bottom: -0.75rem;
|
|
4043
|
-
left: -0.75rem;
|
|
4044
|
-
border-radius: 50%;
|
|
4043
|
+
inset: -0.25rem;
|
|
4044
|
+
border-radius: 0.25rem;
|
|
4045
4045
|
box-shadow: var(--shadow-depth-8-focused);
|
|
4046
4046
|
}
|
|
4047
|
+
.mdc-form-field .mdc-checkbox--disabled {
|
|
4048
|
+
opacity: 0.5;
|
|
4049
|
+
}
|
|
4047
4050
|
.mdc-form-field label {
|
|
4048
4051
|
cursor: pointer;
|
|
4049
4052
|
line-height: normal;
|
|
4050
4053
|
padding-left: 0;
|
|
4051
4054
|
}
|
|
4052
|
-
.mdc-form-field label.mdc-checkbox--disabled {
|
|
4053
|
-
opacity: 0.37;
|
|
4054
|
-
}
|
|
4055
4055
|
.mdc-form-field label.mdc-checkbox--required::after {
|
|
4056
4056
|
margin-left: 0.0625rem;
|
|
4057
4057
|
content: "*";
|
|
@@ -4060,18 +4060,6 @@ a.mdc-list-item {
|
|
|
4060
4060
|
color: var(--lime-error-text-color);
|
|
4061
4061
|
}
|
|
4062
4062
|
|
|
4063
|
-
.mdc-form-field .mdc-checkbox.mdc-ripple-upgraded .mdc-checkbox__ripple:before {
|
|
4064
|
-
animation: fade-out-focus-style 1s ease forwards;
|
|
4065
|
-
}
|
|
4066
|
-
|
|
4067
|
-
@keyframes fade-out-focus-style {
|
|
4068
|
-
0% {
|
|
4069
|
-
opacity: 0.12;
|
|
4070
|
-
}
|
|
4071
|
-
100% {
|
|
4072
|
-
opacity: 0;
|
|
4073
|
-
}
|
|
4074
|
-
}
|
|
4075
4063
|
/*
|
|
4076
4064
|
* This file is imported into every component!
|
|
4077
4065
|
*
|
|
@@ -4036,28 +4036,28 @@ a.mdc-list-item {
|
|
|
4036
4036
|
display: flex;
|
|
4037
4037
|
flex-wrap: wrap;
|
|
4038
4038
|
}
|
|
4039
|
+
.mdc-form-field .mdc-checkbox .mdc-checkbox__native-control[disabled]:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background, .mdc-form-field .mdc-checkbox .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
|
|
4040
|
+
background-color: rgb(var(--contrast-300));
|
|
4041
|
+
}
|
|
4039
4042
|
.mdc-form-field .mdc-checkbox.mdc-checkbox--invalid .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate) ~ .mdc-checkbox__background {
|
|
4040
4043
|
border-color: var(--lime-error-text-color);
|
|
4041
4044
|
}
|
|
4042
|
-
.mdc-form-field .mdc-checkbox
|
|
4045
|
+
.mdc-form-field .mdc-checkbox .mdc-checkbox__native-control:focus-visible + .mdc-checkbox__background:after {
|
|
4043
4046
|
content: "";
|
|
4044
4047
|
display: block;
|
|
4045
4048
|
position: absolute;
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
bottom: -0.75rem;
|
|
4049
|
-
left: -0.75rem;
|
|
4050
|
-
border-radius: 50%;
|
|
4049
|
+
inset: -0.25rem;
|
|
4050
|
+
border-radius: 0.25rem;
|
|
4051
4051
|
box-shadow: var(--shadow-depth-8-focused);
|
|
4052
4052
|
}
|
|
4053
|
+
.mdc-form-field .mdc-checkbox--disabled {
|
|
4054
|
+
opacity: 0.5;
|
|
4055
|
+
}
|
|
4053
4056
|
.mdc-form-field label {
|
|
4054
4057
|
cursor: pointer;
|
|
4055
4058
|
line-height: normal;
|
|
4056
4059
|
padding-left: 0;
|
|
4057
4060
|
}
|
|
4058
|
-
.mdc-form-field label.mdc-checkbox--disabled {
|
|
4059
|
-
opacity: 0.37;
|
|
4060
|
-
}
|
|
4061
4061
|
.mdc-form-field label.mdc-checkbox--required::after {
|
|
4062
4062
|
margin-left: 0.0625rem;
|
|
4063
4063
|
content: "*";
|
|
@@ -4066,18 +4066,6 @@ a.mdc-list-item {
|
|
|
4066
4066
|
color: var(--lime-error-text-color);
|
|
4067
4067
|
}
|
|
4068
4068
|
|
|
4069
|
-
.mdc-form-field .mdc-checkbox.mdc-ripple-upgraded .mdc-checkbox__ripple:before {
|
|
4070
|
-
animation: fade-out-focus-style 1s ease forwards;
|
|
4071
|
-
}
|
|
4072
|
-
|
|
4073
|
-
@keyframes fade-out-focus-style {
|
|
4074
|
-
0% {
|
|
4075
|
-
opacity: 0.12;
|
|
4076
|
-
}
|
|
4077
|
-
100% {
|
|
4078
|
-
opacity: 0;
|
|
4079
|
-
}
|
|
4080
|
-
}
|
|
4081
4069
|
/*
|
|
4082
4070
|
* This file is imported into every component!
|
|
4083
4071
|
*
|
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
animation: display-tooltip 0.2s ease;
|
|
3
3
|
display: flex;
|
|
4
|
-
flex-direction: row;
|
|
5
4
|
border-radius: 0.25rem;
|
|
6
5
|
padding: 0.25rem 0.5rem;
|
|
7
|
-
font-size: 0.875rem;
|
|
8
6
|
background-color: rgb(var(--contrast-1300));
|
|
9
7
|
box-shadow: var(--shadow-depth-16);
|
|
10
8
|
}
|
|
11
9
|
|
|
10
|
+
text {
|
|
11
|
+
font-size: 0.875rem;
|
|
12
|
+
line-height: 1.25;
|
|
13
|
+
display: flex;
|
|
14
|
+
column-gap: 1rem;
|
|
15
|
+
}
|
|
16
|
+
text.has-column-layout {
|
|
17
|
+
display: table-cell;
|
|
18
|
+
width: fit-content;
|
|
19
|
+
max-width: min(var(--tooltip-max-width-of-text), 80vw);
|
|
20
|
+
}
|
|
21
|
+
text.has-column-layout .label {
|
|
22
|
+
padding-bottom: 0.5rem;
|
|
23
|
+
}
|
|
24
|
+
text.has-column-layout .helper-label {
|
|
25
|
+
padding-bottom: 0.25rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
12
28
|
.label {
|
|
13
29
|
color: rgb(var(--contrast-200));
|
|
14
30
|
}
|
|
15
31
|
|
|
16
32
|
.helper-label {
|
|
17
33
|
color: rgb(var(--contrast-800));
|
|
18
|
-
padding: 0 0 0 1rem;
|
|
19
34
|
}
|
|
20
35
|
.helper-label:empty {
|
|
21
36
|
display: none;
|
|
@@ -6,9 +6,21 @@ import { Component, h, Prop } from '@stencil/core';
|
|
|
6
6
|
*/
|
|
7
7
|
export class TooltipContent {
|
|
8
8
|
render() {
|
|
9
|
+
let isLabelsTextLong = false;
|
|
10
|
+
if (this.helperLabel && this.maxlength) {
|
|
11
|
+
isLabelsTextLong =
|
|
12
|
+
this.label.length + this.helperLabel.length > this.maxlength;
|
|
13
|
+
}
|
|
14
|
+
const props = {};
|
|
15
|
+
if (this.maxlength) {
|
|
16
|
+
props.style = {
|
|
17
|
+
'--tooltip-max-width-of-text': `${this.maxlength}` + 'ch',
|
|
18
|
+
};
|
|
19
|
+
}
|
|
9
20
|
return [
|
|
10
|
-
h("
|
|
11
|
-
|
|
21
|
+
h("text", Object.assign({ class: { 'has-column-layout': isLabelsTextLong } }, props),
|
|
22
|
+
h("div", { class: "label" }, this.label),
|
|
23
|
+
h("div", { class: "helper-label" }, this.helperLabel)),
|
|
12
24
|
];
|
|
13
25
|
}
|
|
14
26
|
static get is() { return "limel-tooltip-content"; }
|
|
@@ -28,11 +40,11 @@ export class TooltipContent {
|
|
|
28
40
|
"resolved": "string",
|
|
29
41
|
"references": {}
|
|
30
42
|
},
|
|
31
|
-
"required":
|
|
43
|
+
"required": true,
|
|
32
44
|
"optional": false,
|
|
33
45
|
"docs": {
|
|
34
46
|
"tags": [],
|
|
35
|
-
"text": "
|
|
47
|
+
"text": "Read more in tooltip.tsx"
|
|
36
48
|
},
|
|
37
49
|
"attribute": "label",
|
|
38
50
|
"reflect": true
|
|
@@ -46,13 +58,30 @@ export class TooltipContent {
|
|
|
46
58
|
"references": {}
|
|
47
59
|
},
|
|
48
60
|
"required": false,
|
|
49
|
-
"optional":
|
|
61
|
+
"optional": true,
|
|
50
62
|
"docs": {
|
|
51
63
|
"tags": [],
|
|
52
|
-
"text": "
|
|
64
|
+
"text": "Read more in tooltip.tsx"
|
|
53
65
|
},
|
|
54
66
|
"attribute": "helper-label",
|
|
55
67
|
"reflect": true
|
|
68
|
+
},
|
|
69
|
+
"maxlength": {
|
|
70
|
+
"type": "number",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "number",
|
|
74
|
+
"resolved": "number",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": true,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": "Read more in tooltip.tsx"
|
|
82
|
+
},
|
|
83
|
+
"attribute": "maxlength",
|
|
84
|
+
"reflect": true
|
|
56
85
|
}
|
|
57
86
|
}; }
|
|
58
87
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, h, Prop, Element, State } from '@stencil/core';
|
|
2
2
|
import { createRandomString } from '../../util/random-string';
|
|
3
|
+
const DEFAULT_MAX_LENGTH = 50;
|
|
3
4
|
/**
|
|
4
5
|
* A tooltip can be used to display a descriptive text for any element.
|
|
5
6
|
* The displayed content must be a brief and supplemental string of text,
|
|
@@ -40,10 +41,17 @@ import { createRandomString } from '../../util/random-string';
|
|
|
40
41
|
* effortlessly recognize can be hovered.
|
|
41
42
|
*
|
|
42
43
|
* @exampleComponent limel-example-tooltip
|
|
44
|
+
* @exampleComponent limel-example-tooltip-max-character
|
|
45
|
+
* @exampleComponent limel-example-tooltip-composite
|
|
43
46
|
* @private
|
|
44
47
|
*/
|
|
45
48
|
export class Tooltip {
|
|
46
49
|
constructor() {
|
|
50
|
+
/**
|
|
51
|
+
* The maximum amount of characters before rendering 'label' and
|
|
52
|
+
* 'helperLabel' in two rows.
|
|
53
|
+
*/
|
|
54
|
+
this.maxlength = DEFAULT_MAX_LENGTH;
|
|
47
55
|
this.showTooltip = () => {
|
|
48
56
|
const tooltipDelay = 500;
|
|
49
57
|
this.showTooltipTimeoutHandle = window.setTimeout(() => {
|
|
@@ -71,7 +79,7 @@ export class Tooltip {
|
|
|
71
79
|
'z-index': tooltipZIndex,
|
|
72
80
|
'pointer-events': 'none',
|
|
73
81
|
} },
|
|
74
|
-
h("limel-tooltip-content", { label: this.label, helperLabel: this.helperLabel, role: "tooltip", "aria-hidden": !this.open, id: this.tooltipId }))));
|
|
82
|
+
h("limel-tooltip-content", { label: this.label, helperLabel: this.helperLabel, maxlength: this.maxlength, role: "tooltip", "aria-hidden": !this.open, id: this.tooltipId }))));
|
|
75
83
|
}
|
|
76
84
|
setOwnerAriaLabel() {
|
|
77
85
|
const owner = this.getOwnerElement();
|
|
@@ -108,6 +116,23 @@ export class Tooltip {
|
|
|
108
116
|
"$": ["tooltip.css"]
|
|
109
117
|
}; }
|
|
110
118
|
static get properties() { return {
|
|
119
|
+
"elementId": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "string",
|
|
124
|
+
"resolved": "string",
|
|
125
|
+
"references": {}
|
|
126
|
+
},
|
|
127
|
+
"required": true,
|
|
128
|
+
"optional": false,
|
|
129
|
+
"docs": {
|
|
130
|
+
"tags": [],
|
|
131
|
+
"text": "ID of the owner element that the tooltip should describe.\nMust be a child within the same document fragment as the tooltip element\nitself."
|
|
132
|
+
},
|
|
133
|
+
"attribute": "element-id",
|
|
134
|
+
"reflect": true
|
|
135
|
+
},
|
|
111
136
|
"label": {
|
|
112
137
|
"type": "string",
|
|
113
138
|
"mutable": false,
|
|
@@ -134,7 +159,7 @@ export class Tooltip {
|
|
|
134
159
|
"references": {}
|
|
135
160
|
},
|
|
136
161
|
"required": false,
|
|
137
|
-
"optional":
|
|
162
|
+
"optional": true,
|
|
138
163
|
"docs": {
|
|
139
164
|
"tags": [],
|
|
140
165
|
"text": "Additional helper text for the element.\nExample usage can be a keyboard shortcut to activate the function of the\nowner element."
|
|
@@ -142,22 +167,23 @@ export class Tooltip {
|
|
|
142
167
|
"attribute": "helper-label",
|
|
143
168
|
"reflect": true
|
|
144
169
|
},
|
|
145
|
-
"
|
|
146
|
-
"type": "
|
|
170
|
+
"maxlength": {
|
|
171
|
+
"type": "number",
|
|
147
172
|
"mutable": false,
|
|
148
173
|
"complexType": {
|
|
149
|
-
"original": "
|
|
150
|
-
"resolved": "
|
|
174
|
+
"original": "number",
|
|
175
|
+
"resolved": "number",
|
|
151
176
|
"references": {}
|
|
152
177
|
},
|
|
153
|
-
"required":
|
|
154
|
-
"optional":
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": true,
|
|
155
180
|
"docs": {
|
|
156
181
|
"tags": [],
|
|
157
|
-
"text": "
|
|
182
|
+
"text": "The maximum amount of characters before rendering 'label' and\n'helperLabel' in two rows."
|
|
158
183
|
},
|
|
159
|
-
"attribute": "
|
|
160
|
-
"reflect": true
|
|
184
|
+
"attribute": "maxlength",
|
|
185
|
+
"reflect": true,
|
|
186
|
+
"defaultValue": "DEFAULT_MAX_LENGTH"
|
|
161
187
|
}
|
|
162
188
|
}; }
|
|
163
189
|
static get states() { return {
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { h } from './index-2316f345.js';
|
|
2
2
|
|
|
3
3
|
const CheckboxTemplate = (props) => {
|
|
4
|
+
const inputProps = {};
|
|
5
|
+
if (props.indeterminate) {
|
|
6
|
+
inputProps['data-indeterminate'] = 'true';
|
|
7
|
+
}
|
|
4
8
|
return (h("div", { class: "mdc-form-field " },
|
|
5
9
|
h("div", { class: {
|
|
6
10
|
'mdc-checkbox': true,
|
|
7
11
|
'mdc-checkbox--invalid': props.invalid,
|
|
8
12
|
'mdc-checkbox--disabled': props.disabled,
|
|
9
13
|
'mdc-checkbox--required': props.required,
|
|
14
|
+
'mdc-checkbox--indeterminate': props.indeterminate,
|
|
10
15
|
} },
|
|
11
|
-
h("input", { type: "checkbox", class: "mdc-checkbox__native-control", id: props.id, checked: props.checked, disabled: props.disabled, required: props.required, onChange: props.onChange }),
|
|
16
|
+
h("input", Object.assign({ type: "checkbox", class: "mdc-checkbox__native-control", id: props.id, checked: props.checked, disabled: props.disabled, required: props.required, onChange: props.onChange }, inputProps)),
|
|
12
17
|
h("div", { class: "mdc-checkbox__background" },
|
|
13
18
|
h("svg", { class: "mdc-checkbox__checkmark", viewBox: "0 0 24 24" },
|
|
14
19
|
h("path", { class: "mdc-checkbox__checkmark-path", fill: "none", d: "M1.73,12.91 8.1,19.28 22.79,4.59" })),
|
|
15
|
-
h("div", { class: "mdc-checkbox__mixedmark" })),
|
|
16
|
-
h("div", { class: "mdc-checkbox__ripple" })),
|
|
20
|
+
h("div", { class: "mdc-checkbox__mixedmark" }))),
|
|
17
21
|
h("label", { class: {
|
|
18
22
|
'mdc-checkbox--invalid': props.invalid,
|
|
19
23
|
'mdc-checkbox--disabled': props.disabled,
|
|
20
24
|
'mdc-checkbox--required': props.required,
|
|
25
|
+
'mdc-checkbox--indeterminate': props.indeterminate,
|
|
21
26
|
}, htmlFor: props.id }, props.label),
|
|
22
27
|
h(HelperText, { text: props.helperText })));
|
|
23
28
|
};
|