@paperless/core 2.0.1-beta.166 → 2.0.1-beta.168
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/CHANGELOG.md +23 -0
- package/dist/build/{p-f34e9e65.entry.js → p-086a66af.entry.js} +2 -2
- package/dist/build/{p-f34e9e65.entry.js.map → p-086a66af.entry.js.map} +1 -1
- package/dist/build/{p-8b5b0d8b.js → p-3023698d.js} +1 -1
- package/dist/build/p-3f9af350.entry.js +2 -0
- package/dist/build/p-3f9af350.entry.js.map +1 -0
- package/dist/build/p-68300dbe.entry.js +2 -0
- package/dist/build/p-68300dbe.entry.js.map +1 -0
- package/dist/build/p-7b958fef.entry.js +2 -0
- package/dist/build/p-7b958fef.entry.js.map +1 -0
- package/dist/build/p-c0adcfb5.entry.js +2 -0
- package/dist/build/p-c0adcfb5.entry.js.map +1 -0
- package/dist/build/{p-45948742.entry.js → p-cf1a9710.entry.js} +2 -2
- package/dist/build/p-cf1a9710.entry.js.map +1 -0
- package/dist/build/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
- package/dist/build/p-empty-state.p-floating-menu-container.p-floating-menu-item.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.esm.js.map +1 -1
- package/dist/build/p-radio.entry.esm.js.map +1 -1
- package/dist/build/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -1
- package/dist/build/p-stepper.entry.esm.js.map +1 -1
- package/dist/build/p-toggle.entry.esm.js.map +1 -1
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.cjs.js.map +1 -1
- package/dist/cjs/p-checkbox_4.cjs.entry.js +10 -7
- package/dist/cjs/p-checkbox_4.cjs.entry.js.map +1 -1
- package/dist/cjs/p-empty-state.p-floating-menu-container.p-floating-menu-item.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.cjs.js.map +1 -1
- package/dist/cjs/p-empty-state_9.cjs.entry.js +5 -4
- package/dist/cjs/p-empty-state_9.cjs.entry.js.map +1 -1
- package/dist/cjs/p-radio.cjs.entry.js +8 -5
- package/dist/cjs/p-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/p-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/p-stepper-item.p-stepper-line.entry.cjs.js.map +1 -1
- package/dist/cjs/p-stepper-item_2.cjs.entry.js +19 -5
- package/dist/cjs/p-stepper-item_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-stepper.cjs.entry.js +1 -0
- package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/p-stepper.entry.cjs.js.map +1 -1
- package/dist/cjs/p-toggle.cjs.entry.js +8 -6
- package/dist/cjs/p-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/p-toggle.entry.cjs.js.map +1 -1
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/components/atoms/checkbox/checkbox.component.css +1 -1
- package/dist/collection/components/atoms/checkbox/checkbox.component.js +10 -7
- package/dist/collection/components/atoms/checkbox/checkbox.component.js.map +1 -1
- package/dist/collection/components/atoms/radio/radio.component.css +1 -1
- package/dist/collection/components/atoms/radio/radio.component.js +8 -5
- package/dist/collection/components/atoms/radio/radio.component.js.map +1 -1
- package/dist/collection/components/atoms/stepper/item/stepper-item.component.css +1 -1
- package/dist/collection/components/atoms/stepper/item/stepper-item.component.js +38 -4
- package/dist/collection/components/atoms/stepper/item/stepper-item.component.js.map +1 -1
- package/dist/collection/components/atoms/toggle/toggle.component.css +1 -1
- package/dist/collection/components/atoms/toggle/toggle.component.js +7 -5
- package/dist/collection/components/atoms/toggle/toggle.component.js.map +1 -1
- package/dist/collection/components/molecules/table/header/table-header.component.css +1 -1
- package/dist/collection/components/molecules/table/header/table-header.component.js +4 -3
- package/dist/collection/components/molecules/table/header/table-header.component.js.map +1 -1
- package/dist/collection/components/organisms/stepper/stepper.component.js +1 -0
- package/dist/collection/components/organisms/stepper/stepper.component.js.map +1 -1
- package/dist/components/{p-C9Hyi74u.js → p--h9uYqpp.js} +22 -7
- package/dist/components/p--h9uYqpp.js.map +1 -0
- package/dist/components/{p-Ppklb4qs.js → p-BHO_MniQ.js} +6 -6
- package/dist/components/{p-Ppklb4qs.js.map → p-BHO_MniQ.js.map} +1 -1
- package/dist/components/{p-B60b7s3F.js → p-CR2m4pAn.js} +5 -5
- package/dist/components/{p-B60b7s3F.js.map → p-CR2m4pAn.js.map} +1 -1
- package/dist/components/{p-C9iJS8ET.js → p-CfilaLs-.js} +3 -3
- package/dist/components/{p-C9iJS8ET.js.map → p-CfilaLs-.js.map} +1 -1
- package/dist/components/{p-DCYyroOh.js → p-CxAi21nx.js} +7 -6
- package/dist/components/{p-DCYyroOh.js.map → p-CxAi21nx.js.map} +1 -1
- package/dist/components/{p-C4qAvszO.js → p-DNAQlM-T.js} +4 -4
- package/dist/components/{p-C4qAvszO.js.map → p-DNAQlM-T.js.map} +1 -1
- package/dist/components/p-checkbox.js +1 -1
- package/dist/components/p-dropdown-menu-item.js +1 -1
- package/dist/components/p-pagination-size.js +1 -1
- package/dist/components/p-pagination.js +1 -1
- package/dist/components/{p-CIoY84Y6.js → p-qXjT088h.js} +12 -9
- package/dist/components/p-qXjT088h.js.map +1 -0
- package/dist/components/p-radio.js +8 -5
- package/dist/components/p-radio.js.map +1 -1
- package/dist/components/p-select.js +2 -2
- package/dist/components/p-stepper-item.js +1 -1
- package/dist/components/p-stepper.js +2 -1
- package/dist/components/p-stepper.js.map +1 -1
- package/dist/components/p-table-footer.js +1 -1
- package/dist/components/p-table-header.js +1 -1
- package/dist/components/p-table.js +6 -6
- package/dist/components/p-toggle.js +8 -6
- package/dist/components/p-toggle.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.js.map +1 -1
- package/dist/esm/p-checkbox_4.entry.js +10 -7
- package/dist/esm/p-checkbox_4.entry.js.map +1 -1
- package/dist/esm/p-empty-state.p-floating-menu-container.p-floating-menu-item.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.js.map +1 -1
- package/dist/esm/p-empty-state_9.entry.js +5 -4
- package/dist/esm/p-empty-state_9.entry.js.map +1 -1
- package/dist/esm/p-radio.entry.js +8 -5
- package/dist/esm/p-radio.entry.js.map +1 -1
- package/dist/esm/p-stepper-item.p-stepper-line.entry.js.map +1 -1
- package/dist/esm/p-stepper-item_2.entry.js +19 -5
- package/dist/esm/p-stepper-item_2.entry.js.map +1 -1
- package/dist/esm/p-stepper.entry.js +1 -0
- package/dist/esm/p-stepper.entry.js.map +1 -1
- package/dist/esm/p-toggle.entry.js +8 -6
- package/dist/esm/p-toggle.entry.js.map +1 -1
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/{p-f34e9e65.entry.js → p-086a66af.entry.js} +2 -2
- package/dist/paperless/{p-f34e9e65.entry.js.map → p-086a66af.entry.js.map} +1 -1
- package/dist/paperless/p-3f9af350.entry.js +2 -0
- package/dist/paperless/p-3f9af350.entry.js.map +1 -0
- package/dist/paperless/p-68300dbe.entry.js +2 -0
- package/dist/paperless/p-68300dbe.entry.js.map +1 -0
- package/dist/paperless/p-7b958fef.entry.js +2 -0
- package/dist/paperless/p-7b958fef.entry.js.map +1 -0
- package/dist/paperless/p-c0adcfb5.entry.js +2 -0
- package/dist/paperless/p-c0adcfb5.entry.js.map +1 -0
- package/dist/paperless/{p-45948742.entry.js → p-cf1a9710.entry.js} +2 -2
- package/dist/paperless/p-cf1a9710.entry.js.map +1 -0
- package/dist/paperless/p-checkbox.p-dropdown.p-dropdown-menu-container.p-dropdown-menu-item.entry.esm.js.map +1 -1
- package/dist/paperless/p-empty-state.p-floating-menu-container.p-floating-menu-item.p-table-cell.p-table-container.p-table-footer.p-table-header.p-table-row.p-table-row-actions-container.entry.esm.js.map +1 -1
- package/dist/paperless/p-radio.entry.esm.js.map +1 -1
- package/dist/paperless/p-stepper-item.p-stepper-line.entry.esm.js.map +1 -1
- package/dist/paperless/p-stepper.entry.esm.js.map +1 -1
- package/dist/paperless/p-toggle.entry.esm.js.map +1 -1
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/atoms/stepper/item/stepper-item.component.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/build/p-3d341a83.entry.js +0 -2
- package/dist/build/p-3d341a83.entry.js.map +0 -1
- package/dist/build/p-41e620ae.entry.js +0 -2
- package/dist/build/p-41e620ae.entry.js.map +0 -1
- package/dist/build/p-42ae8573.entry.js +0 -2
- package/dist/build/p-42ae8573.entry.js.map +0 -1
- package/dist/build/p-45948742.entry.js.map +0 -1
- package/dist/build/p-4fb1f39b.entry.js +0 -2
- package/dist/build/p-4fb1f39b.entry.js.map +0 -1
- package/dist/components/p-C9Hyi74u.js.map +0 -1
- package/dist/components/p-CIoY84Y6.js.map +0 -1
- package/dist/paperless/p-3d341a83.entry.js +0 -2
- package/dist/paperless/p-3d341a83.entry.js.map +0 -1
- package/dist/paperless/p-41e620ae.entry.js +0 -2
- package/dist/paperless/p-41e620ae.entry.js.map +0 -1
- package/dist/paperless/p-42ae8573.entry.js +0 -2
- package/dist/paperless/p-42ae8573.entry.js.map +0 -1
- package/dist/paperless/p-45948742.entry.js.map +0 -1
- package/dist/paperless/p-4fb1f39b.entry.js +0 -2
- package/dist/paperless/p-4fb1f39b.entry.js.map +0 -1
|
@@ -13,9 +13,11 @@ const toggle = cva([
|
|
|
13
13
|
'cursor-pointer shadow-1',
|
|
14
14
|
'bg-black-teal-50 border-black-teal-100',
|
|
15
15
|
'hover:bg-supportive-lilac-100 hover:border-black-teal-100',
|
|
16
|
+
'group-hover/toggle-label:bg-supportive-lilac-100 group-hover/toggle-label:border-black-teal-100',
|
|
16
17
|
'checked:bg-supportive-lilac checked:border-black-teal/20',
|
|
17
18
|
'checked:ring-2 checked:ring-supportive-lilac-100',
|
|
18
19
|
'checked:hover:bg-supportive-lilac-700 checked:hover:border-black-teal/20',
|
|
20
|
+
'checked:group-hover/toggle-label:bg-supportive-lilac-700 checked:group-hover/toggle-label:border-black-teal/20',
|
|
19
21
|
],
|
|
20
22
|
true: ['bg-white-600 border-black-teal-50 cursor-not-allowed'],
|
|
21
23
|
},
|
|
@@ -32,8 +34,8 @@ const circle = cva([
|
|
|
32
34
|
'bg-white ring-1 ring-black-teal/10',
|
|
33
35
|
'left-[1px] peer-checked:-translate-x-[calc(100%+1px)]',
|
|
34
36
|
"after:content-[] peer-checked:after:content-[''] after:bg-supportive-lilac-800 after:rounded-full after:transition-all",
|
|
35
|
-
'w-[14px] h-[14px] group-hover:w-[18px]',
|
|
36
|
-
'after:w-1 after:h-1 group-hover:after:w-2',
|
|
37
|
+
'w-[14px] h-[14px] group-hover/p-toggle:w-[18px] group-hover/toggle-label:w-[18px]',
|
|
38
|
+
'after:w-1 after:h-1 group-hover/p-toggle:after:w-2 group-hover/toggle-label:after:w-2',
|
|
37
39
|
],
|
|
38
40
|
true: [
|
|
39
41
|
'bg-black-teal-100 peer-checked:bg-black-teal-200',
|
|
@@ -85,11 +87,11 @@ export class Toggle {
|
|
|
85
87
|
}
|
|
86
88
|
render() {
|
|
87
89
|
const id = this.id?.length ? this.id : this._nonce;
|
|
88
|
-
return (h("label", { key: '
|
|
90
|
+
return (h("label", { key: '42173ad03d7f7e88e46c8f5dd640310a6ddc6061', htmlFor: id, class: 'flex items-center justify-start gap-2 text-black-teal' }, h("div", { key: '8af38bc7c8e5500a62223f0e6e7787b98385d37a', class: 'group/p-toggle relative flex flex-shrink-0 items-center' }, h("input", { key: 'a53031be1e71c9e27d2a033404b25fd12e7fe7be', class: toggle({
|
|
89
91
|
disabled: asBoolean(this.disabled),
|
|
90
|
-
}), type: 'checkbox', id: id, name: this.name, required: this.required, checked: !!this.checked, disabled: asBoolean(this.disabled), onChange: ev => this._onChange(ev) }), h("div", { key: '
|
|
92
|
+
}), type: 'checkbox', id: id, name: this.name, required: this.required, checked: !!this.checked, disabled: asBoolean(this.disabled), onChange: ev => this._onChange(ev) }), h("div", { key: '9cdba16880e7e7bf116e1459a19bb497171f152f', class: circle({
|
|
91
93
|
disabled: asBoolean(this.disabled),
|
|
92
|
-
}) })), h("slot", { key: '
|
|
94
|
+
}) })), h("slot", { key: 'ee95f5c7fddc68dd6a7ecf6aa63821e2b28bb335' })));
|
|
93
95
|
}
|
|
94
96
|
_onChange(ev) {
|
|
95
97
|
if (asBoolean(this.disabled)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/toggle/toggle.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,CAAC,GACD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,qDAAqD;IACrD,mCAAmC;IACnC,sBAAsB;CACtB,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,yBAAyB;gBACzB,wCAAwC;gBACxC,2DAA2D;gBAC3D,0DAA0D;gBAC1D,kDAAkD;gBAClD,0EAA0E;
|
|
1
|
+
{"version":3,"file":"toggle.component.js","sourceRoot":"","sources":["../../../../src/components/atoms/toggle/toggle.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,KAAK,EAC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AO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC;IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tAttachInternals,\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../utils/as-boolean';\nimport { nonce } from '../../../utils/nonce';\n\nconst toggle = cva(\n\t[\n\t\t'peer appearance-none m-0 outline-none flex-shrink-0',\n\t\t'border border-inset border-solid ',\n\t\t'rounded-full w-8 h-4',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-black-teal-50 border-black-teal-100',\n\t\t\t\t\t'hover:bg-supportive-lilac-100 hover:border-black-teal-100',\n\t\t\t\t\t'group-hover/toggle-label:bg-supportive-lilac-100 group-hover/toggle-label:border-black-teal-100',\n\t\t\t\t\t'checked:bg-supportive-lilac checked:border-black-teal/20',\n\t\t\t\t\t'checked:ring-2 checked:ring-supportive-lilac-100',\n\t\t\t\t\t'checked:hover:bg-supportive-lilac-700 checked:hover:border-black-teal/20',\n\t\t\t\t\t'checked:group-hover/toggle-label:bg-supportive-lilac-700 checked:group-hover/toggle-label:border-black-teal/20',\n\t\t\t\t],\n\t\t\t\ttrue: ['bg-white-600 border-black-teal-50 cursor-not-allowed'],\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst circle = cva(\n\t[\n\t\t'flex items-center justify-center',\n\t\t'rounded-full transition-all ',\n\t\t'absolute top-1/2 peer-checked:left-full transform -translate-y-1/2 pointer-events-none',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'bg-white ring-1 ring-black-teal/10',\n\t\t\t\t\t'left-[1px] peer-checked:-translate-x-[calc(100%+1px)]',\n\t\t\t\t\t\"after:content-[] peer-checked:after:content-[''] after:bg-supportive-lilac-800 after:rounded-full after:transition-all\",\n\t\t\t\t\t'w-[14px] h-[14px] group-hover/p-toggle:w-[18px] group-hover/toggle-label:w-[18px]',\n\t\t\t\t\t'after:w-1 after:h-1 group-hover/p-toggle:after:w-2 group-hover/toggle-label:after:w-2',\n\t\t\t\t],\n\t\t\t\ttrue: [\n\t\t\t\t\t'bg-black-teal-100 peer-checked:bg-black-teal-200',\n\t\t\t\t\t'left-[2px] peer-checked:-translate-x-[calc(100%+2px)]',\n\t\t\t\t\t'w-3 h-3',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-toggle',\n\tstyleUrl: 'toggle.component.css',\n\tformAssociated: true,\n})\nexport class Toggle {\n\t/**\n\t * Wether the checkbox is checked\n\t */\n\t@Prop() checked: boolean;\n\n\t/**\n\t * Wether the checkbox is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the checkbox is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The id of the checkbox button\n\t */\n\t@Prop({ reflect: true }) id: string;\n\n\t/**\n\t * The name of the checkbox button\n\t */\n\t@Prop({ reflect: true }) name: string;\n\n\t/**\n\t * Event whenever the checked changes\n\t */\n\t@Event() checkedChange: EventEmitter<boolean>;\n\t/**\n\t * Event whenever the indeterminate changes\n\t */\n\t@Event() indeterminateChange: EventEmitter<boolean>;\n\n\t@State() private _nonce = nonce(5);\n\n\t@AttachInternals() _internals: ElementInternals;\n\n\tformResetCallback() {\n\t\tthis.checked = false;\n\t}\n\n\tformDisabledCallback(disabled: boolean) {\n\t\tif (!this._internals.form) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disabled = disabled;\n\t}\n\n\trender() {\n\t\tconst id = this.id?.length ? this.id : this._nonce;\n\n\t\treturn (\n\t\t\t<label\n\t\t\t\thtmlFor={id}\n\t\t\t\tclass='flex items-center justify-start gap-2 text-black-teal'\n\t\t\t>\n\t\t\t\t<div class='group/p-toggle relative flex flex-shrink-0 items-center'>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={toggle({\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t})}\n\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tchecked={!!this.checked}\n\t\t\t\t\t\tdisabled={asBoolean(this.disabled)}\n\t\t\t\t\t\tonChange={ev => this._onChange(ev)}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={circle({\n\t\t\t\t\t\t\tdisabled: asBoolean(this.disabled),\n\t\t\t\t\t\t})}\n\t\t\t\t\t></div>\n\t\t\t\t</div>\n\t\t\t\t<slot />\n\t\t\t</label>\n\t\t);\n\t}\n\n\tprivate _onChange(ev: Event) {\n\t\tif (asBoolean(this.disabled)) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = (ev.target as HTMLInputElement).checked;\n\t\tif (checked != this.checked) {\n\t\t\tthis.checked = checked;\n\t\t\tthis.checkedChange.emit(checked);\n\t\t\tthis._internals.setFormValue(this.checked ? 'on' : 'off');\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*{box-sizing:border-box}.static{position:static!important}.fixed{position:fixed!important}.bottom-0{bottom:0!important}.left-0{left:0!important}.z-\[1\]{z-index:1!important}.col-start-1{grid-column-start:1!important}.col-start-2{grid-column-start:2!important}.ml-1{margin-left:.25rem!important}.block{display:block!important}.flex{display:flex!important}.hidden{display:none!important}.h-4{height:1rem!important}.h-8{height:2rem!important}.w-3\/4{width:75%!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.justify-end{justify-content:flex-end!important}.gap-2{gap:.5rem!important}.gap-4{gap:1rem!important}.justify-self-start{justify-self:start!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-transparent{border-color:transparent!important}.border-t-mystic-dark{--tw-border-opacity:1!important;border-top-color:rgb(0 255 0/var(--tw-border-opacity,1))!important}.bg-white{--tw-bg-opacity:1!important;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))!important}.p-4{padding:1rem!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}@media (min-width:40rem){.tablet\:flex{display:flex!important}}@media (min-width:64rem){.desktop-xs\:flex{display:flex!important}.desktop-xs\:grid{display:grid!important}.desktop-xs\:hidden{display:none!important}.desktop-xs\:w-auto{width:auto!important}.desktop-xs\:max-w-60{max-width:15rem!important}.desktop-xs\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.desktop-xs\:flex-row{flex-direction:row!important}.desktop-xs\:items-center{align-items:center!important}}
|
|
1
|
+
*{box-sizing:border-box}.static{position:static!important}.fixed{position:fixed!important}.bottom-0{bottom:0!important}.left-0{left:0!important}.z-\[1\]{z-index:1!important}.col-start-1{grid-column-start:1!important}.col-start-2{grid-column-start:2!important}.ml-1{margin-left:.25rem!important}.block{display:block!important}.flex{display:flex!important}.hidden{display:none!important}.h-4{height:1rem!important}.h-8{height:2rem!important}.w-3\/4{width:75%!important}.w-full{width:100%!important}.flex-col{flex-direction:column!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.justify-end{justify-content:flex-end!important}.gap-2{gap:.5rem!important}.gap-4{gap:1rem!important}.justify-self-start{justify-self:start!important}.rounded{border-radius:.25rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-transparent{border-color:transparent!important}.border-t-mystic-dark{--tw-border-opacity:1!important;border-top-color:rgb(0 255 0/var(--tw-border-opacity,1))!important}.bg-white{--tw-bg-opacity:1!important;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))!important}.p-4{padding:1rem!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}@media (min-width:40rem){.tablet\:flex{display:flex!important}.tablet\:px-0{padding-left:0!important;padding-right:0!important}}@media (min-width:64rem){.desktop-xs\:flex{display:flex!important}.desktop-xs\:grid{display:grid!important}.desktop-xs\:hidden{display:none!important}.desktop-xs\:w-auto{width:auto!important}.desktop-xs\:max-w-60{max-width:15rem!important}.desktop-xs\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.desktop-xs\:flex-row{flex-direction:row!important}.desktop-xs\:items-center{align-items:center!important}}
|
|
@@ -5,6 +5,7 @@ import { formatTranslation, getLocaleComponentStrings, } from "../../../../utils
|
|
|
5
5
|
const header = cva([
|
|
6
6
|
'flex flex-col gap-2 z-[1]',
|
|
7
7
|
'w-full',
|
|
8
|
+
'px-4 tablet:px-0',
|
|
8
9
|
'desktop-xs:grid desktop-xs:grid-cols-2',
|
|
9
10
|
]);
|
|
10
11
|
export class TableHeader {
|
|
@@ -126,13 +127,13 @@ export class TableHeader {
|
|
|
126
127
|
const mobileTotal = (this.selectedFiltersAmount || 0) + (activeQuickFilter?.default ? 0 : 1);
|
|
127
128
|
const hasCustomFilterSlot = !!this._el.querySelector(':scope > [slot="custom-filter"]');
|
|
128
129
|
const hasCustomActionsSlot = !!this._el.querySelector(':scope > [slot="custom-actions"]');
|
|
129
|
-
return (h("div", { key: '
|
|
130
|
-
(hasCustomFilterSlot || this.quickFilters.length > 0) && (h("div", { key: '
|
|
130
|
+
return (h("div", { key: 'ab535aa8c4529ad575072685d7e0d8763abfa3df', class: header() }, this.loading && (h("p-loader", { key: '2d75a59cb8b377deb771c289292f8c0377255e0e', variant: 'ghost', class: 'hidden h-8 w-3/4 rounded desktop-xs:flex' })), !this.loading &&
|
|
131
|
+
(hasCustomFilterSlot || this.quickFilters.length > 0) && (h("div", { key: '7652284d3b6171753994973dc2f7dad69a3a6bcd', class: 'col-start-1 flex flex-col justify-start gap-4 justify-self-start desktop-xs:flex-row' }, hasCustomFilterSlot && h("slot", { key: '4209da4be63dde923d6fc4124a6f510592978bca', name: 'custom-filter' }), this.quickFilters.length > 0 && (h("p-segment-container", { key: 'adb4213bc76adc9971cbaf14ad82727ad382bfa8', class: 'hidden desktop-xs:flex' }, this.quickFilters.map(item => (h("p-segment-item", { active: item.identifier === this.activeQuickFilterIdentifier, onClick: () => this.quickFilter.emit(item) }, typeof item.text === 'string' ? item.text : item.text(), ' ', item?.count >= 0 ? `(${item.count})` : ''))))))), h("div", { key: '3707ccfdfb753dc4398824e2b777bccb87fb4b04', class: 'col-start-2 flex flex-col justify-end gap-2 desktop-xs:flex-row desktop-xs:items-center' }, this.enableSearch && (h("p-field", { key: 'c0f442a36ee55f29b569d82bebc38de2ab64ba82', icon: 'search', class: 'desktop-xs:max-w-60', placeholder: 'Zoeken...', value: this.query, onValueChange: ev => this._queryObserver.next(ev.detail) })), h("div", { key: '055050b150fad4d5c013a7c6f04bdd433e966a2f', class: 'flex items-center gap-2' }, this.enableFilter && (h("p-button", { key: 'b14ae98072117e21a84d6041f6459baa997f47d7', icon: 'filter', variant: 'secondary', class: `w-full ${this.enableFilterDesktop
|
|
131
132
|
? 'desktop-xs:w-auto'
|
|
132
133
|
: 'desktop-xs:hidden'}`, onClick: () => this.filter.emit() }, this.filterButtonTemplate
|
|
133
134
|
? this.filterButtonTemplate()
|
|
134
135
|
: this._defaultFilterButtonTemplate(), this.selectedFiltersAmount &&
|
|
135
|
-
this._getLabel(this.selectedFiltersAmount), mobileTotal > 0 && this._getLabel(mobileTotal, 'mobile'))), !this.loading && this.enableExport && this.enableFilter && (h("p-divider", { key: '
|
|
136
|
+
this._getLabel(this.selectedFiltersAmount), mobileTotal > 0 && this._getLabel(mobileTotal, 'mobile'))), !this.loading && this.enableExport && this.enableFilter && (h("p-divider", { key: 'd92bc4736c8a262e109f57f0d4a885ea732ce74f', variant: 'vertical', class: 'hidden h-4 tablet:flex' })), !this.loading && this.enableExport && (h("p-button", { key: 'bca239c0104cb7ea42e51cdcfdf0cc859c4de427', variant: 'secondary', icon: 'upload', class: 'desktop-xs:auto w-full', onClick: () => this.export.emit() }, formatTranslation(this._locales.export)))), this.enableAction && this._buttonTemplate(), hasCustomActionsSlot && h("slot", { key: '7b4fedb1b1d78b11a8b9b29adf99416836bae534', name: 'custom-actions' })), this.enableAction && this.canUseAction && (h("div", { key: 'f30fda6c05739a02115df7dd8904c61dd7076efe', class: 'fixed bottom-0 left-0 block w-full border border-solid border-transparent border-t-mystic-dark bg-white p-4 desktop-xs:hidden' }, this._buttonTemplate(true)))));
|
|
136
137
|
}
|
|
137
138
|
async _setLocales() {
|
|
138
139
|
this._locales = await getLocaleComponentStrings(this._el);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header.component.js","sourceRoot":"","sources":["../../../../../src/components/molecules/table/header/table-header.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { debounceTime, distinctUntilChanged, Subject } from 'rxjs';\nimport { QuickFilter } from '../../../../types/table';\nimport {\n\tformatTranslation,\n\tgetLocaleComponentStrings,\n} from '../../../../utils/localization';\nimport { IconVariant } from '../../../atoms/icon/icon.component';\n\nexport type templateFunc = () => string;\nexport type buttonTemplateFunc = (amount: number) => string;\n\nconst header = cva([\n\t'flex flex-col gap-2 z-[1]',\n\t'w-full',\n\n\t'desktop-xs:grid desktop-xs:grid-cols-2',\n]);\n\n@Component({\n\ttag: 'p-table-header',\n\tstyleUrl: 'table-header.component.css',\n\tshadow: true,\n})\nexport class TableHeader {\n\tprivate _defaultFilterButtonTemplate: templateFunc = () =>\n\t\tformatTranslation(this._locales.filter);\n\tprivate _defaultActionButtonTemplate: buttonTemplateFunc = (amount: number) =>\n\t\tthis.actionText\n\t\t\t? this.actionText\n\t\t\t: formatTranslation(\n\t\t\t\t\tamount === 0\n\t\t\t\t\t\t? this._locales.edit\n\t\t\t\t\t\t: amount === 1\n\t\t\t\t\t\t? this._locales.edit_single\n\t\t\t\t\t\t: this._locales.edit_plural,\n\t\t\t\t\t{ amount }\n\t\t\t );\n\n\t/**\n\t * Quick filters to show\n\t */\n\t@Prop() quickFilters: QuickFilter[] = [];\n\n\t/**\n\t * Active quick filter identifier\n\t */\n\t@Prop() activeQuickFilterIdentifier: string;\n\n\t/**\n\t * Wether we want to show loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show the search input\n\t */\n\t@Prop() enableSearch: boolean = true;\n\n\t/**\n\t * The amount of items that are selected\n\t */\n\t@Prop() itemsSelectedAmount: number = 0;\n\n\t/**\n\t * The query to show in the search bar\n\t */\n\t@Prop({ mutable: true }) query: string;\n\n\t/**\n\t * Wether to show the filter button\n\t */\n\t@Prop() enableFilter: boolean = true;\n\n\t/**\n\t * Wether to show the export button\n\t */\n\t@Prop() enableExport: boolean = true;\n\n\t/**\n\t * Wether to show the filter button on desktop\n\t */\n\t@Prop() enableFilterDesktop: boolean = true;\n\n\t/**\n\t * The amount of filters being selected\n\t */\n\t@Prop() selectedFiltersAmount: number;\n\n\t/**\n\t * The template for the filter button text\n\t */\n\t@Prop() filterButtonTemplate: templateFunc =\n\t\tthis._defaultFilterButtonTemplate;\n\n\t/**\n\t * Wether to show the action button\n\t */\n\t@Prop() enableAction: boolean = true;\n\n\t/**\n\t * Wether the action button is loading\n\t */\n\t@Prop() actionLoading: boolean = false;\n\n\t/**\n\t * The action button icon\n\t */\n\t@Prop() actionIcon: IconVariant = 'pencil';\n\n\t/**\n\t * The action button text if changed\n\t */\n\t@Prop() actionText: string;\n\n\t/**\n\t * Wether to enable the action button\n\t */\n\t@Prop({ mutable: true }) canUseAction: boolean = false;\n\n\t/**\n\t * The template for the action button text\n\t */\n\t@Prop() actionButtonTemplate: buttonTemplateFunc =\n\t\tthis._defaultActionButtonTemplate;\n\n\t/**\n\t * Event when one of the quick filters is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tquickFilter: EventEmitter<QuickFilter>;\n\n\t/**\n\t * Event when the query changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the filter button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tfilter: EventEmitter<null>;\n\n\t/**\n\t * Event when the action button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\taction: EventEmitter<null>;\n\n\t/**\n\t * Event whenever the export button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\texport: EventEmitter<number>;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Locales used for this component\n\t */\n\t@State() private _locales: any = {};\n\n\tprivate _queryObserver = new Subject<string>();\n\n\tcomponentWillLoad() {\n\t\tthis._setLocales();\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._queryObserver\n\t\t\t.pipe(debounceTime(300), distinctUntilChanged())\n\t\t\t.subscribe(value => this.queryChange.emit(value));\n\t}\n\n\trender() {\n\t\tconst activeQuickFilter = this.quickFilters.find(\n\t\t\tf => f.identifier === this.activeQuickFilterIdentifier\n\t\t);\n\t\tconst mobileTotal =\n\t\t\t(this.selectedFiltersAmount || 0) + (activeQuickFilter?.default ? 0 : 1);\n\n\t\tconst hasCustomFilterSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"custom-filter\"]'\n\t\t);\n\n\t\tconst hasCustomActionsSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"custom-actions\"]'\n\t\t);\n\n\t\treturn (\n\t\t\t<div class={header()}>\n\t\t\t\t{this.loading && (\n\t\t\t\t\t<p-loader\n\t\t\t\t\t\tvariant='ghost'\n\t\t\t\t\t\tclass='hidden h-8 w-3/4 rounded desktop-xs:flex'\n\t\t\t\t\t></p-loader>\n\t\t\t\t)}\n\n\t\t\t\t{!this.loading &&\n\t\t\t\t\t(hasCustomFilterSlot || this.quickFilters.length > 0) && (\n\t\t\t\t\t\t<div class='col-start-1 flex flex-col justify-start gap-4 justify-self-start desktop-xs:flex-row'>\n\t\t\t\t\t\t\t{hasCustomFilterSlot && <slot name='custom-filter' />}\n\n\t\t\t\t\t\t\t{this.quickFilters.length > 0 && (\n\t\t\t\t\t\t\t\t<p-segment-container class='hidden desktop-xs:flex'>\n\t\t\t\t\t\t\t\t\t{this.quickFilters.map(item => (\n\t\t\t\t\t\t\t\t\t\t<p-segment-item\n\t\t\t\t\t\t\t\t\t\t\tactive={\n\t\t\t\t\t\t\t\t\t\t\t\titem.identifier === this.activeQuickFilterIdentifier\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.quickFilter.emit(item)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{typeof item.text === 'string' ? item.text : item.text()}{' '}\n\t\t\t\t\t\t\t\t\t\t\t{item?.count >= 0 ? `(${item.count})` : ''}\n\t\t\t\t\t\t\t\t\t\t</p-segment-item>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</p-segment-container>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t<div class='col-start-2 flex flex-col justify-end gap-2 desktop-xs:flex-row desktop-xs:items-center'>\n\t\t\t\t\t{this.enableSearch && (\n\t\t\t\t\t\t<p-field\n\t\t\t\t\t\t\ticon='search'\n\t\t\t\t\t\t\tclass='desktop-xs:max-w-60'\n\t\t\t\t\t\t\tplaceholder='Zoeken...'\n\t\t\t\t\t\t\tvalue={this.query}\n\t\t\t\t\t\t\tonValueChange={ev => this._queryObserver.next(ev.detail)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div class='flex items-center gap-2'>\n\t\t\t\t\t\t{this.enableFilter && (\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\ticon='filter'\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\tclass={`w-full ${\n\t\t\t\t\t\t\t\t\tthis.enableFilterDesktop\n\t\t\t\t\t\t\t\t\t\t? 'desktop-xs:w-auto'\n\t\t\t\t\t\t\t\t\t\t: 'desktop-xs:hidden'\n\t\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\t\tonClick={() => this.filter.emit()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{this.filterButtonTemplate\n\t\t\t\t\t\t\t\t\t? this.filterButtonTemplate()\n\t\t\t\t\t\t\t\t\t: this._defaultFilterButtonTemplate()}\n\t\t\t\t\t\t\t\t{this.selectedFiltersAmount &&\n\t\t\t\t\t\t\t\t\tthis._getLabel(this.selectedFiltersAmount)}\n\t\t\t\t\t\t\t\t{mobileTotal > 0 && this._getLabel(mobileTotal, 'mobile')}\n\t\t\t\t\t\t\t</p-button>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!this.loading && this.enableExport && this.enableFilter && (\n\t\t\t\t\t\t\t<p-divider\n\t\t\t\t\t\t\t\tvariant='vertical'\n\t\t\t\t\t\t\t\tclass='hidden h-4 tablet:flex'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!this.loading && this.enableExport && (\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\ticon='upload'\n\t\t\t\t\t\t\t\tclass='desktop-xs:auto w-full'\n\t\t\t\t\t\t\t\tonClick={() => this.export.emit()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{formatTranslation(this._locales.export)}\n\t\t\t\t\t\t\t</p-button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{this.enableAction && this._buttonTemplate()}\n\n\t\t\t\t\t{hasCustomActionsSlot && <slot name='custom-actions' />}\n\t\t\t\t</div>\n\n\t\t\t\t{this.enableAction && this.canUseAction && (\n\t\t\t\t\t<div class='fixed bottom-0 left-0 block w-full border border-solid border-transparent border-t-mystic-dark bg-white p-4 desktop-xs:hidden'>\n\t\t\t\t\t\t{this._buttonTemplate(true)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\t@Listen('localeChanged', { target: 'body' })\n\tprivate async _setLocales(): Promise<void> {\n\t\tthis._locales = await getLocaleComponentStrings(this._el);\n\t}\n\n\tprivate _buttonTemplate(mobile = false) {\n\t\treturn (\n\t\t\t<p-button\n\t\t\t\tclass={mobile ? 'w-full' : 'hidden desktop-xs:flex'}\n\t\t\t\ticon={this.actionIcon}\n\t\t\t\tdisabled={!this.canUseAction}\n\t\t\t\tonClick={() => this.action.emit()}\n\t\t\t\tloading={this.actionLoading}\n\t\t\t>\n\t\t\t\t{this.actionButtonTemplate\n\t\t\t\t\t? this.actionButtonTemplate(mobile ? this.itemsSelectedAmount : 0)\n\t\t\t\t\t: this._defaultActionButtonTemplate(\n\t\t\t\t\t\t\tmobile ? this.itemsSelectedAmount : 0\n\t\t\t\t\t )}\n\t\t\t</p-button>\n\t\t);\n\t}\n\n\tprivate _getLabel(amount, variant: 'mobile' | 'default' = 'default') {\n\t\treturn (\n\t\t\t<p-badge\n\t\t\t\tclass={`ml-1 ${\n\t\t\t\t\tvariant === 'default'\n\t\t\t\t\t\t? 'hidden desktop-xs:flex'\n\t\t\t\t\t\t: 'flex desktop-xs:hidden'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{amount}\n\t\t\t</p-badge>\n\t\t);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"table-header.component.js","sourceRoot":"","sources":["../../../../../src/components/molecules/table/header/table-header.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,MAAM,EACN,IAAI,EACJ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,YAAY,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tListen,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { debounceTime, distinctUntilChanged, Subject } from 'rxjs';\nimport { QuickFilter } from '../../../../types/table';\nimport {\n\tformatTranslation,\n\tgetLocaleComponentStrings,\n} from '../../../../utils/localization';\nimport { IconVariant } from '../../../atoms/icon/icon.component';\n\nexport type templateFunc = () => string;\nexport type buttonTemplateFunc = (amount: number) => string;\n\nconst header = cva([\n\t'flex flex-col gap-2 z-[1]',\n\t'w-full',\n\t'px-4 tablet:px-0',\n\n\t'desktop-xs:grid desktop-xs:grid-cols-2',\n]);\n\n@Component({\n\ttag: 'p-table-header',\n\tstyleUrl: 'table-header.component.css',\n\tshadow: true,\n})\nexport class TableHeader {\n\tprivate _defaultFilterButtonTemplate: templateFunc = () =>\n\t\tformatTranslation(this._locales.filter);\n\tprivate _defaultActionButtonTemplate: buttonTemplateFunc = (amount: number) =>\n\t\tthis.actionText\n\t\t\t? this.actionText\n\t\t\t: formatTranslation(\n\t\t\t\t\tamount === 0\n\t\t\t\t\t\t? this._locales.edit\n\t\t\t\t\t\t: amount === 1\n\t\t\t\t\t\t? this._locales.edit_single\n\t\t\t\t\t\t: this._locales.edit_plural,\n\t\t\t\t\t{ amount }\n\t\t\t );\n\n\t/**\n\t * Quick filters to show\n\t */\n\t@Prop() quickFilters: QuickFilter[] = [];\n\n\t/**\n\t * Active quick filter identifier\n\t */\n\t@Prop() activeQuickFilterIdentifier: string;\n\n\t/**\n\t * Wether we want to show loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show the search input\n\t */\n\t@Prop() enableSearch: boolean = true;\n\n\t/**\n\t * The amount of items that are selected\n\t */\n\t@Prop() itemsSelectedAmount: number = 0;\n\n\t/**\n\t * The query to show in the search bar\n\t */\n\t@Prop({ mutable: true }) query: string;\n\n\t/**\n\t * Wether to show the filter button\n\t */\n\t@Prop() enableFilter: boolean = true;\n\n\t/**\n\t * Wether to show the export button\n\t */\n\t@Prop() enableExport: boolean = true;\n\n\t/**\n\t * Wether to show the filter button on desktop\n\t */\n\t@Prop() enableFilterDesktop: boolean = true;\n\n\t/**\n\t * The amount of filters being selected\n\t */\n\t@Prop() selectedFiltersAmount: number;\n\n\t/**\n\t * The template for the filter button text\n\t */\n\t@Prop() filterButtonTemplate: templateFunc =\n\t\tthis._defaultFilterButtonTemplate;\n\n\t/**\n\t * Wether to show the action button\n\t */\n\t@Prop() enableAction: boolean = true;\n\n\t/**\n\t * Wether the action button is loading\n\t */\n\t@Prop() actionLoading: boolean = false;\n\n\t/**\n\t * The action button icon\n\t */\n\t@Prop() actionIcon: IconVariant = 'pencil';\n\n\t/**\n\t * The action button text if changed\n\t */\n\t@Prop() actionText: string;\n\n\t/**\n\t * Wether to enable the action button\n\t */\n\t@Prop({ mutable: true }) canUseAction: boolean = false;\n\n\t/**\n\t * The template for the action button text\n\t */\n\t@Prop() actionButtonTemplate: buttonTemplateFunc =\n\t\tthis._defaultActionButtonTemplate;\n\n\t/**\n\t * Event when one of the quick filters is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tquickFilter: EventEmitter<QuickFilter>;\n\n\t/**\n\t * Event when the query changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the filter button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tfilter: EventEmitter<null>;\n\n\t/**\n\t * Event when the action button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\taction: EventEmitter<null>;\n\n\t/**\n\t * Event whenever the export button is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\texport: EventEmitter<number>;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t/**\n\t * Locales used for this component\n\t */\n\t@State() private _locales: any = {};\n\n\tprivate _queryObserver = new Subject<string>();\n\n\tcomponentWillLoad() {\n\t\tthis._setLocales();\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis._queryObserver\n\t\t\t.pipe(debounceTime(300), distinctUntilChanged())\n\t\t\t.subscribe(value => this.queryChange.emit(value));\n\t}\n\n\trender() {\n\t\tconst activeQuickFilter = this.quickFilters.find(\n\t\t\tf => f.identifier === this.activeQuickFilterIdentifier\n\t\t);\n\t\tconst mobileTotal =\n\t\t\t(this.selectedFiltersAmount || 0) + (activeQuickFilter?.default ? 0 : 1);\n\n\t\tconst hasCustomFilterSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"custom-filter\"]'\n\t\t);\n\n\t\tconst hasCustomActionsSlot = !!this._el.querySelector(\n\t\t\t':scope > [slot=\"custom-actions\"]'\n\t\t);\n\n\t\treturn (\n\t\t\t<div class={header()}>\n\t\t\t\t{this.loading && (\n\t\t\t\t\t<p-loader\n\t\t\t\t\t\tvariant='ghost'\n\t\t\t\t\t\tclass='hidden h-8 w-3/4 rounded desktop-xs:flex'\n\t\t\t\t\t></p-loader>\n\t\t\t\t)}\n\n\t\t\t\t{!this.loading &&\n\t\t\t\t\t(hasCustomFilterSlot || this.quickFilters.length > 0) && (\n\t\t\t\t\t\t<div class='col-start-1 flex flex-col justify-start gap-4 justify-self-start desktop-xs:flex-row'>\n\t\t\t\t\t\t\t{hasCustomFilterSlot && <slot name='custom-filter' />}\n\n\t\t\t\t\t\t\t{this.quickFilters.length > 0 && (\n\t\t\t\t\t\t\t\t<p-segment-container class='hidden desktop-xs:flex'>\n\t\t\t\t\t\t\t\t\t{this.quickFilters.map(item => (\n\t\t\t\t\t\t\t\t\t\t<p-segment-item\n\t\t\t\t\t\t\t\t\t\t\tactive={\n\t\t\t\t\t\t\t\t\t\t\t\titem.identifier === this.activeQuickFilterIdentifier\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.quickFilter.emit(item)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{typeof item.text === 'string' ? item.text : item.text()}{' '}\n\t\t\t\t\t\t\t\t\t\t\t{item?.count >= 0 ? `(${item.count})` : ''}\n\t\t\t\t\t\t\t\t\t\t</p-segment-item>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</p-segment-container>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\n\t\t\t\t<div class='col-start-2 flex flex-col justify-end gap-2 desktop-xs:flex-row desktop-xs:items-center'>\n\t\t\t\t\t{this.enableSearch && (\n\t\t\t\t\t\t<p-field\n\t\t\t\t\t\t\ticon='search'\n\t\t\t\t\t\t\tclass='desktop-xs:max-w-60'\n\t\t\t\t\t\t\tplaceholder='Zoeken...'\n\t\t\t\t\t\t\tvalue={this.query}\n\t\t\t\t\t\t\tonValueChange={ev => this._queryObserver.next(ev.detail)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div class='flex items-center gap-2'>\n\t\t\t\t\t\t{this.enableFilter && (\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\ticon='filter'\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\tclass={`w-full ${\n\t\t\t\t\t\t\t\t\tthis.enableFilterDesktop\n\t\t\t\t\t\t\t\t\t\t? 'desktop-xs:w-auto'\n\t\t\t\t\t\t\t\t\t\t: 'desktop-xs:hidden'\n\t\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\t\tonClick={() => this.filter.emit()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{this.filterButtonTemplate\n\t\t\t\t\t\t\t\t\t? this.filterButtonTemplate()\n\t\t\t\t\t\t\t\t\t: this._defaultFilterButtonTemplate()}\n\t\t\t\t\t\t\t\t{this.selectedFiltersAmount &&\n\t\t\t\t\t\t\t\t\tthis._getLabel(this.selectedFiltersAmount)}\n\t\t\t\t\t\t\t\t{mobileTotal > 0 && this._getLabel(mobileTotal, 'mobile')}\n\t\t\t\t\t\t\t</p-button>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!this.loading && this.enableExport && this.enableFilter && (\n\t\t\t\t\t\t\t<p-divider\n\t\t\t\t\t\t\t\tvariant='vertical'\n\t\t\t\t\t\t\t\tclass='hidden h-4 tablet:flex'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{!this.loading && this.enableExport && (\n\t\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\t\ticon='upload'\n\t\t\t\t\t\t\t\tclass='desktop-xs:auto w-full'\n\t\t\t\t\t\t\t\tonClick={() => this.export.emit()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{formatTranslation(this._locales.export)}\n\t\t\t\t\t\t\t</p-button>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{this.enableAction && this._buttonTemplate()}\n\n\t\t\t\t\t{hasCustomActionsSlot && <slot name='custom-actions' />}\n\t\t\t\t</div>\n\n\t\t\t\t{this.enableAction && this.canUseAction && (\n\t\t\t\t\t<div class='fixed bottom-0 left-0 block w-full border border-solid border-transparent border-t-mystic-dark bg-white p-4 desktop-xs:hidden'>\n\t\t\t\t\t\t{this._buttonTemplate(true)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\t@Listen('localeChanged', { target: 'body' })\n\tprivate async _setLocales(): Promise<void> {\n\t\tthis._locales = await getLocaleComponentStrings(this._el);\n\t}\n\n\tprivate _buttonTemplate(mobile = false) {\n\t\treturn (\n\t\t\t<p-button\n\t\t\t\tclass={mobile ? 'w-full' : 'hidden desktop-xs:flex'}\n\t\t\t\ticon={this.actionIcon}\n\t\t\t\tdisabled={!this.canUseAction}\n\t\t\t\tonClick={() => this.action.emit()}\n\t\t\t\tloading={this.actionLoading}\n\t\t\t>\n\t\t\t\t{this.actionButtonTemplate\n\t\t\t\t\t? this.actionButtonTemplate(mobile ? this.itemsSelectedAmount : 0)\n\t\t\t\t\t: this._defaultActionButtonTemplate(\n\t\t\t\t\t\t\tmobile ? this.itemsSelectedAmount : 0\n\t\t\t\t\t )}\n\t\t\t</p-button>\n\t\t);\n\t}\n\n\tprivate _getLabel(amount, variant: 'mobile' | 'default' = 'default') {\n\t\treturn (\n\t\t\t<p-badge\n\t\t\t\tclass={`ml-1 ${\n\t\t\t\t\tvariant === 'default'\n\t\t\t\t\t\t? 'hidden desktop-xs:flex'\n\t\t\t\t\t\t: 'flex desktop-xs:hidden'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t{amount}\n\t\t\t</p-badge>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/stepper/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EACR,CAAC,EACD,IAAI,EACJ,KAAK,EACL,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAQ/C,MAAM,OAA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":["import {\n\tComponent,\n\tElement,\n\tFragment,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nexport interface StepperStepItemObj {\n\tcontent: string;\n\tactive: boolean;\n\tfinished: boolean;\n}\n\nconst stepper = cva(['flex gap-2'], {\n\tvariants: {\n\t\tdirection: {\n\t\t\tvertical: 'w-full flex-col flex-wrap',\n\t\t\thorizontal: 'h-auto items-center',\n\t\t},\n\t\tgeneratedOnce: {\n\t\t\ttrue: 'opacity-100',\n\t\t\tfalse: 'opacity-0',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.css',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The steps but as a property, can also be used via slot\n\t */\n\t@Prop() steps: string | string[] | StepperStepItemObj[];\n\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * Wether to automatically apply active & finished to items\n\t */\n\t@Prop() enableAutoStatus: boolean = true;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop() direction: 'horizontal' | 'vertical' = 'horizontal';\n\n\t/**\n\t * The alignment of the content in case of vertical direction\n\t */\n\t@Prop() align: 'start' | 'center' | 'end' = 'center';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop() contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _generatedOnce = false;\n\t@State() private _loaded = false;\n\n\tprivate _generateTimeout: NodeJS.Timeout | undefined;\n\tprivate _containerRef: HTMLDivElement;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _hasSlotItems = false;\n\n\tcomponentDidLoad() {\n\t\tthis._hasSlotItems = !!this._el.querySelector(':scope > *');\n\t\tthis._loaded = true;\n\t}\n\n\tdisconnectCallback() {\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._hasSlotItems) {\n\t\t\tconst steps =\n\t\t\t\ttypeof this.steps === 'string' ? JSON.parse(this.steps) : this.steps;\n\t\t\tif (!steps?.length) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst items = steps.map((step, index) => {\n\t\t\t\tconst item = this._getItem(\n\t\t\t\t\ttypeof step === 'string'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tactive: false,\n\t\t\t\t\t\t\t\tfinished: false,\n\t\t\t\t\t\t\t\tcontent: step,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: step,\n\t\t\t\t\tindex\n\t\t\t\t);\n\t\t\t\treturn (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{item}\n\t\t\t\t\t\t{index < steps.length - 1 && this._getLine(index)}\n\t\t\t\t\t</Fragment>\n\t\t\t\t);\n\t\t\t});\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclass={stepper({\n\t\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\t\tgeneratedOnce: true,\n\t\t\t\t\t})}\n\t\t\t\t\tref={ref => this._setContainerRef(ref)}\n\t\t\t\t>\n\t\t\t\t\t{items}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={stepper({\n\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\tgeneratedOnce: this._generatedOnce,\n\t\t\t\t})}\n\t\t\t\tref={ref => this._setContainerRef(ref)}\n\t\t\t>\n\t\t\t\t<slot onSlotchange={() => this._generateLinesOnce()} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t@Watch('align')\n\tprotected _onAlignChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('direction')\n\tprotected _onDirectionChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\tprivate _setContainerRef(ref: HTMLDivElement) {\n\t\tthis._containerRef = ref;\n\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._containerRef);\n\t}\n\n\tprivate _getItem(data: StepperStepItemObj, i: number) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\n\t\treturn (\n\t\t\t<p-stepper-item\n\t\t\t\tactive={this.enableAutoStatus ? i === activeStep : data.active}\n\t\t\t\tfinished={this.enableAutoStatus ? i < activeStep : data.finished}\n\t\t\t\tnumber={i + 1}\n\t\t\t\talign={this.direction === 'vertical' ? this.align : 'start'}\n\t\t\t\tcontentPosition={this.contentPosition}\n\t\t\t>\n\t\t\t\t{data.content}\n\t\t\t</p-stepper-item>\n\t\t);\n\t}\n\n\tprivate _getLine(i: number) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\t\treturn (\n\t\t\t<p-stepper-line\n\t\t\t\tactive={i < activeStep}\n\t\t\t\tdirection={this.direction}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _checkItems(items: NodeListOf<HTMLPStepperItemElement>) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (this.enableAutoStatus) {\n\t\t\t\titem.active = i === activeStep;\n\t\t\t\titem.finished = i < activeStep;\n\t\t\t}\n\n\t\t\titem.number = i + 1;\n\t\t\titem.align = this.direction === 'vertical' ? this.align : 'start';\n\t\t\titem.contentPosition = this.contentPosition;\n\t\t}\n\t}\n\n\tprivate _generateLinesOnce() {\n\t\tif (!this._hasSlotItems) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._generateTimeout) {\n\t\t\tclearTimeout(this._generateTimeout);\n\t\t\tthis._generateTimeout = null;\n\t\t}\n\n\t\tthis._generateTimeout = setTimeout(() => {\n\t\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\t\t\tthis._checkItems(items);\n\t\t\tthis._generateLines(items);\n\t\t\tthis._generateTimeout = null;\n\t\t}, 50);\n\t}\n\n\tprivate _generateLines(items: NodeListOf<HTMLPStepperItemElement>) {\n\t\tif (!this._el) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tlet nextItem = item.nextElementSibling;\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\tconst stepperLine = document.createElement('p-stepper-line');\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tconst stepperLine = nextItem;\n\t\t\t\t\tnextItem = nextItem.nextElementSibling;\n\n\t\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tpreviousItem &&\n\t\t\t\t\tpreviousItem.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t) {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\n\t\tif (!this._generatedOnce) {\n\t\t\tthis._generatedOnce = true;\n\t\t}\n\t}\n\n\tprivate _setLineData(\n\t\tstepperLine: HTMLPStepperLineElement,\n\t\titem: HTMLPStepperItemElement,\n\t\tnextItem: HTMLPStepperItemElement,\n\t\ti: number,\n\t\tactiveStep: number\n\t) {\n\t\tlet heightDiff = item.clientHeight - 24;\n\t\tlet heightDiffNext = nextItem.clientHeight - 24;\n\n\t\tif (this.align === 'center') {\n\t\t\theightDiff = heightDiff / 2;\n\t\t\theightDiffNext = heightDiffNext / 2;\n\t\t}\n\n\t\tstepperLine.direction = this.direction;\n\t\tstepperLine.active = i < activeStep;\n\n\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\tlet totalHeight = 0;\n\n\t\t\tstepperLine.style.marginTop = '0';\n\t\t\tstepperLine.style.marginBottom = '0';\n\n\t\t\tif (this.align === 'start' || this.align === 'center') {\n\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\ttotalHeight += heightDiff;\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${heightDiffNext / 16}rem`;\n\t\t\t\ttotalHeight += heightDiffNext;\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stepper.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/stepper/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EACR,CAAC,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {\n\tComponent,\n\tElement,\n\tFragment,\n\th,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\n\nexport interface StepperStepItemObj {\n\tcontent: string;\n\tactive: boolean;\n\tfinished: boolean;\n}\n\nconst stepper = cva(['flex gap-2'], {\n\tvariants: {\n\t\tdirection: {\n\t\t\tvertical: 'w-full flex-col flex-wrap',\n\t\t\thorizontal: 'h-auto items-center',\n\t\t},\n\t\tgeneratedOnce: {\n\t\t\ttrue: 'opacity-100',\n\t\t\tfalse: 'opacity-0',\n\t\t},\n\t},\n});\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.css',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The steps but as a property, can also be used via slot\n\t */\n\t@Prop() steps: string | string[] | StepperStepItemObj[];\n\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * Wether to automatically apply active & finished to items\n\t */\n\t@Prop() enableAutoStatus: boolean = true;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop() direction: 'horizontal' | 'vertical' = 'horizontal';\n\n\t/**\n\t * The alignment of the content in case of vertical direction\n\t */\n\t@Prop() align: 'start' | 'center' | 'end' = 'center';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop() contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _generatedOnce = false;\n\t@State() private _loaded = false;\n\n\tprivate _generateTimeout: NodeJS.Timeout | undefined;\n\tprivate _containerRef: HTMLDivElement;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _hasSlotItems = false;\n\n\tcomponentDidLoad() {\n\t\tthis._hasSlotItems = !!this._el.querySelector(':scope > *');\n\t\tthis._loaded = true;\n\t}\n\n\tdisconnectCallback() {\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\tif (!this._loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._hasSlotItems) {\n\t\t\tconst steps =\n\t\t\t\ttypeof this.steps === 'string' ? JSON.parse(this.steps) : this.steps;\n\t\t\tif (!steps?.length) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst items = steps.map((step, index) => {\n\t\t\t\tconst item = this._getItem(\n\t\t\t\t\ttypeof step === 'string'\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tactive: false,\n\t\t\t\t\t\t\t\tfinished: false,\n\t\t\t\t\t\t\t\tcontent: step,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: step,\n\t\t\t\t\tindex\n\t\t\t\t);\n\t\t\t\treturn (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{item}\n\t\t\t\t\t\t{index < steps.length - 1 && this._getLine(index)}\n\t\t\t\t\t</Fragment>\n\t\t\t\t);\n\t\t\t});\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclass={stepper({\n\t\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\t\tgeneratedOnce: true,\n\t\t\t\t\t})}\n\t\t\t\t\tref={ref => this._setContainerRef(ref)}\n\t\t\t\t>\n\t\t\t\t\t{items}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={stepper({\n\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\tgeneratedOnce: this._generatedOnce,\n\t\t\t\t})}\n\t\t\t\tref={ref => this._setContainerRef(ref)}\n\t\t\t>\n\t\t\t\t<slot onSlotchange={() => this._generateLinesOnce()} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t@Watch('align')\n\tprotected _onAlignChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('direction')\n\tprotected _onDirectionChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateLinesOnce();\n\t}\n\n\tprivate _setContainerRef(ref: HTMLDivElement) {\n\t\tthis._containerRef = ref;\n\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateLinesOnce());\n\t\tthis._resizeObserver.observe(this._containerRef);\n\t}\n\n\tprivate _getItem(data: StepperStepItemObj, i: number) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\n\t\treturn (\n\t\t\t<p-stepper-item\n\t\t\t\tactive={this.enableAutoStatus ? i === activeStep : data.active}\n\t\t\t\tfinished={this.enableAutoStatus ? i < activeStep : data.finished}\n\t\t\t\tnumber={i + 1}\n\t\t\t\talign={this.direction === 'vertical' ? this.align : 'start'}\n\t\t\t\tcontentPosition={this.contentPosition}\n\t\t\t>\n\t\t\t\t{data.content}\n\t\t\t</p-stepper-item>\n\t\t);\n\t}\n\n\tprivate _getLine(i: number) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\t\treturn (\n\t\t\t<p-stepper-line\n\t\t\t\tactive={i < activeStep}\n\t\t\t\tdirection={this.direction}\n\t\t\t/>\n\t\t);\n\t}\n\n\tprivate _checkItems(items: NodeListOf<HTMLPStepperItemElement>) {\n\t\tconst activeStep = this.activeStep - 1 || 0;\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (this.enableAutoStatus) {\n\t\t\t\titem.active = i === activeStep;\n\t\t\t\titem.finished = i < activeStep;\n\t\t\t}\n\n\t\t\titem.number = i + 1;\n\t\t\titem.align = this.direction === 'vertical' ? this.align : 'start';\n\t\t\titem.direction = this.direction;\n\t\t\titem.contentPosition = this.contentPosition;\n\t\t}\n\t}\n\n\tprivate _generateLinesOnce() {\n\t\tif (!this._hasSlotItems) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._generateTimeout) {\n\t\t\tclearTimeout(this._generateTimeout);\n\t\t\tthis._generateTimeout = null;\n\t\t}\n\n\t\tthis._generateTimeout = setTimeout(() => {\n\t\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\t\t\tthis._checkItems(items);\n\t\t\tthis._generateLines(items);\n\t\t\tthis._generateTimeout = null;\n\t\t}, 50);\n\t}\n\n\tprivate _generateLines(items: NodeListOf<HTMLPStepperItemElement>) {\n\t\tif (!this._el) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tlet nextItem = item.nextElementSibling;\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\tconst stepperLine = document.createElement('p-stepper-line');\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tconst stepperLine = nextItem;\n\t\t\t\t\tnextItem = nextItem.nextElementSibling;\n\n\t\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\t\tthis._setLineData(stepperLine, item, nextItem, i, activeStep);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tpreviousItem &&\n\t\t\t\t\tpreviousItem.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t) {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\n\t\tif (!this._generatedOnce) {\n\t\t\tthis._generatedOnce = true;\n\t\t}\n\t}\n\n\tprivate _setLineData(\n\t\tstepperLine: HTMLPStepperLineElement,\n\t\titem: HTMLPStepperItemElement,\n\t\tnextItem: HTMLPStepperItemElement,\n\t\ti: number,\n\t\tactiveStep: number\n\t) {\n\t\tlet heightDiff = item.clientHeight - 24;\n\t\tlet heightDiffNext = nextItem.clientHeight - 24;\n\n\t\tif (this.align === 'center') {\n\t\t\theightDiff = heightDiff / 2;\n\t\t\theightDiffNext = heightDiffNext / 2;\n\t\t}\n\n\t\tstepperLine.direction = this.direction;\n\t\tstepperLine.active = i < activeStep;\n\n\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\tlet totalHeight = 0;\n\n\t\t\tstepperLine.style.marginTop = '0';\n\t\t\tstepperLine.style.marginBottom = '0';\n\n\t\t\tif (this.align === 'start' || this.align === 'center') {\n\t\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\t\ttotalHeight += heightDiff;\n\t\t\t}\n\n\t\t\tif (this.align === 'center' || this.align === 'end') {\n\t\t\t\tstepperLine.style.marginBottom = `-${heightDiffNext / 16}rem`;\n\t\t\t\ttotalHeight += heightDiffNext;\n\t\t\t}\n\n\t\t\tstepperLine.style.minHeight = `calc(${totalHeight / 16}rem)`;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h } from './p-tdjn65Lz.js';
|
|
|
2
2
|
import { c as cva } from './p-CBWjHURv.js';
|
|
3
3
|
import { a as asBoolean } from './p-C5CTp9IA.js';
|
|
4
4
|
|
|
5
|
-
const stepperItemComponentCss = "*{box-sizing:border-box}.static{position:static!important}.mt-\\[1px\\]{margin-top:1px!important}.flex{display:flex!important}.h-6{height:1.5rem!important}.w-6{width:1.5rem!important}.flex-1{flex:1 1 0%!important}.flex-row-reverse{flex-direction:row-reverse!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.rounded-full{border-radius:9999px!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-dark-teal-400{--tw-border-opacity:1!important;border-color:rgb(51 116 109/var(--tw-border-opacity,1))!important}.bg-dark-teal-400{--tw-bg-opacity:1!important;background-color:rgb(51 116 109/var(--tw-bg-opacity,1))!important}.bg-dark-teal-50{--tw-bg-opacity:1!important;background-color:rgb(229 238 237/var(--tw-bg-opacity,1))!important}.text-center{text-align:center!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-medium{font-weight:500!important}.text-black-teal-400{--tw-text-opacity:1!important;color:rgb(53 85 80/var(--tw-text-opacity,1))!important}.text-black-teal-500{--tw-text-opacity:1!important;color:rgb(3 42 36/var(--tw-text-opacity,1))!important}.text-dark-teal-400{--tw-text-opacity:1!important;color:rgb(51 116 109/var(--tw-text-opacity,1))!important}.text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}";
|
|
5
|
+
const stepperItemComponentCss = "*{box-sizing:border-box}.static{position:static!important}.mt-\\[1px\\]{margin-top:1px!important}.flex{display:flex!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.w-6{width:1.5rem!important}.flex-1{flex:1 1 0%!important}.flex-row-reverse{flex-direction:row-reverse!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.rounded-full{border-radius:9999px!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-dark-teal-400{--tw-border-opacity:1!important;border-color:rgb(51 116 109/var(--tw-border-opacity,1))!important}.bg-dark-teal-400{--tw-bg-opacity:1!important;background-color:rgb(51 116 109/var(--tw-bg-opacity,1))!important}.bg-dark-teal-50{--tw-bg-opacity:1!important;background-color:rgb(229 238 237/var(--tw-bg-opacity,1))!important}.text-center{text-align:center!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-medium{font-weight:500!important}.text-black-teal-400{--tw-text-opacity:1!important;color:rgb(53 85 80/var(--tw-text-opacity,1))!important}.text-black-teal-500{--tw-text-opacity:1!important;color:rgb(3 42 36/var(--tw-text-opacity,1))!important}.text-dark-teal-400{--tw-text-opacity:1!important;color:rgb(51 116 109/var(--tw-text-opacity,1))!important}.text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}@media (min-width:64rem){.desktop-xs\\:inline-block{display:inline-block!important}}";
|
|
6
6
|
|
|
7
7
|
const item = cva('flex gap-2', {
|
|
8
8
|
variants: {
|
|
@@ -61,6 +61,10 @@ const content = cva('text-sm font-medium flex-1 mt-[1px]', {
|
|
|
61
61
|
true: null,
|
|
62
62
|
false: null,
|
|
63
63
|
},
|
|
64
|
+
direction: {
|
|
65
|
+
horizontal: null,
|
|
66
|
+
vertical: null,
|
|
67
|
+
},
|
|
64
68
|
},
|
|
65
69
|
compoundVariants: [
|
|
66
70
|
{
|
|
@@ -78,6 +82,11 @@ const content = cva('text-sm font-medium flex-1 mt-[1px]', {
|
|
|
78
82
|
finished: true,
|
|
79
83
|
class: 'text-black-teal-500',
|
|
80
84
|
},
|
|
85
|
+
{
|
|
86
|
+
direction: 'horizontal',
|
|
87
|
+
active: false,
|
|
88
|
+
class: 'hidden desktop-xs:inline-block',
|
|
89
|
+
},
|
|
81
90
|
],
|
|
82
91
|
});
|
|
83
92
|
const StepperItem = /*@__PURE__*/ proxyCustomElement(class StepperItem extends H {
|
|
@@ -90,6 +99,10 @@ const StepperItem = /*@__PURE__*/ proxyCustomElement(class StepperItem extends H
|
|
|
90
99
|
* The number of the step
|
|
91
100
|
*/
|
|
92
101
|
number = 1;
|
|
102
|
+
/**
|
|
103
|
+
* The direction of the item
|
|
104
|
+
*/
|
|
105
|
+
direction = 'horizontal';
|
|
93
106
|
/**
|
|
94
107
|
* The alignment of the content in case of vertical direction
|
|
95
108
|
*/
|
|
@@ -107,20 +120,22 @@ const StepperItem = /*@__PURE__*/ proxyCustomElement(class StepperItem extends H
|
|
|
107
120
|
*/
|
|
108
121
|
active = false;
|
|
109
122
|
render() {
|
|
110
|
-
return (h("div", { key: '
|
|
123
|
+
return (h("div", { key: '60878b54aefa04d789a8f12f5314065422f6e3ae', class: item({
|
|
111
124
|
align: this.align,
|
|
112
125
|
contentPosition: this.contentPosition,
|
|
113
|
-
}) }, h("div", { key: '
|
|
126
|
+
}) }, h("div", { key: 'cde47d61849fb9601a70e65d640d75fecbabd7b1', class: circle({
|
|
114
127
|
active: asBoolean(this.active),
|
|
115
128
|
finished: asBoolean(this.finished),
|
|
116
|
-
}) }, this.number), h("div", { key: '
|
|
129
|
+
}) }, this.number), h("div", { key: '206a405e10e0aafc7980cf5df7618d2b096e9760', class: content({
|
|
117
130
|
active: asBoolean(this.active),
|
|
118
131
|
finished: asBoolean(this.finished),
|
|
119
|
-
|
|
132
|
+
direction: this.direction,
|
|
133
|
+
}) }, h("slot", { key: '56714497055ae6f9889339f45fdb6e44dacd57c1' }))));
|
|
120
134
|
}
|
|
121
135
|
static get style() { return stepperItemComponentCss; }
|
|
122
136
|
}, [1, "p-stepper-item", {
|
|
123
137
|
"number": [2],
|
|
138
|
+
"direction": [1],
|
|
124
139
|
"align": [1],
|
|
125
140
|
"contentPosition": [1, "content-position"],
|
|
126
141
|
"finished": [4],
|
|
@@ -142,6 +157,6 @@ function defineCustomElement() {
|
|
|
142
157
|
defineCustomElement();
|
|
143
158
|
|
|
144
159
|
export { StepperItem as S, defineCustomElement as d };
|
|
145
|
-
//# sourceMappingURL=p
|
|
160
|
+
//# sourceMappingURL=p--h9uYqpp.js.map
|
|
146
161
|
|
|
147
|
-
//# sourceMappingURL=p
|
|
162
|
+
//# sourceMappingURL=p--h9uYqpp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p--h9uYqpp.js","mappings":";;;;AAAA,MAAM,uBAAuB,GAAG,wlDAAwlD;;ACIxnD,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,EAAE;AAC9B,IAAA,QAAQ,EAAE;AACT,QAAA,KAAK,EAAE;AACN,YAAA,KAAK,EAAE,aAAa;AACpB,YAAA,MAAM,EAAE,cAAc;AACtB,YAAA,GAAG,EAAE,WAAW;AAChB,SAAA;AACD,QAAA,eAAe,EAAE;AAChB,YAAA,KAAK,EAAE,kBAAkB;AACzB,YAAA,GAAG,EAAE,IAAI;AACT,SAAA;AACD,KAAA;AACD,CAAA,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,0CAA0C;IAC1C,iCAAiC;IACjC,0CAA0C;IAC1C,cAAc;CACd,EACD;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,QAAQ,EAAE;AACT,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,QAAA,MAAM,EAAE;AACP,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE,IAAI;AACX,SAAA;AACD,KAAA;AACD,IAAA,gBAAgB,EAAE;AACjB,QAAA;AACC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,KAAK,EAAE,oCAAoC;AAC3C,SAAA;AACD,QAAA;AACC,YAAA,MAAM,EAAE,IAAI;AACZ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AE3D;;AAEG;IACK,KAAK,GAA+B,QAAQ;AAEpD;;AAEG;IACK,eAAe,GAAoB,KAAK;AAEhD;;AAEG;IACK,QAAQ,GAAY,KAAK;AAEjC;;AAEG;IACK,MAAM,GAAY,KAAK;IAE/B,MAAM,GAAA;AACL,QAAA,QACC,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACC,KAAK,EAAE,IAAI,CAAC;gBACX,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,eAAe,EAAE,IAAI,CAAC,eAAe;AACrC,aAAA,CAAC,EAAA,EAEF,CACC,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,MAAM,CAAC;AACb,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,gBAAA,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAClC,aAAA,CAAC,EAED,EAAA,IAAI,CAAC,MAAM,CACP,EACN,CACC,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,OAAO,CAAC;AACd,gBAAA,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,gBAAA,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAClC,SAAS,EAAE,IAAI,CAAC,SAAS;AACzB,aAAA,CAAC,EAAA,EAEF,CAAQ,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACH,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/atoms/stepper/item/stepper-item.component.css?tag=p-stepper-item&encapsulation=shadow","src/components/atoms/stepper/item/stepper-item.component.tsx"],"sourcesContent":["","import { Component, h, Prop } from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { asBoolean } from '../../../../utils/as-boolean';\n\nconst item = cva('flex gap-2', {\n\tvariants: {\n\t\talign: {\n\t\t\tstart: 'items-start',\n\t\t\tcenter: 'items-center',\n\t\t\tend: 'items-end',\n\t\t},\n\t\tcontentPosition: {\n\t\t\tstart: 'flex-row-reverse',\n\t\t\tend: null,\n\t\t},\n\t},\n});\n\nconst circle = cva(\n\t[\n\t\t'h-6 w-6 flex items-center justify-center',\n\t\t'text-sm text-center font-medium',\n\t\t'border border-solid border-dark-teal-400',\n\t\t'rounded-full',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tfinished: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t\tactive: {\n\t\t\t\ttrue: null,\n\t\t\t\tfalse: null,\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [\n\t\t\t{\n\t\t\t\tfinished: false,\n\t\t\t\tactive: false,\n\t\t\t\tclass: 'text-dark-teal-400 bg-dark-teal-50',\n\t\t\t},\n\t\t\t{\n\t\t\t\tactive: true,\n\t\t\t\tfinished: false,\n\t\t\t\tclass: 'text-white bg-dark-teal-400',\n\t\t\t},\n\t\t\t{\n\t\t\t\tactive: false,\n\t\t\t\tfinished: true,\n\t\t\t\tclass: 'text-white bg-dark-teal-400',\n\t\t\t},\n\t\t],\n\t}\n);\n\nconst content = cva('text-sm font-medium flex-1 mt-[1px]', {\n\tvariants: {\n\t\tfinished: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t\tactive: {\n\t\t\ttrue: null,\n\t\t\tfalse: null,\n\t\t},\n\t\tdirection: {\n\t\t\thorizontal: null,\n\t\t\tvertical: null,\n\t\t},\n\t},\n\tcompoundVariants: [\n\t\t{\n\t\t\tfinished: false,\n\t\t\tactive: false,\n\t\t\tclass: 'text-black-teal-400',\n\t\t},\n\t\t{\n\t\t\tactive: true,\n\t\t\tfinished: false,\n\t\t\tclass: 'text-black-teal-500',\n\t\t},\n\t\t{\n\t\t\tactive: false,\n\t\t\tfinished: true,\n\t\t\tclass: 'text-black-teal-500',\n\t\t},\n\t\t{\n\t\t\tdirection: 'horizontal',\n\t\t\tactive: false,\n\t\t\tclass: 'hidden desktop-xs:inline-block',\n\t\t},\n\t],\n});\n\n@Component({\n\ttag: 'p-stepper-item',\n\tstyleUrl: 'stepper-item.component.css',\n\tshadow: true,\n})\nexport class StepperItem {\n\t/**\n\t * The number of the step\n\t */\n\t@Prop() number: number = 1;\n\n\t/**\n\t * The direction of the item\n\t */\n\t@Prop() direction: 'horizontal' | 'vertical' = 'horizontal';\n\n\t/**\n\t * The alignment of the content in case of vertical direction\n\t */\n\t@Prop() align: 'start' | 'center' | 'end' = 'center';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop() contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Wether the step is finished\n\t */\n\t@Prop() finished: boolean = false;\n\n\t/**\n\t * Wether the step is active\n\t */\n\t@Prop() active: boolean = false;\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={item({\n\t\t\t\t\talign: this.align,\n\t\t\t\t\tcontentPosition: this.contentPosition,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclass={circle({\n\t\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\t\tfinished: asBoolean(this.finished),\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{this.number}\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclass={content({\n\t\t\t\t\t\tactive: asBoolean(this.active),\n\t\t\t\t\t\tfinished: asBoolean(this.finished),\n\t\t\t\t\t\tdirection: this.direction,\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-tdjn65Lz.js';
|
|
2
2
|
import { c as cva } from './p-CBWjHURv.js';
|
|
3
|
-
import { d as defineCustomElement$2, a as defaultSize, b as defaultSizeOptions } from './p-
|
|
4
|
-
import { d as defineCustomElement$b } from './p-
|
|
3
|
+
import { d as defineCustomElement$2, a as defaultSize, b as defaultSizeOptions } from './p-DNAQlM-T.js';
|
|
4
|
+
import { d as defineCustomElement$b } from './p-qXjT088h.js';
|
|
5
5
|
import { d as defineCustomElement$a } from './p-C1Fsnz5F.js';
|
|
6
6
|
import { d as defineCustomElement$9 } from './p-C0ZWBE1t.js';
|
|
7
7
|
import { d as defineCustomElement$8 } from './p-CA6-0EkK.js';
|
|
8
|
-
import { d as defineCustomElement$7 } from './p-
|
|
8
|
+
import { d as defineCustomElement$7 } from './p-CfilaLs-.js';
|
|
9
9
|
import { d as defineCustomElement$6 } from './p-ZOW6vT-R.js';
|
|
10
|
-
import { d as defineCustomElement$5 } from './p-
|
|
10
|
+
import { d as defineCustomElement$5 } from './p-CR2m4pAn.js';
|
|
11
11
|
import { d as defineCustomElement$4 } from './p-CJPrTM14.js';
|
|
12
12
|
import { d as defineCustomElement$3 } from './p-D7OHNXA8.js';
|
|
13
13
|
import { d as defineCustomElement$1 } from './p-BuB74H5T.js';
|
|
@@ -225,6 +225,6 @@ function defineCustomElement() {
|
|
|
225
225
|
defineCustomElement();
|
|
226
226
|
|
|
227
227
|
export { TableFooter as T, defineCustomElement as d };
|
|
228
|
-
//# sourceMappingURL=p-
|
|
228
|
+
//# sourceMappingURL=p-BHO_MniQ.js.map
|
|
229
229
|
|
|
230
|
-
//# sourceMappingURL=p-
|
|
230
|
+
//# sourceMappingURL=p-BHO_MniQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-
|
|
1
|
+
{"file":"p-BHO_MniQ.js","mappings":";;;;;;;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,0oEAA0oE;;ACgB1qE,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,yBAAyB;IACzB,kBAAkB;IAClB,sDAAsD;IACtD,oDAAoD;IACpD,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A,CAAI;;AAG9D,QAAA,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC;;IAIvD,QAAQ,GAAA;QACP,IAAI,CAAC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/table/footer/table-footer.component.css?tag=p-table-footer&encapsulation=shadow","src/components/molecules/table/footer/table-footer.component.tsx"],"sourcesContent":[":host {\n\t@apply sticky;\n\t@apply z-[1];\n\n\t--tw-content: '';\n}\n","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\th,\n\tProp,\n\tElement,\n\tState,\n\tListen,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport {\n\tdefaultSize,\n\tdefaultSizeOptions,\n} from '../../../molecules/pagination/size/constants';\n\nconst footer = cva(\n\t[\n\t\t'justify-center relative',\n\t\t'w-full py-8 px-6',\n\t\t'after:absolute after:top-0 after:left-0 after:z-[0]',\n\t\t'after:w-full after:h-full after:transition-opacity',\n\t\t'after:bg-gradient-to-t after:from-white after:via-white/80 after:to-transparent',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tpinned: {\n\t\t\t\tfalse: 'after:opacity-0',\n\t\t\t\ttrue: 'after:opacity-100',\n\t\t\t},\n\t\t\thidden: {\n\t\t\t\tfalse: 'flex',\n\t\t\t\ttrue: 'hidden',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-table-footer',\n\tstyleUrl: 'table-footer.component.css',\n\tshadow: true,\n})\nexport class TableFooter {\n\t/**\n\t * Wether to enable pagination size select\n\t */\n\t@Prop() enablePaginationSize: boolean = true;\n\n\t/**\n\t * Wether to enable pagination pages\n\t */\n\t@Prop() enablePaginationPages: boolean = true;\n\n\t/**\n\t * Wether we want to show loading state\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * The current page\n\t */\n\t@Prop({ mutable: true, reflect: true }) page: number = 1;\n\n\t/**\n\t * The total amount of items\n\t */\n\t@Prop() total!: number;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageChange: EventEmitter<number>;\n\n\t/**\n\t * The amount of items per page\n\t */\n\t@Prop() pageSize: number = defaultSize;\n\n\t/**\n\t * The options for the page size\n\t */\n\t@Prop() pageSizeOptions: number[] = defaultSizeOptions;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageSizeChange: EventEmitter<number>;\n\n\t/**\n\t * Event whenever the footer is hidden or nog\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\thiddenChange: EventEmitter<boolean>;\n\n\t/**\n\t * Wether to hide when there is only 1 page available\n\t */\n\t@Prop() hideOnSinglePage: boolean = true;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _isPinned = false;\n\t@State() private _hasPaginationPages = true;\n\n\tprivate _hidePageSizeSelect = false;\n\tprivate _hidden = false;\n\n\tcomponentDidLoad() {\n\t\tthis._checkStuck();\n\t}\n\n\tcomponentWillRender() {\n\t\tthis._hidePageSizeSelect =\n\t\t\tthis.hideOnSinglePage && this.total <= this.pageSizeOptions?.[0];\n\n\t\tconst hidden =\n\t\t\t(this._hidePageSizeSelect && !this._hasPaginationPages) ||\n\t\t\t(!this.enablePaginationSize && !this.enablePaginationPages);\n\n\t\tif (hidden !== this._hidden) {\n\t\t\tthis._hidden = hidden;\n\t\t\tthis.hiddenChange.emit(hidden);\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass={footer({\n\t\t\t\t\tpinned: this._isPinned,\n\t\t\t\t\thidden: this._hidden,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{(this.enablePaginationPages || this.enablePaginationSize) &&\n\t\t\t\t\tthis.total > 0 && (\n\t\t\t\t\t\t<p-pagination\n\t\t\t\t\t\t\tclass='z-[2]'\n\t\t\t\t\t\t\tenablePaginationSize={this.enablePaginationSize}\n\t\t\t\t\t\t\tenablePaginationPages={this.enablePaginationPages}\n\t\t\t\t\t\t\tpageSize={this.pageSize}\n\t\t\t\t\t\t\tpageSizeOptions={this.pageSizeOptions}\n\t\t\t\t\t\t\tonPageSizeChange={({ detail }) => this._changePageSize(detail)}\n\t\t\t\t\t\t\tpage={this.page}\n\t\t\t\t\t\t\thideOnSinglePage={this.hideOnSinglePage}\n\t\t\t\t\t\t\tonPageChange={({ detail }) => this.pageChange.emit(detail)}\n\t\t\t\t\t\t\ttotal={this.total}\n\t\t\t\t\t\t\tonPagesChange={({ detail }) =>\n\t\t\t\t\t\t\t\t(this._hasPaginationPages = detail > 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _changePageSize(s?: number) {\n\t\tif (!s) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pageSize = s;\n\t\tthis.pageSizeChange.emit(this.pageSize);\n\t}\n\n\tprivate _checkStuck() {\n\t\tconst rect = this._el.getBoundingClientRect();\n\t\tconst modal = this._el.closest('p-modal');\n\t\tconst layout = document.querySelector('p-layout');\n\n\t\tif (modal) {\n\t\t\tconst modalBody = modal.shadowRoot.querySelector('p-modal-body');\n\t\t\tconst innerContent = modalBody.shadowRoot.querySelector('div');\n\n\t\t\tconst innerContentComputed = getComputedStyle(innerContent);\n\n\t\t\tconst modalPaddingBottom = parseInt(\n\t\t\t\tinnerContentComputed.paddingBottom,\n\t\t\t\t10\n\t\t\t);\n\t\t\tthis._el.style.bottom = `-${modalPaddingBottom}px`;\n\t\t\tthis._el.style.marginBottom = `-${modalPaddingBottom - 1}px`;\n\t\t}\n\n\t\tif (layout && !modal) {\n\t\t\tconst innerContent = layout.shadowRoot.querySelector('.content');\n\t\t\tconst innerContentComputed = getComputedStyle(innerContent);\n\n\t\t\tconst layoutPaddingBottom = parseInt(\n\t\t\t\tinnerContentComputed.paddingBottom,\n\t\t\t\t10\n\t\t\t);\n\t\t\tthis._el.style.bottom = `-${layoutPaddingBottom}px`;\n\t\t\tthis._el.style.marginBottom = `-${layoutPaddingBottom - 1}px`;\n\t\t}\n\n\t\tthis._isPinned = window.innerHeight - rect.bottom == 0;\n\t}\n\n\t@Listen('scroll', { target: 'window' })\n\tonScroll() {\n\t\tthis._checkStuck();\n\t}\n}\n"],"version":3}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, F as Fragment, d as Host } from './p-tdjn65Lz.js';
|
|
2
|
-
import { d as defineCustomElement$2, a as defaultSize, b as defaultSizeOptions } from './p-
|
|
2
|
+
import { d as defineCustomElement$2, a as defaultSize, b as defaultSizeOptions } from './p-DNAQlM-T.js';
|
|
3
3
|
import { c as cva } from './p-CBWjHURv.js';
|
|
4
|
-
import { d as defineCustomElement$a } from './p-
|
|
4
|
+
import { d as defineCustomElement$a } from './p-qXjT088h.js';
|
|
5
5
|
import { d as defineCustomElement$9 } from './p-C1Fsnz5F.js';
|
|
6
6
|
import { d as defineCustomElement$8 } from './p-C0ZWBE1t.js';
|
|
7
7
|
import { d as defineCustomElement$7 } from './p-CA6-0EkK.js';
|
|
8
|
-
import { d as defineCustomElement$6 } from './p-
|
|
8
|
+
import { d as defineCustomElement$6 } from './p-CfilaLs-.js';
|
|
9
9
|
import { d as defineCustomElement$5 } from './p-ZOW6vT-R.js';
|
|
10
10
|
import { d as defineCustomElement$4 } from './p-CJPrTM14.js';
|
|
11
11
|
import { d as defineCustomElement$3 } from './p-D7OHNXA8.js';
|
|
@@ -172,6 +172,6 @@ function defineCustomElement() {
|
|
|
172
172
|
defineCustomElement();
|
|
173
173
|
|
|
174
174
|
export { Pagination as P, defineCustomElement as d };
|
|
175
|
-
//# sourceMappingURL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,CAAC,EAAE;YACP;;AAGD,QAAA,IAAI,CAAC,QAAQ,GAAG,CAAC;QACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/molecules/pagination/pagination/pagination.component.css?tag=p-pagination","src/components/molecules/pagination/pagination/pagination.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tFragment,\n\th,\n\tHost,\n\tProp,\n\tState,\n} from '@stencil/core';\nimport { defaultSize, defaultSizeOptions } from '../size/constants';\nimport { cva } from 'class-variance-authority';\n\nconst pagination = cva(\n\t[\n\t\t'p-pagination',\n\t\t'items-center gap-2',\n\t\t'rounded-full',\n\t\t'bg-off-white-300 border border-off-white-700',\n\t\t'p-1',\n\t],\n\t{\n\t\tvariants: {\n\t\t\thidden: {\n\t\t\t\tfalse: 'flex',\n\t\t\t\ttrue: 'hidden',\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-pagination',\n\tstyleUrl: 'pagination.component.css',\n})\nexport class Pagination {\n\t/**\n\t * Wether to hide when there is only 1 page available\n\t */\n\t@Prop() hideOnSinglePage: boolean = true;\n\n\t/**\n\t * Wether to enable pagination size select\n\t */\n\t@Prop() enablePaginationSize: boolean = true;\n\n\t/**\n\t * Wether to enable pagination pages\n\t */\n\t@Prop() enablePaginationPages: boolean = true;\n\n\t/**\n\t * The current page\n\t */\n\t@Prop({ mutable: true, reflect: true }) page: number = 1;\n\n\t/**\n\t * The total amount of items\n\t */\n\t@Prop() total!: number;\n\n\t/**\n\t * The amount of items per page\n\t */\n\t@Prop() pageSize: number = defaultSize;\n\n\t/**\n\t * The options for the page size\n\t */\n\t@Prop() pageSizeOptions: number[] = defaultSizeOptions;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageChange: EventEmitter<number>;\n\n\t/**\n\t * Event whenever the page changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tpageSizeChange: EventEmitter<number>;\n\n\t/**\n\t * The pages that were generated\n\t */\n\t@Event({ bubbles: false }) pagesChange: EventEmitter<number>;\n\n\t@State() private _hasPaginationPages = true;\n\n\trender() {\n\t\tconst hidePageSizeSelect =\n\t\t\tthis.hideOnSinglePage && this.total <= this.pageSizeOptions?.[0];\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={pagination({\n\t\t\t\t\thidden:\n\t\t\t\t\t\t(hidePageSizeSelect && !this._hasPaginationPages) ||\n\t\t\t\t\t\t(!this.enablePaginationSize && !this.enablePaginationPages),\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{this.enablePaginationPages && this.enablePaginationSize && (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<p-pagination-size\n\t\t\t\t\t\t\thidden={hidePageSizeSelect}\n\t\t\t\t\t\t\tsize={this.pageSize}\n\t\t\t\t\t\t\tsizeOptions={this.pageSizeOptions}\n\t\t\t\t\t\t\tonSizeChange={({ detail }) => this._changePageSize(detail)}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{!hidePageSizeSelect &&\n\t\t\t\t\t\t\tthis.hideOnSinglePage &&\n\t\t\t\t\t\t\tthis._hasPaginationPages && (\n\t\t\t\t\t\t\t\t<p-divider\n\t\t\t\t\t\t\t\t\tvariant='vertical'\n\t\t\t\t\t\t\t\t\tclass='mx-0 h-4 text-human-beige-700'\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t</Fragment>\n\t\t\t\t)}\n\n\t\t\t\t{this.enablePaginationPages && (\n\t\t\t\t\t<p-pagination-pages\n\t\t\t\t\t\tpageSize={this.pageSize}\n\t\t\t\t\t\ttotal={this.total}\n\t\t\t\t\t\tpage={this.page}\n\t\t\t\t\t\thideOnSinglePage={this.hideOnSinglePage}\n\t\t\t\t\t\tonPageChange={({ detail }) => this.pageChange.emit(detail)}\n\t\t\t\t\t\tonPagesChange={({ detail }) => {\n\t\t\t\t\t\t\tthis._hasPaginationPages = detail > 1;\n\t\t\t\t\t\t\tthis.pagesChange.emit(detail);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _changePageSize(s?: number) {\n\t\tif (!s) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.pageSize = s;\n\t\tthis.pageSizeChange.emit(this.pageSize);\n\t}\n}\n"],"version":3}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './p-tdjn65Lz.js';
|
|
2
2
|
import { c as cva } from './p-CBWjHURv.js';
|
|
3
3
|
import { a as asBoolean } from './p-C5CTp9IA.js';
|
|
4
|
-
import { d as defineCustomElement$2 } from './p-
|
|
4
|
+
import { d as defineCustomElement$2 } from './p-qXjT088h.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './p-ZOW6vT-R.js';
|
|
6
6
|
|
|
7
7
|
const dropdownMenuItemComponentCss = "*{box-sizing:border-box}.block{display:block!important}.flex{display:flex!important}.h-8{height:2rem!important}.w-full{width:100%!important}.max-w-full{max-width:100%!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.items-center{align-items:center!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.whitespace-nowrap{white-space:nowrap!important}.rounded-lg{border-radius:.5rem!important}.bg-dark-teal-600{--tw-bg-opacity:1!important;background-color:rgb(0 72 64/var(--tw-bg-opacity,1))!important}.bg-negative-red-100{--tw-bg-opacity:1!important;background-color:rgb(255 221 221/var(--tw-bg-opacity,1))!important}.bg-negative-red-50{--tw-bg-opacity:1!important;background-color:rgb(253 237 237/var(--tw-bg-opacity,1))!important}.bg-supportive-lilac-100{--tw-bg-opacity:1!important;background-color:rgb(246 239 255/var(--tw-bg-opacity,1))!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.py-1{padding-bottom:.25rem!important;padding-top:.25rem!important}.text-start{text-align:start!important}.text-base{font-size:1rem!important;line-height:1.5rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.font-medium{font-weight:500!important}.text-black-teal{--tw-text-opacity:1!important;color:rgb(3 42 36/var(--tw-text-opacity,1))!important}.text-black-teal-100{--tw-text-opacity:1!important;color:rgb(205 212 211/var(--tw-text-opacity,1))!important}.text-black-teal-200{--tw-text-opacity:1!important;color:rgb(154 170 167/var(--tw-text-opacity,1))!important}.text-black-teal-300{--tw-text-opacity:1!important;color:rgb(104 127 124/var(--tw-text-opacity,1))!important}.text-dark-teal-100{--tw-text-opacity:1!important;color:rgb(204 220 218/var(--tw-text-opacity,1))!important}.text-negative-red{--tw-text-opacity:1!important;color:rgb(230 30 30/var(--tw-text-opacity,1))!important}.text-negative-red-100{--tw-text-opacity:1!important;color:rgb(255 221 221/var(--tw-text-opacity,1))!important}.text-negative-red-800{--tw-text-opacity:1!important;color:rgb(141 16 16/var(--tw-text-opacity,1))!important}.text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}.opacity-40{opacity:.4!important}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:85.375rem){.container{max-width:85.375rem}}@media (min-width:90rem){.container{max-width:90rem}}@media (min-width:96rem){.container{max-width:96rem}}@media (min-width:105rem){.container{max-width:105rem}}@media (min-width:120rem){.container{max-width:120rem}}@media (min-width:160rem){.container{max-width:160rem}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.hover\\:bg-dark-teal-500:hover{--tw-bg-opacity:1!important;background-color:rgb(0 81 72/var(--tw-bg-opacity,1))!important}.hover\\:bg-negative-red-50:hover{--tw-bg-opacity:1!important;background-color:rgb(253 237 237/var(--tw-bg-opacity,1))!important}.hover\\:bg-supportive-lilac-50:hover{--tw-bg-opacity:1!important;background-color:rgb(250 247 255/var(--tw-bg-opacity,1))!important}@keyframes wave{0%{transform:rotate(0deg)}to{transform:rotate(-15deg)}}.group:hover .group-hover\\:animate-wave{animation:wave .5s ease-in-out -.5s infinite alternate forwards!important}.group:hover .group-hover\\:text-black-teal{--tw-text-opacity:1!important;color:rgb(3 42 36/var(--tw-text-opacity,1))!important}.group:hover .group-hover\\:text-negative-red-800{--tw-text-opacity:1!important;color:rgb(141 16 16/var(--tw-text-opacity,1))!important}.group:hover .group-hover\\:text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity,1))!important}";
|
|
@@ -247,6 +247,6 @@ function defineCustomElement() {
|
|
|
247
247
|
defineCustomElement();
|
|
248
248
|
|
|
249
249
|
export { DropdownMenuItem as D, defineCustomElement as d };
|
|
250
|
-
//# sourceMappingURL=p-
|
|
250
|
+
//# sourceMappingURL=p-CfilaLs-.js.map
|
|
251
251
|
|
|
252
|
-
//# sourceMappingURL=p-
|
|
252
|
+
//# sourceMappingURL=p-CfilaLs-.js.map
|