@rededor/cura 1.0.0-alpha.4 → 1.0.0-alpha.6
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/app-globals-bcffd819.js.map +1 -1
- package/dist/cjs/{cura-button-transparent_2.cjs.entry.js → cura-accordion_12.cjs.entry.js} +813 -38
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-button-outline.cjs.entry.js +3 -2
- package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +103 -0
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-toast.cjs.entry.js +4 -4
- package/dist/cjs/cura-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js +7 -6
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +3 -2
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +5 -4
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
- package/dist/collection/components/cura-alert/cura-alert.stories.js +9 -0
- package/dist/collection/components/cura-alert/cura-alert.stories.js.map +1 -1
- package/dist/collection/components/cura-toast/cura-toast.css +1 -0
- package/dist/collection/components/cura-toast/cura-toast.js +4 -4
- package/dist/collection/components/cura-toast/cura-toast.js.map +1 -1
- package/dist/collection/components/cura-toast/cura-toast.stories.js +11 -0
- package/dist/collection/components/cura-toast/cura-toast.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +3 -2
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js +1 -5
- package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +68 -44
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/components/cura-button-outline.js +3 -2
- package/dist/components/cura-button-outline.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +5 -4
- package/dist/components/cura-button-transparent2.js.map +1 -1
- package/dist/components/cura-button.js +7 -6
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-input-text2.js +3 -6
- package/dist/components/cura-input-text2.js.map +1 -1
- package/dist/components/cura-select2.js +66 -44
- package/dist/components/cura-select2.js.map +1 -1
- package/dist/components/cura-toast.js +4 -4
- package/dist/components/cura-toast.js.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/p-335323b5.entry.js +2 -0
- package/dist/cura/p-335323b5.entry.js.map +1 -0
- package/dist/cura/p-6e3f2b5b.entry.js +2 -0
- package/dist/cura/p-6e3f2b5b.entry.js.map +1 -0
- package/dist/cura/p-70c369b1.js.map +1 -1
- package/dist/cura/{p-3b4bf71e.entry.js → p-79fa3b97.entry.js} +2 -2
- package/dist/cura/{p-3b4bf71e.entry.js.map → p-79fa3b97.entry.js.map} +1 -1
- package/dist/cura/p-f016eb62.entry.js +2 -0
- package/dist/cura/p-f016eb62.entry.js.map +1 -0
- package/dist/esm/app-globals-f2da2b14.js.map +1 -1
- package/dist/esm/{cura-button-transparent_2.entry.js → cura-accordion_12.entry.js} +803 -38
- package/dist/esm/cura-accordion_12.entry.js.map +1 -0
- package/dist/esm/cura-button-outline.entry.js +3 -2
- package/dist/esm/cura-button-outline.entry.js.map +1 -1
- package/dist/esm/cura-button-transparent.entry.js +99 -0
- package/dist/esm/cura-button-transparent.entry.js.map +1 -0
- package/dist/esm/cura-toast.entry.js +4 -4
- package/dist/esm/cura-toast.entry.js.map +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-alert/cura-alert.stories.d.ts +9 -0
- package/dist/types/components/cura-toast/cura-toast.d.ts +1 -1
- package/dist/types/components/cura-toast/cura-toast.stories.d.ts +11 -0
- package/dist/types/components/forms/cura-select/cura-select.d.ts +8 -11
- package/dist/types/components.d.ts +2 -2
- package/package.json +2 -2
- package/dist/cjs/cura-accordion_9.cjs.entry.js +0 -544
- package/dist/cjs/cura-accordion_9.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-button-transparent_2.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-select_2.cjs.entry.js +0 -325
- package/dist/cjs/cura-select_2.cjs.entry.js.map +0 -1
- package/dist/cura/p-27afaed4.entry.js +0 -2
- package/dist/cura/p-27afaed4.entry.js.map +0 -1
- package/dist/cura/p-31ae34e3.entry.js +0 -2
- package/dist/cura/p-31ae34e3.entry.js.map +0 -1
- package/dist/cura/p-45bc4f7c.entry.js +0 -2
- package/dist/cura/p-45bc4f7c.entry.js.map +0 -1
- package/dist/cura/p-a5e53dd4.entry.js +0 -2
- package/dist/cura/p-a5e53dd4.entry.js.map +0 -1
- package/dist/esm/cura-accordion_9.entry.js +0 -532
- package/dist/esm/cura-accordion_9.entry.js.map +0 -1
- package/dist/esm/cura-button-transparent_2.entry.js.map +0 -1
- package/dist/esm/cura-select_2.entry.js +0 -320
- package/dist/esm/cura-select_2.entry.js.map +0 -1
|
@@ -3,11 +3,137 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-98e7ba54.js');
|
|
6
|
+
const curaIcon_definitions = require('./cura-icon.definitions-8d714f6a.js');
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
8
|
+
const curaAccordionCss = ":host{display:block;color:var(--font-color);font-size:var(--font-size);font-size:var(--font-size);font-family:var(--font-family);font-weight:var(--font-weight-regular)}:host::after{content:\"\";display:block;border-bottom:solid 1px var(--neutral-base);width:100%}";
|
|
9
|
+
const CuraAccordionStyle0 = curaAccordionCss;
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
+
const CuraAccordion = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.mutationObserverCallback = (mutations, _) => {
|
|
15
|
+
var _a;
|
|
16
|
+
for (const mutation of mutations) {
|
|
17
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'opened' && ((_a = mutation.target) === null || _a === void 0 ? void 0 : _a['opened'])) {
|
|
18
|
+
if (this.behavior !== 'default')
|
|
19
|
+
continue;
|
|
20
|
+
this.host.querySelectorAll('cura-accordion-item').forEach(item => {
|
|
21
|
+
if (item != mutation.target) {
|
|
22
|
+
item.opened = false;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (mutation.type === 'childList') {
|
|
27
|
+
const addedNodes = Array.from(mutation.addedNodes || []);
|
|
28
|
+
for (let node of addedNodes) {
|
|
29
|
+
this.setChildProperties(node);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.mutationObserver = new MutationObserver(this.mutationObserverCallback);
|
|
35
|
+
this.color = 'primary';
|
|
36
|
+
this.activeColor = 'accent';
|
|
37
|
+
this.colorMode = 'dark';
|
|
38
|
+
this.iconSize = 32;
|
|
39
|
+
this.openIcon = 'down';
|
|
40
|
+
this.closeIcon = 'up';
|
|
41
|
+
this.iconColor = '';
|
|
42
|
+
this.iconActiveColor = '';
|
|
43
|
+
this.behavior = 'default';
|
|
44
|
+
this.styles = {};
|
|
45
|
+
}
|
|
46
|
+
handleChangeColor() {
|
|
47
|
+
this.setColors();
|
|
48
|
+
}
|
|
49
|
+
connectedCallback() {
|
|
50
|
+
const weights = window.CuraAPI.theme.fonts.getWeights();
|
|
51
|
+
this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
|
|
52
|
+
this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);
|
|
53
|
+
this.styles['--neutral-lighter'] = window.CuraAPI.theme.colors.getColor(`neutral-lighter`);
|
|
54
|
+
this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
|
|
55
|
+
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
56
|
+
this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();
|
|
57
|
+
this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
|
|
58
|
+
this.styles['--font-weight-regular'] = weights.regular;
|
|
59
|
+
this.setColors();
|
|
60
|
+
}
|
|
61
|
+
componentDidLoad() {
|
|
62
|
+
this.host.querySelectorAll('cura-accordion-item').forEach(item => {
|
|
63
|
+
this.setChildProperties(item);
|
|
64
|
+
});
|
|
65
|
+
const options = { childList: true, subtree: true, attributes: true };
|
|
66
|
+
this.mutationObserver.observe(this.host, options);
|
|
67
|
+
}
|
|
68
|
+
disconnectedCallback() {
|
|
69
|
+
this.mutationObserver.disconnect();
|
|
70
|
+
}
|
|
71
|
+
setChildProperties(item) {
|
|
72
|
+
// Theme
|
|
73
|
+
item.colorMode = this.colorMode;
|
|
74
|
+
item.iconColor = this.iconColor || this.color;
|
|
75
|
+
item.iconActiveColor = this.iconActiveColor || this.activeColor;
|
|
76
|
+
// Icon
|
|
77
|
+
item.iconSize = this.iconSize;
|
|
78
|
+
item.openIcon = this.openIcon;
|
|
79
|
+
item.closeIcon = this.closeIcon;
|
|
80
|
+
}
|
|
81
|
+
setColors() {
|
|
82
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`), '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`), '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`), '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`), '--color-active-lighter': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-lighter`), '--color-active-light': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-light`), '--color-active-base': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-base`), '--color-active-dark': window.CuraAPI.theme.colors.getColor(`${this.activeColor}-dark`), '--icon-color-lighter': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-lighter`), '--icon-color-light': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-light`), '--icon-color-base': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-base`), '--icon-color-dark': window.CuraAPI.theme.colors.getColor(`${this.iconColor || this.color}-dark`), '--icon-color-active-lighter': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-lighter`), '--icon-color-active-light': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-light`), '--icon-color-active-base': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-base`), '--icon-color-active-dark': window.CuraAPI.theme.colors.getColor(`${this.iconActiveColor || this.activeColor}-dark`) });
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return (index.h(index.Host, { key: '6d25b84df610918423ce8eac4213e4f012af6a20', style: this.styles }, index.h("slot", { key: '812c3195ec83ecee009a221bc3bec303903c1e68', name: 'accordion-item' })));
|
|
86
|
+
}
|
|
87
|
+
get host() { return index.getElement(this); }
|
|
88
|
+
static get watchers() { return {
|
|
89
|
+
"color": ["handleChangeColor"],
|
|
90
|
+
"activeColor": ["handleChangeColor"]
|
|
91
|
+
}; }
|
|
92
|
+
};
|
|
93
|
+
CuraAccordion.style = CuraAccordionStyle0;
|
|
94
|
+
|
|
95
|
+
const curaAccordionItemCss = ":host{display:block}:host .accordion-item{width:100%}:host .accordion-item .label{display:flex;flex-direction:column}:host .accordion-item .label::before{content:\"\";display:block;border-top:solid 1px var(--neutral-base);width:100%}:host .accordion-item .label .label-container{display:flex;flex-grow:1;justify-content:space-between;align-items:center;gap:calc(var(--base-spacing) * 2px);min-height:40px;word-break:break-word;cursor:pointer;font-size:1.14em;font-weight:var(--font-weight-regular);color:var(--color-base);padding:0px}:host .accordion-item .label .label-container cura-icon{margin-right:4px}:host .accordion-item .label .label-container:hover{color:var(--color-light)}:host .accordion-item .label .label-container:hover cura-icon{--color:var(--icon-color-light) !important}:host .accordion-item .label .label-container:active{color:var(--color-dark)}:host .accordion-item .label .label-container:active cura-icon{--color:var(--icon-color-dark) !important}:host .accordion-item .content{font-size:1em;overflow:hidden;max-height:0;transition:max-height 0.25s ease}:host .accordion-item .content .content-wrapper{padding:calc(var(--base-spacing) * 2px) 0px;border-top:solid 1px var(--neutral-base)}:host .accordion-item.active .label .label-container{color:var(--color-active-base)}:host .accordion-item.active .label .label-container:hover{color:var(--color-active-light)}:host .accordion-item.active .label .label-container:hover cura-icon{--color:var(--icon-color-active-light) !important}:host .accordion-item.active .label .label-container:active{color:var(--color-active-dark)}:host .accordion-item.active .label .label-container:active cura-icon{--color:var(--icon-color-active-dark) !important}:host .accordion-item.active .content{max-height:200vh;overflow-y:auto;transition:max-height 0.5s ease 0.14s}:host .accordion-item.inverted .label .label-container{color:var(--neutral-lighter)}:host .accordion-item.inverted .label .label-container:hover{color:var(--color-lighter)}:host .accordion-item.inverted .label .label-container:hover cura-icon{--color:var(--icon-color-lighter) !important}:host .accordion-item.inverted .label .label-container:active{color:var(--color-light)}:host .accordion-item.inverted .label .label-container:active cura-icon{--color:var(--icon-color-light) !important}:host .accordion-item.active.inverted .label .label-container{color:var(--neutral-purewhite)}:host .accordion-item.active.inverted .label .label-container:hover{color:var(--color-active-lighter)}:host .accordion-item.active.inverted .label .label-container:hover cura-icon{--color:var(--icon-color-active-lighter) !important}:host .accordion-item.active.inverted .label .label-container:active{color:var(--color-active-light)}:host .accordion-item.active.inverted .label .label-container:active cura-icon{--color:var(--icon-color-active-light) !important}@media (min-width: 769px) and (max-width: 992px){:host .accordion-item .label .label-container{font-size:1.29em}:host .accordion-item .content{font-size:1.14em}}@media (min-width: 993px){:host .accordion-item .label .label-container{font-size:1.29em}:host .accordion-item .content{font-size:1.14em}}";
|
|
96
|
+
const CuraAccordionItemStyle0 = curaAccordionItemCss;
|
|
97
|
+
|
|
98
|
+
const CuraAccordionItem = class {
|
|
99
|
+
constructor(hostRef) {
|
|
100
|
+
index.registerInstance(this, hostRef);
|
|
101
|
+
this.label = '';
|
|
102
|
+
this.iconSize = 32;
|
|
103
|
+
this.openIcon = 'down';
|
|
104
|
+
this.closeIcon = 'up';
|
|
105
|
+
this.iconColor = '';
|
|
106
|
+
this.iconActiveColor = '';
|
|
107
|
+
this.colorMode = 'dark';
|
|
108
|
+
this.opened = false;
|
|
109
|
+
this.styles = {};
|
|
110
|
+
}
|
|
111
|
+
getIconColor() {
|
|
112
|
+
const inverted = this.colorMode === 'light';
|
|
113
|
+
const iconColor = inverted ? 'neutral-lighter' : `${this.iconColor}-base`;
|
|
114
|
+
const iconActiveColor = inverted ? 'neutral-purewhite' : `${this.iconActiveColor}-base`;
|
|
115
|
+
return this.opened ? iconActiveColor : iconColor;
|
|
116
|
+
}
|
|
117
|
+
getClasses() {
|
|
118
|
+
const classes = {};
|
|
119
|
+
classes['accordion-item'] = true;
|
|
120
|
+
classes['active'] = this.opened;
|
|
121
|
+
classes['inverted'] = this.colorMode === 'light';
|
|
122
|
+
return classes;
|
|
123
|
+
}
|
|
124
|
+
accordionItemClick(_) {
|
|
125
|
+
this.opened = !this.opened;
|
|
126
|
+
}
|
|
127
|
+
render() {
|
|
128
|
+
return (index.h(index.Host, { key: '8d46e9fd7c698c049a9020375cd77b5ebb9d38fd', slot: "accordion-item" }, index.h("div", { key: 'fdc11f228f3051f2452b0beb56e232de836fa382', class: this.getClasses(), style: this.styles }, index.h("div", { key: '7507b6c72d3433550b1590530c8070fe07431389', class: "label", onClick: e => this.accordionItemClick(e) }, index.h("div", { key: '8f6d6deb3fc2e864ac81abb744c5d4a32ad6b974', class: "label-container" }, index.h("span", { key: '7b1a4e96fa8c3dfdfffa7890c17ed8afacf3032f' }, this.label), index.h("cura-icon", { key: '0f9c6f9dc664ad96a7b02c084700fd8f75fbc677', name: this.opened ? this.closeIcon : this.openIcon, size: this.iconSize, color: this.getIconColor() }))), index.h("div", { key: 'fb1860aa74170ff18edc03b8171356cd1a1fd271', class: 'content' }, index.h("div", { key: '4d3c9252658e9c30521353579f0b3ef9bc8a3087', class: "content-wrapper" }, index.h("slot", { key: '067f12a534860a5942d01d5945d1e4d272e5a541' }))))));
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
CuraAccordionItem.style = CuraAccordionItemStyle0;
|
|
132
|
+
|
|
133
|
+
const curaButtonCss = ":host{--border-radius:4px;display:inline-block;vertical-align:middle;position:relative}:host button,:host a{outline:none;box-shadow:none;box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;border-radius:var(--border-radius);position:relative;background-color:var(--color-base-neutral-purewhite);box-sizing:border-box;border:2px solid transparent}:host button:focus,:host a:focus{outline:2px solid #6EA8FF}:host button:not(.disabled):not(.isLoading),:host a:not(.disabled):not(.isLoading){border:2px solid var(--color-base-color-light)}:host button:not(.disabled):hover,:host a:not(.disabled):hover{border-color:var(--color-dark-color-base);background:var(--color-base-color-light);box-shadow:0px 4px 8px 0px rgba(38, 38, 38, 0.16)}:host button:not(.isLoading):not(.disabled):active,:host a:not(.isLoading):not(.disabled):active{background-color:var(--color-dark-color-light);border-color:var(--color-dark-color-light)}:host button:hover,:host a:hover{box-shadow:0 4px 8px 0 rgba(38, 38, 38, 0.16)}:host button.medium:hover,:host a.medium:hover{box-shadow:0 3px 6px 0 rgba(38, 38, 38, 0.16)}:host button.small:hover,:host a.small:hover{box-shadow:0 2px 5px 0 rgba(38, 38, 38, 0.16)}:host button:active,:host button.disabled:hover,:host button.isLoading:hover,:host a:active,:host a.disabled:hover,:host a.isLoading:hover{box-shadow:none !important}:host button.large,:host a.large{padding:calc(var(--base-spacing) * 6.12px) calc(var(--base-spacing) * 9.96px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 33.7px)}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 3.44px) calc(var(--base-spacing) * 9.96px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 29.95px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 3.24px) calc(var(--base-spacing) * 7.44px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 21.67px)}:host button:not(.isLoading).large,:host a:not(.isLoading).large{padding:calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 13px)}:host button:not(.isLoading).medium,:host a:not(.isLoading).medium{padding:calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 11px)}:host button:not(.isLoading).small,:host a:not(.isLoading).small{padding:calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:flex;align-items:center;opacity:1;transition:opacity 0.2s linear;position:relative}:host button.icon-right .button-container,:host a.icon-right .button-container{flex-direction:row-reverse}:host button cura-label,:host a cura-label{flex:1;font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:1.43em;line-height:1.2em;text-align:var(--text-align, \"left\")}:host button.medium cura-label,:host a.medium cura-label{font-size:1.14em}:host button.small cura-label,:host a.small cura-label{font-size:1em}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host a.medium.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.7px)}:host button.medium.icon-right cura-icon,:host a.medium.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.7px)}:host button.small.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.5px)}:host button.small.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.5px)}:host button.disabled,:host a.disabled{cursor:not-allowed;background-color:var(--neutral-pale-neutral-black)}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3.5px)}:host button.icon-only cura-label,:host a.icon-only cura-label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 2.75px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 1.5px)}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0.3}:host button.isLoading.icon-only .button-container,:host a.isLoading.icon-only .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}:host button.isLoading cura-label,:host a.isLoading cura-label{display:none}";
|
|
134
|
+
const CuraButtonStyle0 = curaButtonCss;
|
|
135
|
+
|
|
136
|
+
const CuraButton = class {
|
|
11
137
|
constructor(hostRef) {
|
|
12
138
|
index.registerInstance(this, hostRef);
|
|
13
139
|
if (hostRef.$hostElement$["s-ei"]) {
|
|
@@ -27,27 +153,46 @@ const CuraButtonTransparent = class {
|
|
|
27
153
|
this.iconOnly = false;
|
|
28
154
|
this.href = undefined;
|
|
29
155
|
this.target = "_self";
|
|
30
|
-
this.color = '
|
|
31
|
-
this.
|
|
156
|
+
this.color = 'accent';
|
|
157
|
+
this.background = 'light';
|
|
158
|
+
this.fontColor = 'dark';
|
|
32
159
|
this.textAlign = 'left';
|
|
33
|
-
this.hovered = false;
|
|
34
160
|
this.styles = {};
|
|
161
|
+
this.hovered = false;
|
|
35
162
|
}
|
|
36
163
|
connectedCallback() {
|
|
37
164
|
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
38
165
|
this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
|
|
39
|
-
this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);
|
|
40
|
-
this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
|
|
41
|
-
this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);
|
|
42
166
|
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
43
167
|
this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
|
|
44
168
|
this.styles['--font-weight-medium'] = this.weights.medium;
|
|
45
169
|
this.styles['--text-align'] = this.textAlign;
|
|
170
|
+
this.setColors();
|
|
171
|
+
}
|
|
172
|
+
setColors() {
|
|
173
|
+
const colors = [
|
|
174
|
+
{ name: '--color-base-neutral-purewhite', theme: `${this.background === 'light' ? `${this.color}-base` : 'neutral-pale'}` },
|
|
175
|
+
{ name: '--color-base-color-light', theme: `${this.background === 'light' ? `${this.color}-base` : `${this.color}-lighter`}` },
|
|
176
|
+
{ name: '--color-dark-color-light', theme: `${this.background === 'light' ? `${this.color}-dark` : `${this.color}-light`}` },
|
|
177
|
+
{ name: '--color-dark-color-base', theme: `${this.background === 'light' ? `${this.color}-dark` : `${this.color}-base`}` },
|
|
178
|
+
{ name: '--neutral-pale-neutral-black', theme: `${this.background === 'light' ? 'neutral-pale' : 'neutral-black'}` },
|
|
179
|
+
];
|
|
180
|
+
colors.forEach(color => this.styles[color.name] = window.CuraAPI.theme.colors.getColor(color.theme));
|
|
181
|
+
this.styles = Object.assign({}, this.styles);
|
|
182
|
+
}
|
|
183
|
+
handleMouseEnter() {
|
|
184
|
+
if (this.disabled)
|
|
185
|
+
return;
|
|
186
|
+
this.hovered = true;
|
|
187
|
+
}
|
|
188
|
+
handleMouseLeave() {
|
|
189
|
+
this.hovered = false;
|
|
46
190
|
}
|
|
47
191
|
getClasses() {
|
|
192
|
+
var _a, _b;
|
|
48
193
|
const classes = {};
|
|
49
|
-
classes[`${this.size.toLowerCase()}`] = true;
|
|
50
|
-
classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
|
|
194
|
+
classes[`${(_a = this.size) === null || _a === void 0 ? void 0 : _a.toLowerCase()}`] = true;
|
|
195
|
+
classes[`icon-${(_b = this.iconPosition) === null || _b === void 0 ? void 0 : _b.toLowerCase()}`] = true;
|
|
51
196
|
classes[`icon-only`] = this.iconOnly;
|
|
52
197
|
classes['disabled'] = this.disabled;
|
|
53
198
|
classes['isLoading'] = this.isLoading;
|
|
@@ -55,24 +200,17 @@ const CuraButtonTransparent = class {
|
|
|
55
200
|
}
|
|
56
201
|
getIcon() {
|
|
57
202
|
if (!this.iconName || this.isLoading)
|
|
58
|
-
return
|
|
203
|
+
return '';
|
|
59
204
|
const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
|
|
60
205
|
return index.h("cura-icon", { name: this.iconName, iconset: this.iconset, size: iconSize, color: this.getSymbolColor() });
|
|
61
206
|
}
|
|
62
|
-
handleMouseEnter() {
|
|
63
|
-
if (this.disabled)
|
|
64
|
-
return;
|
|
65
|
-
this.hovered = true;
|
|
66
|
-
}
|
|
67
|
-
handleMouseLeave() {
|
|
68
|
-
this.hovered = false;
|
|
69
|
-
}
|
|
70
207
|
getSymbolColor() {
|
|
71
|
-
if (this.
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
208
|
+
if (this.isLoading && this.fontColor === 'light' ? 'neutral-white' : 'neutral-black')
|
|
209
|
+
return this.disabled
|
|
210
|
+
? 'neutral-dark'
|
|
211
|
+
: this.fontColor === 'light'
|
|
212
|
+
? 'neutral-white'
|
|
213
|
+
: 'neutral-black';
|
|
76
214
|
}
|
|
77
215
|
handleClick(e) {
|
|
78
216
|
if (this.disabled || this.isLoading) {
|
|
@@ -87,15 +225,137 @@ const CuraButtonTransparent = class {
|
|
|
87
225
|
}
|
|
88
226
|
}
|
|
89
227
|
render() {
|
|
90
|
-
return (index.h(index.Host, { key: '
|
|
228
|
+
return (index.h(index.Host, { key: '5a7c983dcae745239e7f81bc172a2aa52b5de8de' }, this.href ? (index.h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("cura-label", { class: "label", lineHeight: '0%', color: this.getSymbolColor() }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() }))) : (index.h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e), onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), type: this.type }, index.h("span", { class: "button-container" }, this.getIcon(), index.h("cura-label", { class: "label", lineHeight: '0%', color: this.getSymbolColor() }, index.h("slot", null))), index.h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() })))));
|
|
91
229
|
}
|
|
92
230
|
static get formAssociated() { return true; }
|
|
93
231
|
static get watchers() { return {
|
|
94
|
-
"
|
|
95
|
-
"color": ["
|
|
232
|
+
"background": ["setColors"],
|
|
233
|
+
"color": ["setColors"]
|
|
234
|
+
}; }
|
|
235
|
+
};
|
|
236
|
+
CuraButton.style = CuraButtonStyle0;
|
|
237
|
+
|
|
238
|
+
const curaHeadingCss = ":host{display:block;font-size:var(--font-size-base)}:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-family:var(--font-family);font-size:1.714em;font-weight:var(--font-weight-regular);color:var(--color-body);line-height:var(--line-height);margin-block:var(--margin-block);letter-spacing:0px}:host h1.bold-weight,:host h2.bold-weight,:host h3.bold-weight,:host h4.bold-weight,:host h5.bold-weight,:host h6.bold-weight{font-weight:var(--font-weight-medium)}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:2.071em;letter-spacing:-0.58px}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:1.214em;line-height:calc(var(--line-height) + 20%)}:host h1.small.bold-weight,:host h1.small ::slotted(b),:host h1.small ::slotted(strong),:host h2.small.bold-weight,:host h2.small ::slotted(b),:host h2.small ::slotted(strong),:host h3.small.bold-weight,:host h3.small ::slotted(b),:host h3.small ::slotted(strong),:host h4.small.bold-weight,:host h4.small ::slotted(b),:host h4.small ::slotted(strong),:host h5.small.bold-weight,:host h5.small ::slotted(b),:host h5.small ::slotted(strong),:host h6.small.bold-weight,:host h6.small ::slotted(b),:host h6.small ::slotted(strong){font-weight:var(--font-weight-bold)}:host h1.xsmall,:host h2.xsmall,:host h3.xsmall,:host h4.xsmall,:host h5.xsmall,:host h6.xsmall{font-size:0.714em;font-weight:var(--font-weight-medium);letter-spacing:0.6px}:host h1.xsmall.bold-weight,:host h1.xsmall ::slotted(b),:host h1.xsmall ::slotted(strong),:host h2.xsmall.bold-weight,:host h2.xsmall ::slotted(b),:host h2.xsmall ::slotted(strong),:host h3.xsmall.bold-weight,:host h3.xsmall ::slotted(b),:host h3.xsmall ::slotted(strong),:host h4.xsmall.bold-weight,:host h4.xsmall ::slotted(b),:host h4.xsmall ::slotted(strong),:host h5.xsmall.bold-weight,:host h5.xsmall ::slotted(b),:host h5.xsmall ::slotted(strong),:host h6.xsmall.bold-weight,:host h6.xsmall ::slotted(b),:host h6.xsmall ::slotted(strong){font-weight:var(--font-weight-bold)}@media (min-width: 769px) and (max-width: 1920px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:2em}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:2.357em;letter-spacing:-0.66px}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:1.357em}:host h1.xsmall,:host h2.xsmall,:host h3.xsmall,:host h4.xsmall,:host h5.xsmall,:host h6.xsmall{font-size:0.857em;line-height:calc(var(--line-height) + 3%);letter-spacing:0.72px}}@media (min-width: 1921px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:2.5em;line-height:calc(var(--line-height) + 5%);letter-spacing:-0.82px}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:2.929em}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:1.714em;line-height:calc(var(--line-height) + 30%);letter-spacing:0%}:host h1.xsmall,:host h2.xsmall,:host h3.xsmall,:host h4.xsmall,:host h5.xsmall,:host h6.xsmall{font-size:1em;line-height:calc(var(--line-height) + 12.857%);letter-spacing:0.28px}}:host ::slotted(b),:host ::slotted(strong){font-weight:var(--font-weight-medium)}:host ::slotted(a){font-weight:var(--font-weight-bold);color:var(--color-link);text-underline-offset:10%;cursor:pointer}:host ::slotted(u){text-underline-offset:10%}:host ::slotted(abbr){color:var(--color-link);text-decoration:underline dashed 1px var(--color-link);text-underline-offset:10%;cursor:default}:host ::slotted(i),:host ::slotted(em){font-weight:var(--font-weight-medium)}";
|
|
239
|
+
const CuraHeadingStyle0 = curaHeadingCss;
|
|
240
|
+
|
|
241
|
+
const CuraHeading = class {
|
|
242
|
+
constructor(hostRef) {
|
|
243
|
+
index.registerInstance(this, hostRef);
|
|
244
|
+
this.theme = window.CuraAPI.theme;
|
|
245
|
+
this.level = 1;
|
|
246
|
+
this.size = 'medium';
|
|
247
|
+
this.weight = 'regular';
|
|
248
|
+
this.spotColor = 'accent-dark';
|
|
249
|
+
this.color = undefined;
|
|
250
|
+
this.marginBlock = '1.25em';
|
|
251
|
+
this.lineHeight = '130%';
|
|
252
|
+
this.styles = {};
|
|
253
|
+
}
|
|
254
|
+
handleChangeColor() {
|
|
255
|
+
this.setColors();
|
|
256
|
+
}
|
|
257
|
+
connectedCallback() {
|
|
258
|
+
this.setFontProperties();
|
|
259
|
+
this.setColors();
|
|
260
|
+
}
|
|
261
|
+
getClasses() {
|
|
262
|
+
const classes = {};
|
|
263
|
+
classes[this.size.toLowerCase()] = true;
|
|
264
|
+
classes[`${this.weight.toLowerCase()}-weight`] = true;
|
|
265
|
+
return classes;
|
|
266
|
+
}
|
|
267
|
+
setFontProperties() {
|
|
268
|
+
this.weights = this.theme.fonts.getWeights();
|
|
269
|
+
this.fontSizeBase = this.theme.fonts.getSize();
|
|
270
|
+
this.styles = {
|
|
271
|
+
'--font-family': window.CuraAPI.theme.fonts.getFamily('heading'),
|
|
272
|
+
'--font-weight-regular': this.weights.regular,
|
|
273
|
+
'--font-weight-medium': this.weights.medium,
|
|
274
|
+
'--font-weight-bold': this.weights.bold,
|
|
275
|
+
'--font-weight-black': this.weights.black
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
hostCSSProperties() {
|
|
279
|
+
return {
|
|
280
|
+
'--margin-block': this.marginBlock,
|
|
281
|
+
'--font-size-base': this.fontSizeBase,
|
|
282
|
+
'--line-height': this.lineHeight
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
setColors() {
|
|
286
|
+
const fontColor = this.color
|
|
287
|
+
? this.theme.colors.getColor(this.color)
|
|
288
|
+
: this.theme.fonts.getColor();
|
|
289
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-body': fontColor || this.theme.colors.getColor('neutral-darker'), '--color-link': this.theme.colors.getColor(`${this.spotColor}`) });
|
|
290
|
+
}
|
|
291
|
+
getHeadingTag() {
|
|
292
|
+
const tags = {
|
|
293
|
+
'1': index.h("h1", { style: this.styles, class: this.getClasses() }, index.h("slot", null)),
|
|
294
|
+
'2': index.h("h2", { style: this.styles, class: this.getClasses() }, index.h("slot", null)),
|
|
295
|
+
'3': index.h("h3", { style: this.styles, class: this.getClasses() }, index.h("slot", null)),
|
|
296
|
+
'4': index.h("h4", { style: this.styles, class: this.getClasses() }, index.h("slot", null)),
|
|
297
|
+
'5': index.h("h5", { style: this.styles, class: this.getClasses() }, index.h("slot", null)),
|
|
298
|
+
'6': index.h("h6", { style: this.styles, class: this.getClasses() }, index.h("slot", null)),
|
|
299
|
+
'default': index.h("h1", { style: this.styles, class: this.getClasses() }, index.h("slot", null))
|
|
300
|
+
};
|
|
301
|
+
return tags[`${this.level}`] || tags['default'];
|
|
302
|
+
}
|
|
303
|
+
render() {
|
|
304
|
+
return (index.h(index.Host, { key: '55016d81f72ce0b506a7e2f2fbca3aa92448d581', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
305
|
+
}
|
|
306
|
+
get host() { return index.getElement(this); }
|
|
307
|
+
static get watchers() { return {
|
|
308
|
+
"color": ["handleChangeColor"],
|
|
309
|
+
"spotColor": ["handleChangeColor"]
|
|
96
310
|
}; }
|
|
97
311
|
};
|
|
98
|
-
|
|
312
|
+
CuraHeading.style = CuraHeadingStyle0;
|
|
313
|
+
|
|
314
|
+
const curaIconCss = ":host{width:var(--size);height:var(--size)}:host svg{display:inline-block;stroke:var(--color);width:var(--size);height:var(--size);stroke-width:var(--stroke);fill:none}";
|
|
315
|
+
const CuraIconStyle0 = curaIconCss;
|
|
316
|
+
|
|
317
|
+
const CuraIcon = class {
|
|
318
|
+
constructor(hostRef) {
|
|
319
|
+
index.registerInstance(this, hostRef);
|
|
320
|
+
this.name = '';
|
|
321
|
+
this.color = 'neutral-base';
|
|
322
|
+
this.size = undefined;
|
|
323
|
+
this.iconset = 'default';
|
|
324
|
+
this.disabled = false;
|
|
325
|
+
}
|
|
326
|
+
sizeHandler(size) {
|
|
327
|
+
if (size === 'micro' && !curaIcon_definitions.microIcons.includes(this.name)) {
|
|
328
|
+
size = 16;
|
|
329
|
+
console.warn(`Icon ${this.name} doesn't support micro size. Minimum size of 16 was applied instead.`);
|
|
330
|
+
}
|
|
331
|
+
const scaledStroke = (iconSize) => {
|
|
332
|
+
return `${curaIcon_definitions.iconSizes[iconSize].stroke * (curaIcon_definitions.iconSizes.default.size / curaIcon_definitions.iconSizes[iconSize].size)}px`;
|
|
333
|
+
};
|
|
334
|
+
this.setHostProperty('--size', curaIcon_definitions.iconSizes[`${size}`] ? `${curaIcon_definitions.iconSizes[size].size}px` : `${curaIcon_definitions.iconSizes.default.size}px`);
|
|
335
|
+
this.setHostProperty('--stroke', curaIcon_definitions.iconSizes[`${size}`] ? scaledStroke(size) : scaledStroke("default"));
|
|
336
|
+
}
|
|
337
|
+
colorHandler() {
|
|
338
|
+
this.setHostProperty('--color', window.CuraAPI.theme.colors.getColor(this.disabled ? 'neutral-light' : this.color || 'neutral'));
|
|
339
|
+
}
|
|
340
|
+
connectedCallback() {
|
|
341
|
+
this.assetsPath = window.CuraAPI.localAssetsPath;
|
|
342
|
+
this.sizeHandler(this.size);
|
|
343
|
+
this.colorHandler();
|
|
344
|
+
}
|
|
345
|
+
setHostProperty(prop, value) {
|
|
346
|
+
this.host.style.setProperty(prop, value);
|
|
347
|
+
}
|
|
348
|
+
render() {
|
|
349
|
+
return (index.h(index.Host, { key: 'd49f752d12f9babd6a82fe97ef384f89879e1db9' }, index.h("svg", { key: '0c6d9dad5f8f8b571dd422ebb5f7941a75b46336', version: "1.1", viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid meet", xmlns: "http://www.w3.org/2000/svg" }, index.h("use", { key: '88eab15bcbbff03713282d99055f140ccd424108', xlinkHref: `${this.assetsPath}/icons/iconset-${this.iconset}.svg#${this.name}` }))));
|
|
350
|
+
}
|
|
351
|
+
get host() { return index.getElement(this); }
|
|
352
|
+
static get watchers() { return {
|
|
353
|
+
"size": ["sizeHandler"],
|
|
354
|
+
"color": ["colorHandler"],
|
|
355
|
+
"disabled": ["colorHandler"]
|
|
356
|
+
}; }
|
|
357
|
+
};
|
|
358
|
+
CuraIcon.style = CuraIconStyle0;
|
|
99
359
|
|
|
100
360
|
/** Checks if value is string */
|
|
101
361
|
function isString(str) {
|
|
@@ -3733,11 +3993,7 @@ const maskOptions = {
|
|
|
3733
3993
|
placeholderChar: '_',
|
|
3734
3994
|
},
|
|
3735
3995
|
date: {
|
|
3736
|
-
mask:
|
|
3737
|
-
min: new Date(1900, 0, 1),
|
|
3738
|
-
max: new Date(2099, 11, 31),
|
|
3739
|
-
lazy: false,
|
|
3740
|
-
placeholderChar: '_',
|
|
3996
|
+
mask: '00/00/0000'
|
|
3741
3997
|
},
|
|
3742
3998
|
};
|
|
3743
3999
|
|
|
@@ -3995,6 +4251,7 @@ const CuraInputText = class {
|
|
|
3995
4251
|
}
|
|
3996
4252
|
handleInputChange(event) {
|
|
3997
4253
|
const inputValue = event.target.value;
|
|
4254
|
+
this.valueChange.emit(inputValue);
|
|
3998
4255
|
if (this.type === 'number') {
|
|
3999
4256
|
this.handleNumberInputChange(inputValue);
|
|
4000
4257
|
}
|
|
@@ -4034,7 +4291,7 @@ const CuraInputText = class {
|
|
|
4034
4291
|
e.preventDefault();
|
|
4035
4292
|
}
|
|
4036
4293
|
render() {
|
|
4037
|
-
return (index.h(index.Host, { key: '
|
|
4294
|
+
return (index.h(index.Host, { key: '2f2f783ecef425e66a87f01ee01da880de719a39' }, index.h("div", { key: '1d9045829f1c0d651c72b79d76e02e2c46061dac', style: this.styles, onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave(), class: Object.assign({ 'cura-input-group': true }, this.getClasses()) }, index.h("div", { key: '812f545947d26244ef7bef0dfbbdf4ddc48b1553', class: "input-wrapper" }, this.label && (index.h("cura-label", { key: '620aa3fb370e1cc80462c55f1b39418030cbed7d', class: "label", weight: "bold", size: this.size === 'large' ? 'small' : 'xsmall', color: this.getLabelColor() }, this.label, " ", this.required && index.h("span", { key: 'fc0dc595d953c8360acc2277d8744dcf868a59b3', class: "required" }, "* "))), index.h("div", { key: 'fcb2acfb37815c5beb2c1b96ae22a3854b370e15', class: "cura-input-field", part: "cura-input-field", style: this.styles }, this.renderIcon(), index.h("input", { key: '4cd76e5b8cf323f43de0169631cbb168a0eaa954', name: this.name ? this.name : '', type: this.type, onKeyDown: event => this.handleKeyDown(event), onBlur: this.handleInputBlur.bind(this), onFocus: this.handleInputFocus.bind(this), onInput: event => this.handleInputChange(event), class: this.getClasses(), style: this.styles, placeholder: this.placeholder, disabled: this.disabled || this.isLoading, required: this.required, readonly: this.readOnly, maxlength: this.maxlength, value: this.value !== undefined && this.value !== null ? this.value : '', inputmode: this.maskPreset ? 'tel' : this.inputMode, ref: ref => (this.inputRef = ref) }), !!this.clearIcon && !this.readOnly && !this.isLoading && !this.disabled && this.value && this.isFocused && (index.h("cura-icon", { key: '0832143a6aea10d7a07cf281e66e48762c9df30d', size: this.size === 'large' || this.mode === 'transparent' ? 20 : 16, color: "primary-base", name: "closeCircle", iconset: "default", class: "clear-button", onClick: () => this.handleClearInput() })), this.isLoading && index.h("cura-loader-circle", { key: 'a2eebd7fdeb47ca19b3a3be6f379bd27a77292ca', size: this.size === 'large' ? 'medium' : 'small', color: "primary-base" })), this.renderHelperText()))));
|
|
4038
4295
|
}
|
|
4039
4296
|
static get formAssociated() { return true; }
|
|
4040
4297
|
static get watchers() { return {
|
|
@@ -4049,7 +4306,525 @@ const CuraInputText = class {
|
|
|
4049
4306
|
};
|
|
4050
4307
|
CuraInputText.style = CuraInputTextStyle0;
|
|
4051
4308
|
|
|
4052
|
-
|
|
4053
|
-
|
|
4309
|
+
const curaLabelCss = ":host{display:block;font-size:var(--font-size-base)}:host p{font-family:var(--font-family);font-size:1.143em;font-weight:var(--font-weight-medium);color:var(--color-body);line-height:var(--line-height);margin-block:var(--margin-block);letter-spacing:0.32px}:host p.bold-weight,:host p ::slotted(b),:host p ::slotted(strong),:host p ::slotted(u){font-weight:var(--font-weight-bold)}:host p.large{font-size:1.357em;line-height:calc(var(--line-height) - 4%);letter-spacing:0px}:host p.small{font-size:1em;line-height:calc(var(--line-height) - 4%);letter-spacing:0.56px}:host p.xsmall{font-size:0.857em;line-height:calc(var(--line-height) - 17%);letter-spacing:0.72px}:host ::slotted(a){font-weight:var(--font-weight-bold);color:var(--color-link);text-underline-offset:10%}:host ::slotted(u){text-underline-offset:10%}:host ::slotted(abbr){color:var(--color-link);text-decoration:underline dashed 1px var(--color-link);text-underline-offset:10%;cursor:default}";
|
|
4310
|
+
const CuraLabelStyle0 = curaLabelCss;
|
|
4311
|
+
|
|
4312
|
+
const CuraLabel = class {
|
|
4313
|
+
constructor(hostRef) {
|
|
4314
|
+
index.registerInstance(this, hostRef);
|
|
4315
|
+
this.theme = window.CuraAPI.theme;
|
|
4316
|
+
this.size = 'medium';
|
|
4317
|
+
this.weight = 'regular';
|
|
4318
|
+
this.spotColor = 'accent-dark';
|
|
4319
|
+
this.color = undefined;
|
|
4320
|
+
this.marginBlock = '0';
|
|
4321
|
+
this.lineHeight = '125%';
|
|
4322
|
+
this.styles = {};
|
|
4323
|
+
}
|
|
4324
|
+
handleChangeColor() {
|
|
4325
|
+
this.setColors();
|
|
4326
|
+
}
|
|
4327
|
+
connectedCallback() {
|
|
4328
|
+
this.setFontProperties();
|
|
4329
|
+
this.setColors();
|
|
4330
|
+
}
|
|
4331
|
+
getClasses() {
|
|
4332
|
+
const sizeclass = {};
|
|
4333
|
+
sizeclass[this.size.toLowerCase()] = true;
|
|
4334
|
+
sizeclass[`${this.weight.toLowerCase()}-weight`] = true;
|
|
4335
|
+
return sizeclass;
|
|
4336
|
+
}
|
|
4337
|
+
setFontProperties() {
|
|
4338
|
+
this.weights = this.theme.fonts.getWeights();
|
|
4339
|
+
this.fontSizeBase = this.theme.fonts.getSize();
|
|
4340
|
+
this.styles = {
|
|
4341
|
+
'--font-family': this.theme.fonts.getFamily('body'),
|
|
4342
|
+
'--font-weight-medium': this.weights.medium,
|
|
4343
|
+
'--font-weight-bold': this.weights.bold
|
|
4344
|
+
};
|
|
4345
|
+
}
|
|
4346
|
+
setColors() {
|
|
4347
|
+
const fontColor = this.color
|
|
4348
|
+
? this.theme.colors.getColor(this.color)
|
|
4349
|
+
: this.theme.fonts.getColor();
|
|
4350
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-body': fontColor || this.theme.colors.getColor('neutral-darker'), '--color-link': this.theme.colors.getColor(`${this.spotColor}`) });
|
|
4351
|
+
}
|
|
4352
|
+
hostCSSProperties() {
|
|
4353
|
+
return {
|
|
4354
|
+
'--margin-block': this.marginBlock,
|
|
4355
|
+
'--font-size-base': this.fontSizeBase,
|
|
4356
|
+
'--line-height': this.lineHeight
|
|
4357
|
+
};
|
|
4358
|
+
}
|
|
4359
|
+
render() {
|
|
4360
|
+
return (index.h(index.Host, { key: '34d418859c8067e879a089240d36b58f5e91c8fc', style: this.hostCSSProperties() }, index.h("p", { key: '4a28171e079f80d8e61ebe840b858d65dd6d62c3', style: this.styles, class: this.getClasses() }, index.h("slot", { key: '0796484498caddf7935ff3458e13cfab47759a4b' }))));
|
|
4361
|
+
}
|
|
4362
|
+
get host() { return index.getElement(this); }
|
|
4363
|
+
static get watchers() { return {
|
|
4364
|
+
"color": ["handleChangeColor"],
|
|
4365
|
+
"spotColor": ["handleChangeColor"]
|
|
4366
|
+
}; }
|
|
4367
|
+
};
|
|
4368
|
+
CuraLabel.style = CuraLabelStyle0;
|
|
4369
|
+
|
|
4370
|
+
const curaLoaderCircleCss = ":host{display:inline-block;width:var(--size);height:var(--size)}:host svg{width:var(--size);height:var(--size);animation:rotate 0.7s linear infinite}:host circle,:host path{stroke-miterlimit:10;stroke-linecap:round;stroke-linejoin:round}:host path{stroke:var(--color)}:host stop{stop-color:var(--color)}:host linearGradient stop:first-child{stop-opacity:0.14}@keyframes rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}";
|
|
4371
|
+
const CuraLoaderCircleStyle0 = curaLoaderCircleCss;
|
|
4372
|
+
|
|
4373
|
+
const CuraLoaderCircle = class {
|
|
4374
|
+
constructor(hostRef) {
|
|
4375
|
+
index.registerInstance(this, hostRef);
|
|
4376
|
+
this.sizes = {
|
|
4377
|
+
xlarge: 32,
|
|
4378
|
+
large: 24,
|
|
4379
|
+
medium: 20,
|
|
4380
|
+
small: 16,
|
|
4381
|
+
default: 16,
|
|
4382
|
+
};
|
|
4383
|
+
this.getPxSize = () => this.sizes[this.size] || this.sizes['default'];
|
|
4384
|
+
this.size = 'medium';
|
|
4385
|
+
this.color = 'neutral-white';
|
|
4386
|
+
}
|
|
4387
|
+
getStyles() {
|
|
4388
|
+
return {
|
|
4389
|
+
'--size': `${this.getPxSize()}px`,
|
|
4390
|
+
'--color': window.CuraAPI.theme.colors.getColor(this.color)
|
|
4391
|
+
};
|
|
4392
|
+
}
|
|
4393
|
+
render() {
|
|
4394
|
+
return (index.h(index.Host, { key: 'dd0c9e5b82f8f3b41511d31333af00e46435e9db', style: this.getStyles() }, index.h("svg", { key: '2a6a1edab6501c7788bebed93bbc87143d10fbaf', viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("g", { key: '8dd113e23ffc4f5df091738a878eee76e030c904' }, index.h("circle", { key: 'a6e06aad2260ffb8cec65aed59ef8f09459765a1', cx: "8", cy: "8", r: "7", stroke: "url(#paint0_linear_13485_11488)", "stroke-width": "2" }), index.h("path", { key: '88ac6f03cac1030593e06e6062d8d9947474aa62', d: "M1 8C1 4.13401 4.11877 1 7.96596 1C9.53445 1 10.9819 1.52093 12.1462 2.4C12.8959 2.96601 13.5282 3.68049 14 4.5", "stroke-width": "2" })), index.h("defs", { key: '6bae1e73907f3f8a17560ef055290c4ac41959e7' }, index.h("linearGradient", { key: 'c2510effd844984927f4b32fbb7f770ebcb09a3c', id: "paint0_linear_13485_11488", x1: "15.7", y1: "4.5", x2: "4.15", y2: "11.5", gradientUnits: "userSpaceOnUse" }, index.h("stop", { key: '477e90e9eadf1385a8b897917886e1fe352c41d0' }), index.h("stop", { key: '135e22c3a11916fa1ce4bc5870774ecf37512e6f', offset: "1" }))))));
|
|
4395
|
+
}
|
|
4396
|
+
};
|
|
4397
|
+
CuraLoaderCircle.style = CuraLoaderCircleStyle0;
|
|
4398
|
+
|
|
4399
|
+
const curaPageTemplateCss = ":host{display:block}:host .grid-template{display:grid;grid-template-rows:auto;grid-template-columns:auto;grid-template-areas:\"sub-header\" \"header\" \"pre-content\" \"content-container\" \"post-body\" \"footer\" \"sub-footer\"}:host .grid-template #sub-header{grid-area:sub-header}:host .grid-template #header{grid-area:header}:host .grid-template #pre-content{grid-area:pre-content}:host .grid-template #content-container{grid-area:content-container}:host .grid-template #post-body{grid-area:post-body}:host .grid-template #footer{grid-area:footer}:host .grid-template #sub-footer{grid-area:sub-footer}@media (max-width: 768px){:host .grid-template{padding:0px}}@media (min-width: 769px) and (max-width: 992px){:host .grid-template{padding:0px}}@media (min-width: 993px) and (max-width: 1920px){:host .grid-template{padding:0px}:host .grid-template #content-container #sidebar-left ::slotted(div[slot=sidebar-left]){margin-right:calc(var(--spacing) * 5px)}:host .grid-template #content-container #sidebar-right ::slotted(div[slot=sidebar-right]){margin-left:calc(var(--spacing) * 5px)}:host .grid-template #content-container{display:flex}:host .grid-template #content-container #content{flex-grow:1}:host .grid-template #content-container #sidebar-left,:host .grid-template #content-container #sidebar-right{max-width:20%}}@media (min-width: 1921px){:host .grid-template{padding:0px}:host .grid-template #content-container #sidebar-left ::slotted(div[slot=sidebar-left]){margin-right:calc(var(--spacing) * 7px)}:host .grid-template #content-container #sidebar-right ::slotted(div[slot=sidebar-right]){margin-left:calc(var(--spacing) * 7px)}:host .grid-template #content-container{display:flex}:host .grid-template #content-container #content{flex-grow:1}:host .grid-template #content-container #sidebar-left,:host .grid-template #content-container #sidebar-right{max-width:20%}:host .grid-template #content-container.centered{max-width:1921px;justify-self:center}}";
|
|
4400
|
+
const CuraPageTemplateStyle0 = curaPageTemplateCss;
|
|
4401
|
+
|
|
4402
|
+
const CuraPageTemplate = class {
|
|
4403
|
+
constructor(hostRef) {
|
|
4404
|
+
index.registerInstance(this, hostRef);
|
|
4405
|
+
this.contentwidth = 'default';
|
|
4406
|
+
}
|
|
4407
|
+
connectedCallback() {
|
|
4408
|
+
this.styles = {
|
|
4409
|
+
'--spacing': window.CuraAPI.theme.spacing.getSpacing(),
|
|
4410
|
+
};
|
|
4411
|
+
}
|
|
4412
|
+
getClasses() {
|
|
4413
|
+
const classes = {};
|
|
4414
|
+
classes[this.contentwidth.toLowerCase()] = true;
|
|
4415
|
+
return classes;
|
|
4416
|
+
}
|
|
4417
|
+
render() {
|
|
4418
|
+
return (index.h(index.Host, { key: 'b420fd773b337fbf64107124c3a65b7d543aa0f9' }, index.h("div", { key: '00e031bf40ed01904107f07367ee5b3042c1871f', style: this.styles, class: "grid-template" }, index.h("div", { key: '4c5c8112fe739d2b330a5a71bfdd6f6339206b15', id: "sub-header" }, index.h("slot", { key: '8b9896a17e6016bc791da8fd01f562a41d7f5bb1', name: 'sub-header' })), index.h("div", { key: '9d45f7a18ce35ae550521b281cfc0d9ea5009343', id: "header" }, index.h("slot", { key: '79ecbfb33b818b41c98f8a1f09243f6c2082b7bd', name: 'header' })), index.h("div", { key: '129b9928ddd3c0f0c357fa71494b3b77876ecd49', id: "pre-content" }, index.h("slot", { key: '71b6fbe0755848ac8df0a800e65b8ebc6909aff3', name: 'pre-content' })), index.h("div", { key: '80389bc85c71768906aa2ab564a80b84a045705d', id: "content-container", class: this.getClasses() }, index.h("div", { key: '438eb89b07be453c1a7caf31eb78879a6b000fc3', id: "sidebar-left" }, index.h("slot", { key: '8e0dd99e31be8d03d767acdee8bd18f4f6fe80bd', name: 'sidebar-left' })), index.h("div", { key: '21edd321d65ff1a685c699314a2d4617a14b6d09', id: "content" }, index.h("slot", { key: '125f790bc5d5ecade8946c154b00fdb7591ec26f', name: "content" }), index.h("slot", { key: 'e52dfd04c751d893335037f6dc970902a37a7d4f' })), index.h("div", { key: '3d35da8b265ca7a96fe36d8f037c6db0e0857537', id: "sidebar-right" }, index.h("slot", { key: '1d812f29d7cc068b0c4f6e705a60defc91da7145', name: 'sidebar-right' }))), index.h("div", { key: '10f23a4d4e837bbb11e140a5fd09be05836a27ba', id: "post-body" }, index.h("slot", { key: '8f3bd8fea091a0b025e69f1a0916016f1354aeb8', name: 'post-body' })), index.h("div", { key: '474062139aa0dd1ed49bc9c8594820fa2ff0ba83', id: "footer" }, index.h("slot", { key: 'ad46b1122b0875390822df6db770413980090f5e', name: 'footer' })), index.h("div", { key: 'c3de6dd778e675e38099d85d248e7923e276a25c', id: "sub-footer" }, index.h("slot", { key: '81a48964dc8912a225ea9ea49478d674d8d7271b', name: 'sub-footer' })))));
|
|
4419
|
+
}
|
|
4420
|
+
get host() { return index.getElement(this); }
|
|
4421
|
+
};
|
|
4422
|
+
CuraPageTemplate.style = CuraPageTemplateStyle0;
|
|
4423
|
+
|
|
4424
|
+
const curaParagraphCss = ":host{display:block;font-size:var(--font-size-base)}:host p{font-family:var(--font-family);font-size:var(--font-size-base);font-weight:var(--font-weight-regular);color:var(--color-body);line-height:var(--line-height);margin-block:var(--margin-block);letter-spacing:0.28px}:host p.large{font-size:1.214em;line-height:calc(var(--line-height) + 10%);letter-spacing:0px}:host p.small{font-size:0.85em;line-height:calc(var(--line-height) - 5%);letter-spacing:0.48px}:host p.caption,:host p.xsmall{font-size:0.714em;line-height:calc(var(--line-height) - 5%);letter-spacing:0.6px}@media (min-width: 769px) and (max-width: 1920px){:host p{font-size:1.143em;line-height:calc(var(--line-height) + 5%);letter-spacing:0.32px}:host p.large{font-size:1.357em;line-height:calc(var(--line-height) + 10%);letter-spacing:0px}:host p.small{font-size:1em;line-height:calc(var(--line-height) - 5%);letter-spacing:0.56px}:host p.caption,:host p.xsmall{font-size:0.85em;line-height:calc(var(--line-height) - 5%);letter-spacing:0.72px}}@media (min-width: 1921px){:host p{font-size:1.429em;line-height:calc(var(--line-height) + 10%);letter-spacing:0px}:host p.large{font-size:1.714em;line-height:calc(var(--line-height) + 20%)}:host p.small{font-size:1.21em;line-height:calc(var(--line-height) + 5%);letter-spacing:0px}:host p.caption,:host p.xsmall{font-size:1em;line-height:calc(var(--line-height) + 5%);letter-spacing:0.28px}}:host ::slotted(b),:host ::slotted(strong){font-weight:var(--font-weight-bold)}:host ::slotted(a){font-weight:var(--font-weight-medium);color:var(--color-link);text-underline-offset:10%}:host ::slotted(u){font-weight:var(--font-weight-medium);text-underline-offset:10%}:host ::slotted(abbr){color:var(--color-link);text-decoration:underline dashed 1px var(--color-link);text-underline-offset:10%;cursor:default}";
|
|
4425
|
+
const CuraParagraphStyle0 = curaParagraphCss;
|
|
4426
|
+
|
|
4427
|
+
const CuraParagraph = class {
|
|
4428
|
+
constructor(hostRef) {
|
|
4429
|
+
index.registerInstance(this, hostRef);
|
|
4430
|
+
this.theme = window.CuraAPI.theme;
|
|
4431
|
+
this.size = 'medium';
|
|
4432
|
+
this.spotColor = 'accent-dark';
|
|
4433
|
+
this.color = undefined;
|
|
4434
|
+
this.marginBlock = '1.25em';
|
|
4435
|
+
this.lineHeight = '140%';
|
|
4436
|
+
this.styles = {};
|
|
4437
|
+
}
|
|
4438
|
+
handleChangeColor() {
|
|
4439
|
+
this.setColors();
|
|
4440
|
+
}
|
|
4441
|
+
connectedCallback() {
|
|
4442
|
+
this.setFontProperties();
|
|
4443
|
+
this.setColors();
|
|
4444
|
+
}
|
|
4445
|
+
setsizeClass() {
|
|
4446
|
+
const sizeclass = {};
|
|
4447
|
+
sizeclass[this.size.toLowerCase()] = true;
|
|
4448
|
+
return sizeclass;
|
|
4449
|
+
}
|
|
4450
|
+
setFontProperties() {
|
|
4451
|
+
this.weights = this.theme.fonts.getWeights();
|
|
4452
|
+
this.fontSizeBase = this.theme.fonts.getSize();
|
|
4453
|
+
this.styles = {
|
|
4454
|
+
'--font-family': this.theme.fonts.getFamily('body'),
|
|
4455
|
+
'--font-weight-regular': this.weights.regular,
|
|
4456
|
+
'--font-weight-medium': this.weights.medium,
|
|
4457
|
+
'--font-weight-bold': this.weights.bold
|
|
4458
|
+
};
|
|
4459
|
+
}
|
|
4460
|
+
setColors() {
|
|
4461
|
+
const fontColor = this.color
|
|
4462
|
+
? this.theme.colors.getColor(this.color)
|
|
4463
|
+
: this.theme.fonts.getColor();
|
|
4464
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-body': fontColor || this.theme.colors.getColor('neutral-darker'), '--color-link': this.theme.colors.getColor(`${this.spotColor}`) });
|
|
4465
|
+
}
|
|
4466
|
+
hostCSSProperties() {
|
|
4467
|
+
return {
|
|
4468
|
+
'--margin-block': this.marginBlock,
|
|
4469
|
+
'--font-size-base': this.fontSizeBase,
|
|
4470
|
+
'--line-height': this.lineHeight
|
|
4471
|
+
};
|
|
4472
|
+
}
|
|
4473
|
+
render() {
|
|
4474
|
+
return (index.h(index.Host, { key: '2c9903f885ae8346efdbb1569264fc078aee9224', style: this.hostCSSProperties() }, index.h("p", { key: '287c656408d2e9876497f70784ae7ce166417272', style: this.styles, class: this.setsizeClass() }, index.h("slot", { key: 'dde5f8d46c384a76605c1ef33b73c8f442c7a48b' }))));
|
|
4475
|
+
}
|
|
4476
|
+
get host() { return index.getElement(this); }
|
|
4477
|
+
static get watchers() { return {
|
|
4478
|
+
"color": ["handleChangeColor"],
|
|
4479
|
+
"spotColor": ["handleChangeColor"]
|
|
4480
|
+
}; }
|
|
4481
|
+
};
|
|
4482
|
+
CuraParagraph.style = CuraParagraphStyle0;
|
|
4483
|
+
|
|
4484
|
+
const curaSelectCss = ":host{display:block;position:relative;font-family:var(--font-family)}.wrapper{width:100%;user-select:none;text-align:left !important}.wrapper cura-label{margin-bottom:8px}.wrapper .helper-text{margin-top:8px;color:var(--neutral-dark)}.wrapper .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper .cura-input-field .feedback-icon{padding-left:12px}.wrapper .cura-input-field .up-down-icon{order:3;padding-right:12px;cursor:pointer;pointer-events:all}.wrapper .cura-input-field input{padding:0px 12px 0px 8px}.wrapper .cura-input-field.open{border-radius:4px 4px 0 0 !important}.wrapper.transparent{background-color:transparent;padding:0px;max-height:80px}.wrapper.transparent .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:transparent !important;border:none !important;border-radius:0;height:27px}.wrapper.transparent .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.transparent .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.transparent .cura-input-field .feedback-icon{padding-left:12px}.wrapper.transparent .cura-input-field input{color:var(--neutral-black) !important;font-size:16px;font-weight:var(--font-weight-bold) !important;padding:0}.wrapper.transparent .cura-input-field input::placeholder{color:var(--neutral-black)}.wrapper.transparent .cura-input-field .feedback-icon{order:3;margin:0 20px 0 0}.wrapper.transparent:focus-within .cura-input-field{border:none !important;background-color:transparent !important}.wrapper.transparent:focus-within .cura-input-field input{border:none !important;outline:none}.wrapper.transparent .helper-text{margin-top:0px}.wrapper:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field{border-color:var(--neutral-dark)}.wrapper:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field input{color:var(--neutral-dark)}.wrapper:hover:not(.disabled):not(.isLoading):not(.success):not(.error):not(.isFocused):not(.readOnly):not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper:focus-within .cura-input-field{border:2px solid var(--info-base) !important;background-color:var(--neutral-purewhite);outline:none}.wrapper:focus-within .cura-input-field input{color:var(--neutral-black) !important}.wrapper.success .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.success .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.success .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.success .cura-input-field .feedback-icon{padding-left:12px}.wrapper.success .cura-input-field input{color:var(--success-darker) !important}.wrapper.success .cura-input-field input::placeholder{color:var(--success-darker) !important}.wrapper.success:not(.transparent) .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--success-dark) !important;background-color:var(--success-lighter) !important}.wrapper.success:not(.transparent) .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.success:not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.success:not(.transparent) .cura-input-field .feedback-icon{padding-left:12px}.wrapper.error .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.error .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.error .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.error .cura-input-field .feedback-icon{padding-left:12px}.wrapper.error .cura-input-field input{color:var(--error-darker) !important}.wrapper.error .cura-input-field input::placeholder{color:var(--error-darker) !important}.wrapper.error:not(.transparent) .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;border:2px solid var(--error-dark) !important;background-color:var(--error-lighter) !important}.wrapper.error:not(.transparent) .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.error:not(.transparent) .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.error:not(.transparent) .cura-input-field .feedback-icon{padding-left:12px}.wrapper.disabled .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box;background-color:var(--neutral-white);border:2px solid var(--neutral-base)}.wrapper.disabled .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.disabled .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.disabled .cura-input-field .feedback-icon{padding-left:12px}.wrapper.disabled .cura-input-field input{color:var(--neutral-medium)}.wrapper.disabled .cura-input-field input::placeholder{color:var(--neutral-medium)}.wrapper.small .cura-input-field{width:100%;height:32px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.small .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:12px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.small .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.small .cura-input-field .feedback-icon{padding-left:12px}.wrapper.small .cura-input-field input{line-height:13px;letter-spacing:0.72px}.wrapper.small .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.wrapper.small.label .menu{top:53px}.wrapper.small .menu{top:33px}.wrapper.medium .cura-input-field{width:100%;height:40px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.medium .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:14px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.medium .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.medium .cura-input-field .feedback-icon{padding-left:12px}.wrapper.medium .cura-input-field input{line-height:16px;letter-spacing:0.56px}.wrapper.medium .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-regular)}.wrapper.medium.label .menu{top:61px}.wrapper.medium .menu{top:40px}.wrapper.large .cura-input-field{width:100%;height:44px;display:flex;flex-direction:row;align-items:center;background-color:var(--neutral-purewhite);border:2px solid var(--neutral-medium);border-radius:4px;color:var(--primary-base);letter-spacing:0.32px;line-height:20px;overflow:hidden;box-sizing:border-box}.wrapper.large .cura-input-field input{flex:1;width:100%;height:100%;background:transparent;border:none;outline:none;color:var(--neutral-dark);font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:16px;box-sizing:border-box;padding:0px 12px 0px 8px}.wrapper.large .cura-input-field input::placeholder{color:var(--neutral-dark)}.wrapper.large .cura-input-field .feedback-icon{padding-left:12px}.wrapper.large .helper-text{margin-top:8px;color:var(--neutral-dark);font-weight:var(--font-weight-bold)}.wrapper.large.label .menu{top:69px}.wrapper.large .menu{top:47px}.required{color:red}.menu{position:absolute;left:0;right:-1px;background:#fff;border:2px solid var(--neutral-light);border-radius:4px;z-index:1000;max-height:285px;overflow:hidden;border-top:transparent;align-items:center;scrollbar-color:var(--neutral-medium) var(--neutral-black-20);overflow-y:scroll;box-shadow:0px 4px 8px 0px rgba(38, 38, 38, 0.16)}.menu.open{border-radius:0 !important}";
|
|
4485
|
+
const CuraSelectStyle0 = curaSelectCss;
|
|
4486
|
+
|
|
4487
|
+
const CuraSelect = class {
|
|
4488
|
+
constructor(hostRef) {
|
|
4489
|
+
index.registerInstance(this, hostRef);
|
|
4490
|
+
this.selected = index.createEvent(this, "selected", 7);
|
|
4491
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
4492
|
+
this.internals = hostRef.$hostElement$["s-ei"];
|
|
4493
|
+
}
|
|
4494
|
+
else {
|
|
4495
|
+
this.internals = hostRef.$hostElement$.attachInternals();
|
|
4496
|
+
hostRef.$hostElement$["s-ei"] = this.internals;
|
|
4497
|
+
}
|
|
4498
|
+
/**
|
|
4499
|
+
* Styles to be applied to the component.
|
|
4500
|
+
*/
|
|
4501
|
+
this.styles = {};
|
|
4502
|
+
/**
|
|
4503
|
+
* Theme object containing font and color information.
|
|
4504
|
+
*/
|
|
4505
|
+
this.theme = window.CuraAPI.theme;
|
|
4506
|
+
/**
|
|
4507
|
+
* Handles mutations observed by the MutationObserver.
|
|
4508
|
+
* Updates the selected option or filters options based on the mutation type.
|
|
4509
|
+
*/
|
|
4510
|
+
this.handleMutations = (mutations) => {
|
|
4511
|
+
mutations.forEach(mutation => {
|
|
4512
|
+
if (mutation.type === 'attributes') {
|
|
4513
|
+
if (mutation.attributeName === 'selected')
|
|
4514
|
+
this.updateSelectedOption();
|
|
4515
|
+
}
|
|
4516
|
+
});
|
|
4517
|
+
};
|
|
4518
|
+
/**
|
|
4519
|
+
* Handles the selection of an option.
|
|
4520
|
+
*/
|
|
4521
|
+
this.onOptiselected = (event) => {
|
|
4522
|
+
const selectedOption = event.target;
|
|
4523
|
+
this.clearSelectedAttributes();
|
|
4524
|
+
selectedOption.setAttribute('selected', 'true');
|
|
4525
|
+
};
|
|
4526
|
+
this.handleKeyNavigation = (event) => {
|
|
4527
|
+
var _a;
|
|
4528
|
+
const { code: keyCode } = event;
|
|
4529
|
+
if (!this.isOpen && keyCode === 'ArrowDown') {
|
|
4530
|
+
this.isOpen = true;
|
|
4531
|
+
this.activeIndex = 0;
|
|
4532
|
+
return;
|
|
4533
|
+
}
|
|
4534
|
+
if (keyCode === 'ArrowDown') {
|
|
4535
|
+
event.preventDefault();
|
|
4536
|
+
this.updateActiveIndex(1);
|
|
4537
|
+
}
|
|
4538
|
+
if (keyCode === 'ArrowUp') {
|
|
4539
|
+
event.preventDefault();
|
|
4540
|
+
this.updateActiveIndex(-1);
|
|
4541
|
+
}
|
|
4542
|
+
if (keyCode === 'Enter' || keyCode === 'Space') {
|
|
4543
|
+
(_a = this.options[this.activeIndex]) === null || _a === void 0 ? void 0 : _a.click();
|
|
4544
|
+
}
|
|
4545
|
+
if (keyCode === 'Escape') {
|
|
4546
|
+
this.isOpen = false;
|
|
4547
|
+
}
|
|
4548
|
+
};
|
|
4549
|
+
this.handleInputChange = (e) => {
|
|
4550
|
+
this.textInput = e.target.value;
|
|
4551
|
+
this.isOpen = this.textInput.length > 0;
|
|
4552
|
+
this.internals.setFormValue(this.textInput);
|
|
4553
|
+
};
|
|
4554
|
+
this.handleClick = (event) => {
|
|
4555
|
+
if (this.disabled)
|
|
4556
|
+
return event.preventDefault();
|
|
4557
|
+
const target = event.target;
|
|
4558
|
+
if (target.tagName === 'CURA-SELECT-OPTION')
|
|
4559
|
+
return this.onOptiselected(event);
|
|
4560
|
+
this.isOpen = !this.isOpen;
|
|
4561
|
+
};
|
|
4562
|
+
this.label = '';
|
|
4563
|
+
this.placeholder = '';
|
|
4564
|
+
this.value = '';
|
|
4565
|
+
this.mode = 'default';
|
|
4566
|
+
this.size = 'medium';
|
|
4567
|
+
this.status = 'default';
|
|
4568
|
+
this.disabled = false;
|
|
4569
|
+
this.required = false;
|
|
4570
|
+
this.isHovered = false;
|
|
4571
|
+
this.isFocused = false;
|
|
4572
|
+
this.isOpen = false;
|
|
4573
|
+
this.options = undefined;
|
|
4574
|
+
this.activeIndex = -1;
|
|
4575
|
+
this.textInput = '';
|
|
4576
|
+
}
|
|
4577
|
+
updateOptionHighlights(newActiveINdex) {
|
|
4578
|
+
this.options.forEach((option, index) => option.active = index === newActiveINdex);
|
|
4579
|
+
}
|
|
4580
|
+
/**
|
|
4581
|
+
* Filters the options based on the current input value.
|
|
4582
|
+
*/
|
|
4583
|
+
filterOptions(newText) {
|
|
4584
|
+
if (!this.isOpen) {
|
|
4585
|
+
return;
|
|
4586
|
+
}
|
|
4587
|
+
this.options.forEach(option => {
|
|
4588
|
+
var _a;
|
|
4589
|
+
const optionValue = ((_a = option.textContent) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
|
|
4590
|
+
const isVisible = optionValue.includes(newText.toLocaleLowerCase());
|
|
4591
|
+
option.style.display = isVisible ? 'block' : 'none';
|
|
4592
|
+
});
|
|
4593
|
+
}
|
|
4594
|
+
/**
|
|
4595
|
+
* Callback for form association.
|
|
4596
|
+
*/
|
|
4597
|
+
formAssociatedCallback(form) {
|
|
4598
|
+
form.ariaLabel = this.label;
|
|
4599
|
+
}
|
|
4600
|
+
/**
|
|
4601
|
+
* Callback to restore the switch state from the form.
|
|
4602
|
+
*/
|
|
4603
|
+
formStateRestoreCallback(state) {
|
|
4604
|
+
this.textInput = state.value;
|
|
4605
|
+
this.updateSelectedOption();
|
|
4606
|
+
}
|
|
4607
|
+
/**
|
|
4608
|
+
* Callback to reset the switch state when the form is reset.
|
|
4609
|
+
*/
|
|
4610
|
+
formResetCallback() {
|
|
4611
|
+
this.textInput = '';
|
|
4612
|
+
this.clearSelectedAttributes();
|
|
4613
|
+
this.internals.setFormValue('');
|
|
4614
|
+
this.internals.setValidity({});
|
|
4615
|
+
}
|
|
4616
|
+
/**
|
|
4617
|
+
* Callback to update the switch's disabled state when the form's disabled state changes.
|
|
4618
|
+
*/
|
|
4619
|
+
formDisabledCallback(disabled) {
|
|
4620
|
+
this.disabled = disabled;
|
|
4621
|
+
}
|
|
4622
|
+
/**
|
|
4623
|
+
* Lifecycle method called before the component is rendered.
|
|
4624
|
+
* Initializes the options for the select component.
|
|
4625
|
+
*/
|
|
4626
|
+
componentWillLoad() {
|
|
4627
|
+
this.initializeOptions();
|
|
4628
|
+
}
|
|
4629
|
+
/**
|
|
4630
|
+
* Lifecycle method called after the component is rendered.
|
|
4631
|
+
* Initializes select-related functionality.
|
|
4632
|
+
*/
|
|
4633
|
+
componentDidLoad() {
|
|
4634
|
+
this.setupMutationObserver();
|
|
4635
|
+
}
|
|
4636
|
+
/**
|
|
4637
|
+
* Lifecycle method called when the component is connected to the DOM.
|
|
4638
|
+
* Applies styles based on the theme.
|
|
4639
|
+
*/
|
|
4640
|
+
connectedCallback() {
|
|
4641
|
+
this.applyStyles();
|
|
4642
|
+
}
|
|
4643
|
+
/**
|
|
4644
|
+
* Lifecycle method called when the component is disconnected from the DOM.
|
|
4645
|
+
* Disconnects the MutationObserver if it exists.
|
|
4646
|
+
*/
|
|
4647
|
+
disconnectedCallback() {
|
|
4648
|
+
var _a;
|
|
4649
|
+
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
4650
|
+
}
|
|
4651
|
+
initializeOptions() {
|
|
4652
|
+
var _a;
|
|
4653
|
+
this.options = this.host.querySelectorAll('cura-select-option');
|
|
4654
|
+
this.options.forEach(option => {
|
|
4655
|
+
option.setAttribute('size', this.size);
|
|
4656
|
+
const isSelected = this.value === option.value;
|
|
4657
|
+
option.setAttribute('selected', JSON.stringify(isSelected));
|
|
4658
|
+
if (isSelected) {
|
|
4659
|
+
this.value = option.value;
|
|
4660
|
+
this.internals.setFormValue(option.value);
|
|
4661
|
+
}
|
|
4662
|
+
});
|
|
4663
|
+
this.textInput = ((_a = Array.from(this.options).find(option => option.value === this.value)) === null || _a === void 0 ? void 0 : _a.textContent) || this.textInput;
|
|
4664
|
+
}
|
|
4665
|
+
/**
|
|
4666
|
+
* Applies styles to the component based on the theme.
|
|
4667
|
+
*/
|
|
4668
|
+
applyStyles() {
|
|
4669
|
+
const { fonts, colors } = this.theme;
|
|
4670
|
+
const fontWeights = fonts.getWeights();
|
|
4671
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--font-weight-medium': fontWeights.medium, '--font-weight-bold': fontWeights.bold, '--font-weight-regular': fontWeights.regular, '--font-color': fonts.getColor(), '--font-family': fonts.getFamily(), '--font-size': fonts.getSize() });
|
|
4672
|
+
const colorKeys = [
|
|
4673
|
+
'primary-base', 'neutral-purewhite', 'neutral-white', 'neutral-black', 'neutral-medium', 'neutral-light',
|
|
4674
|
+
'neutral-base', 'neutral-dark', 'success-dark', 'success-darker', 'success-lighter',
|
|
4675
|
+
'error-lighter', 'error-dark', 'error-darker', 'error-base', 'info-base'
|
|
4676
|
+
];
|
|
4677
|
+
colorKeys.forEach(key => {
|
|
4678
|
+
this.styles[`--${key}`] = colors.getColor(key);
|
|
4679
|
+
});
|
|
4680
|
+
}
|
|
4681
|
+
/**
|
|
4682
|
+
* Sets up a MutationObserver to watch for changes in the component.
|
|
4683
|
+
*/
|
|
4684
|
+
setupMutationObserver() {
|
|
4685
|
+
this.mutationObserver = new MutationObserver(this.handleMutations);
|
|
4686
|
+
this.mutationObserver.observe(this.host, { attributes: true, subtree: true, attributeFilter: ['selected', 'value'] });
|
|
4687
|
+
}
|
|
4688
|
+
updateSelectedOption() {
|
|
4689
|
+
const selectedOptionElement = this.host.querySelector('cura-select-option[selected]');
|
|
4690
|
+
if (!selectedOptionElement) {
|
|
4691
|
+
return;
|
|
4692
|
+
}
|
|
4693
|
+
this.value = selectedOptionElement.value;
|
|
4694
|
+
this.internals.setFormValue(this.value);
|
|
4695
|
+
if (this.textInput !== selectedOptionElement.textContent) {
|
|
4696
|
+
this.textInput = selectedOptionElement.textContent;
|
|
4697
|
+
this.isOpen = false;
|
|
4698
|
+
this.selected.emit(selectedOptionElement.value);
|
|
4699
|
+
}
|
|
4700
|
+
}
|
|
4701
|
+
/**
|
|
4702
|
+
* Clears the 'selected' attribute from all options.
|
|
4703
|
+
*/
|
|
4704
|
+
clearSelectedAttributes() {
|
|
4705
|
+
this.options.forEach(option => option.removeAttribute('selected'));
|
|
4706
|
+
}
|
|
4707
|
+
updateActiveIndex(direction) {
|
|
4708
|
+
if (this.options.length === 0)
|
|
4709
|
+
return;
|
|
4710
|
+
this.activeIndex = (this.activeIndex + direction + this.options.length) % this.options.length;
|
|
4711
|
+
}
|
|
4712
|
+
getClasses() {
|
|
4713
|
+
return {
|
|
4714
|
+
wrapper: true,
|
|
4715
|
+
label: !!this.label,
|
|
4716
|
+
disabled: this.disabled,
|
|
4717
|
+
transparent: this.mode === 'transparent',
|
|
4718
|
+
[this.size.toLowerCase()]: true,
|
|
4719
|
+
[this.status.toLowerCase()]: true,
|
|
4720
|
+
};
|
|
4721
|
+
}
|
|
4722
|
+
/**
|
|
4723
|
+
* Determines the color based on the item type and component state.
|
|
4724
|
+
*/
|
|
4725
|
+
getColor(item) {
|
|
4726
|
+
if (this.disabled)
|
|
4727
|
+
return 'neutral-medium';
|
|
4728
|
+
const isStatusDefault = this.status === 'default';
|
|
4729
|
+
const isHoveredOrFocused = this.isFocused || this.isHovered;
|
|
4730
|
+
if (item === 'label') {
|
|
4731
|
+
if (!isStatusDefault || isHoveredOrFocused)
|
|
4732
|
+
return 'neutral-black';
|
|
4733
|
+
return 'neutral-dark';
|
|
4734
|
+
}
|
|
4735
|
+
if (isHoveredOrFocused && isStatusDefault)
|
|
4736
|
+
return 'neutral-black';
|
|
4737
|
+
if (this.status === 'success')
|
|
4738
|
+
return 'success-dark';
|
|
4739
|
+
if (this.status === 'error')
|
|
4740
|
+
return 'error-dark';
|
|
4741
|
+
return 'neutral-dark';
|
|
4742
|
+
}
|
|
4743
|
+
/**
|
|
4744
|
+
* Renders the icon based on the component's status.
|
|
4745
|
+
*/
|
|
4746
|
+
renderIcon() {
|
|
4747
|
+
if (this.status === 'default')
|
|
4748
|
+
return null;
|
|
4749
|
+
const icon = { success: 'checkCircle', error: 'alertCircle' }[this.status];
|
|
4750
|
+
return (index.h("cura-icon", { class: 'feedback-icon', name: icon, iconset: 'default', size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles }));
|
|
4751
|
+
}
|
|
4752
|
+
render() {
|
|
4753
|
+
return (index.h(index.Host, { key: '89fbc4dc9c103b21c7e2edcc03042ba8cf5f75c4', style: this.styles }, index.h("div", { key: 'ba79e3a4a5f2cdc7521ad3b9169e119b71512a9a', class: this.getClasses(), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onClick: this.handleClick }, this.label && (index.h("cura-label", { key: '74ec4de79d5b748e0f8022f7b3386eee135bee6e', class: 'label', weight: 'bold', size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && index.h("span", { key: '3a5fb5b5254049cebec618beb76a86406e04d051', class: 'required' }, "* "))), index.h("div", { key: '3f44d54e3e7d668a12b73778122764399af308ce', class: {
|
|
4754
|
+
'cura-input-field': true,
|
|
4755
|
+
'open': this.isOpen
|
|
4756
|
+
} }, this.renderIcon(), index.h("input", { key: '2c91a02d849fd7cb8605b33ec127303e486ae26d', type: "text", autocomplete: 'off', onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), onKeyDown: this.handleKeyNavigation, "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error'), onInput: this.handleInputChange, style: this.styles, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.textInput }), index.h("cura-icon", { key: '417f006c299b2dc7676c614f12edb2091f0eadf5', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: 'default' })), index.h("cura-label", { key: '40a14f36e8e51cf2a90d2ce38741600f14c5683e', class: "helper-text", size: 'xsmall', color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, index.h("slot", { key: 'c504704e9021e866d2bc1b9cb7bb45a81607c32f' })), this.isOpen && (index.h("div", { key: '3b00ec669c428952bdf143be92673e2e5de0568b', class: {
|
|
4757
|
+
'menu': true,
|
|
4758
|
+
'open': this.isOpen
|
|
4759
|
+
} }, index.h("slot", { key: '478b633209673c9ae4f5b690725abcfa537a357b', name: 'option' }))))));
|
|
4760
|
+
}
|
|
4761
|
+
static get formAssociated() { return true; }
|
|
4762
|
+
get host() { return index.getElement(this); }
|
|
4763
|
+
static get watchers() { return {
|
|
4764
|
+
"activeIndex": ["updateOptionHighlights"],
|
|
4765
|
+
"textInput": ["filterOptions"]
|
|
4766
|
+
}; }
|
|
4767
|
+
};
|
|
4768
|
+
CuraSelect.style = CuraSelectStyle0;
|
|
4769
|
+
|
|
4770
|
+
const curaSelectOptionCss = ":host{display:block}.item{display:flex;padding:12px 8px;cursor:pointer;justify-content:space-between;align-items:center;box-sizing:border-box;background:var(--neutral-purewhite)}.item.selected{background-color:var(--primary-lighter-50);border-bottom:1px solid var(--primary-light)}.item:hover:not(.selected){background:var(--neutral-white);box-shadow:0 2px 0 0 var(--neutral-light)}.item.active{background:var(--neutral-white) !important}.item.selected.active{background-color:var(--primary-lighter-50) !important;box-shadow:none}";
|
|
4771
|
+
const CuraSelectOptionStyle0 = curaSelectOptionCss;
|
|
4772
|
+
|
|
4773
|
+
const CuraSelectOption = class {
|
|
4774
|
+
constructor(hostRef) {
|
|
4775
|
+
index.registerInstance(this, hostRef);
|
|
4776
|
+
this.theme = window.CuraAPI.theme;
|
|
4777
|
+
this.value = undefined;
|
|
4778
|
+
this.selected = false;
|
|
4779
|
+
this.active = false;
|
|
4780
|
+
this.size = 'small';
|
|
4781
|
+
this.styles = {};
|
|
4782
|
+
}
|
|
4783
|
+
connectedCallback() {
|
|
4784
|
+
const colors = [
|
|
4785
|
+
{ name: '--primary-lighter-50', theme: 'primary-lighter', opacity: 0.5 },
|
|
4786
|
+
{ name: '--primary-light', theme: 'primary-light' },
|
|
4787
|
+
{ name: '--neutral-light', theme: 'neutral-light' },
|
|
4788
|
+
{ name: '--neutral-purewhite', theme: 'neutral-purewhite' },
|
|
4789
|
+
];
|
|
4790
|
+
colors.forEach(color => this.styles = Object.assign(Object.assign({}, this.styles), { [color.name]: this.theme.colors.getColor(color.theme, color === null || color === void 0 ? void 0 : color.opacity) }));
|
|
4791
|
+
}
|
|
4792
|
+
getSize(element) {
|
|
4793
|
+
const sizeMap = {
|
|
4794
|
+
large: element === 'label' ? 'medium' : 20,
|
|
4795
|
+
medium: element === 'label' ? 'small' : 16,
|
|
4796
|
+
small: element === 'label' ? 'xsmall' : 'micro',
|
|
4797
|
+
};
|
|
4798
|
+
return sizeMap[this.size] || sizeMap['medium'];
|
|
4799
|
+
}
|
|
4800
|
+
getClasses() {
|
|
4801
|
+
return {
|
|
4802
|
+
'item': true,
|
|
4803
|
+
'selected': this.selected,
|
|
4804
|
+
'active': this.active
|
|
4805
|
+
};
|
|
4806
|
+
}
|
|
4807
|
+
render() {
|
|
4808
|
+
return (index.h(index.Host, { key: '231c03411af0a5639358ff232e4a81287a8571f0', slot: "option" }, index.h("div", { key: 'b5baa8f7c4a4e863b96ffda1454a8c339d4b2656', class: this.getClasses(), style: this.styles }, index.h("cura-label", { key: '36d3381260263303242c443004f7e201c2683d4e', color: `${this.selected ? 'primary-base' : 'neutral-black'}`, size: this.getSize('label'), "margin-block": "0" }, index.h("slot", { key: 'cc72fed8c51592c8fd076d091272879c7572a181' })), this.selected && index.h("cura-icon", { key: 'e118108f84d49b3d6574a143f09b2c43d43d11a8', name: 'check', size: this.getSize('icon'), color: "primary-base" }))));
|
|
4809
|
+
}
|
|
4810
|
+
get host() { return index.getElement(this); }
|
|
4811
|
+
static get watchers() { return {
|
|
4812
|
+
"size": ["getSize"]
|
|
4813
|
+
}; }
|
|
4814
|
+
};
|
|
4815
|
+
CuraSelectOption.style = CuraSelectOptionStyle0;
|
|
4054
4816
|
|
|
4055
|
-
|
|
4817
|
+
exports.cura_accordion = CuraAccordion;
|
|
4818
|
+
exports.cura_accordion_item = CuraAccordionItem;
|
|
4819
|
+
exports.cura_button = CuraButton;
|
|
4820
|
+
exports.cura_heading = CuraHeading;
|
|
4821
|
+
exports.cura_icon = CuraIcon;
|
|
4822
|
+
exports.cura_input_text = CuraInputText;
|
|
4823
|
+
exports.cura_label = CuraLabel;
|
|
4824
|
+
exports.cura_loader_circle = CuraLoaderCircle;
|
|
4825
|
+
exports.cura_page_template = CuraPageTemplate;
|
|
4826
|
+
exports.cura_paragraph = CuraParagraph;
|
|
4827
|
+
exports.cura_select = CuraSelect;
|
|
4828
|
+
exports.cura_select_option = CuraSelectOption;
|
|
4829
|
+
|
|
4830
|
+
//# sourceMappingURL=cura-accordion_12.cjs.entry.js.map
|