@kelvininc/ui-components
Version:
Kelvin UI Components
67 lines (59 loc) • 7.16 kB
JavaScript
'use strict';
var index = require('./index-rNNWWpit.js');
var wizard_types = require('./wizard.types-C9Yhv1tt.js');
const TOOLTIP_CUSTOM_STYLE = {
'--container-max-width': '350px'
};
const wizardFooterCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}kv-dropdown-base:not(.hydrated)>[slot=list]{display:none}:host{--stepper-width:100%}.wizard-footer-container{display:flex;align-items:center;justify-content:space-between;padding:var(--spacing-2xl)}.wizard-footer-container .actions-container{display:flex;flex:1}.wizard-footer-container .actions-container .wizard-stepper{width:var(--stepper-width);padding-right:var(--spacing-2xl)}.wizard-footer-container .buttons-container{display:flex;gap:var(--spacing-xl)}";
const KvWizardFooter = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.stepClick = index.createEvent(this, "stepClick", 7);
this.cancelClick = index.createEvent(this, "cancelClick", 7);
this.prevClick = index.createEvent(this, "prevClick", 7);
this.nextClick = index.createEvent(this, "nextClick", 7);
this.completeClick = index.createEvent(this, "completeClick", 7);
/** @inheritdoc */
this.showStepBar = true;
/** @inheritdoc */
this.completeBtnLabel = 'Submit';
/** @inheritdoc */
this.cancelEnabled = true;
/** @inheritdoc */
this.prevEnabled = true;
/** @inheritdoc */
this.nextEnabled = true;
this.onPrevClick = (event) => {
this.prevClick.emit(event);
};
this.onNextClick = (event) => {
this.nextClick.emit(event);
};
this.onCancelClick = (event) => {
this.cancelClick.emit(event);
};
this.onCompleteClick = (event) => {
this.completeClick.emit(event);
};
this.onStepClick = ({ detail }) => {
this.stepClick.emit(detail);
};
}
render() {
return (index.h(index.Host, { key: '1c72b48a085e1fde9d89507ac439de49ba326758' }, index.h("div", { key: '941b5b1e93bfc47a026e2a4942bc19446540c195', class: "wizard-footer-container" }, index.h("div", { key: 'ad4384e06a633ad552dd16760d7c175bf0d0868e', class: "actions-container", part: "footer-actions-container" }, this.showStepBar && (index.h("div", { key: '9c297a9ab1791fa02e567eb7fa93bce06e713ddc', class: "wizard-stepper" }, index.h("kv-step-bar", { key: '4cfda7504734d659e3f4604de04623fdd4b3d3f1', label: this.label, steps: this.steps, currentStep: this.currentStep, progressPercentage: this.progressPercentage, hasError: this.hasError, onStepClicked: this.onStepClick }))), index.h("slot", { key: '9a6da7fe005aa1bbee378067b8d73f527a876263', name: "additional-actions" })), index.h("div", { key: 'eeb928d2812621d145f8048bed4695230b02a60e', class: "buttons-container" }, this.showCancelBtn && (index.h("kv-action-button-text", { key: '8e8c33251445c004b6c660c399907c23a952f378', type: wizard_types.EActionButtonType.Tertiary, text: "Cancel", disabled: !this.cancelEnabled, onClickButton: ({ detail: event }) => this.onCancelClick(event) })), this.showPrevBtn && (index.h("kv-action-button-text", { key: 'a8e79366aa9a139fd864ec4c4a22097f05e1fb88', type: wizard_types.EActionButtonType.Tertiary, text: "Previous", disabled: !this.prevEnabled, onClickButton: ({ detail: event }) => this.onPrevClick(event) })), this.showNextBtn && (index.h("kv-tooltip", { key: '4a33b37757bcf7ece8fdc11b731b91fbcde3abe3', position: wizard_types.ETooltipPosition.TopEnd, text: this.nextTooltip, customStyle: TOOLTIP_CUSTOM_STYLE }, index.h("kv-action-button-text", { key: '92d3abc54efab613dbc64be3b1cd9af05e0b5bcb', type: wizard_types.EActionButtonType.Primary, text: "Next", disabled: !this.nextEnabled, onClickButton: ({ detail: event }) => this.onNextClick(event) }))), this.showCompleteBtn && (index.h("kv-tooltip", { key: '003e61445fd913a3fee53bbedbb43831efd8297d', position: wizard_types.ETooltipPosition.TopEnd, text: this.completeTooltip, customStyle: TOOLTIP_CUSTOM_STYLE }, index.h("kv-action-button-text", { key: 'a62be7cc9a03a5ee7ca2dddda79c3f4ca0b74de9', type: wizard_types.EActionButtonType.Primary, text: this.completeBtnLabel, disabled: !this.completeEnabled, onClickButton: ({ detail: event }) => this.onCompleteClick(event) })))))));
}
};
KvWizardFooter.style = wizardFooterCss;
const wizardHeaderCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}kv-dropdown-base:not(.hydrated)>[slot=list]{display:none}:host{--text-color:var(--text-surface-neutral-secondary);--separator-color:var(--text-surface-neutral-secondary);--container-padding:var(--spacing-2xl)}.wizard-header-container{display:flex;padding:var(--container-padding);justify-content:space-between}.wizard-header-container .left-container{display:flex;align-items:center;flex:1}.wizard-header-container .left-container .label,.wizard-header-container .left-container .description{color:var(--text-color)}.wizard-header-container .left-container .label{font-family:Proxima Nova;font-weight:600;font-size:12px;line-height:16px;letter-spacing:1.5px;text-transform:uppercase}.wizard-header-container .left-container .description{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:Proxima Nova;font-weight:400;font-size:14px;line-height:20px;letter-spacing:0}.wizard-header-container .left-container .separator{width:4px;height:4px;border-radius:50%;margin:0 var(--spacing-md);background-color:var(--separator-color)}.wizard-header-container .left-container kv-toggle-tip .toggle-tip-open-element-container{cursor:pointer;user-select:none;pointer-events:all;margin-left:var(--spacing-md)}";
const KvWizardHeader = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
}
render() {
var _a;
return (index.h(index.Host, { key: '755722aafe8c7c992d81936e1fd05bc970a49a8f' }, index.h("div", { key: 'ea3295bdc10841fcd2636f00dbe33db3965cc03e', class: "wizard-header-container" }, index.h("div", { key: '2196bef1c7318b14a6096cc7a4fef74c864eab8a', class: "left-container" }, index.h("span", { key: '0396db15a603d405e72af97cf00efbf5341d520a', class: "label" }, this.label), index.h("span", { key: '421cba23aac898ce48870e7b3d7a44148ee23bac', class: "separator" }), index.h("span", { key: 'ba0b7f662cbe4b0504d98e4fca5295dab09caabb', class: "description" }, this.description), ((_a = this.tip) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("kv-toggle-tip", { key: 'afc847b950a6c13e99f8b393fd18036bd9dba376', text: this.tip, position: wizard_types.ETooltipPosition.Bottom, customClass: "wizard-header-tip" }, index.h("kv-icon", { key: '082f1c4c12a0a8658cf373baa6108d5367a07881', name: wizard_types.EIconName.Info, slot: "open-element-slot" })))), index.h("slot", { key: '7cea27cf9c27afeb6fc428498bef8b8358066fb4', name: "additional-header-actions" }))));
}
};
KvWizardHeader.style = wizardHeaderCss;
exports.kv_wizard_footer = KvWizardFooter;
exports.kv_wizard_header = KvWizardHeader;