function isAnInternetOrder(order: PossibleOrders): order is InternetOrder {
return !!order && "email" in order;
}
<motion.div
animate={{
height: isExpanded ? "auto" : 0,
}}
style={{
height: isExpanded ? "auto" : "0",
}}
transition={{ duration: 0.3 }}
className="team__card-text stack column"
>
<Typography tag="h3" className="team__card-title">
{title}
</Typography>
<Typography tag="p" className="team__card-description p">
{isExpanded ? text : text.slice(0, 500)}
{text.length > 500 && (
<button className="team__card-expanded" onClick={toggleExpansion}>
{isExpanded ? "Свернуть" : "Читать все"}
</button>
)}
</Typography>
</motion.div>
const choicesMulti = new Choices(selectMulti, {
searchEnabled: false,
itemSelectText: "",
shouldSort: false,
renderSelectedChoices: "always",
callbackOnCreateTemplates: function (template) {
this.passedElement.element.addEventListener("choice", (event) => {
if (event.detail.choice.selected) {
setTimeout(() => {
this.removeActiveItemsByValue(event.detail.choice.value);
this._triggerChange(event.detail.choice.value);
}, 100);
}
});
return {
item: ({ classNames }, data) => {
return template(`
<div class="${classNames.item} ${
data.highlighted
? classNames.highlightedState
: classNames.itemSelectable
} ${
data.placeholder ? classNames.placeholder : ""
}" data-item data-id="${data.id}" data-value="${data.value}" ${
data.active ? 'aria-selected="true"' : ""
} ${data.disabled ? 'aria-disabled="true"' : ""}>
<div class="form__select-wrapper">
<div class="select__text">${String(data.label)}</div>
</div>
</div>
`);
},
choice: ({ classNames }, data) => {
const icon = data.selected ? "active" : "";
return template(`
<div class="${classNames.item} ${classNames.itemChoice} ${
data.disabled ? classNames.itemDisabled : classNames.itemSelectable
}" data-select-text="${this.config.itemSelectText}" data-choice ${
data.disabled
? 'data-choice-disabled aria-disabled="true"'
: "data-choice-selectable"
} data-id="${data.id}" data-value="${data.value}" ${
data.groupId > 0 ? 'role="treeitem"' : 'role="option"'
}>
<div class="select__wrapper">
<div class="form__select-checkbox">
<label class="form__checkbox-label">
<div class="form__checkbox-text">
${String(data.label)}
</div>
<input class="form__checkbox-input" type="checkbox" name="checkbox">
<span class="form__checkbox-box ${icon}"></span>
</label>
</div>
</div>
</div>
`);
},
};
},
});