@digital-realty/ix-wizard 1.0.1
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/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/IxWizard.d.ts +10 -0
- package/dist/IxWizard.js +54 -0
- package/dist/IxWizard.js.map +1 -0
- package/dist/IxWizardStep.d.ts +18 -0
- package/dist/IxWizardStep.js +87 -0
- package/dist/IxWizardStep.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/ix-wizard-step.d.ts +1 -0
- package/dist/ix-wizard-step.js +3 -0
- package/dist/ix-wizard-step.js.map +1 -0
- package/dist/ix-wizard.d.ts +1 -0
- package/dist/ix-wizard.js +3 -0
- package/dist/ix-wizard.js.map +1 -0
- package/dist/react/IxWizard.d.ts +4 -0
- package/dist/react/IxWizard.js +13 -0
- package/dist/react/IxWizard.js.map +1 -0
- package/dist/react/IxWizardStep.d.ts +4 -0
- package/dist/react/IxWizardStep.js +13 -0
- package/dist/react/IxWizardStep.js.map +1 -0
- package/dist/styles/ix-wizard-step-styles.d.ts +1 -0
- package/dist/styles/ix-wizard-step-styles.js +10 -0
- package/dist/styles/ix-wizard-step-styles.js.map +1 -0
- package/dist/styles/ix-wizard-styles.d.ts +1 -0
- package/dist/styles/ix-wizard-styles.js +45 -0
- package/dist/styles/ix-wizard-styles.js.map +1 -0
- package/package.json +110 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 ix-wizard
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# \<ix-wizard>
|
|
2
|
+
|
|
3
|
+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @digital-realty/ix-wizard
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script type="module">
|
|
15
|
+
import '@digital-realty/ix-wizard/ix-wizard.js';
|
|
16
|
+
import '@digital-realty/ix-wizard/ix-wizard-step.js';
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<ix-wizard>
|
|
20
|
+
<ix-wizard-step>
|
|
21
|
+
<div value="1">Option label</div>
|
|
22
|
+
</ix-wizard-step>
|
|
23
|
+
</ix-wizard>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```JS
|
|
27
|
+
import { IxWizard, IxWizardStep } from 'ix-wizard'
|
|
28
|
+
|
|
29
|
+
<IxWizard>
|
|
30
|
+
<IxWizardStep>
|
|
31
|
+
<div value="1">Option label</div>
|
|
32
|
+
</IxWizardStep>
|
|
33
|
+
</IxWizard>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Demo and Documentation
|
|
37
|
+
|
|
38
|
+
Full documentation and demo are available at [DLR Component Gallery](https://inxn-p1-uicomponentgallery.azurewebsites.net/?path=/story/inxn-ix-wizard--default).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
export declare class IxWizard extends LitElement {
|
|
3
|
+
static get styles(): import("lit").CSSResult[];
|
|
4
|
+
totalSteps: number;
|
|
5
|
+
currentStep: number;
|
|
6
|
+
hideStepCount: boolean;
|
|
7
|
+
firstUpdated(): void;
|
|
8
|
+
renderStepCount(): typeof nothing | import("lit").TemplateResult<1>;
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
package/dist/IxWizard.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html, nothing } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { IxWizardStyles } from './styles/ix-wizard-styles.js';
|
|
5
|
+
export class IxWizard extends LitElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.totalSteps = 0;
|
|
9
|
+
this.currentStep = 0;
|
|
10
|
+
this.hideStepCount = false;
|
|
11
|
+
}
|
|
12
|
+
static get styles() {
|
|
13
|
+
return [IxWizardStyles];
|
|
14
|
+
}
|
|
15
|
+
firstUpdated() {
|
|
16
|
+
var _a;
|
|
17
|
+
if (this.totalSteps === 0) {
|
|
18
|
+
const slot = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot');
|
|
19
|
+
const wizardSteps = slot === null || slot === void 0 ? void 0 : slot.assignedElements();
|
|
20
|
+
this.totalSteps = (wizardSteps === null || wizardSteps === void 0 ? void 0 : wizardSteps.length) || 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
renderStepCount() {
|
|
24
|
+
if (this.currentStep === 0 || this.hideStepCount)
|
|
25
|
+
return nothing;
|
|
26
|
+
return html `<div class="wizard-title">
|
|
27
|
+
<md-icon>chevron_left</md-icon>
|
|
28
|
+
<span class="button-label"
|
|
29
|
+
>${this.currentStep} of ${this.totalSteps}</span
|
|
30
|
+
>
|
|
31
|
+
<md-icon>chevron_right</md-icon>
|
|
32
|
+
</div>`;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return html `
|
|
36
|
+
<div class="wizard-wrapper">
|
|
37
|
+
<div class="wizard-header">${this.renderStepCount()}</div>
|
|
38
|
+
<div class="wizard-body">
|
|
39
|
+
<slot></slot>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
__decorate([
|
|
46
|
+
property({ type: Number })
|
|
47
|
+
], IxWizard.prototype, "totalSteps", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
property({ type: Number })
|
|
50
|
+
], IxWizard.prototype, "currentStep", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
property({ type: Boolean })
|
|
53
|
+
], IxWizard.prototype, "hideStepCount", void 0);
|
|
54
|
+
//# sourceMappingURL=IxWizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxWizard.js","sourceRoot":"","sources":["../src/IxWizard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,OAAO,QAAS,SAAQ,UAAU;IAAxC;;QAK8B,eAAU,GAAG,CAAC,CAAC;QAEf,gBAAW,GAAG,CAAC,CAAC;QAEf,kBAAa,GAAG,KAAK,CAAC;IAgCrD,CAAC;IAxCC,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1B,CAAC;IAQD,YAAY;;QACV,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;YACzB,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAC,MAAM,CAAC,CAAC;YACpD,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,EAAE,CAAC;YAC7C,IAAI,CAAC,UAAU,GAAG,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,KAAI,CAAC,CAAC;SAC5C;IACH,CAAC;IAED,eAAe;QACb,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC,IAAI,IAAI,CAAC,aAAa;YAAE,OAAO,OAAO,CAAC;QAEjE,OAAO,IAAI,CAAA;;;WAGJ,IAAI,CAAC,WAAW,OAAO,IAAI,CAAC,UAAU;;;WAGtC,CAAC;IACV,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;qCAEsB,IAAI,CAAC,eAAe,EAAE;;;;;KAKtD,CAAC;IACJ,CAAC;CACF;AApC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAgB;AAEf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAiB;AAEf;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAuB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { IxWizardStyles } from './styles/ix-wizard-styles.js';\n\nexport class IxWizard extends LitElement {\n static get styles() {\n return [IxWizardStyles];\n }\n\n @property({ type: Number }) totalSteps = 0;\n\n @property({ type: Number }) currentStep = 0;\n\n @property({ type: Boolean }) hideStepCount = false;\n\n firstUpdated() {\n if (this.totalSteps === 0) {\n const slot = this.shadowRoot?.querySelector('slot');\n const wizardSteps = slot?.assignedElements();\n this.totalSteps = wizardSteps?.length || 0;\n }\n }\n\n renderStepCount() {\n if (this.currentStep === 0 || this.hideStepCount) return nothing;\n\n return html`<div class=\"wizard-title\">\n <md-icon>chevron_left</md-icon>\n <span class=\"button-label\"\n >${this.currentStep} of ${this.totalSteps}</span\n >\n <md-icon>chevron_right</md-icon>\n </div>`;\n }\n\n render() {\n return html`\n <div class=\"wizard-wrapper\">\n <div class=\"wizard-header\">${this.renderStepCount()}</div>\n <div class=\"wizard-body\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
import '@digital-realty/ix-button';
|
|
3
|
+
import '@material/web/icon/icon.js';
|
|
4
|
+
export declare class IxWizardStep extends LitElement {
|
|
5
|
+
static get styles(): import("lit").CSSResult[];
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
isBackButtonVisible: boolean;
|
|
8
|
+
isBackButtonDisabled: boolean;
|
|
9
|
+
onBackButtonClick: any;
|
|
10
|
+
backButtonText: string;
|
|
11
|
+
isNextButtonVisible: boolean;
|
|
12
|
+
isNextButtonDisabled: boolean;
|
|
13
|
+
onNextButtonClick: any;
|
|
14
|
+
nextButtonText: string;
|
|
15
|
+
renderBackButton(): typeof nothing | import("lit").TemplateResult<1>;
|
|
16
|
+
renderNextButton(): typeof nothing | import("lit").TemplateResult<1>;
|
|
17
|
+
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html, nothing } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import '@digital-realty/ix-button';
|
|
5
|
+
import '@material/web/icon/icon.js';
|
|
6
|
+
import { IxWizardStepStyles } from './styles/ix-wizard-step-styles.js';
|
|
7
|
+
export class IxWizardStep extends LitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.isVisible = true;
|
|
11
|
+
this.isBackButtonVisible = false;
|
|
12
|
+
this.isBackButtonDisabled = false;
|
|
13
|
+
this.backButtonText = 'Back';
|
|
14
|
+
this.isNextButtonVisible = true;
|
|
15
|
+
this.isNextButtonDisabled = false;
|
|
16
|
+
this.nextButtonText = 'Next';
|
|
17
|
+
}
|
|
18
|
+
static get styles() {
|
|
19
|
+
return [IxWizardStepStyles];
|
|
20
|
+
}
|
|
21
|
+
renderBackButton() {
|
|
22
|
+
if (!this.isBackButtonVisible)
|
|
23
|
+
return nothing;
|
|
24
|
+
return html ` <ix-button
|
|
25
|
+
type="button"
|
|
26
|
+
appearance="outlined"
|
|
27
|
+
?disabled=${this.isBackButtonDisabled}
|
|
28
|
+
@click=${() => this.onBackButtonClick()}
|
|
29
|
+
has-icon
|
|
30
|
+
>
|
|
31
|
+
<span class="button-label">${this.backButtonText}</span>
|
|
32
|
+
<md-icon slot="icon">west</md-icon>
|
|
33
|
+
</ix-button>`;
|
|
34
|
+
}
|
|
35
|
+
renderNextButton() {
|
|
36
|
+
if (!this.isNextButtonVisible)
|
|
37
|
+
return nothing;
|
|
38
|
+
return html ` <ix-button
|
|
39
|
+
?disabled=${this.isNextButtonDisabled}
|
|
40
|
+
type="submit"
|
|
41
|
+
@click=${() => this.onNextButtonClick()}
|
|
42
|
+
has-icon
|
|
43
|
+
trailing-icon
|
|
44
|
+
>
|
|
45
|
+
<md-icon slot="icon">east</md-icon>
|
|
46
|
+
<span class="button-label">${this.nextButtonText}</span>
|
|
47
|
+
</ix-button>`;
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
if (!this.isVisible)
|
|
51
|
+
return nothing;
|
|
52
|
+
return html `
|
|
53
|
+
<slot></slot>
|
|
54
|
+
<div class="wizard-step__btn-group">
|
|
55
|
+
${this.renderBackButton()} ${this.renderNextButton()}
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
__decorate([
|
|
61
|
+
property({ type: Boolean })
|
|
62
|
+
], IxWizardStep.prototype, "isVisible", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
property({ type: Boolean })
|
|
65
|
+
], IxWizardStep.prototype, "isBackButtonVisible", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property({ type: Boolean })
|
|
68
|
+
], IxWizardStep.prototype, "isBackButtonDisabled", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
property({ type: Function })
|
|
71
|
+
], IxWizardStep.prototype, "onBackButtonClick", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
property({ type: String })
|
|
74
|
+
], IxWizardStep.prototype, "backButtonText", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property({ type: Boolean })
|
|
77
|
+
], IxWizardStep.prototype, "isNextButtonVisible", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
property({ type: Boolean })
|
|
80
|
+
], IxWizardStep.prototype, "isNextButtonDisabled", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
property({ type: Function })
|
|
83
|
+
], IxWizardStep.prototype, "onNextButtonClick", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property({ type: String })
|
|
86
|
+
], IxWizardStep.prototype, "nextButtonText", void 0);
|
|
87
|
+
//# sourceMappingURL=IxWizardStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxWizardStep.js","sourceRoot":"","sources":["../src/IxWizardStep.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,2BAA2B,CAAC;AACnC,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,OAAO,YAAa,SAAQ,UAAU;IAA5C;;QAK+B,cAAS,GAAG,IAAI,CAAC;QAEjB,wBAAmB,GAAG,KAAK,CAAC;QAE5B,yBAAoB,GAAG,KAAK,CAAC;QAI9B,mBAAc,GAAG,MAAM,CAAC;QAEvB,wBAAmB,GAAG,IAAI,CAAC;QAE3B,yBAAoB,GAAG,KAAK,CAAC;QAI9B,mBAAc,GAAG,MAAM,CAAC;IA0CtD,CAAC;IA9DC,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9B,CAAC;IAoBD,gBAAgB;QACd,IAAI,CAAC,IAAI,CAAC,mBAAmB;YAAE,OAAO,OAAO,CAAC;QAE9C,OAAO,IAAI,CAAA;;;kBAGG,IAAI,CAAC,oBAAoB;eAC5B,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;;;mCAGV,IAAI,CAAC,cAAc;;iBAErC,CAAC;IAChB,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,IAAI,CAAC,mBAAmB;YAAE,OAAO,OAAO,CAAC;QAE9C,OAAO,IAAI,CAAA;kBACG,IAAI,CAAC,oBAAoB;;eAE5B,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;;;;;mCAKV,IAAI,CAAC,cAAc;iBACrC,CAAC;IAChB,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO,OAAO,CAAC;QAEpC,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,gBAAgB,EAAE,IAAI,IAAI,CAAC,gBAAgB,EAAE;;KAEvD,CAAC;IACJ,CAAC;CACF;AA1D8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CAAkB;AAEjB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yDAA6B;AAE5B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAA8B;AAE5B;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;uDAAwB;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAyB;AAEvB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yDAA4B;AAE3B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAA8B;AAE5B;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;uDAAwB;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAyB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport '@digital-realty/ix-button';\nimport '@material/web/icon/icon.js';\nimport { IxWizardStepStyles } from './styles/ix-wizard-step-styles.js';\n\nexport class IxWizardStep extends LitElement {\n static get styles() {\n return [IxWizardStepStyles];\n }\n\n @property({ type: Boolean }) isVisible = true;\n\n @property({ type: Boolean }) isBackButtonVisible = false;\n\n @property({ type: Boolean }) isBackButtonDisabled = false;\n\n @property({ type: Function }) onBackButtonClick: any;\n\n @property({ type: String }) backButtonText = 'Back';\n\n @property({ type: Boolean }) isNextButtonVisible = true;\n\n @property({ type: Boolean }) isNextButtonDisabled = false;\n\n @property({ type: Function }) onNextButtonClick: any;\n\n @property({ type: String }) nextButtonText = 'Next';\n\n renderBackButton() {\n if (!this.isBackButtonVisible) return nothing;\n\n return html` <ix-button\n type=\"button\"\n appearance=\"outlined\"\n ?disabled=${this.isBackButtonDisabled}\n @click=${() => this.onBackButtonClick()}\n has-icon\n >\n <span class=\"button-label\">${this.backButtonText}</span>\n <md-icon slot=\"icon\">west</md-icon>\n </ix-button>`;\n }\n\n renderNextButton() {\n if (!this.isNextButtonVisible) return nothing;\n\n return html` <ix-button\n ?disabled=${this.isNextButtonDisabled}\n type=\"submit\"\n @click=${() => this.onNextButtonClick()}\n has-icon\n trailing-icon\n >\n <md-icon slot=\"icon\">east</md-icon>\n <span class=\"button-label\">${this.nextButtonText}</span>\n </ix-button>`;\n }\n\n render() {\n if (!this.isVisible) return nothing;\n\n return html`\n <slot></slot>\n <div class=\"wizard-step__btn-group\">\n ${this.renderBackButton()} ${this.renderNextButton()}\n </div>\n `;\n }\n}\n"]}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { IxWizard } from './IxWizard.js';\nexport { IxWizardStep } from './IxWizardStep.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-wizard-step.js","sourceRoot":"","sources":["../src/ix-wizard-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { IxWizardStep } from './IxWizardStep.js';\n\nwindow.customElements.define('ix-wizard-step', IxWizardStep);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-wizard.js","sourceRoot":"","sources":["../src/ix-wizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { IxWizard } from './IxWizard.js';\n\nwindow.customElements.define('ix-wizard', IxWizard);\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxWizard as IxWizardLit } from '../IxWizard.js';
|
|
4
|
+
customElements.define('ix-wizard', IxWizardLit);
|
|
5
|
+
export const IxWizard = createComponent({
|
|
6
|
+
tagName: 'ix-wizard',
|
|
7
|
+
elementClass: IxWizardLit,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onclick: 'onClick',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=IxWizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxWizard.js","sourceRoot":"","sources":["../../src/react/IxWizard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzD,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;IACtC,OAAO,EAAE,WAAW;IACpB,YAAY,EAAE,WAAW;IACzB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,SAAS;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit/react';\nimport { IxWizard as IxWizardLit } from '../IxWizard.js';\n\ncustomElements.define('ix-wizard', IxWizardLit);\n\nexport const IxWizard = createComponent({\n tagName: 'ix-wizard',\n elementClass: IxWizardLit,\n react: React,\n events: {\n onclick: 'onClick',\n },\n});\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { IxWizardStep as IxWizardStepLit } from '../IxWizardStep.js';
|
|
4
|
+
customElements.define('ix-wizard-step', IxWizardStepLit);
|
|
5
|
+
export const IxWizardStep = createComponent({
|
|
6
|
+
tagName: 'ix-wizard-step',
|
|
7
|
+
elementClass: IxWizardStepLit,
|
|
8
|
+
react: React,
|
|
9
|
+
events: {
|
|
10
|
+
onclick: 'onClick',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=IxWizardStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IxWizardStep.js","sourceRoot":"","sources":["../../src/react/IxWizardStep.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErE,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC;IAC1C,OAAO,EAAE,gBAAgB;IACzB,YAAY,EAAE,eAAe;IAC7B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,SAAS;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { createComponent } from '@lit/react';\nimport { IxWizardStep as IxWizardStepLit } from '../IxWizardStep.js';\n\ncustomElements.define('ix-wizard-step', IxWizardStepLit);\n\nexport const IxWizardStep = createComponent({\n tagName: 'ix-wizard-step',\n elementClass: IxWizardStepLit,\n react: React,\n events: {\n onclick: 'onClick',\n },\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IxWizardStepStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-wizard-step-styles.js","sourceRoot":"","sources":["../../src/styles/ix-wizard-step-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;;;CAOpC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const IxWizardStepStyles = css`\n .wizard-step__btn-group {\n padding: 20px 0px;\n display: flex;\n gap: 20px;\n justify-content: flex-end;\n }\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IxWizardStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const IxWizardStyles = css `
|
|
3
|
+
ix-dialog {
|
|
4
|
+
--md-dialog-container-color: #fff;
|
|
5
|
+
}
|
|
6
|
+
.wizard-wrapper {
|
|
7
|
+
--md-outlined-field-bottom-space: 2px;
|
|
8
|
+
--md-outlined-field-top-space: 2px;
|
|
9
|
+
--md-outlined-button-outline-color: var(--md-sys-color-primary);
|
|
10
|
+
--md-outlined-select-text-field-outline-color: #ddd;
|
|
11
|
+
--md-menu-container-color: #fff;
|
|
12
|
+
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 20px;
|
|
16
|
+
|
|
17
|
+
margin: 0 25px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.wizard-header {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
}
|
|
24
|
+
.wizard-header .wizard-title {
|
|
25
|
+
position: relative;
|
|
26
|
+
width: 140px;
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: 24px 1fr 24px;
|
|
29
|
+
-webkit-box-align: center;
|
|
30
|
+
place-items: center;
|
|
31
|
+
top: var(--ix-wizard-top, 0);
|
|
32
|
+
}
|
|
33
|
+
.wizard-header .wizard-title md-icon {
|
|
34
|
+
color: lightgrey;
|
|
35
|
+
}
|
|
36
|
+
.wizard-header .wizard-title span {
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-style: normal;
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
letter-spacing: 1.25px;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
color: #092241;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
//# sourceMappingURL=ix-wizard-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ix-wizard-styles.js","sourceRoot":"","sources":["../../src/styles/ix-wizard-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ChC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const IxWizardStyles = css`\n ix-dialog {\n --md-dialog-container-color: #fff;\n }\n .wizard-wrapper {\n --md-outlined-field-bottom-space: 2px;\n --md-outlined-field-top-space: 2px;\n --md-outlined-button-outline-color: var(--md-sys-color-primary);\n --md-outlined-select-text-field-outline-color: #ddd;\n --md-menu-container-color: #fff;\n\n display: flex;\n flex-direction: column;\n gap: 20px;\n\n margin: 0 25px;\n }\n\n .wizard-header {\n display: flex;\n justify-content: center;\n }\n .wizard-header .wizard-title {\n position: relative;\n width: 140px;\n display: grid;\n grid-template-columns: 24px 1fr 24px;\n -webkit-box-align: center;\n place-items: center;\n top: var(--ix-wizard-top, 0);\n }\n .wizard-header .wizard-title md-icon {\n color: lightgrey;\n }\n .wizard-header .wizard-title span {\n font-weight: 700;\n font-style: normal;\n font-size: 14px;\n letter-spacing: 1.25px;\n text-transform: uppercase;\n color: #092241;\n }\n`;\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@digital-realty/ix-wizard",
|
|
3
|
+
"description": "Webcomponent ix-wizard following open-wc recommendations",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "interxion",
|
|
6
|
+
"version": "1.0.1",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/index.js",
|
|
12
|
+
"./ix-wizard.js": "./dist/ix-wizard.js",
|
|
13
|
+
"./ix-wizard-step.js": "./dist/ix-wizard-step.js",
|
|
14
|
+
"./IxWizard": "./dist/react/IxWizard.js",
|
|
15
|
+
"./IxWizardStep": "./dist/react/IxWizardStep.js"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"analyze": "cem analyze --litelement",
|
|
22
|
+
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
23
|
+
"build": "tsc && npm run analyze -- --exclude dist",
|
|
24
|
+
"prepublish": "tsc && npm run analyze -- --exclude dist",
|
|
25
|
+
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
26
|
+
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
27
|
+
"test": "tsc && wtr --coverage",
|
|
28
|
+
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"",
|
|
29
|
+
"storybook": "tsc && npm run analyze -- --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
|
|
30
|
+
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@digital-realty/ix-button": "*",
|
|
34
|
+
"@digital-realty/ix-icon": "*",
|
|
35
|
+
"@digital-realty/theme": "*",
|
|
36
|
+
"@lit/react": "^1.0.2",
|
|
37
|
+
"@material/web": "^1.0.1",
|
|
38
|
+
"lit": "^2.0.2",
|
|
39
|
+
"react": "^18.2.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
43
|
+
"@open-wc/eslint-config": "^9.2.1",
|
|
44
|
+
"@open-wc/testing": "^3.1.6",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
46
|
+
"@typescript-eslint/parser": "^5.48.0",
|
|
47
|
+
"@web/dev-server": "^0.1.34",
|
|
48
|
+
"@web/dev-server-storybook": "^0.5.4",
|
|
49
|
+
"@web/test-runner": "^0.14.0",
|
|
50
|
+
"concurrently": "^5.3.0",
|
|
51
|
+
"eslint": "^8.31.0",
|
|
52
|
+
"eslint-config-prettier": "^8.3.0",
|
|
53
|
+
"husky": "^4.3.8",
|
|
54
|
+
"lint-staged": "^10.5.4",
|
|
55
|
+
"prettier": "^2.4.1",
|
|
56
|
+
"tslib": "^2.3.1",
|
|
57
|
+
"typescript": "^4.5.2"
|
|
58
|
+
},
|
|
59
|
+
"customElements": "custom-elements.json",
|
|
60
|
+
"eslintConfig": {
|
|
61
|
+
"parser": "@typescript-eslint/parser",
|
|
62
|
+
"extends": [
|
|
63
|
+
"@open-wc",
|
|
64
|
+
"prettier"
|
|
65
|
+
],
|
|
66
|
+
"plugins": [
|
|
67
|
+
"@typescript-eslint"
|
|
68
|
+
],
|
|
69
|
+
"rules": {
|
|
70
|
+
"no-unused-vars": "off",
|
|
71
|
+
"@typescript-eslint/no-unused-vars": [
|
|
72
|
+
"error"
|
|
73
|
+
],
|
|
74
|
+
"import/no-unresolved": "off",
|
|
75
|
+
"import/extensions": [
|
|
76
|
+
"error",
|
|
77
|
+
"always",
|
|
78
|
+
{
|
|
79
|
+
"ignorePackages": true
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"globals": {
|
|
84
|
+
"ShadowRootInit": true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"prettier": {
|
|
88
|
+
"singleQuote": true,
|
|
89
|
+
"arrowParens": "avoid"
|
|
90
|
+
},
|
|
91
|
+
"husky": {
|
|
92
|
+
"hooks": {
|
|
93
|
+
"pre-commit": "lint-staged"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"lint-staged": {
|
|
97
|
+
"*.ts": [
|
|
98
|
+
"eslint --fix",
|
|
99
|
+
"prettier --write"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"files": [
|
|
103
|
+
"/dist",
|
|
104
|
+
"!/dist/test",
|
|
105
|
+
"package.json",
|
|
106
|
+
"README.md",
|
|
107
|
+
"LICENSE"
|
|
108
|
+
],
|
|
109
|
+
"gitHead": "fb8987c768a39f377d98b1edacf456011cec29fe"
|
|
110
|
+
}
|