@zanichelli/albe-web-components 16.4.0-rc-2 → 16.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cjs/{index-1bcf6013.js → index-22bdf239.js} +2 -2
- package/dist/cjs/index-22bdf239.js.map +1 -0
- package/dist/cjs/{index-59c3bcbe.js → index-6726b7d2.js} +2 -2
- package/dist/cjs/{index-59c3bcbe.js.map → index-6726b7d2.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +24 -3
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +4 -10
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -1
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/cjs/z-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/z-table.cjs.entry.js +2 -2
- package/dist/cjs/z-th.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +2 -2
- package/dist/collection/beans/index.js.map +1 -1
- package/dist/collection/components/css-components/z-fab/index.stories.js.map +1 -1
- package/dist/collection/components/css-components/z-link/index.stories.js.map +1 -1
- package/dist/collection/components/date-picker/utils.js.map +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.js.map +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.stories.js.map +1 -1
- package/dist/collection/components/date-picker/z-range-picker/index.js.map +1 -1
- package/dist/collection/components/date-picker/z-range-picker/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file/index.stories.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.stories.js.map +1 -1
- package/dist/collection/components/index.js.map +1 -1
- package/dist/collection/components/list/z-list/index.js.map +1 -1
- package/dist/collection/components/list/z-list/index.stories.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.stories.js.map +1 -1
- package/dist/collection/components/list/z-list-group/index.js.map +1 -1
- package/dist/collection/components/list/z-list-group/index.stories.js.map +1 -1
- package/dist/collection/components/table/cells/z-td/index.js.map +1 -1
- package/dist/collection/components/table/cells/z-th/index.js.map +1 -1
- package/dist/collection/components/table/cells/z-th/styles.css +1 -1
- package/dist/collection/components/table/z-table/index.js.map +1 -1
- package/dist/collection/components/table/z-table/index.stories.js.map +1 -1
- package/dist/collection/components/table/z-tbody/index.js.map +1 -1
- package/dist/collection/components/table/z-tfoot/index.js.map +1 -1
- package/dist/collection/components/table/z-thead/index.js.map +1 -1
- package/dist/collection/components/table/z-tr/index.js.map +1 -1
- package/dist/collection/components/z-accordion/index.js.map +1 -1
- package/dist/collection/components/z-accordion/index.stories.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/index.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/index.stories.js.map +1 -1
- package/dist/collection/components/z-app-header/index.js.map +1 -1
- package/dist/collection/components/z-app-header/index.stories.js.map +1 -1
- package/dist/collection/components/z-aria-alert/index.js.map +1 -1
- package/dist/collection/components/z-aria-alert/index.stories.js.map +1 -1
- package/dist/collection/components/z-avatar/index.js.map +1 -1
- package/dist/collection/components/z-avatar/index.stories.js.map +1 -1
- package/dist/collection/components/z-book-card/index.js.map +1 -1
- package/dist/collection/components/z-book-card/index.stories.js.map +1 -1
- package/dist/collection/components/z-breadcrumb/index.js.map +1 -1
- package/dist/collection/components/z-breadcrumb/index.stories.js.map +1 -1
- package/dist/collection/components/z-button/index.js.map +1 -1
- package/dist/collection/components/z-button/index.stories.js.map +1 -1
- package/dist/collection/components/z-button-sort/index.js.map +1 -1
- package/dist/collection/components/z-button-sort/index.stories.js.map +1 -1
- package/dist/collection/components/z-card/index.js.map +1 -1
- package/dist/collection/components/z-card/index.stories.js.map +1 -1
- package/dist/collection/components/z-carousel/index.js.map +1 -1
- package/dist/collection/components/z-carousel/index.stories.js.map +1 -1
- package/dist/collection/components/z-chip/index.js.map +1 -1
- package/dist/collection/components/z-chip/index.stories.js.map +1 -1
- package/dist/collection/components/z-combobox/index.js.map +1 -1
- package/dist/collection/components/z-combobox/index.stories.js.map +1 -1
- package/dist/collection/components/z-cover-hero/index.js.map +1 -1
- package/dist/collection/components/z-cover-hero/index.stories.js.map +1 -1
- package/dist/collection/components/z-divider/index.js.map +1 -1
- package/dist/collection/components/z-divider/index.stories.js.map +1 -1
- package/dist/collection/components/z-ghost-loading/index.js.map +1 -1
- package/dist/collection/components/z-ghost-loading/index.stories.js.map +1 -1
- package/dist/collection/components/z-icon/index.js.map +1 -1
- package/dist/collection/components/z-icon/index.stories.js.map +1 -1
- package/dist/collection/components/z-info-box/index.js.map +1 -1
- package/dist/collection/components/z-info-box/index.stories.js.map +1 -1
- package/dist/collection/components/z-info-reveal/index.js.map +1 -1
- package/dist/collection/components/z-info-reveal/index.stories.js.map +1 -1
- package/dist/collection/components/z-input/index.js.map +1 -1
- package/dist/collection/components/z-input/index.stories.js.map +1 -1
- package/dist/collection/components/z-input-message/index.js.map +1 -1
- package/dist/collection/components/z-input-message/index.stories.js.map +1 -1
- package/dist/collection/components/z-logo/index.js.map +1 -1
- package/dist/collection/components/z-logo/index.stories.js.map +1 -1
- package/dist/collection/components/z-menu/index.js.map +1 -1
- package/dist/collection/components/z-menu/index.stories.js.map +1 -1
- package/dist/collection/components/z-menu/styles.css +1 -0
- package/dist/collection/components/z-menu-section/index.js.map +1 -1
- package/dist/collection/components/z-menu-section/index.stories.js.map +1 -1
- package/dist/collection/components/z-modal/index.js +4 -10
- package/dist/collection/components/z-modal/index.js.map +1 -1
- package/dist/collection/components/z-modal/index.stories.js.map +1 -1
- package/dist/collection/components/z-navigation-tabs/index.js.map +1 -1
- package/dist/collection/components/z-navigation-tabs/index.stories.js.map +1 -1
- package/dist/collection/components/z-notification/index.js.map +1 -1
- package/dist/collection/components/z-notification/index.stories.js.map +1 -1
- package/dist/collection/components/z-offcanvas/index.js +27 -3
- package/dist/collection/components/z-offcanvas/index.js.map +1 -1
- package/dist/collection/components/z-offcanvas/index.stories.js +12 -46
- package/dist/collection/components/z-offcanvas/index.stories.js.map +1 -1
- package/dist/collection/components/z-offcanvas/styles.css +10 -15
- package/dist/collection/components/z-pagination/index.js.map +1 -1
- package/dist/collection/components/z-pagination/index.stories.js.map +1 -1
- package/dist/collection/components/z-panel-elem/index.js.map +1 -1
- package/dist/collection/components/z-panel-elem/index.stories.js.map +1 -1
- package/dist/collection/components/z-popover/index.js.map +1 -1
- package/dist/collection/components/z-popover/index.stories.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.stories.js.map +1 -1
- package/dist/collection/components/z-section-title/index.js.map +1 -1
- package/dist/collection/components/z-section-title/index.stories.js.map +1 -1
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-select/index.stories.js.map +1 -1
- package/dist/collection/components/z-skip-to-content/index.js.map +1 -1
- package/dist/collection/components/z-skip-to-content/index.stories.js.map +1 -1
- package/dist/collection/components/z-stepper/index.js.map +1 -1
- package/dist/collection/components/z-stepper/index.stories.js.map +1 -1
- package/dist/collection/components/z-stepper-item/index.js.map +1 -1
- package/dist/collection/components/z-stepper-item/index.stories.js.map +1 -1
- package/dist/collection/components/z-tag/index.js.map +1 -1
- package/dist/collection/components/z-tag/index.stories.js.map +1 -1
- package/dist/collection/components/z-toast-notification/index.js.map +1 -1
- package/dist/collection/components/z-toast-notification/index.stories.js.map +1 -1
- package/dist/collection/components/z-toast-notification-list/index.js.map +1 -1
- package/dist/collection/components/z-toast-notification-list/index.stories.js.map +1 -1
- package/dist/collection/components/z-toggle-button/index.js.map +1 -1
- package/dist/collection/components/z-toggle-button/index.stories.js.map +1 -1
- package/dist/collection/components/z-toggle-switch/index.js.map +1 -1
- package/dist/collection/components/z-toggle-switch/index.stories.js.map +1 -1
- package/dist/collection/components/z-tooltip/index.js.map +1 -1
- package/dist/collection/components/z-tooltip/index.stories.js.map +1 -1
- package/dist/collection/components/z-visually-hidden/index.js.map +1 -1
- package/dist/collection/components/z-visually-hidden/index.stories.js.map +1 -1
- package/dist/collection/constants/breakpoints.js.map +1 -1
- package/dist/collection/constants/icons.js.map +1 -1
- package/dist/collection/constants/iconset.js +12 -0
- package/dist/collection/constants/iconset.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-slideshow/index.js.map +1 -1
- package/dist/collection/utils/storybook-utils.js.map +1 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/iconset.js +12 -0
- package/dist/components/iconset.js.map +1 -1
- package/dist/components/index15.js +4 -10
- package/dist/components/index15.js.map +1 -1
- package/dist/components/index21.js +13 -4
- package/dist/components/index21.js.map +1 -1
- package/dist/components/z-menu.js +1 -1
- package/dist/components/z-menu.js.map +1 -1
- package/dist/components/z-th.js +1 -1
- package/dist/components/z-th.js.map +1 -1
- package/dist/docs/grid/index.stories.js +54 -0
- package/dist/docs/grid/index.stories.js.map +1 -0
- package/dist/docs/iconset/index.stories.js +32 -0
- package/dist/docs/iconset/index.stories.js.map +1 -0
- package/dist/docs/themes/index.stories.js +90 -0
- package/dist/docs/themes/index.stories.js.map +1 -0
- package/dist/docs/typography/index.stories.js +186 -0
- package/dist/docs/typography/index.stories.js.map +1 -0
- package/dist/esm/{index-fcf764b5.js → index-681cc2b7.js} +2 -2
- package/dist/esm/index-681cc2b7.js.map +1 -0
- package/dist/esm/{index-2b5c2515.js → index-7b64c875.js} +2 -2
- package/dist/esm/{index-2b5c2515.js.map → index-7b64c875.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +24 -3
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js +4 -10
- package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -1
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-menu.entry.js.map +1 -1
- package/dist/esm/z-table.entry.js +2 -2
- package/dist/esm/z-th.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +2 -2
- package/dist/types/components/z-modal/index.d.ts +0 -1
- package/dist/types/components/z-offcanvas/index.d.ts +5 -0
- package/dist/types/components/z-offcanvas/index.stories.d.ts +4 -6
- package/dist/types/components.d.ts +2 -2
- package/dist/types/constants/iconset.d.ts +24 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/grid/index.stories.d.ts +9 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/iconset/index.stories.d.ts +11 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/themes/index.stories.d.ts +27 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/typography/index.stories.d.ts +96 -0
- package/dist/web-components-library/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
- package/dist/web-components-library/p-11df2c0a.entry.js +2 -0
- package/dist/web-components-library/p-11df2c0a.entry.js.map +1 -0
- package/dist/web-components-library/{p-cce46031.js → p-13366542.js} +2 -2
- package/dist/web-components-library/p-456f984f.js +2 -0
- package/dist/web-components-library/p-456f984f.js.map +1 -0
- package/dist/web-components-library/p-6b791915.entry.js +2 -0
- package/dist/web-components-library/p-8d443cac.entry.js +2 -0
- package/dist/web-components-library/p-b20bfb34.entry.js +2 -0
- package/dist/web-components-library/p-b20bfb34.entry.js.map +1 -0
- package/dist/web-components-library/p-ceb4403d.entry.js +2 -0
- package/dist/web-components-library/p-ceb4403d.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.css +529 -28
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/www/build/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
- package/www/build/p-11df2c0a.entry.js +2 -0
- package/www/build/p-11df2c0a.entry.js.map +1 -0
- package/www/build/{p-cce46031.js → p-13366542.js} +2 -2
- package/www/build/p-1fcf4111.js +2 -0
- package/www/build/p-456f984f.js +2 -0
- package/www/build/p-456f984f.js.map +1 -0
- package/www/build/p-6b791915.entry.js +2 -0
- package/www/build/p-8d443cac.entry.js +2 -0
- package/www/build/p-b20bfb34.entry.js +2 -0
- package/www/build/p-b20bfb34.entry.js.map +1 -0
- package/www/build/p-ceb4403d.entry.js +2 -0
- package/www/build/p-ceb4403d.entry.js.map +1 -0
- package/www/build/{p-ae0a33a2.css → p-d9dbe303.css} +529 -28
- package/www/build/web-components-library.css +529 -28
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/index-1bcf6013.js.map +0 -1
- package/dist/esm/index-fcf764b5.js.map +0 -1
- package/dist/web-components-library/p-0c813477.entry.js +0 -2
- package/dist/web-components-library/p-0c813477.entry.js.map +0 -1
- package/dist/web-components-library/p-26ac8973.entry.js +0 -2
- package/dist/web-components-library/p-26ac8973.entry.js.map +0 -1
- package/dist/web-components-library/p-47bf778e.js +0 -2
- package/dist/web-components-library/p-47bf778e.js.map +0 -1
- package/dist/web-components-library/p-67896876.entry.js +0 -2
- package/dist/web-components-library/p-822a2097.entry.js +0 -2
- package/dist/web-components-library/p-b72a4b5e.entry.js +0 -2
- package/dist/web-components-library/p-b72a4b5e.entry.js.map +0 -1
- package/www/build/p-0c813477.entry.js +0 -2
- package/www/build/p-0c813477.entry.js.map +0 -1
- package/www/build/p-26ac8973.entry.js +0 -2
- package/www/build/p-26ac8973.entry.js.map +0 -1
- package/www/build/p-47bf778e.js +0 -2
- package/www/build/p-47bf778e.js.map +0 -1
- package/www/build/p-67896876.entry.js +0 -2
- package/www/build/p-822a2097.entry.js +0 -2
- package/www/build/p-88640e60.js +0 -2
- package/www/build/p-b72a4b5e.entry.js +0 -2
- package/www/build/p-b72a4b5e.entry.js.map +0 -1
- /package/dist/web-components-library/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cce46031.js.map → p-13366542.js.map} +0 -0
- /package/dist/web-components-library/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
- /package/www/build/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
- /package/www/build/{p-cce46031.js.map → p-13366542.js.map} +0 -0
- /package/www/build/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
- /package/www/build/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/list/z-list/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SACjC;QACD,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SACjC;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ,CAAC,MAAM;QACrB,QAAQ,EAAE,QAAQ,CAAC,IAAI;KACxB;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;kBAEN,IAAI,CAAC,QAAQ;aAClB,IAAI,CAAC,IAAI;;;oBAGF,IAAI,CAAC,QAA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AAI,CAAA;;;;;;cAMM;CACG,CAAC;AAElB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,GAAG,EAAE,CACX,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;cAqBM;CACG,CAAC;AAElB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;SAC9B;KACF;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ,CAAC,SAAS;KAC7B;CACc,CAAC;AAElB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;SAC9B;KACF;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,QAAQ,CAAC,OAAO;KAC3B;CACc,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {ZList} from \".\";\nimport {ListSize, ListType} from \"../../../beans\";\nimport \"../z-list-element/index\";\nimport \"../z-list-group/index\";\nimport \"./index\";\n\nconst StoryMeta = {\n title: \"ZList/ZList\",\n component: \"z-list\",\n argTypes: {\n size: {\n control: {\n type: \"select\",\n },\n options: Object.values(ListSize),\n },\n listType: {\n control: {\n type: \"select\",\n },\n options: Object.values(ListType),\n },\n },\n args: {\n size: ListSize.MEDIUM,\n listType: ListType.NONE,\n },\n render: (args) => html`\n <z-list\n .listType=${args.listType}\n size=${args.size}\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 1</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 2</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 3</z-list-element\n >\n </z-list>\n `,\n} satisfies Meta<ZList>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZList>;\n\nexport const Default = {} satisfies Story;\n\nexport const HeaderDivider = {\n render: (args) =>\n html`<z-list>\n <z-list-group divider-type=\"header\">\n <div slot=\"header-title\">Gruppo 1</div>\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 1</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 2</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 3</z-list-element\n >\n </z-list-group>\n <z-list-group divider-type=\"header\">\n <div slot=\"header-title\">Gruppo 2</div>\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 1</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 2</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 3</z-list-element\n >\n </z-list-group>\n </z-list>`,\n} satisfies Story;\n\nexport const ElementDivider = {\n render: (args) =>\n html`<z-list>\n <z-list-group divider-type=\"element\">\n <div slot=\"header-title\">Gruppo 1</div>\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 1</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 2</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 3</z-list-element\n >\n </z-list-group>\n <z-list-group divider-type=\"element\">\n <div slot=\"header-title\">Gruppo 2</div>\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 1</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 2</z-list-element\n >\n <z-list-element\n .listType=${args.listType}\n size=${args.size}\n >Elemento 3</z-list-element\n >\n </z-list-group>\n </z-list>`,\n} satisfies Story;\n\nexport const ClickableElements = {\n render: () =>\n html`<z-list>\n <z-list-group>\n <z-list-element clickable>Elemento 1</z-list-element>\n <z-list-element clickable>Elemento 2</z-list-element>\n <z-list-element clickable>Elemento 3</z-list-element>\n </z-list-group>\n </z-list>`,\n} satisfies Story;\n\nexport const ExpandableElements = {\n render: () =>\n html`<z-list size=\"large\">\n <z-list-group divider-type=\"element\">\n <z-list-element\n expandable\n align-button=\"left\"\n expandable-style=\"accordion\"\n ><span>Elemento 1</span><span slot=\"inner-content\">INNER CONTENT 1 BUTTON LEFT</span></z-list-element\n >\n <z-list-element\n expandable\n align-button=\"right\"\n expandable-style=\"menu\"\n ><span>Elemento 2</span><span slot=\"inner-content\">INNER CONTENT 2</span></z-list-element\n >\n <z-list-element\n expandable\n align-button=\"right\"\n expandable-style=\"menu\"\n ><span>Elemento 3</span><span slot=\"inner-content\">INNER CONTENT 3</span></z-list-element\n >\n </z-list-group>\n </z-list>`,\n} satisfies Story;\n\nexport const UnorderedIndex = {\n parameters: {\n controls: {\n exclude: [\"size\", \"listType\"],\n },\n },\n args: {\n listType: ListType.UNORDERED,\n },\n} satisfies Story;\n\nexport const OrderedIndex = {\n parameters: {\n controls: {\n exclude: [\"size\", \"listType\"],\n },\n },\n args: {\n listType: ListType.ORDERED,\n },\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/list/z-list-element/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACpG,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAOxB,MAAM,OAAO,YAAY;IA+BvB,sBAAsB,CAAC,CAAc;QACnC,IAAI,IAAI,CAAC,aAAa,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,MAAM,EAAE,C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zB;YACL,IAAI,CAAC,WAAW,KAAK,eAAe,CAAC,OAAO,IAAI,CAC/C,kEACE,KAAK,EAAE,IAAI,CAAC,YAAY,EACxB,IAAI,EAAE,IAAI,CAAC,WAAW,GACtB,CACH,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Listen, Prop, State} from \"@stencil/core\";\nimport {\n DividerSize,\n ExpandableListButtonAlign,\n ExpandableListStyle,\n KeyboardCode,\n ListDividerType,\n ListSize,\n ListType,\n} from \"../../../beans\";\n\n@Component({\n tag: \"z-list-element\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZListElement {\n @Element() host: HTMLZListElementElement;\n\n /** remove filter click event, returns filterid */\n @Event({\n eventName: \"accessibleFocus\",\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n accessibleFocus: EventEmitter<number>;\n\n /** set parent aria-activedescendant on focus event, returns filterid */\n @Event({\n eventName: \"ariaDescendantFocus\",\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n ariaDescendantFocus: EventEmitter<number>;\n\n /** remove filter click event, returns filterid */\n @Event({\n eventName: \"clickItem\",\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n clickItem: EventEmitter;\n\n @Listen(\"accessibleFocus\", {target: \"document\"})\n accessibleFocusHandler(e: CustomEvent): void {\n if (this.listElementId === e.detail) {\n const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);\n toFocus.focus();\n }\n }\n\n /**\n * [optional] Align expandable button left or right.\n */\n @Prop({reflect: true})\n alignButton?: ExpandableListButtonAlign = ExpandableListButtonAlign.LEFT;\n\n /**\n * [optional] Sets element clickable.\n */\n @Prop({reflect: true})\n clickable?: boolean = false;\n\n /**\n * [optional] Sets the divider color.\n */\n @Prop()\n dividerColor?: string = \"color-surface03\";\n\n /**\n * [optional] Sets the position where to insert the divider.\n */\n @Prop()\n dividerType?: ListDividerType = ListDividerType.NONE;\n\n /**\n * [optional] Sets the divider size.\n */\n @Prop()\n dividerSize?: DividerSize = DividerSize.SMALL;\n\n /**\n * [optional] Sets element as expandable.\n */\n @Prop({reflect: true})\n expandable?: boolean = false;\n\n /**\n * [optional] Sets expandable style to element.\n */\n @Prop()\n expandableStyle?: ExpandableListStyle = ExpandableListStyle.ACCORDION;\n\n /**\n * [optional] List element id.\n */\n @Prop({reflect: true})\n listElementId?: number;\n\n /**\n * [optional] Sets size of inside elements.\n */\n @Prop({reflect: true})\n size?: ListSize = ListSize.MEDIUM;\n\n /**\n * [optional] Sets text color of the element.\n */\n @Prop({reflect: true})\n color?: string = \"none\";\n\n /**\n * [optional] Sets disabled style of the element.\n */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /**\n * [optional] position of the list element inside the list or the group\n */\n @Prop({reflect: true})\n listElementPosition?: string = \"0\";\n\n /**\n * [optional] type of the list marker for each element\n */\n @Prop({reflect: true})\n listType?: ListType = ListType.NONE;\n\n /**\n * Sets element role.\n */\n @Prop({reflect: true})\n role = \"listitem\";\n\n /** set tabindex to Host tag (optional). Defaults to 0. */\n @Prop()\n htmlTabindex?: number | null = 0;\n\n @State()\n showInnerContent = false;\n\n private openElementConfig = {\n accordion: {\n open: \"minus-circled\",\n close: \"plus-circled\",\n },\n menu: {\n open: \"chevron-up\",\n close: \"chevron-down\",\n },\n };\n\n /**\n * Constructor.\n */\n constructor() {\n this.handleClick = this.handleClick.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n }\n\n /**\n * Handler for click on element. If element is expandable, change state.\n * @returns void\n */\n private handleClick(): void {\n this.clickItem.emit(this.listElementId);\n if (!this.expandable) {\n return;\n }\n this.showInnerContent = !this.showInnerContent;\n }\n\n private handleKeyDown(event): void {\n const expandByKey = event.code === KeyboardCode.ENTER;\n switch (event.code) {\n case KeyboardCode.ARROW_DOWN:\n event.preventDefault();\n this.accessibleFocus.emit(this.listElementId + 1);\n break;\n case KeyboardCode.ARROW_UP:\n event.preventDefault();\n this.accessibleFocus.emit(this.listElementId - 1);\n break;\n case KeyboardCode.ENTER:\n event.preventDefault();\n this.clickItem.emit(this.listElementId);\n break;\n default:\n break;\n }\n\n if (!this.expandable || !expandByKey) {\n return;\n }\n this.showInnerContent = !this.showInnerContent;\n }\n\n /**\n * Renders button to expand element.\n * @returns expadable button\n */\n private renderExpandableButton(): HTMLZIconElement {\n if (!this.expandable) {\n return null;\n }\n\n return (\n <z-icon\n name={\n this.showInnerContent\n ? this.openElementConfig[this.expandableStyle].open\n : this.openElementConfig[this.expandableStyle].close\n }\n />\n );\n }\n\n /**\n * Renders expanded content if element is expandable.\n * @returns expanded content\n */\n private renderExpandedContent(): HTMLDivElement {\n if (!this.expandable) {\n return null;\n }\n\n return (\n <div\n class={{\n \"z-list-element-inner-container\": true,\n \"expanded\": this.showInnerContent,\n }}\n >\n <slot name=\"inner-content\" />\n </div>\n );\n }\n\n /**\n * Renders content of the z-list-element\n * @returns list content\n */\n private renderContent(): HTMLDivElement {\n if (this.listType === ListType.NONE) {\n return <slot />;\n }\n\n if (this.listType === ListType.ORDERED) {\n return (\n <div class=\"z-list-content-container\">\n <div>{this.listElementPosition}. </div>\n <slot />\n </div>\n );\n }\n\n if (this.listType === ListType.UNORDERED) {\n return (\n <div class=\"z-list-content-container\">\n <span>• </span>\n <slot />\n </div>\n );\n }\n }\n\n render(): HTMLZListElementElement {\n return (\n <Host\n aria-expanded={this.expandable ? this.showInnerContent : null}\n onClick={this.handleClick}\n onFocus={() => this.ariaDescendantFocus.emit(this.listElementId)}\n onKeyDown={this.handleKeyDown}\n clickable={this.clickable && !this.disabled}\n tabIndex={this.htmlTabindex}\n >\n <div\n class=\"container\"\n style={{color: `var(--${this.color})`}}\n tabindex=\"-1\"\n id={`z-list-element-id-${this.listElementId}`}\n part=\"list-item-container\"\n >\n <div class=\"z-list-element-container\">\n {this.renderExpandableButton()}\n {this.renderContent()}\n </div>\n {this.renderExpandedContent()}\n </div>\n {this.dividerType === ListDividerType.ELEMENT && (\n <z-divider\n color={this.dividerColor}\n size={this.dividerSize}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/list/z-list-element/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACpG,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAOxB,MAAM,OAAO,YAAY;IA+BvB,sBAAsB,CAAC,CAAc;QACnC,IAAI,IAAI,CAAC,aAAa,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;YACrF,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAwGD;;OAEG;IACH;QAdQ,sBAAiB,GAAG;YAC1B,SAAS,EAAE;gBACT,IAAI,EAAE,eAAe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ACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Listen, Prop, State} from \"@stencil/core\";\nimport {\n DividerSize,\n ExpandableListButtonAlign,\n ExpandableListStyle,\n KeyboardCode,\n ListDividerType,\n ListSize,\n ListType,\n} from \"../../../beans\";\n\n@Component({\n tag: \"z-list-element\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZListElement {\n @Element() host: HTMLZListElementElement;\n\n /** remove filter click event, returns filterid */\n @Event({\n eventName: \"accessibleFocus\",\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n accessibleFocus: EventEmitter<number>;\n\n /** set parent aria-activedescendant on focus event, returns filterid */\n @Event({\n eventName: \"ariaDescendantFocus\",\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n ariaDescendantFocus: EventEmitter<number>;\n\n /** remove filter click event, returns filterid */\n @Event({\n eventName: \"clickItem\",\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n clickItem: EventEmitter;\n\n @Listen(\"accessibleFocus\", {target: \"document\"})\n accessibleFocusHandler(e: CustomEvent): void {\n if (this.listElementId === e.detail) {\n const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);\n toFocus.focus();\n }\n }\n\n /**\n * [optional] Align expandable button left or right.\n */\n @Prop({reflect: true})\n alignButton?: ExpandableListButtonAlign = ExpandableListButtonAlign.LEFT;\n\n /**\n * [optional] Sets element clickable.\n */\n @Prop({reflect: true})\n clickable?: boolean = false;\n\n /**\n * [optional] Sets the divider color.\n */\n @Prop()\n dividerColor?: string = \"color-surface03\";\n\n /**\n * [optional] Sets the position where to insert the divider.\n */\n @Prop()\n dividerType?: ListDividerType = ListDividerType.NONE;\n\n /**\n * [optional] Sets the divider size.\n */\n @Prop()\n dividerSize?: DividerSize = DividerSize.SMALL;\n\n /**\n * [optional] Sets element as expandable.\n */\n @Prop({reflect: true})\n expandable?: boolean = false;\n\n /**\n * [optional] Sets expandable style to element.\n */\n @Prop()\n expandableStyle?: ExpandableListStyle = ExpandableListStyle.ACCORDION;\n\n /**\n * [optional] List element id.\n */\n @Prop({reflect: true})\n listElementId?: number;\n\n /**\n * [optional] Sets size of inside elements.\n */\n @Prop({reflect: true})\n size?: ListSize = ListSize.MEDIUM;\n\n /**\n * [optional] Sets text color of the element.\n */\n @Prop({reflect: true})\n color?: string = \"none\";\n\n /**\n * [optional] Sets disabled style of the element.\n */\n @Prop({reflect: true})\n disabled?: boolean = false;\n\n /**\n * [optional] position of the list element inside the list or the group\n */\n @Prop({reflect: true})\n listElementPosition?: string = \"0\";\n\n /**\n * [optional] type of the list marker for each element\n */\n @Prop({reflect: true})\n listType?: ListType = ListType.NONE;\n\n /**\n * Sets element role.\n */\n @Prop({reflect: true})\n role = \"listitem\";\n\n /** set tabindex to Host tag (optional). Defaults to 0. */\n @Prop()\n htmlTabindex?: number | null = 0;\n\n @State()\n showInnerContent = false;\n\n private openElementConfig = {\n accordion: {\n open: \"minus-circled\",\n close: \"plus-circled\",\n },\n menu: {\n open: \"chevron-up\",\n close: \"chevron-down\",\n },\n };\n\n /**\n * Constructor.\n */\n constructor() {\n this.handleClick = this.handleClick.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n }\n\n /**\n * Handler for click on element. If element is expandable, change state.\n * @returns void\n */\n private handleClick(): void {\n this.clickItem.emit(this.listElementId);\n if (!this.expandable) {\n return;\n }\n this.showInnerContent = !this.showInnerContent;\n }\n\n private handleKeyDown(event): void {\n const expandByKey = event.code === KeyboardCode.ENTER;\n switch (event.code) {\n case KeyboardCode.ARROW_DOWN:\n event.preventDefault();\n this.accessibleFocus.emit(this.listElementId + 1);\n break;\n case KeyboardCode.ARROW_UP:\n event.preventDefault();\n this.accessibleFocus.emit(this.listElementId - 1);\n break;\n case KeyboardCode.ENTER:\n event.preventDefault();\n this.clickItem.emit(this.listElementId);\n break;\n default:\n break;\n }\n\n if (!this.expandable || !expandByKey) {\n return;\n }\n this.showInnerContent = !this.showInnerContent;\n }\n\n /**\n * Renders button to expand element.\n * @returns expadable button\n */\n private renderExpandableButton(): HTMLZIconElement {\n if (!this.expandable) {\n return null;\n }\n\n return (\n <z-icon\n name={\n this.showInnerContent\n ? this.openElementConfig[this.expandableStyle].open\n : this.openElementConfig[this.expandableStyle].close\n }\n />\n );\n }\n\n /**\n * Renders expanded content if element is expandable.\n * @returns expanded content\n */\n private renderExpandedContent(): HTMLDivElement {\n if (!this.expandable) {\n return null;\n }\n\n return (\n <div\n class={{\n \"z-list-element-inner-container\": true,\n \"expanded\": this.showInnerContent,\n }}\n >\n <slot name=\"inner-content\" />\n </div>\n );\n }\n\n /**\n * Renders content of the z-list-element\n * @returns list content\n */\n private renderContent(): HTMLDivElement {\n if (this.listType === ListType.NONE) {\n return <slot />;\n }\n\n if (this.listType === ListType.ORDERED) {\n return (\n <div class=\"z-list-content-container\">\n <div>{this.listElementPosition}. </div>\n <slot />\n </div>\n );\n }\n\n if (this.listType === ListType.UNORDERED) {\n return (\n <div class=\"z-list-content-container\">\n <span>• </span>\n <slot />\n </div>\n );\n }\n }\n\n render(): HTMLZListElementElement {\n return (\n <Host\n aria-expanded={this.expandable ? this.showInnerContent : null}\n onClick={this.handleClick}\n onFocus={() => this.ariaDescendantFocus.emit(this.listElementId)}\n onKeyDown={this.handleKeyDown}\n clickable={this.clickable && !this.disabled}\n tabIndex={this.htmlTabindex}\n >\n <div\n class=\"container\"\n style={{color: `var(--${this.color})`}}\n tabindex=\"-1\"\n id={`z-list-element-id-${this.listElementId}`}\n part=\"list-item-container\"\n >\n <div class=\"z-list-element-container\">\n {this.renderExpandableButton()}\n {this.renderContent()}\n </div>\n {this.renderExpandedContent()}\n </div>\n {this.dividerType === ListDividerType.ELEMENT && (\n <z-divider\n color={this.dividerColor}\n size={this.dividerSize}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/list/z-list-element/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACR,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,cAAc,EAAC,MAAM,gCAAgC,CAAC;AAC9D,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,gBAAgB;IAC3B,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC;SAClD;QACD,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SAClE;QACD,WAAW,EAAE;YACX,O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B;CAC2B,CAAC;AAE/B,eAAe,SAAS,CAAC;AAEzB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;uBAEe,IAAI,CAAC,WAAW;oBACnB,IAAI,CAAC,SAAS;wBACV,IAAI,CAAC,YAAY;uBAClB,IAAI,CAAC,WAAW;uBAChB,IAAI,CAAC,WAAW;qBAClB,IAAI,CAAC,UAAU;2BACT,IAAI,CAAC,eAAe;0BACrB,IAAI,CAAC,aAAa;eAC7B,IAAI,CAAC,IAAI;gBACR,IAAI,CAAC,KAAK;mBACP,IAAI,CAAC,QAAQ;gCACA,IAAI,CAAC,mBAAmB;oBACpC,IAAI,CAAC,QAAQ;;;;uBAIV,IAAI,CAAC,WAAW;oBACnB,IAAI,CAAC,SAAS;wBACV,IAAI,CAAC,YAAY;uBAClB,IAAI,CAAC,WAAW;uBAChB,IAAI,CAAC,WAAW;qBAClB,IAAI,CAAC,UAAU;2BACT,IAAI,CAAC,eAAe;0BACrB,IAAI,CAAC,aAAa;eAC7B,IAAI,CAAC,IAAI;gBACR,IAAI,CAAC,KAAK;mBACP,IAAI,CAAC,QAAQ;gCACA,IAAI,CAAC,mBAAmB;oBACpC,IAAI,CAAC,QAAQ;;;;uBAIV,IAAI,CAAC,WAAW;oBACnB,IAAI,CAAC,SAAS;wBACV,IAAI,CAAC,YAAY;uBAClB,IAAI,CAAC,WAAW;uBAChB,IAAI,CAAC,WAAW;qBAClB,IAAI,CAAC,UAAU;2BACT,IAAI,CAAC,eAAe;0BACrB,IAAI,CAAC,aAAa;eAC7B,IAAI,CAAC,IAAI;gBACR,IAAI,CAAC,KAAK;mBACP,IAAI,CAAC,QAAQ;gCACA,IAAI,CAAC,mBAAmB;oBACpC,IAAI,CAAC,QAAQ;;;cAGnB;CACoB,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {ZListElement} from \".\";\nimport {\n DividerSize,\n ExpandableListButtonAlign,\n ExpandableListStyle,\n ListDividerType,\n ListSize,\n ListType,\n} from \"../../../beans\";\nimport {getColorTokens} from \"../../../utils/storybook-utils\";\nimport \"../z-list/index\";\nimport \"./index\";\n\nconst StoryMeta = {\n title: \"ZList/ZListElement\",\n component: \"z-list-element\",\n argTypes: {\n alignButton: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ExpandableListButtonAlign),\n },\n dividerColor: {\n control: {\n type: \"select\",\n },\n options: getColorTokens().map((token) => token.replace(\"--\", \"\")),\n },\n dividerType: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ListDividerType),\n },\n dividerSize: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(DividerSize),\n },\n expandableStyle: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ExpandableListStyle),\n },\n size: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ListSize),\n },\n color: {\n control: {\n type: \"select\",\n },\n options: getColorTokens().map((token) => token.replace(\"--\", \"\")),\n },\n listType: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ListType),\n },\n },\n args: {\n alignButton: ExpandableListButtonAlign.LEFT,\n clickable: false,\n dividerColor: \"color-surface03\",\n dividerType: ListDividerType.NONE,\n dividerSize: DividerSize.SMALL,\n expandable: false,\n expandableStyle: ExpandableListStyle.ACCORDION,\n listElementId: 0,\n size: ListSize.MEDIUM,\n color: \"color-default-text\",\n disabled: true,\n listElementPosition: \"0\",\n listType: ListType.NONE,\n },\n} satisfies Meta<ZListElement>;\n\nexport default StoryMeta;\n\nexport const Default = {\n render: (args) =>\n html`<z-list>\n <z-list-element\n align-button=${args.alignButton}\n clickable=${args.clickable}\n divider-color=${args.dividerColor}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n expandable=${args.expandable}\n expandable-style=${args.expandableStyle}\n list-element-id=${args.listElementId}\n size=${args.size}\n color=${args.color}\n disabled=${args.disabled}\n list-element-position=${args.listElementPosition}\n list-type=${args.listType}\n ><span>Elemento 1</span><span slot=\"inner-content\">Inner content</span></z-list-element\n >\n <z-list-element\n align-button=${args.alignButton}\n clickable=${args.clickable}\n divider-color=${args.dividerColor}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n expandable=${args.expandable}\n expandable-style=${args.expandableStyle}\n list-element-id=${args.listElementId}\n size=${args.size}\n color=${args.color}\n disabled=${args.disabled}\n list-element-position=${args.listElementPosition}\n list-type=${args.listType}\n >Elemento 2</z-list-element\n >\n <z-list-element\n align-button=${args.alignButton}\n clickable=${args.clickable}\n divider-color=${args.dividerColor}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n expandable=${args.expandable}\n expandable-style=${args.expandableStyle}\n list-element-id=${args.listElementId}\n size=${args.size}\n color=${args.color}\n disabled=${args.disabled}\n list-element-position=${args.listElementPosition}\n list-type=${args.listType}\n >Elemento 3</z-list-element\n >\n </z-list>`,\n} satisfies StoryObj<ZListElement>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/list/z-list-group/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAOhF,MAAM,OAAO,UAAU;;oBAOH,QAAQ,CAAC,MAAM;2BAMD,eAAe,CAAC,IAAI;2BAMxB,WAAW,CAAC,KAAK;4BAMrB,SAAS;wBAMX,QAAQ,CAAC,IAAI;;IAInC,gBAAgB;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, h, Host, Prop} from \"@stencil/core\";\nimport {DividerSize, ListDividerType, ListSize, ListType} from \"../../../beans\";\n\n@Component({\n tag: \"z-list-group\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZListGroup {\n @Element() host: HTMLZListGroupElement;\n\n /**\n * [optional] Sets size of inside elements.\n */\n @Prop({reflect: true})\n size?: ListSize = ListSize.MEDIUM;\n\n /**\n * [optional] Sets the position where to insert the divider.\n */\n @Prop({reflect: true})\n dividerType?: ListDividerType = ListDividerType.NONE;\n\n /**\n * [optional] Sets the divider size.\n */\n @Prop({reflect: true})\n dividerSize?: DividerSize = DividerSize.SMALL;\n\n /**\n * [optional] Sets the divider color.\n */\n @Prop({reflect: true})\n dividerColor?: string = \"gray200\";\n\n /**\n * [optional] type of the list marker for each element\n */\n @Prop({reflect: true})\n listType?: ListType = ListType.NONE;\n\n private hasHeader: boolean;\n\n componentDidLoad(): void {\n const children = this.host.children;\n for (let i = 0; i < children.length; i++) {\n if (children.length - 1 > i) {\n children[i].setAttribute(\"divider-type\", this.dividerType);\n children[i].setAttribute(\"divider-size\", this.dividerSize);\n children[i].setAttribute(\"divider-color\", this.dividerColor);\n }\n children[i].setAttribute(\"size\", this.size);\n children[i].setAttribute(\"list-type\", this.listType);\n children[i].setAttribute(\"list-element-position\", i.toString());\n }\n }\n\n componentWillLoad(): void {\n this.hasHeader = !!this.host.querySelector('[slot=\"header-title\"]');\n }\n\n render(): HTMLZListGroupElement {\n return (\n <Host role=\"group\">\n <div\n class={{\n \"z-list-group-header-container\": true,\n \"has-header\": this.hasHeader,\n }}\n >\n <slot name=\"header-title\" />\n {this.dividerType === ListDividerType.HEADER && (\n <z-divider\n color={this.dividerColor}\n size={this.dividerSize}\n />\n )}\n </div>\n <slot />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/list/z-list-group/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AACtE,OAAO,yBAAyB,CAAC;AACjC,OAAO,iBAAiB,CAAC;AACzB,OAAO,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,cAAc;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SACjC;QACD,WAAW,EAAE;YACX,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;SACxC;QACD,WAAW,EAAE;YACX,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;SACpC;QACD,YAAY,EAAE,sBAAsB,EAAE;QACtC,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;YACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SACjC;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ,CAAC,KAAK;QACpB,WAAW,EAAE,eAAe,CAAC,MAAM;QACnC,WAAW,EAAE,WAAW,CAAC,KAAK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AC,YAAY;;;;;GAKxC;CACF,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {ZListGroup} from \".\";\nimport {DividerSize, ListDividerType, ListSize, ListType} from \"../../../beans\";\nimport {getColorTokenArgConfig} from \"../../../utils/storybook-utils\";\nimport \"../z-list-element/index\";\nimport \"../z-list/index\";\nimport \"./index\";\n\nconst StoryMeta = {\n title: \"ZList/ZListGroup\",\n component: \"z-list-group\",\n argTypes: {\n size: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ListSize),\n },\n dividerType: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ListDividerType),\n },\n dividerSize: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(DividerSize),\n },\n dividerColor: getColorTokenArgConfig(),\n listType: {\n control: {\n type: \"inline-radio\",\n },\n options: Object.values(ListType),\n },\n },\n args: {\n size: ListSize.SMALL,\n dividerType: ListDividerType.HEADER,\n dividerSize: DividerSize.SMALL,\n dividerColor: \"gray200\",\n listType: ListType.NONE,\n },\n} satisfies Meta<ZListGroup>;\nexport default StoryMeta;\n\nexport const Default = {\n render: (args) => html`\n <z-list>\n <z-list-group\n size=${args.size}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n list-type=${args.listType}\n >\n <div slot=\"header-title\">Gruppo 1</div>\n <z-list-element\n size=${args.size}\n list-type=${args.listType}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n >Elemento 1</z-list-element\n >\n <z-list-element\n size=${args.size}\n list-type=${args.listType}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n >Elemento 2</z-list-element\n >\n <z-list-element\n size=${args.size}\n list-type=${args.listType}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n >Elemento 3</z-list-element\n >\n </z-list-group>\n <z-list-group\n size=${args.size}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n list-type=${args.listType}\n >\n <div slot=\"header-title\">Gruppo 1</div>\n <z-list-element\n size=${args.size}\n list-type=${args.listType}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n >Elemento 1</z-list-element\n >\n <z-list-element\n size=${args.size}\n list-type=${args.listType}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n >Elemento 2</z-list-element\n >\n <z-list-element\n size=${args.size}\n list-type=${args.listType}\n divider-type=${args.dividerType}\n divider-size=${args.dividerSize}\n divider-color=${args.dividerColor}\n >Elemento 3</z-list-element\n >\n </z-list-group>\n </z-list>\n `,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/table/cells/z-td/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AACnG,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAEnG;;;GAGG;AAMH,MAAM,OAAO,GAAG;;;sBAaL,KAAK;wBAQkB,IAAI;+BAMA,eAAe,CAAC,IAAI;0BAM3C,KAAK;;IAgBR,aAAa;QACrB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;QACtD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,CAAC,aAAa,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, PopoverPosition, VisibilityCondition} from \"../../../../beans\";\n\n/**\n * ZTd component.\n * @slot - ZTd content.\n */\n@Component({\n tag: \"z-td\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTd {\n @Element() host: HTMLZTdElement;\n\n /**\n * Number of columns that the cell should span.\n */\n @Prop()\n colspan: number;\n\n /**\n * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Enables the contextual menu.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the menu button.\n */\n @Prop({reflect: true})\n showMenu: VisibilityCondition = null;\n\n /**\n * Set the popover position, the default is \"auto\".\n */\n @Prop()\n popoverPosition?: PopoverPosition = PopoverPosition.AUTO;\n\n /**\n * Store the open state of the menu.\n */\n @State()\n isMenuOpen = false;\n\n private menuTrigger: HTMLZButtonElement;\n\n private popoverEl: HTMLZPopoverElement;\n\n /**\n * Emitted when the value of the `colspan` changes.\n */\n @Event({\n bubbles: true,\n cancelable: false,\n })\n colspanChange: EventEmitter<number>;\n\n @Watch(\"colspan\")\n protected updateColspan(): void {\n if (this.colspan) {\n this.host.style.gridColumn = `span ${this.colspan}`;\n } else {\n this.host.style.removeProperty(\"grid-column\");\n }\n\n this.colspanChange.emit(this.colspan || 1);\n }\n\n private onMenuButtonClick(ev: MouseEvent): void {\n ev.stopPropagation();\n this.popoverEl.open = !this.popoverEl.open;\n }\n\n componentWillLoad(): void {\n this.updateColspan();\n }\n\n render(): HTMLZTdElement {\n return (\n <Host\n role=\"cell\"\n menu-open={this.isMenuOpen}\n >\n <div class=\"cell--content\">\n <slot></slot>\n {this.showMenu && (\n <div class=\"cell--menu-container prevent-expand\">\n <z-button\n variant={ButtonVariant.TERTIARY}\n icon=\"contextual-menu\"\n size={ControlSize.X_SMALL}\n ref={(el) => (this.menuTrigger = el as HTMLZButtonElement)}\n onClick={this.onMenuButtonClick.bind(this)}\n />\n <z-popover\n class=\"cell-popover\"\n ref={(el) => (this.popoverEl = el as HTMLZPopoverElement)}\n bindTo={this.menuTrigger as HTMLElement}\n onOpenChange={(event) => (this.isMenuOpen = event.detail.open)}\n position={this.popoverPosition}\n >\n <slot name=\"contextual-menu\"></slot>\n </z-popover>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/table/cells/z-th/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AACnG,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAElH;;;;GAIG;AAMH,MAAM,OAAO,GAAG;;;wBAekB,IAAI;2BAQD,IAAI;sBAM9B,KAAK;;sBAYW,KAAK;+BAMZ,eAAe,CAAC,IAAI;0BAMzB,KAAK;;IAclB;;OAEG;IACH,IAAY,iBAAiB;QAC3B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACK,UAAU;QAChB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,GAAG,KAA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K,KAAK,EAAC,sBAAsB;oBAC/B,iEACE,OAAO,EAAE,aAAa,CAAC,QAAQ,EAC/B,IAAI,EAAC,iBAAiB,EACtB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,EAAiB,CAAC,EACnD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAC3D;oBACF,kEACE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAyB,CAAC,EACzD,MAAM,EAAE,IAAI,CAAC,WAAW,EACxB,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAC9D,QAAQ,EAAE,IAAI,CAAC,eAAe;wBAE9B,6DAAM,IAAI,EAAC,iBAAiB,GAAQ,CAC1B,CACR,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, PopoverPosition, SortDirection, VisibilityCondition} from \"../../../../beans\";\n\n/**\n * ZTh component.\n * @slot - ZTh content.\n * @slot contextual-menu - Contextual menu content. Only visible when `showMenu` is true.\n */\n@Component({\n tag: \"z-th\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTh {\n @Element() host: HTMLZThElement;\n\n /**\n * Number of columns that the cell should span.\n */\n @Prop()\n colspan: number;\n\n /**\n * Enables the contextual menu.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the menu button.\n */\n @Prop({reflect: true})\n showMenu: VisibilityCondition = null;\n\n /**\n * Enables the sorting button.\n * Can be set to \"hover\" or \"always\" to show the button only on cell hover or always.\n * Set a nullish value to hide the sort button.\n */\n @Prop({reflect: true})\n showSorting: VisibilityCondition = null;\n\n /**\n * Whether the cell should stick.\n */\n @Prop({reflect: true})\n sticky = false;\n\n /**\n * Current sorting direction.\n */\n @Prop({mutable: true})\n sortDirection?: SortDirection;\n\n /**\n * Sorted state of the column.\n */\n @Prop({reflect: true, mutable: true})\n sorted: boolean | null = false;\n\n /**\n * Set popover position.\n */\n @Prop()\n popoverPosition = PopoverPosition.AUTO;\n\n /**\n * Store the open state of the menu.\n */\n @State()\n isMenuOpen = false;\n\n /**\n * Sort event fired when the user clicks on the sort button.\n * The sorting logic must be implemented by the app.\n * You can set an `id` on the `z-th` to easly identify the column in the event listener.\n */\n @Event()\n private sort: EventEmitter;\n\n private menuTrigger: HTMLElement;\n\n private popoverEl: HTMLZPopoverElement;\n\n /**\n * Get the value to set to the `aria-sort` attribute based on the current sort direction.\n */\n private get ariaSortDirection(): string {\n if (!this.sortDirection) {\n return null;\n }\n\n return this.sortDirection === SortDirection.ASC ? \"ascending\" : \"descending\";\n }\n\n /**\n * Handle the click on the sort button.\n * @fires sort\n */\n private handleSort(): void {\n if (!this.sortDirection) {\n this.sorted = false;\n\n return;\n }\n\n this.sortDirection = this.sortDirection === SortDirection.ASC ? SortDirection.DESC : SortDirection.ASC;\n this.sorted = true;\n\n this.sort.emit({sortDirection: this.sortDirection});\n }\n\n @Watch(\"colspan\")\n protected updateColspan(): void {\n if (this.colspan) {\n this.host.style.gridColumn = `span ${this.colspan}`;\n } else {\n this.host.style.removeProperty(\"grid-column\");\n }\n }\n\n componentWillLoad(): void {\n this.updateColspan();\n }\n\n render(): HTMLZThElement {\n return (\n <Host\n role=\"columnheader\"\n menu-open={this.isMenuOpen}\n aria-sort={this.ariaSortDirection}\n sortable={this.showSorting}\n >\n <div class=\"cell--content\">\n <slot></slot>\n {this.showSorting && (\n <button\n class=\"z-th--sort-button\"\n type=\"button\"\n onClick={this.handleSort.bind(this)}\n >\n <z-icon\n name={this.sortDirection === SortDirection.DESC ? \"arrow-simple-up\" : \"arrow-simple-down\"}\n width={14}\n height={14}\n />\n </button>\n )}\n {this.showMenu && (\n <div class=\"cell--menu-container\">\n <z-button\n variant={ButtonVariant.TERTIARY}\n icon=\"contextual-menu\"\n size={ControlSize.X_SMALL}\n ref={(el) => (this.menuTrigger = el as HTMLElement)}\n onClick={() => (this.popoverEl.open = !this.popoverEl.open)}\n />\n <z-popover\n ref={(el) => (this.popoverEl = el as HTMLZPopoverElement)}\n bindTo={this.menuTrigger}\n onOpenChange={(event) => (this.isMenuOpen = event.detail.open)}\n position={this.popoverPosition}\n >\n <slot name=\"contextual-menu\"></slot>\n </z-popover>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AACvE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,eAAe,CAAC;AAEvB;;;;GAIG;AAMH,MAAM,OAAO,MAAM;;wBAON,KAAK;0BAMH,KAAK;;IAEV,gBAAgB;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9E,CAAC;IAID;;OAEG;IACH,iBAAiB;QACf,IAAI,CAAC,0BAA0B,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE;YAC1D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;YACjD,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,CAAC,YAAY,CAAC;YAC/B,iBAAiB,EAAE,KAAK;SACzB,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB;;QAClB,MAAA,IAAI,CAAC,0BAA0B,0CAAE,UAAU,EAAE,CAAC;IAChD,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC/B,4DACE,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,OAAO;gBAEZ,8DAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Host, Prop, State, h} from \"@stencil/core\";\nimport \"../z-tbody/index\";\nimport \"../z-tfoot/index\";\nimport \"../z-thead/index\";\nimport \"../z-tr/index\";\n\n/**\n * ZTable component.\n * @slot - Table content (`z-thead`, `z-tbody`, `z-tfoot`, `z-tr`).\n * @cssprop --z-table--cells-padding - Padding of the cells.\n */\n@Component({\n tag: \"z-table\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTable {\n @Element() host: HTMLZTableElement;\n\n /**\n * Whether the table cells should show a border between them.\n */\n @Prop({reflect: true})\n bordered = false;\n\n /**\n * Whether the table contains some expandable rows.\n */\n @State()\n expandable = false;\n\n private updateExpandable(): void {\n this.expandable = this.host.querySelectorAll(\"z-tr[expandable]\").length > 0;\n }\n\n private expandableMutationObserver: MutationObserver;\n\n /**\n * Setup the table creating a mutation observer for the expandable attribute.\n */\n componentWillLoad(): void {\n this.expandableMutationObserver = new MutationObserver(() => {\n this.updateExpandable();\n });\n this.expandableMutationObserver.observe(this.host, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"expandable\"],\n attributeOldValue: false,\n });\n }\n\n disconnectedCallback(): void {\n this.expandableMutationObserver?.disconnect();\n }\n\n render(): HTMLZTableElement {\n return (\n <Host expandable={this.expandable}>\n <div\n class=\"table\"\n role=\"table\"\n >\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/table/z-table/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAEnF,OAAO,sBAAsB,CAAC;AAC9B,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAI7B;;;;;;;;;;GAUG;AACH,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE;QACJ,UAAU,EAAE,IAAI;QAChB,0BAA0B,EAAE,MAAM;KACnC;CACgC,CAAC;AAEpC,eAAe,SAAS,CAAC;AAEzB,MAAM,aAAa,GAAG,CAAC,KAAK,GAAG,CAAC,EAAkB,EAAE,CAClD,IAAI,CAAA,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA,8BAA8B,CAAC,EAAE,CAAC;AAEnF,MAAM,C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I,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA,SAAS,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;eACzE;CACd,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {repeat} from \"lit/directives/repeat.js\";\nimport {styleMap} from \"lit/directives/style-map.js\";\nimport {type ZTable} from \".\";\nimport {PopoverPosition, SortDirection, VisibilityCondition} from \"../../../beans\";\nimport {CSSVarsArguments} from \"../../../utils/storybook-utils\";\nimport \"../../z-button/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\ntype ZTableStoriesArgs = ZTable & CSSVarsArguments<\"z-table--cells-padding\">;\n\n/**\n * ## Accessibility\n *\n * The `ZTable` and its related components comes with a set of roles and ARIA attributes to help screen readers to understand the table structure and its content.\n * The roles are mainly used to identify the table parts, since they are not the native HTML table elements.\n * The ARIA attributes used are the following:\n * - [`aria-sort`](https://www.w3.org/TR/wai-aria-1.1/#aria-sort) to identify the sorting direction of a column when sorting is enabled\n * - [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.1/#aria-expanded) to identify if a row is expanded or not when expandable rows are enabled. The attribute is set on the button that expands the row, as explained in the [docs](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded)\n * - [`aria-controls`](https://www.w3.org/TR/wai-aria-1.1/#aria-controls) is used on the expandable row button to identify the content that is controlled by the button itself, as explained in the [docs](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls). Maybe the `aria-owns` attribute were more appropriate, but it is not supported on MacOS and iOS with VoiceOver, so we used `aria-controls` instead.\n * - [`aria-label`](https://www.w3.org/TR/wai-aria-1.1/#aria-label) is used on the expandable row button to provide a label for the button, since the button doesn't have any text content.\n */\nconst StoryMeta = {\n title: \"ZTable\",\n component: \"z-table\",\n args: {\n \"bordered\": true,\n \"--z-table--cells-padding\": \"16px\",\n },\n} satisfies Meta<ZTableStoriesArgs>;\n\nexport default StoryMeta;\n\nconst cellsTemplate = (count = 1): TemplateResult =>\n html`${repeat([...new Array(count)], () => html`<z-td>Contenuto cella</z-td>`)}`;\n\nexport const Default = {\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>${repeat([...new Array(8)], () => html`<z-th>Titolo colonna</z-th>`)}</z-tr>\n </z-thead>\n <z-tbody>${repeat([...new Array(5)], () => html`<z-tr>${cellsTemplate(8)}</z-tr>`)}</z-tbody>\n <z-tfoot>\n <z-tr>\n <z-td colspan=\"8\">Table footer</z-td>\n </z-tr>\n </z-tfoot>\n </z-table>`,\n};\n\n/**\n * Just set `expandable` prop on the `z-tr` element to make it expandable, then put an additional `z-td` as extended content.\n * If you put a clickable item as a child cell of a z-tr with `expandable` set to `true`, you need to set a \"prevent-expand\" class on that item, in order to prevent unwanted row expansions.\n */\nexport const ExpandableRows = {\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>${repeat([...new Array(8)], (_, index) => html`<z-th>Colonna ${index + 1}</z-th>`)}</z-tr>\n </z-thead>\n <z-tbody>\n <z-tr>\n <z-td>Contenuto cella</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td show-menu>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div></z-td\n >\n ${cellsTemplate(5)}\n </z-tr>\n <z-tr>${repeat([...new Array(8)], () => html`<z-td>Contenuto cella</z-td>`)}</z-tr>\n <z-tr expandable>\n <z-td>Contenuto cella</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td>\n <span>Contenuto cella</span>\n <z-button\n class=\"prevent-expand\"\n onclick=\"alert('button clicked without expanding the row')\"\n icon=\"plus\"\n size=\"x-small\"\n ></z-button\n ></z-td>\n ${cellsTemplate(5)}\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n <z-tr>${cellsTemplate(8)}</z-tr>\n <z-tr expandable>\n <z-td>Contenuto cella</z-td>\n <z-td show-menu=\"always\">\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div></z-td\n >\n ${cellsTemplate(6)}\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n </z-tbody>\n <z-tfoot>\n <z-tr>\n <z-td colspan=\"8\">Table footer</z-td>\n </z-tr>\n </z-tfoot>\n </z-table>`,\n};\n\n/**\n * To make a column sticky, you need to set the `sticky` prop on the `z-th` and/or `z-td` elements of the same column.\n * For the header or footer, just set the `sticky` prop on the `z-thead` or `z-tfoot` element.\n */\nexport const Sticky = {\n args: {\n stickyHeader: true,\n stickyFooter: true,\n stickFirstColumn: true,\n },\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n \"height\": \"400px\",\n })}\n >\n <z-thead .sticky=${args.stickyHeader}>\n <z-tr>\n <z-th .sticky=${args.stickFirstColumn}>Colonna 1</z-th>\n ${repeat([...new Array(7)], (_, index) => html`<z-th>Colonna ${index + 2}</z-th>`)}\n </z-tr>\n </z-thead>\n <z-tbody>\n <z-tr>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td show-menu>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div></z-td\n >\n ${cellsTemplate(4)}\n </z-tr>\n ${repeat(\n [...new Array(5)],\n () =>\n html`<z-tr>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n ${cellsTemplate(7)}\n </z-tr>`\n )}\n <z-tr expandable>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n ${cellsTemplate(6)}\n <z-td>\n <span>Contenuto cella</span>\n <z-button\n class=\"prevent-expand\"\n onclick=\"alert('button clicked')\"\n icon=\"plus\"\n size=\"x-small\"\n ></z-button\n ></z-td>\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n <z-tr expandable>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n ${cellsTemplate(7)}\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n </z-tbody>\n <z-tfoot .sticky=${args.stickyFooter}>\n <z-tr>\n <z-td colspan=\"8\">Table footer</z-td>\n </z-tr>\n </z-tfoot>\n </z-table>`,\n};\n\n/**\n * Use the `showMenu` prop on `z-td` or `z-th`, setting a value of the enum `VisibilityCondition` (`HOVER` or `ALWAYS`), to show a contextual menu button on the cell. The content of the menu must be placed using the slot `contextual-menu`.\n * Use `popoverPosition` prop on `z-th` to set the position of contextual menu, default is `auto`.\n */\nexport const CellsWithContextualMenu = {\n argTypes: {\n showMenu: {\n control: {\n type: \"inline-radio\",\n labels: {\n null: \"hidden\",\n },\n },\n popoverPosition: {\n options: Object.values(PopoverPosition),\n control: {\n type: \"select\",\n },\n },\n options: [null, ...Object.values(VisibilityCondition)],\n },\n },\n args: {\n showMenu: VisibilityCondition.HOVER,\n popoverPosition: PopoverPosition.AUTO,\n },\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>\n <z-th>Colonna 1</z-th>\n <z-th\n .showMenu=${args.showMenu}\n .popoverPosition=${args.popoverPosition}\n >\n Heading con menu\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-th>\n <z-th>Colonna 2</z-th>\n </z-tr>\n </z-thead>\n <z-tbody>\n ${repeat(\n [...new Array(3)],\n () =>\n html`<z-tr>\n <z-td .showMenu=${args.showMenu}>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-td>\n <z-td>Contenuto cella</z-td>\n <z-td .showMenu=${args.showMenu}>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-td>\n </z-tr>`\n )}\n </z-tbody>\n </z-table>`,\n};\n\n/**\n * Set the `sortDirection` prop to `SortDirection.ASC` or `SortDirection.DESC` to enable sorting and show the sort button.\n * Clicking the button will fire the `sort` event with the `sortDirection` as detail.\n */\nexport const SortAction = {\n argTypes: {\n showSorting: {\n options: Object.values(VisibilityCondition),\n control: {\n type: \"inline-radio\",\n },\n },\n },\n args: {\n showSorting: VisibilityCondition.HOVER,\n },\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>\n <z-th\n .sortDirection=${SortDirection.ASC}\n .showMenu=${VisibilityCondition.HOVER}\n .showSorting=${args.showSorting}\n >\n Colonna 1 con menu e sorting\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-th>\n <z-th>Colonna 2</z-th>\n <z-th\n .sortDirection=${SortDirection.DESC}\n .showSorting=${args.showSorting}\n >Colonna 3 con sorting</z-th\n >\n </z-tr>\n </z-thead>\n <z-tbody>${repeat([...new Array(3)], () => html`<z-tr>${cellsTemplate(3)}</z-tr>`)}</z-tbody>\n </z-table>`,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/table/z-table/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAA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,EAAE,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC;YAC3C,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;SACF;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,mBAAmB,CAAC,KAAK;KACvC;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;kBAEU,IAAI,CAAC,QAAQ;cACjB,QAAQ,CAAC;QACf,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;KAC7D,CAAC;;;;;6BAKqB,aAAa,CAAC,GAAG;wBACtB,mBAAmB,CAAC,KAAK;2BACtB,IAAI,CAAC,WAAW;;;;;;;6BAOd,aAAa,CAAC,IAAI;2BACpB,IAAI,CAAC,WAAW;;;;;iBAK1B,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA,SAAS,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;eACzE;CACd,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {repeat} from \"lit/directives/repeat.js\";\nimport {styleMap} from \"lit/directives/style-map.js\";\nimport {type ZTable} from \".\";\nimport {PopoverPosition, SortDirection, VisibilityCondition} from \"../../../beans\";\nimport {CSSVarsArguments} from \"../../../utils/storybook-utils\";\nimport \"../../z-button/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\ntype ZTableStoriesArgs = ZTable & CSSVarsArguments<\"z-table--cells-padding\">;\n\n/**\n * ## Accessibility\n *\n * The `ZTable` and its related components comes with a set of roles and ARIA attributes to help screen readers to understand the table structure and its content.\n * The roles are mainly used to identify the table parts, since they are not the native HTML table elements.\n * The ARIA attributes used are the following:\n * - [`aria-sort`](https://www.w3.org/TR/wai-aria-1.1/#aria-sort) to identify the sorting direction of a column when sorting is enabled\n * - [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.1/#aria-expanded) to identify if a row is expanded or not when expandable rows are enabled. The attribute is set on the button that expands the row, as explained in the [docs](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded)\n * - [`aria-controls`](https://www.w3.org/TR/wai-aria-1.1/#aria-controls) is used on the expandable row button to identify the content that is controlled by the button itself, as explained in the [docs](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls). Maybe the `aria-owns` attribute were more appropriate, but it is not supported on MacOS and iOS with VoiceOver, so we used `aria-controls` instead.\n * - [`aria-label`](https://www.w3.org/TR/wai-aria-1.1/#aria-label) is used on the expandable row button to provide a label for the button, since the button doesn't have any text content.\n */\nconst StoryMeta = {\n title: \"ZTable\",\n component: \"z-table\",\n args: {\n \"bordered\": true,\n \"--z-table--cells-padding\": \"16px\",\n },\n} satisfies Meta<ZTableStoriesArgs>;\n\nexport default StoryMeta;\n\nconst cellsTemplate = (count = 1): TemplateResult =>\n html`${repeat([...new Array(count)], () => html`<z-td>Contenuto cella</z-td>`)}`;\n\nexport const Default = {\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>${repeat([...new Array(8)], () => html`<z-th>Titolo colonna</z-th>`)}</z-tr>\n </z-thead>\n <z-tbody>${repeat([...new Array(5)], () => html`<z-tr>${cellsTemplate(8)}</z-tr>`)}</z-tbody>\n <z-tfoot>\n <z-tr>\n <z-td colspan=\"8\">Table footer</z-td>\n </z-tr>\n </z-tfoot>\n </z-table>`,\n};\n\n/**\n * Just set `expandable` prop on the `z-tr` element to make it expandable, then put an additional `z-td` as extended content.\n * If you put a clickable item as a child cell of a z-tr with `expandable` set to `true`, you need to set a \"prevent-expand\" class on that item, in order to prevent unwanted row expansions.\n */\nexport const ExpandableRows = {\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>${repeat([...new Array(8)], (_, index) => html`<z-th>Colonna ${index + 1}</z-th>`)}</z-tr>\n </z-thead>\n <z-tbody>\n <z-tr>\n <z-td>Contenuto cella</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td show-menu>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div></z-td\n >\n ${cellsTemplate(5)}\n </z-tr>\n <z-tr>${repeat([...new Array(8)], () => html`<z-td>Contenuto cella</z-td>`)}</z-tr>\n <z-tr expandable>\n <z-td>Contenuto cella</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td>\n <span>Contenuto cella</span>\n <z-button\n class=\"prevent-expand\"\n onclick=\"alert('button clicked without expanding the row')\"\n icon=\"plus\"\n size=\"x-small\"\n ></z-button\n ></z-td>\n ${cellsTemplate(5)}\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n <z-tr>${cellsTemplate(8)}</z-tr>\n <z-tr expandable>\n <z-td>Contenuto cella</z-td>\n <z-td show-menu=\"always\">\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div></z-td\n >\n ${cellsTemplate(6)}\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n </z-tbody>\n <z-tfoot>\n <z-tr>\n <z-td colspan=\"8\">Table footer</z-td>\n </z-tr>\n </z-tfoot>\n </z-table>`,\n};\n\n/**\n * To make a column sticky, you need to set the `sticky` prop on the `z-th` and/or `z-td` elements of the same column.\n * For the header or footer, just set the `sticky` prop on the `z-thead` or `z-tfoot` element.\n */\nexport const Sticky = {\n args: {\n stickyHeader: true,\n stickyFooter: true,\n stickFirstColumn: true,\n },\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n \"height\": \"400px\",\n })}\n >\n <z-thead .sticky=${args.stickyHeader}>\n <z-tr>\n <z-th .sticky=${args.stickFirstColumn}>Colonna 1</z-th>\n ${repeat([...new Array(7)], (_, index) => html`<z-th>Colonna ${index + 2}</z-th>`)}\n </z-tr>\n </z-thead>\n <z-tbody>\n <z-tr>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td>Contenuto cella</z-td>\n <z-td show-menu>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div></z-td\n >\n ${cellsTemplate(4)}\n </z-tr>\n ${repeat(\n [...new Array(5)],\n () =>\n html`<z-tr>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n ${cellsTemplate(7)}\n </z-tr>`\n )}\n <z-tr expandable>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n ${cellsTemplate(6)}\n <z-td>\n <span>Contenuto cella</span>\n <z-button\n class=\"prevent-expand\"\n onclick=\"alert('button clicked')\"\n icon=\"plus\"\n size=\"x-small\"\n ></z-button\n ></z-td>\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n <z-tr expandable>\n <z-td .sticky=${args.stickFirstColumn}>Contenuto cella 1</z-td>\n ${cellsTemplate(7)}\n <z-td>Contenuto espanso</z-td>\n </z-tr>\n </z-tbody>\n <z-tfoot .sticky=${args.stickyFooter}>\n <z-tr>\n <z-td colspan=\"8\">Table footer</z-td>\n </z-tr>\n </z-tfoot>\n </z-table>`,\n};\n\n/**\n * Use the `showMenu` prop on `z-td` or `z-th`, setting a value of the enum `VisibilityCondition` (`HOVER` or `ALWAYS`), to show a contextual menu button on the cell. The content of the menu must be placed using the slot `contextual-menu`.\n * Use `popoverPosition` prop on `z-th` to set the position of contextual menu, default is `auto`.\n */\nexport const CellsWithContextualMenu = {\n argTypes: {\n showMenu: {\n control: {\n type: \"inline-radio\",\n labels: {\n null: \"hidden\",\n },\n },\n popoverPosition: {\n options: Object.values(PopoverPosition),\n control: {\n type: \"select\",\n },\n },\n options: [null, ...Object.values(VisibilityCondition)],\n },\n },\n args: {\n showMenu: VisibilityCondition.HOVER,\n popoverPosition: PopoverPosition.AUTO,\n },\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>\n <z-th>Colonna 1</z-th>\n <z-th\n .showMenu=${args.showMenu}\n .popoverPosition=${args.popoverPosition}\n >\n Heading con menu\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-th>\n <z-th>Colonna 2</z-th>\n </z-tr>\n </z-thead>\n <z-tbody>\n ${repeat(\n [...new Array(3)],\n () =>\n html`<z-tr>\n <z-td .showMenu=${args.showMenu}>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-td>\n <z-td>Contenuto cella</z-td>\n <z-td .showMenu=${args.showMenu}>\n <span>Contenuto cella con menu</span>\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-td>\n </z-tr>`\n )}\n </z-tbody>\n </z-table>`,\n};\n\n/**\n * Set the `sortDirection` prop to `SortDirection.ASC` or `SortDirection.DESC` to enable sorting and show the sort button.\n * Clicking the button will fire the `sort` event with the `sortDirection` as detail.\n */\nexport const SortAction = {\n argTypes: {\n showSorting: {\n options: Object.values(VisibilityCondition),\n control: {\n type: \"inline-radio\",\n },\n },\n },\n args: {\n showSorting: VisibilityCondition.HOVER,\n },\n render: (args) =>\n html`<z-table\n class=\"z-table-demo\"\n .bordered=${args.bordered}\n style=${styleMap({\n \"--z-table--cells-padding\": args[\"--z-table--cells-padding\"],\n })}\n >\n <z-thead>\n <z-tr>\n <z-th\n .sortDirection=${SortDirection.ASC}\n .showMenu=${VisibilityCondition.HOVER}\n .showSorting=${args.showSorting}\n >\n Colonna 1 con menu e sorting\n <div slot=\"contextual-menu\">Contenuto del popover</div>\n </z-th>\n <z-th>Colonna 2</z-th>\n <z-th\n .sortDirection=${SortDirection.DESC}\n .showSorting=${args.showSorting}\n >Colonna 3 con sorting</z-th\n >\n </z-tr>\n </z-thead>\n <z-tbody>${repeat([...new Array(3)], () => html`<z-tr>${cellsTemplate(3)}</z-tr>`)}</z-tbody>\n </z-table>`,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-tbody/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AAMH,MAAM,OAAO,MAAM;IACjB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,UAAU;YACnB,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;CACF","sourcesContent":["import {Component, Host, h} from \"@stencil/core\";\n\n/**\n * ZTbody component.\n * @slot - ZTbody content (`z-tr`).\n */\n@Component({\n tag: \"z-tbody\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTbody {\n render(): HTMLZTbodyElement {\n return (\n <Host role=\"rowgroup\">\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-tfoot/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAEvD;;;GAGG;AAMH,MAAM,OAAO,MAAM;;sBAKR,KAAK;;IAEd,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,UAAU;YACnB,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, Prop, h} from \"@stencil/core\";\n\n/**\n * ZTFoot component.\n * @slot - ZTFoot content (`z-tr`).\n */\n@Component({\n tag: \"z-tfoot\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTfoot {\n /**\n * If true, the footer will be stuck to the bottom of the table.\n */\n @Prop({reflect: true})\n sticky = false;\n\n render(): void {\n return (\n <Host role=\"rowgroup\">\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-thead/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAEvD;;;GAGG;AAMH,MAAM,OAAO,MAAM;;sBAKR,KAAK;;IAEd,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,IAAI,EAAC,UAAU;YACnB,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Host, Prop, h} from \"@stencil/core\";\n\n/**\n * ZThead component.\n * @slot - ZThead content (`z-tr`).\n */\n@Component({\n tag: \"z-thead\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZThead {\n /**\n * If true, the header will be stuck to the top of the table.\n */\n @Prop({reflect: true})\n sticky = false;\n\n render(): HTMLZTheadElement {\n return (\n <Host role=\"rowgroup\">\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/table/z-tr/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE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C,IAAI,CAAC,UAAU,IAAI,aAAa,EAAE,CAAC;YACtC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAC,CAAC,CAAC;IAC9C,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,IAAI,EAAC,KAAK,EACV,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YAEvB,4DAAK,KAAK,EAAC,+BAA+B,IACvC,IAAI,CAAC,UAAU,IAAI,CAClB,gFACiB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,gBACnC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,mBAC7C,IAAI,CAAC,mBAAmB,EACvC,IAAI,EAAC,QAAQ;gBAEb,+DAAQ,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,GAAW,CAClE,CACV,CACG;YACN,6DAAM,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS,CACrD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {randomId} from \"../../../utils/utils\";\nimport \"../cells/z-td/index\";\nimport \"../cells/z-th/index\";\n\n/**\n * ZTr component.\n * When the row is `expandable`, you can set the `prevent-expand` css class on an interactive element inside the row\n * to prevent the row from expanding.\n * @slot - ZTr content (`z-td` or `z-th`).\n */\n@Component({\n tag: \"z-tr\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZTr {\n @Element() host: HTMLZTrElement;\n\n /**\n * Whether the row is expandable.\n * Use a `z-td` as the last cell of the row for the additional content.\n * It will show a button to expand/collapse the row.\n * The last cell will be hidden until the button or row is clicked.\n *\n * If some element inside the expandable row contains the `prevent-expand` css class,\n * the row will not expand by clicking that element.\n */\n @Prop({reflect: true})\n expandable = false;\n\n /**\n * Whether the row is currently expanded.\n */\n @State()\n expanded = false;\n\n /**\n * HTML Id of the expandable content.\n * It is used to link the button to the content through the `aria-controls` attribute.\n */\n @State()\n expandableContentId: string;\n\n /** Row has been expanded */\n @Event()\n expand: EventEmitter;\n\n @Watch(\"expandable\")\n @Listen(\"colspanchange\")\n protected updateColumns(): void {\n const cells = Array.from(this.host.querySelectorAll<HTMLZTdElement | HTMLZThElement>(\"z-td, z-th\"));\n if (this.expandable) {\n cells.pop();\n }\n\n const columns = cells.map((cell) => cell.colspan || 1).reduce((a, b) => a + b, 0);\n this.host.style.setProperty(\"--columns\", `${columns}`);\n\n if (this.expandable) {\n const expandableContent = cells.pop();\n expandableContent.id = expandableContent.id || `z-tr-expandable-content-${randomId()}`;\n this.expandableContentId = expandableContent.id;\n }\n }\n\n /**\n * Handle click on row.\n * Skip expansion if the click is on a element with `prevent-expand` css class.\n */\n private onRowClick(event: MouseEvent): void {\n const preventExpand = (event.target as HTMLElement).closest(\".prevent-expand\");\n if (!this.expandable || preventExpand) {\n return;\n }\n\n this.expanded = !this.expanded;\n this.expand.emit({expanded: this.expanded});\n }\n\n componentWillLoad(): void {\n this.updateColumns();\n }\n\n render(): HTMLZTrElement {\n return (\n <Host\n role=\"row\"\n onClick={this.onRowClick.bind(this)}\n expanded={this.expanded}\n >\n <div class=\"z-tr--expand-button-container\">\n {this.expandable && (\n <button\n aria-expanded={this.expanded ? \"true\" : \"false\"}\n aria-label={this.expanded ? \"Comprimi riga\" : \"Espandi riga\"}\n aria-controls={this.expandableContentId}\n type=\"button\"\n >\n <z-icon name={this.expanded ? \"minus-circled\" : \"plus-circled\"}></z-icon>\n </button>\n )}\n </div>\n <slot onSlotchange={this.updateColumns.bind(this)}></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/z-accordion/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;;;;;GAeG;AAMH,MAAM,OAAO,UAAU;;;;oBAiBd,WAAW,CAAC,GAAG;0BAMT,KAAK;oBAMX,KAAK;yBAMA,KAAK;uBAMW,gBAAgB,CAAC,OAAO;sBAM3C,IAAI;;IASH,gBAAgB;QACxB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QACpB,CAAC;IACH,CAAC;IAID;;;;OAIG;IACK,eAAe;QACrB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC;YAE7B,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,OAAO,CACL,gEACE,GAAG,EAAE,CAAC,GAAuB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,EACzD,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EACzC,IAAI,EAAE,IAAI,CAAC,IAAI;YAEf,gEACE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EACrC,IAAI,EAAC,SAAS;gBAEb,IAAI,CAAC,IAAI,IAAI,CACZ,+DACE,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAE,IAAI,CAAC,IAAI,GACf,CACH;gBACD,6DAAM,KAAK,EAAC,mBAAmB,IAAE,IAAI,CAAC,KAAK,CAAQ;gBACnD,6DAAM,KAAK,EAAC,kBAAkB;oBAC5B,6DAAM,IAAI,EAAC,KAAK,GAAG,CACd;gBACP,+DACE,KAAK,EAAC,qBAAqB,EAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,GAC/C,CACM;YACT,CAAC,IAAI,CAAC,UAAU,IAAI,CACnB,4DACE,KAAK,EAAC,qBAAqB,EAC3B,IAAI,EAAC,SAAS;gBAEd,8DAAQ,CACJ,CACP,CACO,CACX,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Event, EventEmitter, Prop, Watch, h} from \"@stencil/core\";\nimport {AccordionVariant, ControlSize} from \"../../beans\";\n\n/**\n * Accordion component.\n *\n * @slot - Slot for the main content.\n * @slot tag - Slot for tags.\n * @cssprop --z-accordion-highlight-color - Color of the highlight band on the summary's left edge. Only applies when `highlight` is true. Default: `transparent`.\n * @cssprop --z-accordion-bg - Background color of the summary. Default: `--color-surface02`.\n * @cssprop --z-accordion-label-color - Label color. Default: `--color-default-text`.\n * @cssprop --z-accordion-disabled-label-color - Label color when disabled. Default: `--color-text03`.\n * @cssprop --z-accordion-content-bg - Background color of the accordion. Default: `--color-surface02`.\n * @cssprop --z-accordion-content-fg - Content text color. Default: `--color-default-text`.\n * @cssprop --z-accordion-hover-color - Hover color of the summary. Default: `--color-surface03`.\n * @cssprop --z-accordion-left-padding - Left padding of the summary. Default: `--space-unit` * 2.\n * @cssprop --z-accordion-right-padding - Right padding of the summary. Default: `--space-unit`.\n * @cssprop --z-accordion-label-font-weight - Font weight of the summary label. Default: `--font-sb`.\n */\n@Component({\n tag: \"z-accordion\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZAccordion {\n /**\n * Text label.\n */\n @Prop()\n label: string;\n\n /**\n * Name of the z-icon to display before the label's text.\n */\n @Prop()\n icon: string;\n\n /**\n * Size of the component.\n */\n @Prop({reflect: true})\n size = ControlSize.BIG;\n\n /**\n * Disabled state of the accordion.\n */\n @Prop({reflect: true})\n isDisabled = false;\n\n /**\n * The open state of the accordion.\n */\n @Prop({reflect: true, mutable: true})\n open = false;\n\n /**\n * Enable highlight band on the `summary`'s left edge.\n */\n @Prop({reflect: true})\n highlight = false;\n\n /**\n * Accordion variant.\n */\n @Prop({reflect: true})\n variant: AccordionVariant = AccordionVariant.DEFAULT;\n\n /**\n * Enable box-shadow on the accordion. Only applies when `variant` is `BACKGROUND`.\n */\n @Prop({reflect: true})\n shadow = true;\n\n /**\n * Event fired when the accordion is toggled.\n */\n @Event()\n toggled: EventEmitter<boolean>;\n\n @Watch(\"isDisabled\")\n protected onDisabledChange(): void {\n if (this.isDisabled) {\n this.open = false;\n }\n }\n\n private detailsElm: HTMLDetailsElement;\n\n /**\n * Handle `details` element toggle.\n * If currently disabled, prevent toggling by forcing the `open` state to `false`.\n * Unfortunately the \"toggle\" event is not cancelable and when catched, the `open` state is already changed.\n */\n private onDetailsToggle(): void {\n if (this.isDisabled) {\n this.open = false;\n this.detailsElm.open = false;\n\n return;\n }\n\n this.open = this.detailsElm.open;\n this.toggled.emit(this.open);\n }\n\n render(): HTMLDetailsElement {\n return (\n <details\n ref={(elm: HTMLDetailsElement) => (this.detailsElm = elm)}\n onToggle={this.onDetailsToggle.bind(this)}\n open={this.open}\n >\n <summary\n tabIndex={this.isDisabled ? -1 : null}\n part=\"summary\"\n >\n {this.icon && (\n <z-icon\n class=\"z-accordion-label-icon\"\n name={this.icon}\n />\n )}\n <span class=\"z-accordion-label\">{this.label}</span>\n <span class=\"z-accordion-tags\">\n <slot name=\"tag\" />\n </span>\n <z-icon\n class=\"z-accordion-chevron\"\n name={this.open ? \"chevron-up\" : \"chevron-down\"}\n />\n </summary>\n {!this.isDisabled && (\n <div\n class=\"z-accordion-content\"\n part=\"content\"\n >\n <slot />\n </div>\n )}\n </details>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../src/components/z-accordion/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAmB,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AACrF,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AAEjB,MAAM,YAAY,GAAG;IACnB,kBAAkB,EAAE,sBAAsB,CAAC,IAAI,CAAC;IAChD,2BAA2B,EAAE,sBAAsB,CAAC,IAAI,CAAC;IACzD,oCAAoC,kCAC/B,sBAAsB,CAAC,IAAI,CAAC,KAC/B,EAAE,EAAE;YACF,GAAG,EAAE,YAAY;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CAAC;QAC5D,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC5D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAC9D,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC;QAClE,4BAA4B,EAAE,IAAI,CAAC,4BAA4B,CAAC;QAChE,iCAAiC,EAAE,IAAI,CAAC,iCAAiC,CAAC;KAC3E,CAAC;;;;;;;;;;;GAWL;CACc,CAAC","sourcesContent":["import {Args, Meta, StoryObj} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {styleMap} from \"lit/directives/style-map.js\";\nimport {type ZAccordion} from \".\";\nimport {AccordionVariant, ControlSize} from \"../../beans\";\nimport {ICONS} from \"../../constants/iconset\";\nimport {CSSVarsArguments, getColorTokenArgConfig} from \"../../utils/storybook-utils\";\nimport \"../z-tag/index\";\nimport \"./index\";\n\nconst cssPropsArgs = {\n \"--z-accordion-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-label-color\": getColorTokenArgConfig(true),\n \"--z-accordion-disabled-label-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"isDisabled\",\n truthy: true,\n },\n },\n \"--z-accordion-content-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-content-fg\": getColorTokenArgConfig(true),\n \"--z-accordion-hover-color\": getColorTokenArgConfig(true),\n \"--z-accordion-highlight-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"highlight\",\n truthy: true,\n },\n },\n} as const;\n\ntype ZAccordionStoriesArgs = ZAccordion &\n CSSVarsArguments<\n | keyof typeof cssPropsArgs\n | `z-accordion-${\"left\" | \"right\"}-padding`\n | \"z-accordion-label-font-weight\"\n | `z-accordion-highlight-color${number | undefined}`\n >;\n\n/**\n * To add the highlight band on the left, set the `highlight` property to `true` then set the `--z-accordion-highlight-color` CSS variable to the desired color.\n */\nconst StoryMeta = {\n title: \"ZAccordion\",\n component: \"z-accordion\",\n argTypes: {\n ...cssPropsArgs,\n icon: {\n options: [null, ...Object.keys(ICONS).sort()],\n control: {\n type: \"select\",\n labels: {\n null: \"—\",\n },\n },\n },\n shadow: {\n if: {\n arg: \"variant\",\n eq: AccordionVariant.BACKGROUND,\n },\n },\n size: {\n options: Object.values(ControlSize),\n control: {\n type: \"inline-radio\",\n },\n },\n variant: {\n options: Object.values(AccordionVariant),\n control: {\n type: \"inline-radio\",\n },\n },\n },\n args: {\n \"--z-accordion-bg\": null,\n \"--z-accordion-label-color\": null,\n \"--z-accordion-disabled-label-color\": null,\n \"--z-accordion-content-bg\": null,\n \"--z-accordion-content-fg\": null,\n \"--z-accordion-hover-color\": null,\n \"--z-accordion-highlight-color\": null,\n \"--z-accordion-right-padding\": \"var(--space-unit)\",\n \"--z-accordion-left-padding\": \"calc(var(--space-unit) * 2)\",\n \"--z-accordion-label-font-weight\": \"var(--font-sb)\",\n \"highlight\": false,\n \"icon\": null,\n \"isDisabled\": false,\n \"label\": \"Text label\",\n \"open\": false,\n \"shadow\": true,\n \"size\": ControlSize.BIG,\n \"variant\": AccordionVariant.DEFAULT,\n },\n render: (args: Args): TemplateResult =>\n html`<z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>`,\n} satisfies Meta<ZAccordionStoriesArgs>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZAccordionStoriesArgs>;\n\nexport const Default = {};\n\n/**\n * When multiple `ZAccordion`s are placed in stack, the style is automatically optimized through global styles.\n */\nexport const Stack = {\n argTypes: {\n \"--z-accordion-highlight-color2\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color3\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color4\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n },\n args: {\n \"--z-accordion-highlight-color2\": null,\n \"--z-accordion-highlight-color3\": null,\n \"--z-accordion-highlight-color4\": null,\n },\n parameters: {\n controls: {\n exclude: [\"open\"],\n },\n },\n render: (args) =>\n html`${[\n StoryMeta.render(args),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color2\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color3\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color4\"],\n }),\n ]}`,\n} satisfies Story;\n\nexport const WithTags = {\n render: (args) => html`\n <z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n <z-tag slot=\"tag\">Tag 1</z-tag>\n <z-tag slot=\"tag\">Tag 2</z-tag>\n <z-tag slot=\"tag\">Tag 3</z-tag>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>\n `,\n} satisfies Story;\n"]}
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/z-accordion/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAsB,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAmB,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AACrF,OAAO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O;cACd,QAAQ,CAAC;QACf,+BAA+B,EAAE,IAAI,CAAC,+BAA+B,CAAC;QACtE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC;QAC5C,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAC9D,oCAAoC,EAAE,IAAI,CAAC,oCAAoC,CAAC;QAChF,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC5D,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;QAC5D,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC;QAC9D,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC;QAClE,4BAA4B,EAAE,IAAI,CAAC,4BAA4B,CAAC;QAChE,iCAAiC,EAAE,IAAI,CAAC,iCAAiC,CAAC;KAC3E,CAAC;;;;;;;;;;;GAWL;CACc,CAAC","sourcesContent":["import {Args, Meta, StoryObj} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {styleMap} from \"lit/directives/style-map.js\";\nimport {type ZAccordion} from \".\";\nimport {AccordionVariant, ControlSize} from \"../../beans\";\nimport {ICONS} from \"../../constants/iconset\";\nimport {CSSVarsArguments, getColorTokenArgConfig} from \"../../utils/storybook-utils\";\nimport \"../z-tag/index\";\nimport \"./index\";\n\nconst cssPropsArgs = {\n \"--z-accordion-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-label-color\": getColorTokenArgConfig(true),\n \"--z-accordion-disabled-label-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"isDisabled\",\n truthy: true,\n },\n },\n \"--z-accordion-content-bg\": getColorTokenArgConfig(true),\n \"--z-accordion-content-fg\": getColorTokenArgConfig(true),\n \"--z-accordion-hover-color\": getColorTokenArgConfig(true),\n \"--z-accordion-highlight-color\": {\n ...getColorTokenArgConfig(true),\n if: {\n arg: \"highlight\",\n truthy: true,\n },\n },\n} as const;\n\ntype ZAccordionStoriesArgs = ZAccordion &\n CSSVarsArguments<\n | keyof typeof cssPropsArgs\n | `z-accordion-${\"left\" | \"right\"}-padding`\n | \"z-accordion-label-font-weight\"\n | `z-accordion-highlight-color${number | undefined}`\n >;\n\n/**\n * To add the highlight band on the left, set the `highlight` property to `true` then set the `--z-accordion-highlight-color` CSS variable to the desired color.\n */\nconst StoryMeta = {\n title: \"ZAccordion\",\n component: \"z-accordion\",\n argTypes: {\n ...cssPropsArgs,\n icon: {\n options: [null, ...Object.keys(ICONS).sort()],\n control: {\n type: \"select\",\n labels: {\n null: \"—\",\n },\n },\n },\n shadow: {\n if: {\n arg: \"variant\",\n eq: AccordionVariant.BACKGROUND,\n },\n },\n size: {\n options: Object.values(ControlSize),\n control: {\n type: \"inline-radio\",\n },\n },\n variant: {\n options: Object.values(AccordionVariant),\n control: {\n type: \"inline-radio\",\n },\n },\n },\n args: {\n \"--z-accordion-bg\": null,\n \"--z-accordion-label-color\": null,\n \"--z-accordion-disabled-label-color\": null,\n \"--z-accordion-content-bg\": null,\n \"--z-accordion-content-fg\": null,\n \"--z-accordion-hover-color\": null,\n \"--z-accordion-highlight-color\": null,\n \"--z-accordion-right-padding\": \"var(--space-unit)\",\n \"--z-accordion-left-padding\": \"calc(var(--space-unit) * 2)\",\n \"--z-accordion-label-font-weight\": \"var(--font-sb)\",\n \"highlight\": false,\n \"icon\": null,\n \"isDisabled\": false,\n \"label\": \"Text label\",\n \"open\": false,\n \"shadow\": true,\n \"size\": ControlSize.BIG,\n \"variant\": AccordionVariant.DEFAULT,\n },\n render: (args: Args): TemplateResult =>\n html`<z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>`,\n} satisfies Meta<ZAccordionStoriesArgs>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZAccordionStoriesArgs>;\n\nexport const Default = {};\n\n/**\n * When multiple `ZAccordion`s are placed in stack, the style is automatically optimized through global styles.\n */\nexport const Stack = {\n argTypes: {\n \"--z-accordion-highlight-color2\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color3\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n \"--z-accordion-highlight-color4\": cssPropsArgs[\"--z-accordion-highlight-color\"],\n },\n args: {\n \"--z-accordion-highlight-color2\": null,\n \"--z-accordion-highlight-color3\": null,\n \"--z-accordion-highlight-color4\": null,\n },\n parameters: {\n controls: {\n exclude: [\"open\"],\n },\n },\n render: (args) =>\n html`${[\n StoryMeta.render(args),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color2\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color3\"],\n }),\n StoryMeta.render({\n ...args,\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color4\"],\n }),\n ]}`,\n} satisfies Story;\n\nexport const WithTags = {\n render: (args) => html`\n <z-accordion\n .highlight=${args.highlight}\n .icon=${args.icon}\n .isDisabled=${args.isDisabled}\n .open=${args.open}\n .shadow=${args.shadow}\n label=${args.label}\n size=${args.size}\n variant=${args.variant}\n style=${styleMap({\n \"--z-accordion-highlight-color\": args[\"--z-accordion-highlight-color\"],\n \"--z-accordion-bg\": args[\"--z-accordion-bg\"],\n \"--z-accordion-label-color\": args[\"--z-accordion-label-color\"],\n \"--z-accordion-disabled-label-color\": args[\"--z-accordion-disabled-label-color\"],\n \"--z-accordion-content-bg\": args[\"--z-accordion-content-bg\"],\n \"--z-accordion-content-fg\": args[\"--z-accordion-content-fg\"],\n \"--z-accordion-hover-color\": args[\"--z-accordion-hover-color\"],\n \"--z-accordion-right-padding\": args[\"--z-accordion-right-padding\"],\n \"--z-accordion-left-padding\": args[\"--z-accordion-left-padding\"],\n \"--z-accordion-label-font-weight\": args[\"--z-accordion-label-font-weight\"],\n })}\n >\n <z-tag slot=\"tag\">Tag 1</z-tag>\n <z-tag slot=\"tag\">Tag 2</z-tag>\n <z-tag slot=\"tag\">Tag 3</z-tag>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quem enim ardorem studii censetis fuisse in Archimede,\n qui dum in pulvere quaedam describit attentius, ne patriam quidem captam esse senserit? Possumusne ergo in vita\n summum bonum dicere, cum id ne in cena quidem posse videamur? Morbo gravissimo affectus, exul, orbus, egens,\n torqueatur eculeo: quem hunc appellas, Zeno? Nam memini etiam quae nolo, oblivisci non possum quae volo. Nec vero\n sum nescius esse utilitatem in historia, non modo voluptatem.\n </z-accordion>\n `,\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components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CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAClE,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,oBAAoB;QAClB,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,SAAS,EAAE,IAAI,CAAC,SAAS;YAC7B,iEACE,KAAK,EAAC,QAAQ,EACd,OAAO,EAAE,aAAa,CAAC,SAAS,EAChC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EACpD,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,cAG/B;YACX,4DAAK,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;gBAC/B,8DAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, h, Host, Prop, State} from \"@stencil/core\";\nimport {ButtonVariant} from \"../../beans\";\n\n/**\n * Anchor navigation component.\n * @slot - Anchor navigation items. Use `<a>` elements inside. If you need an extra action element, use a wrapper around it and the anchor.\n * @example\n * ```\n * <z-anchor-navigation>\n * <div>\n * <a href=\"#section-id\">Section name</a>\n * <button type=\"button\">\n * <z-icon name=\"share\" />\n * </button>\n * </div>\n * </z-anchor-navigation>\n * ```\n */\n@Component({\n tag: \"z-anchor-navigation\",\n styleUrl: \"styles.css\",\n shadow: false,\n})\nexport class ZAnchorNavigation {\n /**\n * If enabled, the text of each anchor will be hidden unless\n * for the current one or the one the user is hovering.\n */\n @Prop({reflect: true})\n hideUnselected = false;\n\n /**\n * Enables automatic inference of the current item, listening for hash change\n * and checking the `href` of the slotted anchors.\n * When disabled, the highlight of current item must be handled manually by setting the `data-current`\n * attribute to the correct slotted items and the `aria-current` attribute to the anchors.\n */\n @Prop()\n autoCurrent = true;\n\n /**\n * Whether the mobile list is collapsed.\n */\n @State()\n collapsed = false;\n\n @Element() host: HTMLZAnchorNavigationElement;\n\n /** Reference to the nav element. */\n private nav: HTMLElement;\n\n /**\n * Set `aria-current` attribute to the anchors.\n */\n private setCurrent(): void {\n const currentElement = Array.from(this.nav.querySelectorAll(\"a\")).find(\n (anchor) => anchor.href === this.host.ownerDocument.location.href\n );\n Array.from(this.nav.children).forEach((item) => {\n const anchor = item instanceof HTMLAnchorElement ? item : item.querySelector(\"a\");\n const isCurrent = anchor === currentElement;\n anchor.setAttribute(\"aria-current\", isCurrent.toString());\n item.toggleAttribute(\"data-current\", isCurrent);\n });\n }\n\n /**\n * Toggle collapsed state.\n */\n private toggleCollapsed(): void {\n this.collapsed = !this.collapsed;\n }\n\n componentDidLoad(): void {\n if (this.autoCurrent) {\n window.addEventListener(\"hashchange\", this.setCurrent.bind(this));\n this.setCurrent();\n }\n }\n\n disconnectedCallback(): void {\n window.removeEventListener(\"hashchange\", this.setCurrent);\n }\n\n render(): HTMLZAnchorNavigationElement {\n return (\n <Host collapsed={this.collapsed}>\n <z-button\n class=\"toggle\"\n variant={ButtonVariant.SECONDARY}\n icon={this.collapsed ? \"chevron-up\" : \"chevron-down\"}\n onClick={this.toggleCollapsed.bind(this)}\n >\n salta a\n </z-button>\n <nav ref={(el) => (this.nav = el)}>\n <slot></slot>\n </nav>\n </Host>\n );\n }\n}\n"]}
|