UNPKG

carbon-components-angular

Version:
1 lines 5.03 kB
{"version":3,"file":"carbon-components-angular-list.mjs","sources":["../../src/list/list-item.directive.ts","../../src/list/list.directive.ts","../../src/list/list.module.ts","../../src/list/carbon-components-angular-list.ts"],"sourcesContent":["import { Directive, HostBinding } from \"@angular/core\";\n\n/**\n * Applies list styling to the item it is used on. Best used with `li`s.\n */\n@Directive({\n\tselector: \"[cdsListItem], [ibmListItem]\"\n})\nexport class ListItemDirective {\n\t@HostBinding(\"class.cds--list__item\") wrapper = true;\n}\n","import {\n\tDirective,\n\tElementRef,\n\tHostBinding,\n\tInput\n} from \"@angular/core\";\n\n/**\n * Applies either ordered or unordered styling to the list container it is applied to.\n *\n * For `ul`s it will apply unordered list styles, and for `ol`s it will apply ordered list styles.\n *\n * If a `ul` or `ol` is nested within a `li` the directive will apply nested list styling.\n *\n * Get started with importing the module:\n *\n * ```typescript\n * import { ListModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-list--basic)\n */\n@Directive({\n\tselector: \"[cdsList], [ibmList]\"\n})\nexport class List {\n\t@HostBinding(\"class.cds--list--ordered\") get ordered() {\n\t\tif (this.nested) { return false; }\n\t\treturn this.elementRef.nativeElement.tagName === \"OL\";\n\t}\n\n\t@HostBinding(\"class.cds--list--unordered\") get unordered() {\n\t\tif (this.nested) { return false; }\n\t\treturn this.elementRef.nativeElement.tagName === \"UL\";\n\t}\n\n\t@HostBinding(\"class.cds--list--nested\") get nested() {\n\t\treturn !!(this.elementRef.nativeElement.parentElement && this.elementRef.nativeElement.parentElement.tagName === \"LI\");\n\t}\n\n\t/**\n\t * Set to `true` to make list expressive\n\t */\n\t@Input() @HostBinding(\"class.cds--list--expressive\") isExpressive = false;\n\n\tconstructor(protected elementRef: ElementRef) {}\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\n\nimport { ListItemDirective } from \"./list-item.directive\";\nimport { List } from \"./list.directive\";\n\n@NgModule({\n\tdeclarations: [\n\t\tListItemDirective,\n\t\tList\n\t],\n\texports: [\n\t\tListItemDirective,\n\t\tList\n\t],\n\timports: [CommonModule]\n})\nexport class ListModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAEA;;AAEG;MAIU,iBAAiB,CAAA;AAH9B,IAAA,WAAA,GAAA;AAIuC,QAAA,IAAO,CAAA,OAAA,GAAG,IAAI,CAAC;KACrD;;8GAFY,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAjB,iBAAiB,EAAA,QAAA,EAAA,8BAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,uBAAA,EAAA,cAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAH7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,8BAA8B;iBACxC,CAAA;8BAEsC,OAAO,EAAA,CAAA;sBAA5C,WAAW;uBAAC,uBAAuB,CAAA;;;ACFrC;;;;;;;;;;;;;;AAcG;MAIU,IAAI,CAAA;AAoBhB,IAAA,WAAA,CAAsB,UAAsB,EAAA;AAAtB,QAAA,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;AAL5C;;AAEG;AACkD,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK,CAAC;KAE1B;AAnBhD,IAAA,IAA6C,OAAO,GAAA;QACnD,IAAI,IAAI,CAAC,MAAM,EAAE;AAAE,YAAA,OAAO,KAAK,CAAC;AAAE,SAAA;QAClC,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,KAAK,IAAI,CAAC;KACtD;AAED,IAAA,IAA+C,SAAS,GAAA;QACvD,IAAI,IAAI,CAAC,MAAM,EAAE;AAAE,YAAA,OAAO,KAAK,CAA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