carbon-components-angular 5.47.2 → 5.49.0
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/docs/documentation/classes/NumberChange.html +34 -0
- package/docs/documentation/components/ListRow.html +67 -236
- package/docs/documentation/components/NumberComponent.html +48 -14
- package/docs/documentation/components/PaginationNav.html +262 -33
- package/docs/documentation/components/ProgressIndicator.html +2 -2
- package/docs/documentation/components/StructuredList.html +1 -1
- package/docs/documentation/coverage.html +7 -7
- package/docs/documentation/interfaces/PaginationNavTranslations.html +20 -2
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/ComboBoxModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ComboBoxModule.html +4 -4
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +38 -34
- package/docs/documentation/modules/DatePickerInputModule.html +38 -34
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +56 -52
- package/docs/documentation/modules/DatePickerModule.html +56 -52
- package/docs/documentation/modules/FileUploaderModule/dependencies.svg +35 -35
- package/docs/documentation/modules/FileUploaderModule.html +35 -35
- package/docs/documentation/modules/InlineLoadingModule/dependencies.svg +4 -4
- package/docs/documentation/modules/InlineLoadingModule.html +4 -4
- package/docs/documentation/modules/ProgressBarModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ProgressBarModule.html +4 -4
- package/docs/documentation/modules/RadioModule/dependencies.svg +35 -35
- package/docs/documentation/modules/RadioModule.html +35 -35
- package/docs/documentation/modules/SearchModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SearchModule.html +4 -4
- package/docs/documentation/modules/SelectModule/dependencies.svg +60 -60
- package/docs/documentation/modules/SelectModule.html +60 -60
- package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SliderModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TableModule.html +4 -4
- package/docs/documentation/modules/TabsModule/dependencies.svg +68 -68
- package/docs/documentation/modules/TabsModule.html +68 -68
- package/docs/documentation/modules/TagModule/dependencies.svg +28 -28
- package/docs/documentation/modules/TagModule.html +28 -28
- package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ThemeModule.html +4 -4
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TimePickerSelectModule.html +4 -4
- package/docs/documentation/modules/ToggleModule/dependencies.svg +38 -42
- package/docs/documentation/modules/ToggleModule.html +38 -42
- package/docs/documentation/modules/TooltipModule/dependencies.svg +28 -28
- package/docs/documentation/modules/TooltipModule.html +28 -28
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +32 -32
- package/docs/documentation/modules/TreeviewModule.html +32 -32
- package/docs/documentation.json +188 -170
- package/docs/storybook/{8341.2bf88948.iframe.bundle.js → 8341.d095fdee.iframe.bundle.js} +1 -1
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.11fd86ca.iframe.bundle.js +1 -0
- package/docs/storybook/main.css +3007 -2790
- package/docs/storybook/{number-input-number-stories.6aba5a3d.iframe.bundle.js → number-input-number-stories.8d02c22f.iframe.bundle.js} +1 -1
- package/docs/storybook/pagination-pagination-nav-stories.7b305bf2.iframe.bundle.js +1 -0
- package/docs/storybook/patterns-filtering-multiple-categories-stories.17085244.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.14d57f59.iframe.bundle.js → runtime~main.807a23cc.iframe.bundle.js} +1 -1
- package/docs/storybook/{structured-list-structured-list-stories.c86ef32b.iframe.bundle.js → structured-list-structured-list-stories.e6a4535e.iframe.bundle.js} +1 -1
- package/esm2020/number-input/number.component.mjs +31 -1
- package/esm2020/pagination/pagination-nav/pagination-nav.component.mjs +32 -5
- package/esm2020/progress-indicator/progress-indicator.component.mjs +2 -2
- package/esm2020/structured-list/list-row.component.mjs +14 -20
- package/esm2020/structured-list/structured-list.component.mjs +2 -2
- package/fesm2015/carbon-components-angular-number-input.mjs +30 -0
- package/fesm2015/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-pagination.mjs +31 -4
- package/fesm2015/carbon-components-angular-pagination.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-progress-indicator.mjs +1 -1
- package/fesm2015/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-structured-list.mjs +14 -20
- package/fesm2015/carbon-components-angular-structured-list.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-number-input.mjs +30 -0
- package/fesm2020/carbon-components-angular-number-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-pagination.mjs +31 -4
- package/fesm2020/carbon-components-angular-pagination.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-progress-indicator.mjs +1 -1
- package/fesm2020/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-structured-list.mjs +14 -20
- package/fesm2020/carbon-components-angular-structured-list.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination/pagination-nav/pagination-nav.component.d.ts +8 -1
- package/progress-indicator/progress-indicator.component.d.ts +1 -1
- package/structured-list/list-row.component.d.ts +1 -3
- package/docs/storybook/main.ca52fea9.iframe.bundle.js +0 -1
- package/docs/storybook/pagination-pagination-nav-stories.ace8938b.iframe.bundle.js +0 -1
- package/docs/storybook/patterns-filtering-multiple-categories-stories.487f9487.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -1461,12 +1461,12 @@
|
|
|
1461
1461
|
},
|
|
1462
1462
|
{
|
|
1463
1463
|
"name": "PaginationNavTranslations",
|
|
1464
|
-
"id": "interface-PaginationNavTranslations-
|
|
1464
|
+
"id": "interface-PaginationNavTranslations-02747b3f02dda4195eb9b8d17de227f10ddb93cd71d7303c3e81567547ccb446b5f32191b820b258e4c180ac7d7172629000d09893bd3b623c8f47837e111b52",
|
|
1465
1465
|
"file": "src/pagination/pagination-nav/pagination-nav.component.ts",
|
|
1466
1466
|
"deprecated": false,
|
|
1467
1467
|
"deprecationMessage": "",
|
|
1468
1468
|
"type": "interface",
|
|
1469
|
-
"sourceCode": "import { PaginationModel } from \"../pagination-model.class\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { ExperimentalService } from \"carbon-components-angular/experimental\";\nimport { merge } from \"carbon-components-angular/utils\";\nimport { range } from \"carbon-components-angular/common\";\n\nexport interface PaginationNavTranslations {\n\tNEXT: string;\n\tPREVIOUS: string;\n}\n\n/**\n * Use pagination when you have multiple pages of data to handle. Get started with importing the module:\n *\n * ```typescript\n * import { PaginationModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-pagination-nav [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination-nav>\n * ```\n *\n * In your `selectPage()` method set the `model.currentPage` to selected page, _after_\n * you load the page.\n *\n * ```typescript\n * selectPage(page) {\n * \t// ... your code to load the page goes here\n *\n * \tthis.model.currentPage = page;\n *\n * \t// ... anything you want to do after page selection changes goes here\n * }\n * ```\n *\n * [See demo](../../?path=/story/components-pagination-nav--basic)\n */\n@Component({\n\tselector: \"cds-pagination-nav, ibm-pagination-navm\",\n\ttemplate: `\n\t<div>\n\t\t<div class=\"cds--pagination-nav\">\n\t\t\t<ul class=\"cds--pagination-nav__list\">\n\t\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t\t<cds-icon-button\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\
|
|
1469
|
+
"sourceCode": "import { PaginationModel } from \"../pagination-model.class\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tHostBinding\n} from \"@angular/core\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { ExperimentalService } from \"carbon-components-angular/experimental\";\nimport { merge } from \"carbon-components-angular/utils\";\nimport { range } from \"carbon-components-angular/common\";\n\nexport interface PaginationNavTranslations {\n\tNEXT: string;\n\tPREVIOUS: string;\n}\n\n/**\n * Use pagination when you have multiple pages of data to handle. Get started with importing the module:\n *\n * ```typescript\n * import { PaginationModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-pagination-nav [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination-nav>\n * ```\n *\n * In your `selectPage()` method set the `model.currentPage` to selected page, _after_\n * you load the page.\n *\n * ```typescript\n * selectPage(page) {\n * \t// ... your code to load the page goes here\n *\n * \tthis.model.currentPage = page;\n *\n * \t// ... anything you want to do after page selection changes goes here\n * }\n * ```\n *\n * [See demo](../../?path=/story/components-pagination-nav--basic)\n */\n@Component({\n\tselector: \"cds-pagination-nav, ibm-pagination-navm\",\n\ttemplate: `\n\t<div>\n\t\t<div class=\"cds--pagination-nav\">\n\t\t\t<ul class=\"cds--pagination-nav__list\">\n\t\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t\t<cds-icon-button\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t\t(click)=\"jumpToPrevious()\"\n\t\t\t\t\t\t[disabled]=\"leftArrowDisabled\"\n\t\t\t\t\t\t[description]=\"previousItemText.subject | async\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tcdsIcon=\"caret--left\"\n\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\tclass=\"cds--btn__icon\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</cds-icon-button>\n\t\t\t\t</li>\n\t\t\t\t<cds-pagination-nav-item\n\t\t\t\t\t*ngIf=\"this.numOfItemsToShow >= 5 || (this.numOfItemsToShow <= 4 && currentPage <= 1)\"\n\t\t\t\t\tpage=\"1\"\n\t\t\t\t\t(click)=\"currentPage = 1\"\n\t\t\t\t\t[isActive]=\"currentPage == 1\">\n\t\t\t\t</cds-pagination-nav-item>\n\t\t\t\t<cds-pagination-overflow\n\t\t\t\t\t*ngIf=\"frontCuts\"\n\t\t\t\t\t[count]=\"frontCuts\"\n\t\t\t\t\t[fromIndex]=\"startOffset\"\n\t\t\t\t\t(change)=\"handleOverflowSelection($event)\">\n\t\t\t\t</cds-pagination-overflow>\n\t\t\t\t<cds-pagination-nav-item\n\t\t\t\t\t*ngFor=\"let page of getPages();\"\n\t\t\t\t\t[page]=\"page\"\n\t\t\t\t\t(click)=\"currentPage = page\"\n\t\t\t\t\t[isActive]=\"currentPage == page\">\n\t\t\t\t</cds-pagination-nav-item>\n\t\t\t\t<cds-pagination-overflow\n\t\t\t\t\t*ngIf=\"backCuts\"\n\t\t\t\t\t[count]=\"backCuts\"\n\t\t\t\t\t[fromIndex]=\"totalNumbersArray.length - backCuts - 1\"\n\t\t\t\t\t(change)=\"handleOverflowSelection($event)\">\n\t\t\t\t</cds-pagination-overflow>\n\t\t\t\t<cds-pagination-nav-item\n\t\t\t\t\t*ngIf=\"totalDataLength > 1\"\n\t\t\t\t\t[page]=\"totalNumbersArray.length\"\n\t\t\t\t\t(click)=\"currentPage = totalNumbersArray.length\"\n\t\t\t\t\t[isActive]=\"currentPage == totalNumbersArray.length\">\n\t\t\t\t</cds-pagination-nav-item>\n\t\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t\t<cds-icon-button\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t\t(click)=\"jumpToNext()\"\n\t\t\t\t\t\t[disabled]=\"rightArrowDisabled\"\n\t\t\t\t\t\t[description]=\"nextItemText.subject | async\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tcdsIcon=\"caret--right\"\n\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\tclass=\"cds--btn__icon\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</cds-icon-button>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t`\n})\nexport class PaginationNav {\n\tstatic paginationCounter = 0;\n\t/**\n\t * `PaginationNavModel` with the information about pages you're controlling.\n\t */\n\t@Input() model: PaginationModel;\n\t/**\n\t * Set to `true` to disable the backward/forward buttons.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Number of items to show in pagination. Minimum is 4.\n\t */\n\t@Input() numOfItemsToShow = 4;\n\n\t/**\n\t * Expects an object that contains some or all of:\n\t * ```\n\t * {\n\t *\t\t\"NEXT\": \"Next\",\n\t *\t\t\"PREVIOUS\": \"Previous\",\n\t * }\n\t * ```\n\t */\n\t@Input()\n\tset translations(value: PaginationNavTranslations) {\n\t\tconst valueWithDefaults = merge(this.i18n.getMultiple(\"PAGINATION\"), value);\n\t\tthis.nextItemText.override(valueWithDefaults.NEXT);\n\t\tthis.previousItemText.override(valueWithDefaults.PREVIOUS);\n\t}\n\n\t/**\n\t * Sets the pagination nav size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"lg\";\n\n\t// Size\n\t@HostBinding(\"class.cds--layout--size-sm\") get smallLayoutSize() {\n\t\treturn this.size === \"sm\";\n\t}\n\t@HostBinding(\"class.cds--layout--size-md\") get mediumLayoutSize() {\n\t\treturn this.size === \"md\";\n\t}\n\t@HostBinding(\"class.cds--layout--size-lg\") get largeLayoutSize() {\n\t\treturn this.size === \"lg\";\n\t}\n\n\t/**\n\t * Emits the new page number.\n\t *\n\t * You should tie into this and update `model.currentPage` once the fresh\n\t * data is finally loaded.\n\t */\n\t@Output() selectPage = new EventEmitter<number>();\n\n\tget totalNumbersArray() {\n\t\treturn range(this.totalDataLength + 1, 1);\n\t}\n\n\tget currentPage() {\n\t\treturn this.model.currentPage;\n\t}\n\n\tset currentPage(value) {\n\t\tvalue = Number(value);\n\t\t// emits the value to allow the user to update current page\n\t\t// in the model once the page is loaded\n\t\tthis.selectPage.emit(value);\n\t}\n\n\tget totalDataLength() {\n\t\treturn this.model.totalDataLength;\n\t}\n\n\tget startOffset() {\n\t\treturn this.numOfItemsToShow <= 4 && this.currentPage > 1 ? 0 : 1;\n\t}\n\n\tget frontCuts() {\n\t\tconst cuts = this.getCuts();\n\t\treturn cuts.front;\n\t}\n\n\tget backCuts() {\n\t\tconst cuts = this.getCuts();\n\t\treturn cuts.back;\n\t}\n\n\tget leftArrowDisabled() {\n\t\treturn this.disabled || this.currentPage === 1;\n\t}\n\n\tget rightArrowDisabled() {\n\t\treturn this.disabled || this.currentPage === this.totalDataLength;\n\t}\n\n\tnextItemText = this.i18n.getOverridable(\"PAGINATION.NEXT\");\n\tpreviousItemText = this.i18n.getOverridable(\"PAGINATION.PREVIOUS\");\n\n\tconstructor(protected i18n: I18n, protected experimental: ExperimentalService) {\n\t\tPaginationNav.paginationCounter++;\n\t}\n\n\thandleOverflowSelection(page) {\n\t\tif (typeof page === \"number\") {\n\t\t\tthis.currentPage = page;\n\t\t}\n\t}\n\n\tpublic jumpToNext() {\n\t\tthis.currentPage = this.currentPage < this.totalDataLength ? this.currentPage + 1 : this.totalDataLength;\n\t}\n\n\tpublic jumpToPrevious() {\n\t\tthis.currentPage = this.currentPage > 1 ? this.currentPage - 1 : 1;\n\t}\n\n\tpublic getPages() {\n\t\tif (this.totalDataLength <= 1) {\n\t\t\treturn null;\n\t\t}\n\t\tconst cuts = this.getCuts();\n\t\treturn this.totalNumbersArray.slice(this.startOffset + cuts.front, (1 + cuts.back) * -1);\n\t}\n\n\tprivate getCuts(splitPoint = null) {\n\t\tconst page = this.currentPage - 1;\n\t\tconst totalItems = this.totalDataLength;\n\t\tconst itemsThatFit = this.numOfItemsToShow;\n\n\t\tif (itemsThatFit >= totalItems) {\n\t\t\treturn {\n\t\t\t\tfront: 0,\n\t\t\t\tback: 0\n\t\t\t};\n\t\t}\n\t\tconst split = splitPoint || Math.ceil(itemsThatFit / 2) - 1;\n\t\tlet frontHidden = page + 1 - split;\n\t\tlet backHidden = totalItems - page - (itemsThatFit - split) + 1;\n\n\t\tif (frontHidden <= 1) {\n\t\t\tbackHidden -= frontHidden <= 0 ? Math.abs(frontHidden) + 1 : 0;\n\t\t\tfrontHidden = 0;\n\t\t}\n\t\tif (backHidden <= 1) {\n\t\t\tfrontHidden -= backHidden <= 0 ? Math.abs(backHidden) + 1 : 0;\n\t\t\tbackHidden = 0;\n\t\t}\n\t\treturn {\n\t\t\tfront: frontHidden,\n\t\t\tback: backHidden\n\t\t};\n\t}\n}\n",
|
|
1470
1470
|
"properties": [
|
|
1471
1471
|
{
|
|
1472
1472
|
"name": "NEXT",
|
|
@@ -1475,7 +1475,7 @@
|
|
|
1475
1475
|
"type": "string",
|
|
1476
1476
|
"optional": false,
|
|
1477
1477
|
"description": "",
|
|
1478
|
-
"line":
|
|
1478
|
+
"line": 16
|
|
1479
1479
|
},
|
|
1480
1480
|
{
|
|
1481
1481
|
"name": "PREVIOUS",
|
|
@@ -1484,7 +1484,7 @@
|
|
|
1484
1484
|
"type": "string",
|
|
1485
1485
|
"optional": false,
|
|
1486
1486
|
"description": "",
|
|
1487
|
-
"line":
|
|
1487
|
+
"line": 17
|
|
1488
1488
|
}
|
|
1489
1489
|
],
|
|
1490
1490
|
"indexSignatures": [],
|
|
@@ -7051,12 +7051,12 @@
|
|
|
7051
7051
|
},
|
|
7052
7052
|
{
|
|
7053
7053
|
"name": "NumberChange",
|
|
7054
|
-
"id": "class-NumberChange-
|
|
7054
|
+
"id": "class-NumberChange-fe20fe65939c8d249815e7b930825da7d9229c32f54dbd3496ec81d6605b4b2f291e5ea9d9ed648e5d850c504af01a335a7caf96b73baaad8c4717ab91830c1f",
|
|
7055
7055
|
"file": "src/number-input/number.component.ts",
|
|
7056
7056
|
"deprecated": false,
|
|
7057
7057
|
"deprecationMessage": "",
|
|
7058
7058
|
"type": "class",
|
|
7059
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(focus)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(blur)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr *ngIf=\"fluid\" class=\"cds--number-input__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--number-input--fluid\") @Input() fluid = false;\n\n\t@HostBinding(\"class.cds--number-input--fluid--invalid\") get fluidInvalid() {\n\t\treturn this.fluid && this.invalid;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--disabled\") get fluidDisabled() {\n\t\treturn this.fluid && this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--focus\") get fluidFocus() {\n\t\treturn this.fluid && this._isFocused;\n\t}\n\n\t@HostBinding(\"class.cds--text-input--fluid__skeleton\") get fluidSkeleton() {\n\t\treturn this.fluid && this.skeleton;\n\t}\n\n\tprotected _isFocused = false;\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tif (\"type\" in event.target && (<HTMLInputElement>event.target).type === \"button\") {\n\t\t\tthis._isFocused = false;\n\t\t} else {\n\t\t\tthis._isFocused = event.type === \"focus\";\n\t\t}\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
7059
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(focus)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(blur)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr *ngIf=\"fluid\" class=\"cds--number-input__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--number-input--fluid\") @Input() fluid = false;\n\n\t@HostBinding(\"class.cds--number-input--fluid--invalid\") get fluidInvalid() {\n\t\treturn this.fluid && this.invalid;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--disabled\") get fluidDisabled() {\n\t\treturn this.fluid && this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--focus\") get fluidFocus() {\n\t\treturn this.fluid && this._isFocused;\n\t}\n\n\t@HostBinding(\"class.cds--text-input--fluid__skeleton\") get fluidSkeleton() {\n\t\treturn this.fluid && this.skeleton;\n\t}\n\n\tprotected _isFocused = false;\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\t// if max is set and value + step is greater than max, set value to max\n\t\t// example: max = 100, step = 10, value = 95 , value + step = 105, value will be set to 100 (max) instead of 105\n\t\tif (this.max !== null && this.value + this.step > this.max) {\n\t\t\tthis.value = this.max;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if min is set and value + step is less than min, set value to min\n\t\t// example: min = 5, step = 2, value = 0, value + step = 2, value will be set to 5 (min) instead of 2\n\t\tif (this.min !== null && this.value + this.step < this.min) {\n\t\t\tthis.value = this.min;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if max is not set or value + step is less than max, increment value by step\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\t// if max is set and value - step is greater than max, set value to max\n\t\t// example: max = 15, step = 2, value = 20, value - step = 18, value will be set to 15 (max) instead of 18\n\t\tif (this.max !== null && this.value - this.step > this.max) {\n\t\t\tthis.value = this.max;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if min is set and value - step is less than min, set value to min\n\t\t// example: min = 5, step = 2, value = 6, value - step = 4, value will be set to 5 (min) instead of 4\n\t\tif (this.min !== null && this.value - this.step < this.min) {\n\t\t\tthis.value = this.min;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if min is not set or value - step is greater than min, decrement value by step\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tif (\"type\" in event.target && (<HTMLInputElement>event.target).type === \"button\") {\n\t\t\tthis._isFocused = false;\n\t\t} else {\n\t\t\tthis._isFocused = event.type === \"focus\";\n\t\t}\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
7060
7060
|
"inputsClass": [],
|
|
7061
7061
|
"outputsClass": [],
|
|
7062
7062
|
"properties": [
|
|
@@ -36053,7 +36053,7 @@
|
|
|
36053
36053
|
},
|
|
36054
36054
|
{
|
|
36055
36055
|
"name": "ListRow",
|
|
36056
|
-
"id": "component-ListRow-
|
|
36056
|
+
"id": "component-ListRow-a4df99227a20b8139056c28b5a99ebf53dc7674812b105f3176175e3e6adeb92949dc089ce6c7a525c4d3c15715b9a62b42538cd998a0dd0eb25e615143f5722",
|
|
36057
36057
|
"file": "src/structured-list/list-row.component.ts",
|
|
36058
36058
|
"encapsulation": [],
|
|
36059
36059
|
"entryComponents": [],
|
|
@@ -36063,7 +36063,7 @@
|
|
|
36063
36063
|
"selector": "cds-list-row, ibm-list-row",
|
|
36064
36064
|
"styleUrls": [],
|
|
36065
36065
|
"styles": [],
|
|
36066
|
-
"template": "<ng-content></ng-content>\n<ng-container *ngIf=\"selection\">\n\t<input\n\t\t#input\n\t\
|
|
36066
|
+
"template": "<ng-content></ng-content>\n<ng-container *ngIf=\"selection\">\n\t<input\n\t\t#input\n\t\tclass=\"cds--structured-list-input cds--visually-hidden\"\n\t\ttype=\"radio\"\n\t\t[value]=\"value\"\n\t\t[name]=\"name\"\n\t\t[title]=\"label\"\n\t\t(focus)=\"handleFocus(true)\"\n\t\t(blur)=\"handleFocus(false)\"\n\t\t(change)=\"onChange($event)\"\n\t\t[checked]=\"selected\"/>\n\t<div class=\"cds--structured-list-td\">\n\t\t<svg cdsIcon=\"checkmark--filled\" size=\"16\" class=\"cds--structured-list-svg\"></svg>\n\t</div>\n</ng-container>\n\t",
|
|
36067
36067
|
"templateUrl": [],
|
|
36068
36068
|
"viewProviders": [],
|
|
36069
36069
|
"hostDirectives": [],
|
|
@@ -36074,7 +36074,7 @@
|
|
|
36074
36074
|
"deprecationMessage": "",
|
|
36075
36075
|
"rawdescription": "\n\nApplies an accessible label to the row. Defaults to no label.\n",
|
|
36076
36076
|
"description": "<p>Applies an accessible label to the row. Defaults to no label.</p>\n",
|
|
36077
|
-
"line":
|
|
36077
|
+
"line": 64,
|
|
36078
36078
|
"type": "any",
|
|
36079
36079
|
"decorators": []
|
|
36080
36080
|
},
|
|
@@ -36083,7 +36083,7 @@
|
|
|
36083
36083
|
"defaultValue": "false",
|
|
36084
36084
|
"deprecated": false,
|
|
36085
36085
|
"deprecationMessage": "",
|
|
36086
|
-
"line":
|
|
36086
|
+
"line": 60,
|
|
36087
36087
|
"type": "boolean",
|
|
36088
36088
|
"decorators": []
|
|
36089
36089
|
},
|
|
@@ -36093,7 +36093,7 @@
|
|
|
36093
36093
|
"deprecationMessage": "",
|
|
36094
36094
|
"rawdescription": "\n\nThe value for the row. Returned via `ngModel` or `selected` event on the containing `StructuredList`.\n",
|
|
36095
36095
|
"description": "<p>The value for the row. Returned via <code>ngModel</code> or <code>selected</code> event on the containing <code>StructuredList</code>.</p>\n",
|
|
36096
|
-
"line":
|
|
36096
|
+
"line": 68,
|
|
36097
36097
|
"type": "any",
|
|
36098
36098
|
"decorators": []
|
|
36099
36099
|
}
|
|
@@ -36106,7 +36106,7 @@
|
|
|
36106
36106
|
"deprecationMessage": "",
|
|
36107
36107
|
"rawdescription": "\n\nInternal event used to notify the containing `StructuredList` of changes.\n",
|
|
36108
36108
|
"description": "<p>Internal event used to notify the containing <code>StructuredList</code> of changes.</p>\n",
|
|
36109
|
-
"line":
|
|
36109
|
+
"line": 72,
|
|
36110
36110
|
"type": "EventEmitter<Event>"
|
|
36111
36111
|
}
|
|
36112
36112
|
],
|
|
@@ -36155,7 +36155,7 @@
|
|
|
36155
36155
|
"type": "string",
|
|
36156
36156
|
"optional": false,
|
|
36157
36157
|
"description": "<p>Set by the containing <code>StructuredList</code>. When <code>selection = true</code>, used for the <code>name</code> property on the radio input.</p>\n",
|
|
36158
|
-
"line":
|
|
36158
|
+
"line": 81,
|
|
36159
36159
|
"rawdescription": "\n\nSet by the containing `StructuredList`. When `selection = true`, used for the `name` property on the radio input.\n"
|
|
36160
36160
|
},
|
|
36161
36161
|
{
|
|
@@ -36185,28 +36185,9 @@
|
|
|
36185
36185
|
"type": "",
|
|
36186
36186
|
"optional": false,
|
|
36187
36187
|
"description": "<p>Set by the containing <code>StructuredList</code>. Enables or disables row level selection features.</p>\n",
|
|
36188
|
-
"line":
|
|
36188
|
+
"line": 77,
|
|
36189
36189
|
"rawdescription": "\n\nSet by the containing `StructuredList`. Enables or disables row level selection features.\n"
|
|
36190
36190
|
},
|
|
36191
|
-
{
|
|
36192
|
-
"name": "tabindex",
|
|
36193
|
-
"defaultValue": "this.selection ? \"0\" : null",
|
|
36194
|
-
"deprecated": false,
|
|
36195
|
-
"deprecationMessage": "",
|
|
36196
|
-
"type": "",
|
|
36197
|
-
"optional": false,
|
|
36198
|
-
"description": "",
|
|
36199
|
-
"line": 83,
|
|
36200
|
-
"decorators": [
|
|
36201
|
-
{
|
|
36202
|
-
"name": "HostBinding",
|
|
36203
|
-
"stringifiedArguments": "'attr.tabindex'"
|
|
36204
|
-
}
|
|
36205
|
-
],
|
|
36206
|
-
"modifierKind": [
|
|
36207
|
-
170
|
|
36208
|
-
]
|
|
36209
|
-
},
|
|
36210
36191
|
{
|
|
36211
36192
|
"name": "wrapper",
|
|
36212
36193
|
"defaultValue": "true",
|
|
@@ -36215,7 +36196,7 @@
|
|
|
36215
36196
|
"type": "",
|
|
36216
36197
|
"optional": false,
|
|
36217
36198
|
"description": "",
|
|
36218
|
-
"line":
|
|
36199
|
+
"line": 83,
|
|
36219
36200
|
"decorators": [
|
|
36220
36201
|
{
|
|
36221
36202
|
"name": "HostBinding",
|
|
@@ -36229,22 +36210,31 @@
|
|
|
36229
36210
|
],
|
|
36230
36211
|
"methodsClass": [
|
|
36231
36212
|
{
|
|
36232
|
-
"name": "
|
|
36233
|
-
"args": [
|
|
36213
|
+
"name": "handleFocus",
|
|
36214
|
+
"args": [
|
|
36215
|
+
{
|
|
36216
|
+
"name": "isFocused",
|
|
36217
|
+
"type": "",
|
|
36218
|
+
"deprecated": false,
|
|
36219
|
+
"deprecationMessage": ""
|
|
36220
|
+
}
|
|
36221
|
+
],
|
|
36234
36222
|
"optional": false,
|
|
36235
36223
|
"returnType": "void",
|
|
36236
36224
|
"typeParameters": [],
|
|
36237
|
-
"line":
|
|
36225
|
+
"line": 110,
|
|
36238
36226
|
"deprecated": false,
|
|
36239
36227
|
"deprecationMessage": "",
|
|
36240
|
-
"
|
|
36228
|
+
"jsdoctags": [
|
|
36241
36229
|
{
|
|
36242
|
-
"name": "
|
|
36243
|
-
"
|
|
36230
|
+
"name": "isFocused",
|
|
36231
|
+
"type": "",
|
|
36232
|
+
"deprecated": false,
|
|
36233
|
+
"deprecationMessage": "",
|
|
36234
|
+
"tagName": {
|
|
36235
|
+
"text": "param"
|
|
36236
|
+
}
|
|
36244
36237
|
}
|
|
36245
|
-
],
|
|
36246
|
-
"modifierKind": [
|
|
36247
|
-
170
|
|
36248
36238
|
]
|
|
36249
36239
|
},
|
|
36250
36240
|
{
|
|
@@ -36260,7 +36250,7 @@
|
|
|
36260
36250
|
"optional": false,
|
|
36261
36251
|
"returnType": "void",
|
|
36262
36252
|
"typeParameters": [],
|
|
36263
|
-
"line":
|
|
36253
|
+
"line": 106,
|
|
36264
36254
|
"deprecated": false,
|
|
36265
36255
|
"deprecationMessage": "",
|
|
36266
36256
|
"jsdoctags": [
|
|
@@ -36293,25 +36283,6 @@
|
|
|
36293
36283
|
"modifierKind": [
|
|
36294
36284
|
170
|
|
36295
36285
|
]
|
|
36296
|
-
},
|
|
36297
|
-
{
|
|
36298
|
-
"name": "onfocus",
|
|
36299
|
-
"args": [],
|
|
36300
|
-
"optional": false,
|
|
36301
|
-
"returnType": "void",
|
|
36302
|
-
"typeParameters": [],
|
|
36303
|
-
"line": 107,
|
|
36304
|
-
"deprecated": false,
|
|
36305
|
-
"deprecationMessage": "",
|
|
36306
|
-
"decorators": [
|
|
36307
|
-
{
|
|
36308
|
-
"name": "HostListener",
|
|
36309
|
-
"stringifiedArguments": "'focus'"
|
|
36310
|
-
}
|
|
36311
|
-
],
|
|
36312
|
-
"modifierKind": [
|
|
36313
|
-
170
|
|
36314
|
-
]
|
|
36315
36286
|
}
|
|
36316
36287
|
],
|
|
36317
36288
|
"deprecated": false,
|
|
@@ -36326,21 +36297,12 @@
|
|
|
36326
36297
|
"type": "string",
|
|
36327
36298
|
"decorators": []
|
|
36328
36299
|
},
|
|
36329
|
-
{
|
|
36330
|
-
"name": "attr.tabindex",
|
|
36331
|
-
"defaultValue": "this.selection ? \"0\" : null",
|
|
36332
|
-
"deprecated": false,
|
|
36333
|
-
"deprecationMessage": "",
|
|
36334
|
-
"line": 83,
|
|
36335
|
-
"type": "string",
|
|
36336
|
-
"decorators": []
|
|
36337
|
-
},
|
|
36338
36300
|
{
|
|
36339
36301
|
"name": "class.cds--structured-list-row",
|
|
36340
36302
|
"defaultValue": "true",
|
|
36341
36303
|
"deprecated": false,
|
|
36342
36304
|
"deprecationMessage": "",
|
|
36343
|
-
"line":
|
|
36305
|
+
"line": 83,
|
|
36344
36306
|
"type": "boolean",
|
|
36345
36307
|
"decorators": []
|
|
36346
36308
|
},
|
|
@@ -36348,20 +36310,12 @@
|
|
|
36348
36310
|
"name": "class.cds--structured-list-row--focused-within",
|
|
36349
36311
|
"deprecated": false,
|
|
36350
36312
|
"deprecationMessage": "",
|
|
36351
|
-
"line":
|
|
36313
|
+
"line": 57,
|
|
36352
36314
|
"type": "boolean",
|
|
36353
36315
|
"decorators": []
|
|
36354
36316
|
}
|
|
36355
36317
|
],
|
|
36356
36318
|
"hostListeners": [
|
|
36357
|
-
{
|
|
36358
|
-
"name": "blur",
|
|
36359
|
-
"args": [],
|
|
36360
|
-
"argsDecorator": [],
|
|
36361
|
-
"deprecated": false,
|
|
36362
|
-
"deprecationMessage": "",
|
|
36363
|
-
"line": 112
|
|
36364
|
-
},
|
|
36365
36319
|
{
|
|
36366
36320
|
"name": "click",
|
|
36367
36321
|
"args": [],
|
|
@@ -36369,14 +36323,6 @@
|
|
|
36369
36323
|
"deprecated": false,
|
|
36370
36324
|
"deprecationMessage": "",
|
|
36371
36325
|
"line": 100
|
|
36372
|
-
},
|
|
36373
|
-
{
|
|
36374
|
-
"name": "focus",
|
|
36375
|
-
"args": [],
|
|
36376
|
-
"argsDecorator": [],
|
|
36377
|
-
"deprecated": false,
|
|
36378
|
-
"deprecationMessage": "",
|
|
36379
|
-
"line": 107
|
|
36380
36326
|
}
|
|
36381
36327
|
],
|
|
36382
36328
|
"standalone": false,
|
|
@@ -36384,7 +36330,7 @@
|
|
|
36384
36330
|
"description": "<p><code>ListRow</code> provides a container for the <code>ListColumn</code>s that make up the body of a structured list.</p>\n<p>Example:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"> <cds-list-row>\n <cds-list-column>Row 1</cds-list-column>\n <cds-list-column nowrap="true">Row One</cds-list-column>\n <cds-list-column>\n Lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Nunc dui magna,\n finibus id tortor sed, aliquet bibendum augue.\n Aenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n Pellentesque vulputate nisl a porttitor interdum.\n </cds-list-column>\n </cds-list-row></code></pre></div>",
|
|
36385
36331
|
"rawdescription": "\n\n`ListRow` provides a container for the `ListColumn`s that make up the body of a structured list.\n\nExample:\n```html\n\t<cds-list-row>\n\t\t<cds-list-column>Row 1</cds-list-column>\n\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n\t\t<cds-list-column>\n\t\t\tLorem ipsum dolor sit amet,\n\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t</cds-list-column>\n\t</cds-list-row>\n```\n",
|
|
36386
36332
|
"type": "component",
|
|
36387
|
-
"sourceCode": "import {\n\tComponent,\n\tHostBinding,\n\tContentChildren,\n\tQueryList,\n\tAfterContentInit,\n\tInput,\n\tHostListener,\n\tViewChild,\n\tElementRef,\n\tEventEmitter,\n\tOutput\n} from \"@angular/core\";\nimport { ListColumn } from \"./list-column.component\";\n\n/**\n * `ListRow` provides a container for the `ListColumn`s that make up the body of a structured list.\n *\n * Example:\n * ```html\n * \t<cds-list-row>\n *\t\t<cds-list-column>Row 1</cds-list-column>\n *\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n *\t\t<cds-list-column>\n *\t\t\tLorem ipsum dolor sit amet,\n *\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n *\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n *\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n *\t\t\tPellentesque vulputate nisl a porttitor interdum.\n *\t\t</cds-list-column>\n *\t</cds-list-row>\n * ```\n */\n@Component({\n\tselector: \"cds-list-row, ibm-list-row\",\n\ttemplate: `\n\t\t<ng-content></ng-content>\n\t\t<ng-container *ngIf=\"selection\">\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\
|
|
36333
|
+
"sourceCode": "import {\n\tComponent,\n\tHostBinding,\n\tContentChildren,\n\tQueryList,\n\tAfterContentInit,\n\tInput,\n\tHostListener,\n\tViewChild,\n\tElementRef,\n\tEventEmitter,\n\tOutput\n} from \"@angular/core\";\nimport { ListColumn } from \"./list-column.component\";\n\n/**\n * `ListRow` provides a container for the `ListColumn`s that make up the body of a structured list.\n *\n * Example:\n * ```html\n * \t<cds-list-row>\n *\t\t<cds-list-column>Row 1</cds-list-column>\n *\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n *\t\t<cds-list-column>\n *\t\t\tLorem ipsum dolor sit amet,\n *\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n *\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n *\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n *\t\t\tPellentesque vulputate nisl a porttitor interdum.\n *\t\t</cds-list-column>\n *\t</cds-list-row>\n * ```\n */\n@Component({\n\tselector: \"cds-list-row, ibm-list-row\",\n\ttemplate: `\n\t\t<ng-content></ng-content>\n\t\t<ng-container *ngIf=\"selection\">\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\tclass=\"cds--structured-list-input cds--visually-hidden\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\t[value]=\"value\"\n\t\t\t\t[name]=\"name\"\n\t\t\t\t[title]=\"label\"\n\t\t\t\t(focus)=\"handleFocus(true)\"\n\t\t\t\t(blur)=\"handleFocus(false)\"\n\t\t\t\t(change)=\"onChange($event)\"\n\t\t\t\t[checked]=\"selected\"/>\n\t\t\t<div class=\"cds--structured-list-td\">\n\t\t\t\t<svg cdsIcon=\"checkmark--filled\" size=\"16\" class=\"cds--structured-list-svg\"></svg>\n\t\t\t</div>\n\t\t</ng-container>\n\t`\n})\nexport class ListRow implements AfterContentInit {\n\t@HostBinding(\"class.cds--structured-list-row--focused-within\") get focusClass() {\n\t\treturn this.isFocused;\n\t}\n\t@Input() @HostBinding(\"class.cds--structured-list-row--selected\") selected = false;\n\t/**\n\t * Applies an accessible label to the row. Defaults to no label.\n\t */\n\t@Input() @HostBinding(\"attr.aria-label\") label;\n\t/**\n\t * The value for the row. Returned via `ngModel` or `selected` event on the containing `StructuredList`.\n\t */\n\t@Input() value;\n\t/**\n\t * Internal event used to notify the containing `StructuredList` of changes.\n\t */\n\t@Output() change: EventEmitter<Event> = new EventEmitter();\n\n\t/**\n\t * Set by the containing `StructuredList`. Enables or disables row level selection features.\n\t */\n\tselection = false;\n\t/**\n\t * Set by the containing `StructuredList`. When `selection = true`, used for the `name` property on the radio input.\n\t */\n\tname = \"list\";\n\n\t@HostBinding(\"class.cds--structured-list-row\") wrapper = true;\n\t@HostBinding(\"attr.role\") role = \"row\";\n\n\t@ContentChildren(ListColumn) columns: QueryList<ListColumn>;\n\n\t@ViewChild(\"input\") input: ElementRef;\n\n\tprivate isFocused = false;\n\n\tngAfterContentInit() {\n\t\tthis.columns.forEach(column => {\n\t\t\tcolumn.isBodyColumn = true;\n\t\t\tcolumn.isHeaderColumn = false;\n\t\t});\n\t}\n\n\t@HostListener(\"click\")\n\tonclick() {\n\t\tif (this.selection) {\n\t\t\tthis.input.nativeElement.click();\n\t\t}\n\t}\n\t\n\tonChange(event) {\n\t\tthis.change.emit(event);\n\t}\n\n\thandleFocus(isFocused) {\n\t\tif (this.selection) {\n\t\t\tthis.isFocused = isFocused;\n\t\t\tif (this.isFocused) {\n\t\t\t\tthis.input.nativeElement.click();\n\t\t\t}\n\t\t}\n\t}\n}\n",
|
|
36388
36334
|
"assetsDirs": [],
|
|
36389
36335
|
"styleUrlsData": "",
|
|
36390
36336
|
"stylesData": "",
|
|
@@ -36399,7 +36345,7 @@
|
|
|
36399
36345
|
"name": "focusClass",
|
|
36400
36346
|
"type": "",
|
|
36401
36347
|
"returnType": "",
|
|
36402
|
-
"line":
|
|
36348
|
+
"line": 57
|
|
36403
36349
|
}
|
|
36404
36350
|
}
|
|
36405
36351
|
}
|
|
@@ -38202,7 +38148,7 @@
|
|
|
38202
38148
|
},
|
|
38203
38149
|
{
|
|
38204
38150
|
"name": "NumberComponent",
|
|
38205
|
-
"id": "component-NumberComponent-
|
|
38151
|
+
"id": "component-NumberComponent-fe20fe65939c8d249815e7b930825da7d9229c32f54dbd3496ec81d6605b4b2f291e5ea9d9ed648e5d850c504af01a335a7caf96b73baaad8c4717ab91830c1f",
|
|
38206
38152
|
"file": "src/number-input/number.component.ts",
|
|
38207
38153
|
"encapsulation": [],
|
|
38208
38154
|
"entryComponents": [],
|
|
@@ -38556,7 +38502,7 @@
|
|
|
38556
38502
|
"optional": false,
|
|
38557
38503
|
"returnType": "void",
|
|
38558
38504
|
"typeParameters": [],
|
|
38559
|
-
"line":
|
|
38505
|
+
"line": 418,
|
|
38560
38506
|
"deprecated": false,
|
|
38561
38507
|
"deprecationMessage": "",
|
|
38562
38508
|
"rawdescription": "\n\nCreates a class of `NumberChange` to emit the change in the `Number`.\n",
|
|
@@ -38587,7 +38533,7 @@
|
|
|
38587
38533
|
"optional": false,
|
|
38588
38534
|
"returnType": "Observable<string>",
|
|
38589
38535
|
"typeParameters": [],
|
|
38590
|
-
"line":
|
|
38536
|
+
"line": 407,
|
|
38591
38537
|
"deprecated": false,
|
|
38592
38538
|
"deprecationMessage": ""
|
|
38593
38539
|
},
|
|
@@ -38597,7 +38543,7 @@
|
|
|
38597
38543
|
"optional": false,
|
|
38598
38544
|
"returnType": "Observable<string>",
|
|
38599
38545
|
"typeParameters": [],
|
|
38600
|
-
"line":
|
|
38546
|
+
"line": 411,
|
|
38601
38547
|
"deprecated": false,
|
|
38602
38548
|
"deprecationMessage": ""
|
|
38603
38549
|
},
|
|
@@ -38614,7 +38560,7 @@
|
|
|
38614
38560
|
"optional": false,
|
|
38615
38561
|
"returnType": "void",
|
|
38616
38562
|
"typeParameters": [],
|
|
38617
|
-
"line":
|
|
38563
|
+
"line": 435,
|
|
38618
38564
|
"deprecated": false,
|
|
38619
38565
|
"deprecationMessage": "",
|
|
38620
38566
|
"jsdoctags": [
|
|
@@ -38642,7 +38588,7 @@
|
|
|
38642
38588
|
"optional": false,
|
|
38643
38589
|
"returnType": "boolean",
|
|
38644
38590
|
"typeParameters": [],
|
|
38645
|
-
"line":
|
|
38591
|
+
"line": 431,
|
|
38646
38592
|
"deprecated": false,
|
|
38647
38593
|
"deprecationMessage": "",
|
|
38648
38594
|
"modifierKind": [
|
|
@@ -38666,7 +38612,7 @@
|
|
|
38666
38612
|
"optional": false,
|
|
38667
38613
|
"returnType": "void",
|
|
38668
38614
|
"typeParameters": [],
|
|
38669
|
-
"line":
|
|
38615
|
+
"line": 382,
|
|
38670
38616
|
"deprecated": false,
|
|
38671
38617
|
"deprecationMessage": "",
|
|
38672
38618
|
"rawdescription": "\n\nSubtracts `step` to the current `value`.\n",
|
|
@@ -38697,7 +38643,7 @@
|
|
|
38697
38643
|
"optional": false,
|
|
38698
38644
|
"returnType": "void",
|
|
38699
38645
|
"typeParameters": [],
|
|
38700
|
-
"line":
|
|
38646
|
+
"line": 426,
|
|
38701
38647
|
"deprecated": false,
|
|
38702
38648
|
"deprecationMessage": "",
|
|
38703
38649
|
"jsdoctags": [
|
|
@@ -38932,7 +38878,7 @@
|
|
|
38932
38878
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { NumberModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-number--basic\">See demo</a></p>\n",
|
|
38933
38879
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { NumberModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-number--basic)\n",
|
|
38934
38880
|
"type": "component",
|
|
38935
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(focus)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(blur)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr *ngIf=\"fluid\" class=\"cds--number-input__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--number-input--fluid\") @Input() fluid = false;\n\n\t@HostBinding(\"class.cds--number-input--fluid--invalid\") get fluidInvalid() {\n\t\treturn this.fluid && this.invalid;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--disabled\") get fluidDisabled() {\n\t\treturn this.fluid && this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--focus\") get fluidFocus() {\n\t\treturn this.fluid && this._isFocused;\n\t}\n\n\t@HostBinding(\"class.cds--text-input--fluid__skeleton\") get fluidSkeleton() {\n\t\treturn this.fluid && this.skeleton;\n\t}\n\n\tprotected _isFocused = false;\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tif (\"type\" in event.target && (<HTMLInputElement>event.target).type === \"button\") {\n\t\t\tthis._isFocused = false;\n\t\t} else {\n\t\t\tthis._isFocused = event.type === \"focus\";\n\t\t}\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
38881
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tHostBinding,\n\tEventEmitter,\n\tOutput,\n\tTemplateRef,\n\tHostListener\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Used to emit changes performed on number input components.\n */\nexport class NumberChange {\n\t/**\n\t * Contains the `Number` that has been changed.\n\t */\n\tsource: NumberComponent;\n\t/**\n\t * The value of the `Number` field encompassed in the `NumberChange` class.\n\t */\n\tvalue: number;\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { NumberModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-number--basic)\n */\n@Component({\n\tselector: \"cds-number, ibm-number\",\n\ttemplate: `\n\t\t<label *ngIf=\"skeleton && label\" class=\"cds--label cds--skeleton\"></label>\n\t\t<div\n\t\t\tdata-numberinput\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\tclass=\"cds--number\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--number--light': theme === 'light',\n\t\t\t\t'cds--number--nolabel': !label,\n\t\t\t\t'cds--number--helpertext': helperText,\n\t\t\t\t'cds--skeleton' : skeleton,\n\t\t\t\t'cds--number--sm': size === 'sm',\n\t\t\t\t'cds--number--md': size === 'md',\n\t\t\t\t'cds--number--lg': size === 'lg'\n\t\t\t}\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"!skeleton && label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\tclass=\"cds--number__input-wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--number__input-wrapper--warning': warn\n\t\t\t\t}\">\n\t\t\t\t<input\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t[attr.min]=\"min\"\n\t\t\t\t\t[attr.max]=\"max\"\n\t\t\t\t\t[attr.step]=\"step\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[required]=\"required\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\t[attr.data-invalid]=\"invalid ? invalid : null\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t(focus)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(blur)=\"fluid ? handleFocus($event): null\"\n\t\t\t\t\t(change)=\"onNumberInputChange($event)\"/>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--number__invalid cds--number__invalid--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<div *ngIf=\"!skeleton\" class=\"cds--number__controls\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn down-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getDecrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onDecrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"subtract\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"cds--number__control-btn up-icon\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t[attr.disabled]=\"disabled ? true : null\"\n\t\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\t\t[attr.aria-label]=\"getIncrementLabel() | async\"\n\t\t\t\t\t\t(click)=\"onIncrement()\">\n\t\t\t\t\t\t<svg cdsIcon=\"add\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class=\"cds--number__rule-divider\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr *ngIf=\"fluid\" class=\"cds--number-input__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: NumberComponent,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class NumberComponent implements ControlValueAccessor {\n\t/**\n\t * Variable used for creating unique ids for number input components.\n\t */\n\tstatic numberCount = 0;\n\n\t@HostBinding(\"class.cds--form-item\") containerClass = true;\n\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() @HostBinding(\"class.cds--number--readonly\") readonly = false;\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` number input theme.\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` for a disabled number input.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading number component.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an invalid number component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * The unique id for the number component.\n\t */\n\t@Input() id = `number-${NumberComponent.numberCount}`;\n\t/**\n\t * Sets the placeholder attribute on the `input` element.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * Number input field render size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Reflects the required attribute of the `input` element.\n\t */\n\t@Input() required: boolean;\n\t/**\n\t * Sets the value attribute on the `input` element.\n\t */\n\t@Input() set value(v: any) {\n\t\tif (v === \"\" || v === null) {\n\t\t\tthis._value = null;\n\t\t\treturn;\n\t\t}\n\t\tthis._value = Number(v);\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\t/**\n\t * Sets the min attribute on the `input` element.\n\t */\n\t@Input() min = null;\n\t/**\n\t * Sets the max attribute on the `input` element.\n\t */\n\t@Input() max = null;\n\t/**\n\t * Sets the text inside the `label` tag.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Sets the amount the number controls increment and decrement by.\n\t */\n\t@Input() step = 1;\n\t/**\n\t * If `step` is a decimal, we may want precision to be set to go around floating point precision.\n\t */\n\t@Input() precision: number;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\t/**\n\t * Sets the arialabel for input\n\t */\n\t@Input() ariaLabel: string;\n\t/**\n\t * Emits event notifying other classes when a change in state occurs in the input.\n\t */\n\t@Output() change = new EventEmitter<NumberChange>();\n\n\t@Input()\n\tset decrementLabel(value: string | Observable<string>) {\n\t\tthis._decrementLabel.override(value);\n\t}\n\n\tget decrementLabel() {\n\t\treturn this._decrementLabel.value;\n\t}\n\n\t@Input()\n\tset incrementLabel(value: string | Observable<string>) {\n\t\tthis._incrementLabel.override(value);\n\t}\n\n\tget incrementLabel() {\n\t\treturn this._incrementLabel.value;\n\t}\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--number-input--fluid\") @Input() fluid = false;\n\n\t@HostBinding(\"class.cds--number-input--fluid--invalid\") get fluidInvalid() {\n\t\treturn this.fluid && this.invalid;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--disabled\") get fluidDisabled() {\n\t\treturn this.fluid && this.disabled;\n\t}\n\n\t@HostBinding(\"class.cds--number-input--fluid--focus\") get fluidFocus() {\n\t\treturn this.fluid && this._isFocused;\n\t}\n\n\t@HostBinding(\"class.cds--text-input--fluid__skeleton\") get fluidSkeleton() {\n\t\treturn this.fluid && this.skeleton;\n\t}\n\n\tprotected _isFocused = false;\n\n\tprotected _value = 0;\n\n\tprotected _decrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.DECREMENT\");\n\tprotected _incrementLabel: Overridable = this.i18n.getOverridable(\"NUMBER.INCREMENT\");\n\n\t/**\n\t * Creates an instance of `Number`.\n\t */\n\tconstructor(protected i18n: I18n) {\n\t\tNumberComponent.numberCount++;\n\t}\n\n\t/**\n\t * This is the initial value set to the component\n\t * @param value The input value.\n\t */\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Sets a method in order to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the number input is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Sets the disabled state through the model\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Called when number input is blurred. Needed to properly implement `ControlValueAccessor`.\n\t */\n\tonTouched: () => any = () => { };\n\n\t/**\n\t * Method set in `registerOnChange` to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Adds `step` to the current `value`.\n\t */\n\tonIncrement(): void {\n\t\t// if max is set and value + step is greater than max, set value to max\n\t\t// example: max = 100, step = 10, value = 95 , value + step = 105, value will be set to 100 (max) instead of 105\n\t\tif (this.max !== null && this.value + this.step > this.max) {\n\t\t\tthis.value = this.max;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if min is set and value + step is less than min, set value to min\n\t\t// example: min = 5, step = 2, value = 0, value + step = 2, value will be set to 5 (min) instead of 2\n\t\tif (this.min !== null && this.value + this.step < this.min) {\n\t\t\tthis.value = this.min;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if max is not set or value + step is less than max, increment value by step\n\t\tif (this.max === null || this.value + this.step <= this.max) {\n\t\t\tthis.value += this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\t/**\n\t * Subtracts `step` to the current `value`.\n\t */\n\tonDecrement(): void {\n\t\t// if max is set and value - step is greater than max, set value to max\n\t\t// example: max = 15, step = 2, value = 20, value - step = 18, value will be set to 15 (max) instead of 18\n\t\tif (this.max !== null && this.value - this.step > this.max) {\n\t\t\tthis.value = this.max;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if min is set and value - step is less than min, set value to min\n\t\t// example: min = 5, step = 2, value = 6, value - step = 4, value will be set to 5 (min) instead of 4\n\t\tif (this.min !== null && this.value - this.step < this.min) {\n\t\t\tthis.value = this.min;\n\t\t\tthis.emitChangeEvent();\n\t\t\treturn;\n\t\t}\n\n\t\t// if min is not set or value - step is greater than min, decrement value by step\n\t\tif (this.min === null || this.value - this.step >= this.min) {\n\t\t\tthis.value -= this.step;\n\t\t\tthis.value = parseFloat(this.value.toPrecision(this.precision));\n\t\t\tthis.emitChangeEvent();\n\t\t}\n\t}\n\n\tgetDecrementLabel(): Observable<string> {\n\t\treturn this._decrementLabel.subject;\n\t}\n\n\tgetIncrementLabel(): Observable<string> {\n\t\treturn this._incrementLabel.subject;\n\t}\n\n\t/**\n\t * Creates a class of `NumberChange` to emit the change in the `Number`.\n\t */\n\temitChangeEvent(): void {\n\t\tlet event = new NumberChange();\n\t\tevent.source = this;\n\t\tevent.value = this.value;\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(this.value);\n\t}\n\n\tonNumberInputChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.emitChangeEvent();\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tif (\"type\" in event.target && (<HTMLInputElement>event.target).type === \"button\") {\n\t\t\tthis._isFocused = false;\n\t\t} else {\n\t\t\tthis._isFocused = event.type === \"focus\";\n\t\t}\n\t}\n}\nexport { NumberComponent as Number };\n",
|
|
38936
38882
|
"assetsDirs": [],
|
|
38937
38883
|
"styleUrlsData": "",
|
|
38938
38884
|
"stylesData": "",
|
|
@@ -41620,7 +41566,7 @@
|
|
|
41620
41566
|
},
|
|
41621
41567
|
{
|
|
41622
41568
|
"name": "PaginationNav",
|
|
41623
|
-
"id": "component-PaginationNav-
|
|
41569
|
+
"id": "component-PaginationNav-02747b3f02dda4195eb9b8d17de227f10ddb93cd71d7303c3e81567547ccb446b5f32191b820b258e4c180ac7d7172629000d09893bd3b623c8f47837e111b52",
|
|
41624
41570
|
"file": "src/pagination/pagination-nav/pagination-nav.component.ts",
|
|
41625
41571
|
"encapsulation": [],
|
|
41626
41572
|
"entryComponents": [],
|
|
@@ -41630,7 +41576,7 @@
|
|
|
41630
41576
|
"selector": "cds-pagination-nav, ibm-pagination-navm",
|
|
41631
41577
|
"styleUrls": [],
|
|
41632
41578
|
"styles": [],
|
|
41633
|
-
"template": "<div>\n\t<div class=\"cds--pagination-nav\">\n\t\t<ul class=\"cds--pagination-nav__list\">\n\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t<cds-icon-button\n\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\
|
|
41579
|
+
"template": "<div>\n\t<div class=\"cds--pagination-nav\">\n\t\t<ul class=\"cds--pagination-nav__list\">\n\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t<cds-icon-button\n\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t(click)=\"jumpToPrevious()\"\n\t\t\t\t\t[disabled]=\"leftArrowDisabled\"\n\t\t\t\t\t[description]=\"previousItemText.subject | async\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tcdsIcon=\"caret--left\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--btn__icon\">\n\t\t\t\t\t</svg>\n\t\t\t\t</cds-icon-button>\n\t\t\t</li>\n\t\t\t<cds-pagination-nav-item\n\t\t\t\t*ngIf=\"this.numOfItemsToShow >= 5 || (this.numOfItemsToShow <= 4 && currentPage <= 1)\"\n\t\t\t\tpage=\"1\"\n\t\t\t\t(click)=\"currentPage = 1\"\n\t\t\t\t[isActive]=\"currentPage == 1\">\n\t\t\t</cds-pagination-nav-item>\n\t\t\t<cds-pagination-overflow\n\t\t\t\t*ngIf=\"frontCuts\"\n\t\t\t\t[count]=\"frontCuts\"\n\t\t\t\t[fromIndex]=\"startOffset\"\n\t\t\t\t(change)=\"handleOverflowSelection($event)\">\n\t\t\t</cds-pagination-overflow>\n\t\t\t<cds-pagination-nav-item\n\t\t\t\t*ngFor=\"let page of getPages();\"\n\t\t\t\t[page]=\"page\"\n\t\t\t\t(click)=\"currentPage = page\"\n\t\t\t\t[isActive]=\"currentPage == page\">\n\t\t\t</cds-pagination-nav-item>\n\t\t\t<cds-pagination-overflow\n\t\t\t\t*ngIf=\"backCuts\"\n\t\t\t\t[count]=\"backCuts\"\n\t\t\t\t[fromIndex]=\"totalNumbersArray.length - backCuts - 1\"\n\t\t\t\t(change)=\"handleOverflowSelection($event)\">\n\t\t\t</cds-pagination-overflow>\n\t\t\t<cds-pagination-nav-item\n\t\t\t\t*ngIf=\"totalDataLength > 1\"\n\t\t\t\t[page]=\"totalNumbersArray.length\"\n\t\t\t\t(click)=\"currentPage = totalNumbersArray.length\"\n\t\t\t\t[isActive]=\"currentPage == totalNumbersArray.length\">\n\t\t\t</cds-pagination-nav-item>\n\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t<cds-icon-button\n\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t(click)=\"jumpToNext()\"\n\t\t\t\t\t[disabled]=\"rightArrowDisabled\"\n\t\t\t\t\t[description]=\"nextItemText.subject | async\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tcdsIcon=\"caret--right\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--btn__icon\">\n\t\t\t\t\t</svg>\n\t\t\t\t</cds-icon-button>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</div>\n",
|
|
41634
41580
|
"templateUrl": [],
|
|
41635
41581
|
"viewProviders": [],
|
|
41636
41582
|
"hostDirectives": [],
|
|
@@ -41642,7 +41588,7 @@
|
|
|
41642
41588
|
"deprecationMessage": "",
|
|
41643
41589
|
"rawdescription": "\n\nSet to `true` to disable the backward/forward buttons.\n",
|
|
41644
41590
|
"description": "<p>Set to <code>true</code> to disable the backward/forward buttons.</p>\n",
|
|
41645
|
-
"line":
|
|
41591
|
+
"line": 124,
|
|
41646
41592
|
"type": "boolean",
|
|
41647
41593
|
"decorators": []
|
|
41648
41594
|
},
|
|
@@ -41652,7 +41598,7 @@
|
|
|
41652
41598
|
"deprecationMessage": "",
|
|
41653
41599
|
"rawdescription": "\n\n`PaginationNavModel` with the information about pages you're controlling.\n",
|
|
41654
41600
|
"description": "<p><code>PaginationNavModel</code> with the information about pages you're controlling.</p>\n",
|
|
41655
|
-
"line":
|
|
41601
|
+
"line": 120,
|
|
41656
41602
|
"type": "PaginationModel",
|
|
41657
41603
|
"decorators": []
|
|
41658
41604
|
},
|
|
@@ -41663,17 +41609,28 @@
|
|
|
41663
41609
|
"deprecationMessage": "",
|
|
41664
41610
|
"rawdescription": "\n\nNumber of items to show in pagination. Minimum is 4.\n",
|
|
41665
41611
|
"description": "<p>Number of items to show in pagination. Minimum is 4.</p>\n",
|
|
41666
|
-
"line":
|
|
41612
|
+
"line": 128,
|
|
41667
41613
|
"type": "number",
|
|
41668
41614
|
"decorators": []
|
|
41669
41615
|
},
|
|
41616
|
+
{
|
|
41617
|
+
"name": "size",
|
|
41618
|
+
"defaultValue": "\"lg\"",
|
|
41619
|
+
"deprecated": false,
|
|
41620
|
+
"deprecationMessage": "",
|
|
41621
|
+
"rawdescription": "\n\nSets the pagination nav size\n",
|
|
41622
|
+
"description": "<p>Sets the pagination nav size</p>\n",
|
|
41623
|
+
"line": 149,
|
|
41624
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
41625
|
+
"decorators": []
|
|
41626
|
+
},
|
|
41670
41627
|
{
|
|
41671
41628
|
"name": "translations",
|
|
41672
41629
|
"deprecated": false,
|
|
41673
41630
|
"deprecationMessage": "",
|
|
41674
41631
|
"rawdescription": "\n\nExpects an object that contains some or all of:\n```\n{\n\t\t\"NEXT\": \"Next\",\n\t\t\"PREVIOUS\": \"Previous\",\n}\n```\n",
|
|
41675
41632
|
"description": "<p>Expects an object that contains some or all of:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-none\">{\n "NEXT": "Next",\n "PREVIOUS": "Previous",\n}</code></pre></div>",
|
|
41676
|
-
"line":
|
|
41633
|
+
"line": 140,
|
|
41677
41634
|
"type": "PaginationNavTranslations",
|
|
41678
41635
|
"decorators": []
|
|
41679
41636
|
}
|
|
@@ -41686,7 +41643,7 @@
|
|
|
41686
41643
|
"deprecationMessage": "",
|
|
41687
41644
|
"rawdescription": "\n\nEmits the new page number.\n\nYou should tie into this and update `model.currentPage` once the fresh\ndata is finally loaded.\n",
|
|
41688
41645
|
"description": "<p>Emits the new page number.</p>\n<p>You should tie into this and update <code>model.currentPage</code> once the fresh\ndata is finally loaded.</p>\n",
|
|
41689
|
-
"line":
|
|
41646
|
+
"line": 168,
|
|
41690
41647
|
"type": "EventEmitter"
|
|
41691
41648
|
}
|
|
41692
41649
|
],
|
|
@@ -41699,7 +41656,7 @@
|
|
|
41699
41656
|
"type": "",
|
|
41700
41657
|
"optional": false,
|
|
41701
41658
|
"description": "",
|
|
41702
|
-
"line":
|
|
41659
|
+
"line": 211
|
|
41703
41660
|
},
|
|
41704
41661
|
{
|
|
41705
41662
|
"name": "paginationCounter",
|
|
@@ -41709,7 +41666,7 @@
|
|
|
41709
41666
|
"type": "number",
|
|
41710
41667
|
"optional": false,
|
|
41711
41668
|
"description": "",
|
|
41712
|
-
"line":
|
|
41669
|
+
"line": 116,
|
|
41713
41670
|
"modifierKind": [
|
|
41714
41671
|
126
|
|
41715
41672
|
]
|
|
@@ -41722,7 +41679,7 @@
|
|
|
41722
41679
|
"type": "",
|
|
41723
41680
|
"optional": false,
|
|
41724
41681
|
"description": "",
|
|
41725
|
-
"line":
|
|
41682
|
+
"line": 212
|
|
41726
41683
|
}
|
|
41727
41684
|
],
|
|
41728
41685
|
"methodsClass": [
|
|
@@ -41732,7 +41689,7 @@
|
|
|
41732
41689
|
"optional": false,
|
|
41733
41690
|
"returnType": "any",
|
|
41734
41691
|
"typeParameters": [],
|
|
41735
|
-
"line":
|
|
41692
|
+
"line": 232,
|
|
41736
41693
|
"deprecated": false,
|
|
41737
41694
|
"deprecationMessage": "",
|
|
41738
41695
|
"modifierKind": [
|
|
@@ -41752,7 +41709,7 @@
|
|
|
41752
41709
|
"optional": false,
|
|
41753
41710
|
"returnType": "void",
|
|
41754
41711
|
"typeParameters": [],
|
|
41755
|
-
"line":
|
|
41712
|
+
"line": 218,
|
|
41756
41713
|
"deprecated": false,
|
|
41757
41714
|
"deprecationMessage": "",
|
|
41758
41715
|
"jsdoctags": [
|
|
@@ -41773,7 +41730,7 @@
|
|
|
41773
41730
|
"optional": false,
|
|
41774
41731
|
"returnType": "void",
|
|
41775
41732
|
"typeParameters": [],
|
|
41776
|
-
"line":
|
|
41733
|
+
"line": 224,
|
|
41777
41734
|
"deprecated": false,
|
|
41778
41735
|
"deprecationMessage": "",
|
|
41779
41736
|
"modifierKind": [
|
|
@@ -41786,7 +41743,7 @@
|
|
|
41786
41743
|
"optional": false,
|
|
41787
41744
|
"returnType": "void",
|
|
41788
41745
|
"typeParameters": [],
|
|
41789
|
-
"line":
|
|
41746
|
+
"line": 228,
|
|
41790
41747
|
"deprecated": false,
|
|
41791
41748
|
"deprecationMessage": "",
|
|
41792
41749
|
"modifierKind": [
|
|
@@ -41796,14 +41753,39 @@
|
|
|
41796
41753
|
],
|
|
41797
41754
|
"deprecated": false,
|
|
41798
41755
|
"deprecationMessage": "",
|
|
41799
|
-
"hostBindings": [
|
|
41756
|
+
"hostBindings": [
|
|
41757
|
+
{
|
|
41758
|
+
"name": "class.cds--layout--size-lg",
|
|
41759
|
+
"deprecated": false,
|
|
41760
|
+
"deprecationMessage": "",
|
|
41761
|
+
"line": 158,
|
|
41762
|
+
"type": "boolean",
|
|
41763
|
+
"decorators": []
|
|
41764
|
+
},
|
|
41765
|
+
{
|
|
41766
|
+
"name": "class.cds--layout--size-md",
|
|
41767
|
+
"deprecated": false,
|
|
41768
|
+
"deprecationMessage": "",
|
|
41769
|
+
"line": 155,
|
|
41770
|
+
"type": "boolean",
|
|
41771
|
+
"decorators": []
|
|
41772
|
+
},
|
|
41773
|
+
{
|
|
41774
|
+
"name": "class.cds--layout--size-sm",
|
|
41775
|
+
"deprecated": false,
|
|
41776
|
+
"deprecationMessage": "",
|
|
41777
|
+
"line": 152,
|
|
41778
|
+
"type": "boolean",
|
|
41779
|
+
"decorators": []
|
|
41780
|
+
}
|
|
41781
|
+
],
|
|
41800
41782
|
"hostListeners": [],
|
|
41801
41783
|
"standalone": false,
|
|
41802
41784
|
"imports": [],
|
|
41803
41785
|
"description": "<p>Use pagination when you have multiple pages of data to handle. Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { PaginationModule } from 'carbon-components-angular';</code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-pagination-nav [model]="model" (selectPage)="selectPage($event)"></cds-pagination-nav></code></pre></div><p>In your <code>selectPage()</code> method set the <code>model.currentPage</code> to selected page, <em>after</em>\nyou load the page.</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">selectPage(page) {\n // ... your code to load the page goes here\n\n this.model.currentPage = page;\n\n // ... anything you want to do after page selection changes goes here\n}</code></pre></div><p><a href=\"../../?path=/story/components-pagination-nav--basic\">See demo</a></p>\n",
|
|
41804
41786
|
"rawdescription": "\n\nUse pagination when you have multiple pages of data to handle. Get started with importing the module:\n\n```typescript\nimport { PaginationModule } from 'carbon-components-angular';\n```\n\n```html\n<cds-pagination-nav [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination-nav>\n```\n\nIn your `selectPage()` method set the `model.currentPage` to selected page, _after_\nyou load the page.\n\n```typescript\nselectPage(page) {\n\t// ... your code to load the page goes here\n\n\tthis.model.currentPage = page;\n\n\t// ... anything you want to do after page selection changes goes here\n}\n```\n\n[See demo](../../?path=/story/components-pagination-nav--basic)\n",
|
|
41805
41787
|
"type": "component",
|
|
41806
|
-
"sourceCode": "import { PaginationModel } from \"../pagination-model.class\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { ExperimentalService } from \"carbon-components-angular/experimental\";\nimport { merge } from \"carbon-components-angular/utils\";\nimport { range } from \"carbon-components-angular/common\";\n\nexport interface PaginationNavTranslations {\n\tNEXT: string;\n\tPREVIOUS: string;\n}\n\n/**\n * Use pagination when you have multiple pages of data to handle. Get started with importing the module:\n *\n * ```typescript\n * import { PaginationModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-pagination-nav [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination-nav>\n * ```\n *\n * In your `selectPage()` method set the `model.currentPage` to selected page, _after_\n * you load the page.\n *\n * ```typescript\n * selectPage(page) {\n * \t// ... your code to load the page goes here\n *\n * \tthis.model.currentPage = page;\n *\n * \t// ... anything you want to do after page selection changes goes here\n * }\n * ```\n *\n * [See demo](../../?path=/story/components-pagination-nav--basic)\n */\n@Component({\n\tselector: \"cds-pagination-nav, ibm-pagination-navm\",\n\ttemplate: `\n\t<div>\n\t\t<div class=\"cds--pagination-nav\">\n\t\t\t<ul class=\"cds--pagination-nav__list\">\n\t\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t\t<cds-icon-button\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\
|
|
41788
|
+
"sourceCode": "import { PaginationModel } from \"../pagination-model.class\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tHostBinding\n} from \"@angular/core\";\n\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { ExperimentalService } from \"carbon-components-angular/experimental\";\nimport { merge } from \"carbon-components-angular/utils\";\nimport { range } from \"carbon-components-angular/common\";\n\nexport interface PaginationNavTranslations {\n\tNEXT: string;\n\tPREVIOUS: string;\n}\n\n/**\n * Use pagination when you have multiple pages of data to handle. Get started with importing the module:\n *\n * ```typescript\n * import { PaginationModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-pagination-nav [model]=\"model\" (selectPage)=\"selectPage($event)\"></cds-pagination-nav>\n * ```\n *\n * In your `selectPage()` method set the `model.currentPage` to selected page, _after_\n * you load the page.\n *\n * ```typescript\n * selectPage(page) {\n * \t// ... your code to load the page goes here\n *\n * \tthis.model.currentPage = page;\n *\n * \t// ... anything you want to do after page selection changes goes here\n * }\n * ```\n *\n * [See demo](../../?path=/story/components-pagination-nav--basic)\n */\n@Component({\n\tselector: \"cds-pagination-nav, ibm-pagination-navm\",\n\ttemplate: `\n\t<div>\n\t\t<div class=\"cds--pagination-nav\">\n\t\t\t<ul class=\"cds--pagination-nav__list\">\n\t\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t\t<cds-icon-button\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t\t(click)=\"jumpToPrevious()\"\n\t\t\t\t\t\t[disabled]=\"leftArrowDisabled\"\n\t\t\t\t\t\t[description]=\"previousItemText.subject | async\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tcdsIcon=\"caret--left\"\n\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\tclass=\"cds--btn__icon\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</cds-icon-button>\n\t\t\t\t</li>\n\t\t\t\t<cds-pagination-nav-item\n\t\t\t\t\t*ngIf=\"this.numOfItemsToShow >= 5 || (this.numOfItemsToShow <= 4 && currentPage <= 1)\"\n\t\t\t\t\tpage=\"1\"\n\t\t\t\t\t(click)=\"currentPage = 1\"\n\t\t\t\t\t[isActive]=\"currentPage == 1\">\n\t\t\t\t</cds-pagination-nav-item>\n\t\t\t\t<cds-pagination-overflow\n\t\t\t\t\t*ngIf=\"frontCuts\"\n\t\t\t\t\t[count]=\"frontCuts\"\n\t\t\t\t\t[fromIndex]=\"startOffset\"\n\t\t\t\t\t(change)=\"handleOverflowSelection($event)\">\n\t\t\t\t</cds-pagination-overflow>\n\t\t\t\t<cds-pagination-nav-item\n\t\t\t\t\t*ngFor=\"let page of getPages();\"\n\t\t\t\t\t[page]=\"page\"\n\t\t\t\t\t(click)=\"currentPage = page\"\n\t\t\t\t\t[isActive]=\"currentPage == page\">\n\t\t\t\t</cds-pagination-nav-item>\n\t\t\t\t<cds-pagination-overflow\n\t\t\t\t\t*ngIf=\"backCuts\"\n\t\t\t\t\t[count]=\"backCuts\"\n\t\t\t\t\t[fromIndex]=\"totalNumbersArray.length - backCuts - 1\"\n\t\t\t\t\t(change)=\"handleOverflowSelection($event)\">\n\t\t\t\t</cds-pagination-overflow>\n\t\t\t\t<cds-pagination-nav-item\n\t\t\t\t\t*ngIf=\"totalDataLength > 1\"\n\t\t\t\t\t[page]=\"totalNumbersArray.length\"\n\t\t\t\t\t(click)=\"currentPage = totalNumbersArray.length\"\n\t\t\t\t\t[isActive]=\"currentPage == totalNumbersArray.length\">\n\t\t\t\t</cds-pagination-nav-item>\n\t\t\t\t<li class=\"cds--pagination-nav__list-item\">\n\t\t\t\t\t<cds-icon-button\n\t\t\t\t\t\tkind=\"ghost\"\n\t\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t\t(click)=\"jumpToNext()\"\n\t\t\t\t\t\t[disabled]=\"rightArrowDisabled\"\n\t\t\t\t\t\t[description]=\"nextItemText.subject | async\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tcdsIcon=\"caret--right\"\n\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\tclass=\"cds--btn__icon\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</cds-icon-button>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t`\n})\nexport class PaginationNav {\n\tstatic paginationCounter = 0;\n\t/**\n\t * `PaginationNavModel` with the information about pages you're controlling.\n\t */\n\t@Input() model: PaginationModel;\n\t/**\n\t * Set to `true` to disable the backward/forward buttons.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Number of items to show in pagination. Minimum is 4.\n\t */\n\t@Input() numOfItemsToShow = 4;\n\n\t/**\n\t * Expects an object that contains some or all of:\n\t * ```\n\t * {\n\t *\t\t\"NEXT\": \"Next\",\n\t *\t\t\"PREVIOUS\": \"Previous\",\n\t * }\n\t * ```\n\t */\n\t@Input()\n\tset translations(value: PaginationNavTranslations) {\n\t\tconst valueWithDefaults = merge(this.i18n.getMultiple(\"PAGINATION\"), value);\n\t\tthis.nextItemText.override(valueWithDefaults.NEXT);\n\t\tthis.previousItemText.override(valueWithDefaults.PREVIOUS);\n\t}\n\n\t/**\n\t * Sets the pagination nav size\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"lg\";\n\n\t// Size\n\t@HostBinding(\"class.cds--layout--size-sm\") get smallLayoutSize() {\n\t\treturn this.size === \"sm\";\n\t}\n\t@HostBinding(\"class.cds--layout--size-md\") get mediumLayoutSize() {\n\t\treturn this.size === \"md\";\n\t}\n\t@HostBinding(\"class.cds--layout--size-lg\") get largeLayoutSize() {\n\t\treturn this.size === \"lg\";\n\t}\n\n\t/**\n\t * Emits the new page number.\n\t *\n\t * You should tie into this and update `model.currentPage` once the fresh\n\t * data is finally loaded.\n\t */\n\t@Output() selectPage = new EventEmitter<number>();\n\n\tget totalNumbersArray() {\n\t\treturn range(this.totalDataLength + 1, 1);\n\t}\n\n\tget currentPage() {\n\t\treturn this.model.currentPage;\n\t}\n\n\tset currentPage(value) {\n\t\tvalue = Number(value);\n\t\t// emits the value to allow the user to update current page\n\t\t// in the model once the page is loaded\n\t\tthis.selectPage.emit(value);\n\t}\n\n\tget totalDataLength() {\n\t\treturn this.model.totalDataLength;\n\t}\n\n\tget startOffset() {\n\t\treturn this.numOfItemsToShow <= 4 && this.currentPage > 1 ? 0 : 1;\n\t}\n\n\tget frontCuts() {\n\t\tconst cuts = this.getCuts();\n\t\treturn cuts.front;\n\t}\n\n\tget backCuts() {\n\t\tconst cuts = this.getCuts();\n\t\treturn cuts.back;\n\t}\n\n\tget leftArrowDisabled() {\n\t\treturn this.disabled || this.currentPage === 1;\n\t}\n\n\tget rightArrowDisabled() {\n\t\treturn this.disabled || this.currentPage === this.totalDataLength;\n\t}\n\n\tnextItemText = this.i18n.getOverridable(\"PAGINATION.NEXT\");\n\tpreviousItemText = this.i18n.getOverridable(\"PAGINATION.PREVIOUS\");\n\n\tconstructor(protected i18n: I18n, protected experimental: ExperimentalService) {\n\t\tPaginationNav.paginationCounter++;\n\t}\n\n\thandleOverflowSelection(page) {\n\t\tif (typeof page === \"number\") {\n\t\t\tthis.currentPage = page;\n\t\t}\n\t}\n\n\tpublic jumpToNext() {\n\t\tthis.currentPage = this.currentPage < this.totalDataLength ? this.currentPage + 1 : this.totalDataLength;\n\t}\n\n\tpublic jumpToPrevious() {\n\t\tthis.currentPage = this.currentPage > 1 ? this.currentPage - 1 : 1;\n\t}\n\n\tpublic getPages() {\n\t\tif (this.totalDataLength <= 1) {\n\t\t\treturn null;\n\t\t}\n\t\tconst cuts = this.getCuts();\n\t\treturn this.totalNumbersArray.slice(this.startOffset + cuts.front, (1 + cuts.back) * -1);\n\t}\n\n\tprivate getCuts(splitPoint = null) {\n\t\tconst page = this.currentPage - 1;\n\t\tconst totalItems = this.totalDataLength;\n\t\tconst itemsThatFit = this.numOfItemsToShow;\n\n\t\tif (itemsThatFit >= totalItems) {\n\t\t\treturn {\n\t\t\t\tfront: 0,\n\t\t\t\tback: 0\n\t\t\t};\n\t\t}\n\t\tconst split = splitPoint || Math.ceil(itemsThatFit / 2) - 1;\n\t\tlet frontHidden = page + 1 - split;\n\t\tlet backHidden = totalItems - page - (itemsThatFit - split) + 1;\n\n\t\tif (frontHidden <= 1) {\n\t\t\tbackHidden -= frontHidden <= 0 ? Math.abs(frontHidden) + 1 : 0;\n\t\t\tfrontHidden = 0;\n\t\t}\n\t\tif (backHidden <= 1) {\n\t\t\tfrontHidden -= backHidden <= 0 ? Math.abs(backHidden) + 1 : 0;\n\t\t\tbackHidden = 0;\n\t\t}\n\t\treturn {\n\t\t\tfront: frontHidden,\n\t\t\tback: backHidden\n\t\t};\n\t}\n}\n",
|
|
41807
41789
|
"assetsDirs": [],
|
|
41808
41790
|
"styleUrlsData": "",
|
|
41809
41791
|
"stylesData": "",
|
|
@@ -41826,7 +41808,7 @@
|
|
|
41826
41808
|
"deprecationMessage": ""
|
|
41827
41809
|
}
|
|
41828
41810
|
],
|
|
41829
|
-
"line":
|
|
41811
|
+
"line": 212,
|
|
41830
41812
|
"jsdoctags": [
|
|
41831
41813
|
{
|
|
41832
41814
|
"name": "i18n",
|
|
@@ -41866,7 +41848,7 @@
|
|
|
41866
41848
|
}
|
|
41867
41849
|
],
|
|
41868
41850
|
"returnType": "void",
|
|
41869
|
-
"line":
|
|
41851
|
+
"line": 140,
|
|
41870
41852
|
"rawdescription": "\n\nExpects an object that contains some or all of:\n```\n{\n\t\t\"NEXT\": \"Next\",\n\t\t\"PREVIOUS\": \"Previous\",\n}\n```\n",
|
|
41871
41853
|
"description": "<p>Expects an object that contains some or all of:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-none\">{\n "NEXT": "Next",\n "PREVIOUS": "Previous",\n}</code></pre></div>",
|
|
41872
41854
|
"jsdoctags": [
|
|
@@ -41882,13 +41864,40 @@
|
|
|
41882
41864
|
]
|
|
41883
41865
|
}
|
|
41884
41866
|
},
|
|
41867
|
+
"smallLayoutSize": {
|
|
41868
|
+
"name": "smallLayoutSize",
|
|
41869
|
+
"getSignature": {
|
|
41870
|
+
"name": "smallLayoutSize",
|
|
41871
|
+
"type": "",
|
|
41872
|
+
"returnType": "",
|
|
41873
|
+
"line": 152
|
|
41874
|
+
}
|
|
41875
|
+
},
|
|
41876
|
+
"mediumLayoutSize": {
|
|
41877
|
+
"name": "mediumLayoutSize",
|
|
41878
|
+
"getSignature": {
|
|
41879
|
+
"name": "mediumLayoutSize",
|
|
41880
|
+
"type": "",
|
|
41881
|
+
"returnType": "",
|
|
41882
|
+
"line": 155
|
|
41883
|
+
}
|
|
41884
|
+
},
|
|
41885
|
+
"largeLayoutSize": {
|
|
41886
|
+
"name": "largeLayoutSize",
|
|
41887
|
+
"getSignature": {
|
|
41888
|
+
"name": "largeLayoutSize",
|
|
41889
|
+
"type": "",
|
|
41890
|
+
"returnType": "",
|
|
41891
|
+
"line": 158
|
|
41892
|
+
}
|
|
41893
|
+
},
|
|
41885
41894
|
"totalNumbersArray": {
|
|
41886
41895
|
"name": "totalNumbersArray",
|
|
41887
41896
|
"getSignature": {
|
|
41888
41897
|
"name": "totalNumbersArray",
|
|
41889
41898
|
"type": "",
|
|
41890
41899
|
"returnType": "",
|
|
41891
|
-
"line":
|
|
41900
|
+
"line": 170
|
|
41892
41901
|
}
|
|
41893
41902
|
},
|
|
41894
41903
|
"currentPage": {
|
|
@@ -41907,7 +41916,7 @@
|
|
|
41907
41916
|
}
|
|
41908
41917
|
],
|
|
41909
41918
|
"returnType": "void",
|
|
41910
|
-
"line":
|
|
41919
|
+
"line": 178,
|
|
41911
41920
|
"jsdoctags": [
|
|
41912
41921
|
{
|
|
41913
41922
|
"name": "value",
|
|
@@ -41924,7 +41933,7 @@
|
|
|
41924
41933
|
"name": "currentPage",
|
|
41925
41934
|
"type": "",
|
|
41926
41935
|
"returnType": "",
|
|
41927
|
-
"line":
|
|
41936
|
+
"line": 174
|
|
41928
41937
|
}
|
|
41929
41938
|
},
|
|
41930
41939
|
"totalDataLength": {
|
|
@@ -41933,7 +41942,7 @@
|
|
|
41933
41942
|
"name": "totalDataLength",
|
|
41934
41943
|
"type": "",
|
|
41935
41944
|
"returnType": "",
|
|
41936
|
-
"line":
|
|
41945
|
+
"line": 185
|
|
41937
41946
|
}
|
|
41938
41947
|
},
|
|
41939
41948
|
"startOffset": {
|
|
@@ -41942,7 +41951,7 @@
|
|
|
41942
41951
|
"name": "startOffset",
|
|
41943
41952
|
"type": "",
|
|
41944
41953
|
"returnType": "",
|
|
41945
|
-
"line":
|
|
41954
|
+
"line": 189
|
|
41946
41955
|
}
|
|
41947
41956
|
},
|
|
41948
41957
|
"frontCuts": {
|
|
@@ -41951,7 +41960,7 @@
|
|
|
41951
41960
|
"name": "frontCuts",
|
|
41952
41961
|
"type": "",
|
|
41953
41962
|
"returnType": "",
|
|
41954
|
-
"line":
|
|
41963
|
+
"line": 193
|
|
41955
41964
|
}
|
|
41956
41965
|
},
|
|
41957
41966
|
"backCuts": {
|
|
@@ -41960,7 +41969,7 @@
|
|
|
41960
41969
|
"name": "backCuts",
|
|
41961
41970
|
"type": "",
|
|
41962
41971
|
"returnType": "",
|
|
41963
|
-
"line":
|
|
41972
|
+
"line": 198
|
|
41964
41973
|
}
|
|
41965
41974
|
},
|
|
41966
41975
|
"leftArrowDisabled": {
|
|
@@ -41969,7 +41978,7 @@
|
|
|
41969
41978
|
"name": "leftArrowDisabled",
|
|
41970
41979
|
"type": "",
|
|
41971
41980
|
"returnType": "",
|
|
41972
|
-
"line":
|
|
41981
|
+
"line": 203
|
|
41973
41982
|
}
|
|
41974
41983
|
},
|
|
41975
41984
|
"rightArrowDisabled": {
|
|
@@ -41978,7 +41987,7 @@
|
|
|
41978
41987
|
"name": "rightArrowDisabled",
|
|
41979
41988
|
"type": "",
|
|
41980
41989
|
"returnType": "",
|
|
41981
|
-
"line":
|
|
41990
|
+
"line": 207
|
|
41982
41991
|
}
|
|
41983
41992
|
}
|
|
41984
41993
|
}
|
|
@@ -42062,7 +42071,7 @@
|
|
|
42062
42071
|
},
|
|
42063
42072
|
{
|
|
42064
42073
|
"name": "PaginationNavStory",
|
|
42065
|
-
"id": "component-PaginationNavStory-
|
|
42074
|
+
"id": "component-PaginationNavStory-82b8f8e304195eef384cf31fbe1fbd130e1484d237aca1ba87a29713634a23a7ee9178947747f33d4eb1186d62e6bfcaac749c07da8ef3386e92b63c27ee2ac7",
|
|
42066
42075
|
"file": "src/pagination/pagination-nav/stories/pagination-nav-story.component.ts",
|
|
42067
42076
|
"encapsulation": [],
|
|
42068
42077
|
"entryComponents": [],
|
|
@@ -42072,7 +42081,7 @@
|
|
|
42072
42081
|
"selector": "app-pagination",
|
|
42073
42082
|
"styleUrls": [],
|
|
42074
42083
|
"styles": [],
|
|
42075
|
-
"template": "<cds-pagination-nav\n\t[model]=\"model\"\n\t[disabled]=\"disabled\"\n\t(selectPage)=\"selectPage($event)\"\n\t[numOfItemsToShow]=\"numOfItemsToShow\">\n</cds-pagination-nav>\n\t",
|
|
42084
|
+
"template": "<cds-pagination-nav\n\t[model]=\"model\"\n\t[disabled]=\"disabled\"\n\t(selectPage)=\"selectPage($event)\"\n\t[numOfItemsToShow]=\"numOfItemsToShow\"\n\t[size]=\"size\">\n</cds-pagination-nav>\n\t",
|
|
42076
42085
|
"templateUrl": [],
|
|
42077
42086
|
"viewProviders": [],
|
|
42078
42087
|
"hostDirectives": [],
|
|
@@ -42082,7 +42091,7 @@
|
|
|
42082
42091
|
"defaultValue": "false",
|
|
42083
42092
|
"deprecated": false,
|
|
42084
42093
|
"deprecationMessage": "",
|
|
42085
|
-
"line":
|
|
42094
|
+
"line": 23,
|
|
42086
42095
|
"type": "boolean",
|
|
42087
42096
|
"decorators": []
|
|
42088
42097
|
},
|
|
@@ -42091,7 +42100,7 @@
|
|
|
42091
42100
|
"defaultValue": "new PaginationModel()",
|
|
42092
42101
|
"deprecated": false,
|
|
42093
42102
|
"deprecationMessage": "",
|
|
42094
|
-
"line":
|
|
42103
|
+
"line": 22,
|
|
42095
42104
|
"type": "any",
|
|
42096
42105
|
"decorators": []
|
|
42097
42106
|
},
|
|
@@ -42100,7 +42109,7 @@
|
|
|
42100
42109
|
"defaultValue": "false",
|
|
42101
42110
|
"deprecated": false,
|
|
42102
42111
|
"deprecationMessage": "",
|
|
42103
|
-
"line":
|
|
42112
|
+
"line": 25,
|
|
42104
42113
|
"type": "boolean",
|
|
42105
42114
|
"decorators": []
|
|
42106
42115
|
},
|
|
@@ -42109,15 +42118,24 @@
|
|
|
42109
42118
|
"defaultValue": "false",
|
|
42110
42119
|
"deprecated": false,
|
|
42111
42120
|
"deprecationMessage": "",
|
|
42112
|
-
"line":
|
|
42121
|
+
"line": 24,
|
|
42113
42122
|
"type": "boolean",
|
|
42114
42123
|
"decorators": []
|
|
42115
42124
|
},
|
|
42116
42125
|
{
|
|
42117
|
-
"name": "
|
|
42126
|
+
"name": "size",
|
|
42127
|
+
"defaultValue": "\"md\"",
|
|
42118
42128
|
"deprecated": false,
|
|
42119
42129
|
"deprecationMessage": "",
|
|
42120
42130
|
"line": 26,
|
|
42131
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
42132
|
+
"decorators": []
|
|
42133
|
+
},
|
|
42134
|
+
{
|
|
42135
|
+
"name": "totalDataLength",
|
|
42136
|
+
"deprecated": false,
|
|
42137
|
+
"deprecationMessage": "",
|
|
42138
|
+
"line": 28,
|
|
42121
42139
|
"type": "any",
|
|
42122
42140
|
"decorators": []
|
|
42123
42141
|
}
|
|
@@ -42138,7 +42156,7 @@
|
|
|
42138
42156
|
"optional": false,
|
|
42139
42157
|
"returnType": "void",
|
|
42140
42158
|
"typeParameters": [],
|
|
42141
|
-
"line":
|
|
42159
|
+
"line": 39,
|
|
42142
42160
|
"deprecated": false,
|
|
42143
42161
|
"deprecationMessage": "",
|
|
42144
42162
|
"jsdoctags": [
|
|
@@ -42163,7 +42181,7 @@
|
|
|
42163
42181
|
"description": "",
|
|
42164
42182
|
"rawdescription": "\n",
|
|
42165
42183
|
"type": "component",
|
|
42166
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOnInit\n} from \"@angular/core\";\n\nimport { PaginationModel } from \"../..\";\n\n@Component({\n\tselector: \"app-pagination\",\n\ttemplate: `\n\t\t<cds-pagination-nav\n\t\t\t[model]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(selectPage)=\"selectPage($event)\"\n\t\t\t[numOfItemsToShow]=\"numOfItemsToShow\">\n\t\t</cds-pagination-nav>\n\t`\n})\nexport class PaginationNavStory implements OnInit {\n\t@Input() model = new PaginationModel();\n\t@Input() disabled = false;\n\t@Input() pageInputDisabled = false;\n\t@Input() numOfItemsToShow = false;\n\n\t@Input() get totalDataLength() {\n\t\treturn this.model.totalDataLength;\n\t}\n\tset totalDataLength(value) {\n\t\tthis.model.totalDataLength = value;\n\t}\n\n\tngOnInit() {\n\t\tthis.model.currentPage = 1;\n\t}\n\n\tselectPage(page) {\n\t\tconsole.log(\"Loading page\", page, \"from pagination model\");\n\t\tthis.model.currentPage = page;\n\t}\n}\n",
|
|
42184
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOnInit\n} from \"@angular/core\";\n\nimport { PaginationModel } from \"../..\";\n\n@Component({\n\tselector: \"app-pagination\",\n\ttemplate: `\n\t\t<cds-pagination-nav\n\t\t\t[model]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(selectPage)=\"selectPage($event)\"\n\t\t\t[numOfItemsToShow]=\"numOfItemsToShow\"\n\t\t\t[size]=\"size\">\n\t\t</cds-pagination-nav>\n\t`\n})\nexport class PaginationNavStory implements OnInit {\n\t@Input() model = new PaginationModel();\n\t@Input() disabled = false;\n\t@Input() pageInputDisabled = false;\n\t@Input() numOfItemsToShow = false;\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\n\t@Input() get totalDataLength() {\n\t\treturn this.model.totalDataLength;\n\t}\n\tset totalDataLength(value) {\n\t\tthis.model.totalDataLength = value;\n\t}\n\n\tngOnInit() {\n\t\tthis.model.currentPage = 1;\n\t}\n\n\tselectPage(page) {\n\t\tconsole.log(\"Loading page\", page, \"from pagination model\");\n\t\tthis.model.currentPage = page;\n\t}\n}\n",
|
|
42167
42185
|
"assetsDirs": [],
|
|
42168
42186
|
"styleUrlsData": "",
|
|
42169
42187
|
"stylesData": "",
|
|
@@ -42188,7 +42206,7 @@
|
|
|
42188
42206
|
}
|
|
42189
42207
|
],
|
|
42190
42208
|
"returnType": "void",
|
|
42191
|
-
"line":
|
|
42209
|
+
"line": 31,
|
|
42192
42210
|
"jsdoctags": [
|
|
42193
42211
|
{
|
|
42194
42212
|
"name": "value",
|
|
@@ -42205,7 +42223,7 @@
|
|
|
42205
42223
|
"name": "totalDataLength",
|
|
42206
42224
|
"type": "",
|
|
42207
42225
|
"returnType": "",
|
|
42208
|
-
"line":
|
|
42226
|
+
"line": 28
|
|
42209
42227
|
}
|
|
42210
42228
|
}
|
|
42211
42229
|
}
|
|
@@ -44083,7 +44101,7 @@
|
|
|
44083
44101
|
},
|
|
44084
44102
|
{
|
|
44085
44103
|
"name": "ProgressIndicator",
|
|
44086
|
-
"id": "component-ProgressIndicator-
|
|
44104
|
+
"id": "component-ProgressIndicator-44188c869e43c1d9a135becb504bc44a785fca0023a6f24b962f6f49958a0b43c0f37bca4fb522cd52a3858ab9bf3f229d033dacc3ac3e586936051aa7419ba1",
|
|
44087
44105
|
"file": "src/progress-indicator/progress-indicator.component.ts",
|
|
44088
44106
|
"encapsulation": [],
|
|
44089
44107
|
"entryComponents": [],
|
|
@@ -44198,8 +44216,8 @@
|
|
|
44198
44216
|
"jsdoctags": [
|
|
44199
44217
|
{
|
|
44200
44218
|
"name": {
|
|
44201
|
-
"pos":
|
|
44202
|
-
"end":
|
|
44219
|
+
"pos": 3581,
|
|
44220
|
+
"end": 3586,
|
|
44203
44221
|
"flags": 16842752,
|
|
44204
44222
|
"modifierFlagsCache": 0,
|
|
44205
44223
|
"transformFlags": 0,
|
|
@@ -44210,8 +44228,8 @@
|
|
|
44210
44228
|
"deprecated": false,
|
|
44211
44229
|
"deprecationMessage": "",
|
|
44212
44230
|
"tagName": {
|
|
44213
|
-
"pos":
|
|
44214
|
-
"end":
|
|
44231
|
+
"pos": 3575,
|
|
44232
|
+
"end": 3580,
|
|
44215
44233
|
"flags": 16842752,
|
|
44216
44234
|
"modifierFlagsCache": 0,
|
|
44217
44235
|
"transformFlags": 0,
|
|
@@ -44222,8 +44240,8 @@
|
|
|
44222
44240
|
},
|
|
44223
44241
|
{
|
|
44224
44242
|
"tagName": {
|
|
44225
|
-
"pos":
|
|
44226
|
-
"end":
|
|
44243
|
+
"pos": 3599,
|
|
44244
|
+
"end": 3606,
|
|
44227
44245
|
"flags": 16842752,
|
|
44228
44246
|
"modifierFlagsCache": 0,
|
|
44229
44247
|
"transformFlags": 0,
|
|
@@ -44255,8 +44273,8 @@
|
|
|
44255
44273
|
"jsdoctags": [
|
|
44256
44274
|
{
|
|
44257
44275
|
"name": {
|
|
44258
|
-
"pos":
|
|
44259
|
-
"end":
|
|
44276
|
+
"pos": 3127,
|
|
44277
|
+
"end": 3132,
|
|
44260
44278
|
"flags": 16842752,
|
|
44261
44279
|
"modifierFlagsCache": 0,
|
|
44262
44280
|
"transformFlags": 0,
|
|
@@ -44267,8 +44285,8 @@
|
|
|
44267
44285
|
"deprecated": false,
|
|
44268
44286
|
"deprecationMessage": "",
|
|
44269
44287
|
"tagName": {
|
|
44270
|
-
"pos":
|
|
44271
|
-
"end":
|
|
44288
|
+
"pos": 3121,
|
|
44289
|
+
"end": 3126,
|
|
44272
44290
|
"flags": 16842752,
|
|
44273
44291
|
"modifierFlagsCache": 0,
|
|
44274
44292
|
"transformFlags": 0,
|
|
@@ -44317,10 +44335,10 @@
|
|
|
44317
44335
|
"hostListeners": [],
|
|
44318
44336
|
"standalone": false,
|
|
44319
44337
|
"imports": [],
|
|
44320
|
-
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import {
|
|
44321
|
-
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport {
|
|
44338
|
+
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { ProgressIndicatorModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-progress-indicator--basic\">See demo</a></p>\n",
|
|
44339
|
+
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { ProgressIndicatorModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-progress-indicator--basic)\n",
|
|
44322
44340
|
"type": "component",
|
|
44323
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Step } from \"./progress-indicator-step.interface\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import {
|
|
44341
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Step } from \"./progress-indicator-step.interface\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { ProgressIndicatorModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-progress-indicator--basic)\n */\n@Component({\n\tselector: \"cds-progress-indicator, ibm-progress-indicator\",\n\ttemplate: `\n\t<ul\n\t\tdata-progress\n\t\tdata-progress-current\n\t\tclass=\"cds--progress\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--skeleton': skeleton,\n\t\t\t'cds--progress--vertical': (orientation === 'vertical'),\n\t\t\t'cds--progress--space-equal': spacing === 'equal' && orientation !== 'vertical'\n\t\t}\">\n\t\t<li\n\t\t\tclass=\"cds--progress-step\"\n\t\t\t*ngFor=\"let step of steps; let i = index\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--progress-step--disabled' : step.disabled,\n\t\t\t\t'cds--progress-step--complete' : step.complete,\n\t\t\t\t'cds--progress-step--incomplete' : !step.complete && i !== current,\n\t\t\t\t'cds--progress-step--current': i === current\n\t\t\t}\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cds--progress-step-button\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--progress-step-button--unclickable': !step.onClick || current === i\n\t\t\t\t}\"\n\t\t\t\t[disabled]=\"step.disabled\"\n\t\t\t\t[attr.aria-disabled]=\"step.disabled\"\n\t\t\t\t[tabindex]=\"(current !== i && step.onClick && !step.disabled) ? 0 : -1\"\n\t\t\t\t[title]=\"step.label\"\n\t\t\t\t(click)=\"onClick(i)\">\n\t\t\t\t<span class=\"cds--assistive-text\">\n\t\t\t\t\t{{this.translations[getCurrentState(i)?.toUpperCase()]}}\n\t\t\t\t</span>\n\t\t\t\t<svg\n\t\t\t\t\t[cdsIcon]=\"statusIcons[getCurrentState(i)]\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--progress__warning': step.invalid && i !== current\n\t\t\t\t\t}\">\n\t\t\t\t\t<title *ngIf=\"step.description\">{{step.description}}</title>\n\t\t\t\t</svg>\n\t\t\t\t<div class=\"cds--progress-text\">\n\t\t\t\t\t<p class=\"cds--progress-label\">{{step.label}}</p>\n\t\t\t\t\t<p *ngIf=\"step.secondaryLabel\" class=\"cds--progress-optional\">{{step.secondaryLabel}}</p>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"cds--progress-line\"></span>\n\t\t\t</button>\n\t\t</li>\n\t</ul>\n\t`\n})\nexport class ProgressIndicator {\n\t@Input() get current() {\n\t\treturn this._current;\n\t}\n\tset current(current: number) {\n\t\tthis._current = current;\n\t\tthis.setProgressIndicatorStates();\n\t}\n\tstatic skeletonSteps(stepCount: number) {\n\t\tconst steps = [];\n\t\tfor (let i = 0; i < stepCount; i++) {\n\t\t\tsteps.push({ complete: false });\n\t\t}\n\n\t\treturn steps;\n\t}\n\n\t@Input() steps: Array<Step>;\n\t@Output() stepSelected = new EventEmitter<{ step: Step, index: number }>();\n\n\t@Input() translations = this.i18n.get().PROGRESS_INDICATOR;\n\t@Input() orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n\t@Input() skeleton = false;\n\t@Input() spacing: \"default\" | \"equal\" = \"default\";\n\n\t// Get icon names based for each status\n\treadonly statusIcons = {\n\t\tcurrent: \"incomplete\",\n\t\tcomplete: \"checkmark--outline\",\n\t\tinvalid: \"warning\",\n\t\tincomplete: \"circle-dash\"\n\t};\n\n\tprivate _current: number;\n\n\tconstructor(protected i18n: I18n) { }\n\n\t/**\n\t * Executes click function if `onClick` exists for step\n\t * `Current` step functions will not be executed\n\t * @param index number\n\t */\n\tonClick(index: number) {\n\t\tif (index !== this.current && typeof this.steps[index].onClick === \"function\") {\n\t\t\tthis.steps[index].onClick();\n\t\t}\n\t\tthis.stepSelected.emit({ step: this.steps[index], index });\n\t}\n\n\t/**\n\t * Gets current state based on weight of the state\n\t * Weight of state goes from error, incomplete, current, and complete\n\t *\n\t * This function is used to determine which icon & translation string to display\n\t * @param index number\n\t * @returns string\n\t */\n\tgetCurrentState(index: number) {\n\t\tif (index === this.current) {\n\t\t\treturn \"current\";\n\t\t} else if (this.steps[index].invalid) {\n\t\t\treturn \"invalid\";\n\t\t} else if (this.steps[index].complete) {\n\t\t\treturn \"complete\";\n\t\t}\n\n\t\treturn \"incomplete\";\n\t}\n\n\tprivate setProgressIndicatorStates() {\n\t\tif (this.steps === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Set all preceding steps to `complete` & following to `incomplete`\n\t\tthis.steps.forEach((step: Step, index) => {\n\t\t\tif (index < this.current) {\n\t\t\t\tstep.complete = true;\n\t\t\t} else {\n\t\t\t\tstep.complete = false;\n\t\t\t}\n\t\t});\n\t}\n}\n",
|
|
44324
44342
|
"assetsDirs": [],
|
|
44325
44343
|
"styleUrlsData": "",
|
|
44326
44344
|
"stylesData": "",
|
|
@@ -51638,7 +51656,7 @@
|
|
|
51638
51656
|
},
|
|
51639
51657
|
{
|
|
51640
51658
|
"name": "StructuredList",
|
|
51641
|
-
"id": "component-StructuredList-
|
|
51659
|
+
"id": "component-StructuredList-c8b48b09f6ed4c012aa71c2bd466ad0179d6b9174cbebafbfaeb0b4cc996e668d9b8e722dd09ef2cbaf72ff5a75f0395834550002608ce3d08b42c6130cc71cb",
|
|
51642
51660
|
"file": "src/structured-list/structured-list.component.ts",
|
|
51643
51661
|
"encapsulation": [],
|
|
51644
51662
|
"entryComponents": [],
|
|
@@ -51891,7 +51909,7 @@
|
|
|
51891
51909
|
"description": "<p>Structured Lists represent related tabular data. For larger datasets consider a full <code>Table</code>.</p>\n<p>See <a href=\"https://www.carbondesignsystem.com/components/structured-list/usage\">structured-list/usage</a> for usage guidance.</p>\n<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { StructuredListModule } from 'carbon-components-angular';</code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"> <cds-structured-list>\n <cds-list-header>\n <cds-list-column nowrap="true">Column 1</cds-list-column>\n <cds-list-column nowrap="true">Column 2</cds-list-column>\n <cds-list-column>Column 3</cds-list-column>\n </cds-list-header>\n <cds-list-row>\n <cds-list-column>Row 1</cds-list-column>\n <cds-list-column nowrap="true">Row One</cds-list-column>\n <cds-list-column>\n Lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Nunc dui magna,\n finibus id tortor sed, aliquet bibendum augue.\n Aenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n Pellentesque vulputate nisl a porttitor interdum.\n </cds-list-column>\n </cds-list-row>\n <cds-list-row>\n <cds-list-column>Row 2</cds-list-column>\n <cds-list-column nowrap="true">Row Two</cds-list-column>\n <cds-list-column>\n Lorem ipsum dolor sit amet,\n consectetur adipiscing elit. Nunc dui magna,\n finibus id tortor sed, aliquet bibendum augue.\n Aenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n Pellentesque vulputate nisl a porttitor interdum.\n </cds-list-column>\n </cds-list-row>\n </cds-structured-list></code></pre></div><p><a href=\"../../?path=/story/components-structured-list--basic\">See demo</a></p>\n",
|
|
51892
51910
|
"rawdescription": "\n\nStructured Lists represent related tabular data. For larger datasets consider a full `Table`.\n\nSee [structured-list/usage](https://www.carbondesignsystem.com/components/structured-list/usage) for usage guidance.\n\nGet started with importing the module:\n\n```typescript\nimport { StructuredListModule } from 'carbon-components-angular';\n```\n\n```html\n\t<cds-structured-list>\n\t\t<cds-list-header>\n\t\t\t<cds-list-column nowrap=\"true\">Column 1</cds-list-column>\n\t\t\t<cds-list-column nowrap=\"true\">Column 2</cds-list-column>\n\t\t\t<cds-list-column>Column 3</cds-list-column>\n\t\t</cds-list-header>\n\t\t<cds-list-row>\n\t\t\t<cds-list-column>Row 1</cds-list-column>\n\t\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n\t\t\t<cds-list-column>\n\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t</cds-list-column>\n\t\t</cds-list-row>\n\t\t<cds-list-row>\n\t\t\t<cds-list-column>Row 2</cds-list-column>\n\t\t\t<cds-list-column nowrap=\"true\">Row Two</cds-list-column>\n\t\t\t<cds-list-column>\n\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t</cds-list-column>\n\t\t</cds-list-row>\n\t</cds-structured-list>\n```\n\n[See demo](../../?path=/story/components-structured-list--basic)\n",
|
|
51893
51911
|
"type": "component",
|
|
51894
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tContentChildren,\n\tQueryList,\n\tAfterContentInit,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { ListRow } from \"./list-row.component\";\nimport { ListHeader } from \"./list-header.component\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\n/**\n * Structured Lists represent related tabular data. For larger datasets consider a full `Table`.\n *\n * See [structured-list/usage](https://www.carbondesignsystem.com/components/structured-list/usage) for usage guidance.\n *\n * Get started with importing the module:\n *\n * ```typescript\n * import { StructuredListModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n *\t<cds-structured-list>\n *\t\t<cds-list-header>\n *\t\t\t<cds-list-column nowrap=\"true\">Column 1</cds-list-column>\n *\t\t\t<cds-list-column nowrap=\"true\">Column 2</cds-list-column>\n *\t\t\t<cds-list-column>Column 3</cds-list-column>\n *\t\t</cds-list-header>\n *\t\t<cds-list-row>\n *\t\t\t<cds-list-column>Row 1</cds-list-column>\n *\t\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n *\t\t\t<cds-list-column>\n *\t\t\t\tLorem ipsum dolor sit amet,\n *\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n *\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n *\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n *\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n *\t\t\t</cds-list-column>\n *\t\t</cds-list-row>\n *\t\t<cds-list-row>\n *\t\t\t<cds-list-column>Row 2</cds-list-column>\n *\t\t\t<cds-list-column nowrap=\"true\">Row Two</cds-list-column>\n *\t\t\t<cds-list-column>\n *\t\t\t\tLorem ipsum dolor sit amet,\n *\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n *\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n *\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n *\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n *\t\t\t</cds-list-column>\n *\t\t</cds-list-row>\n *\t</cds-structured-list>\n * ```\n *\n * [See demo](../../?path=/story/components-structured-list--basic)\n */\n@Component({\n\tselector: \"cds-structured-list, ibm-structured-list\",\n\ttemplate: `\n\t\t<div\n\t\t\tclass=\"cds--structured-list\"\n\t\t\trole=\"table\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--structured-list--flush': flushed,\n\t\t\t\t'cds--structured-list--selection': selection,\n\t\t\t\t'cds--structured-list--condensed': condensed,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-content select=\"cds-list-header,ibm-list-header\"></ng-content>\n\t\t\t<div class=\"cds--structured-list-tbody\" role=\"rowgroup\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: StructuredList,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class StructuredList implements AfterContentInit, ControlValueAccessor {\n\t/**\n\t * A counter to provide unique default values.\n\t */\n\tstatic listCount = 0;\n\t/**\n\t * Set to `true` to enable radio like selection of the rows.\n\t */\n\t@Input() selection = false;\n\t/**\n\t * Set to `true` to align content with margin\n\t */\n\t@Input() flushed = false;\n\t/**\n\t * Set to `true` to apply a condensed style to the headers and rows.\n\t */\n\t@Input() condensed = false;\n\t/**\n\t * Used when `selection = true` as the row radio group `name`\n\t */\n\t@Input() name = `structured-list-${StructuredList.listCount++}`;\n\n\t/**\n\t * Sets the skeleton value for all `ListHeader` to the skeleton value of `StructuredList`.\n\t */\n\t@Input()\n\tset skeleton(value: any) {\n\t\tthis._skeleton = value;\n\t\tthis.updateChildren();\n\t}\n\n\t/**\n\t * Returns the skeleton value in the `StructuredList` if there is one.\n\t */\n\tget skeleton(): any {\n\t\treturn this._skeleton;\n\t}\n\n\t/**\n\t * Emits an event when the row selection changes.\n\t *\n\t * Emits an object that looks like:\n\t * ```javascript\n\t * {\n\t * \tvalue: \"something\",\n\t * \tselected: true,\n\t * \tname: \"structured-list-1\"\n\t * }\n\t * ```\n\t */\n\t@Output() selected: EventEmitter<{value: string, selected: boolean, name: string}> = new EventEmitter();\n\n\t@ContentChildren(ListRow) rows: QueryList<ListRow>;\n\t@ContentChildren(ListHeader) headers: QueryList<ListHeader>;\n\n\tprotected _skeleton = false;\n\n\tonChange = (_: any) => { };\n\n\tonTouched = () => { };\n\n\tngAfterContentInit() {\n\t\tconst setSelection = (rowOrHeader: ListRow | ListHeader) => {\n\t\t\trowOrHeader.selection = this.selection;\n\t\t};\n\n\t\tthis.headers.forEach(setSelection);\n\t\tthis.rows.forEach(row => {\n\t\t\tsetSelection(row);\n\t\t\trow.name = this.name;\n\t\t\trow.
|
|
51912
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tContentChildren,\n\tQueryList,\n\tAfterContentInit,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { ListRow } from \"./list-row.component\";\nimport { ListHeader } from \"./list-header.component\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\n/**\n * Structured Lists represent related tabular data. For larger datasets consider a full `Table`.\n *\n * See [structured-list/usage](https://www.carbondesignsystem.com/components/structured-list/usage) for usage guidance.\n *\n * Get started with importing the module:\n *\n * ```typescript\n * import { StructuredListModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n *\t<cds-structured-list>\n *\t\t<cds-list-header>\n *\t\t\t<cds-list-column nowrap=\"true\">Column 1</cds-list-column>\n *\t\t\t<cds-list-column nowrap=\"true\">Column 2</cds-list-column>\n *\t\t\t<cds-list-column>Column 3</cds-list-column>\n *\t\t</cds-list-header>\n *\t\t<cds-list-row>\n *\t\t\t<cds-list-column>Row 1</cds-list-column>\n *\t\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n *\t\t\t<cds-list-column>\n *\t\t\t\tLorem ipsum dolor sit amet,\n *\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n *\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n *\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n *\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n *\t\t\t</cds-list-column>\n *\t\t</cds-list-row>\n *\t\t<cds-list-row>\n *\t\t\t<cds-list-column>Row 2</cds-list-column>\n *\t\t\t<cds-list-column nowrap=\"true\">Row Two</cds-list-column>\n *\t\t\t<cds-list-column>\n *\t\t\t\tLorem ipsum dolor sit amet,\n *\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n *\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n *\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n *\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n *\t\t\t</cds-list-column>\n *\t\t</cds-list-row>\n *\t</cds-structured-list>\n * ```\n *\n * [See demo](../../?path=/story/components-structured-list--basic)\n */\n@Component({\n\tselector: \"cds-structured-list, ibm-structured-list\",\n\ttemplate: `\n\t\t<div\n\t\t\tclass=\"cds--structured-list\"\n\t\t\trole=\"table\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--structured-list--flush': flushed,\n\t\t\t\t'cds--structured-list--selection': selection,\n\t\t\t\t'cds--structured-list--condensed': condensed,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-content select=\"cds-list-header,ibm-list-header\"></ng-content>\n\t\t\t<div class=\"cds--structured-list-tbody\" role=\"rowgroup\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: StructuredList,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class StructuredList implements AfterContentInit, ControlValueAccessor {\n\t/**\n\t * A counter to provide unique default values.\n\t */\n\tstatic listCount = 0;\n\t/**\n\t * Set to `true` to enable radio like selection of the rows.\n\t */\n\t@Input() selection = false;\n\t/**\n\t * Set to `true` to align content with margin\n\t */\n\t@Input() flushed = false;\n\t/**\n\t * Set to `true` to apply a condensed style to the headers and rows.\n\t */\n\t@Input() condensed = false;\n\t/**\n\t * Used when `selection = true` as the row radio group `name`\n\t */\n\t@Input() name = `structured-list-${StructuredList.listCount++}`;\n\n\t/**\n\t * Sets the skeleton value for all `ListHeader` to the skeleton value of `StructuredList`.\n\t */\n\t@Input()\n\tset skeleton(value: any) {\n\t\tthis._skeleton = value;\n\t\tthis.updateChildren();\n\t}\n\n\t/**\n\t * Returns the skeleton value in the `StructuredList` if there is one.\n\t */\n\tget skeleton(): any {\n\t\treturn this._skeleton;\n\t}\n\n\t/**\n\t * Emits an event when the row selection changes.\n\t *\n\t * Emits an object that looks like:\n\t * ```javascript\n\t * {\n\t * \tvalue: \"something\",\n\t * \tselected: true,\n\t * \tname: \"structured-list-1\"\n\t * }\n\t * ```\n\t */\n\t@Output() selected: EventEmitter<{value: string, selected: boolean, name: string}> = new EventEmitter();\n\n\t@ContentChildren(ListRow) rows: QueryList<ListRow>;\n\t@ContentChildren(ListHeader) headers: QueryList<ListHeader>;\n\n\tprotected _skeleton = false;\n\n\tonChange = (_: any) => { };\n\n\tonTouched = () => { };\n\n\tngAfterContentInit() {\n\t\tconst setSelection = (rowOrHeader: ListRow | ListHeader) => {\n\t\t\trowOrHeader.selection = this.selection;\n\t\t};\n\n\t\tthis.headers.forEach(setSelection);\n\t\tthis.rows.forEach(row => {\n\t\t\tsetSelection(row);\n\t\t\trow.name = this.name;\n\t\t\trow.change.subscribe(() => {\n\t\t\t\tthis.selected.emit({\n\t\t\t\t\tvalue: row.value,\n\t\t\t\t\tselected: row.selected,\n\t\t\t\t\tname: this.name\n\t\t\t\t});\n\t\t\t\tthis.onChange(row.value);\n\t\t\t\tthis.writeValue(row.value);\n\t\t\t});\n\t\t});\n\t\tthis.updateChildren();\n\t}\n\n\twriteValue(value: any) {\n\t\tif (!this.rows) { return; }\n\t\tthis.rows.forEach(row => {\n\t\t\tif (row.value === value) {\n\t\t\t\trow.selected = true;\n\t\t\t} else {\n\t\t\t\trow.selected = false;\n\t\t\t}\n\t\t});\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tprotected updateChildren() {\n\t\tif (this.headers) {\n\t\t\tthis.headers.toArray().forEach(child => child.skeleton = this.skeleton);\n\t\t}\n\t}\n}\n",
|
|
51895
51913
|
"assetsDirs": [],
|
|
51896
51914
|
"styleUrlsData": "",
|
|
51897
51915
|
"stylesData": "",
|
|
@@ -74012,7 +74030,7 @@
|
|
|
74012
74030
|
"deprecated": false,
|
|
74013
74031
|
"deprecationMessage": "",
|
|
74014
74032
|
"type": "",
|
|
74015
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
74033
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(change)=\"change($event)\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
74016
74034
|
},
|
|
74017
74035
|
{
|
|
74018
74036
|
"name": "ModelTemplate",
|
|
@@ -74699,7 +74717,7 @@
|
|
|
74699
74717
|
"deprecated": false,
|
|
74700
74718
|
"deprecationMessage": "",
|
|
74701
74719
|
"type": "",
|
|
74702
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-structured-list\n\t\t\t[border]=\"border\"\n\t\t\t[condensed]=\"condensed\"\n\t\t\t[nowrap]=\"nowrap\"\n\t\t\tselection=\"true\"\n\t\t\t[(ngModel)]=\"valueSelected\">\n\t\t\t<cds-list-header>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 2</cds-list-column>\n\t\t\t\t<cds-list-column>Column 3</cds-list-column>\n\t\t\t</cds-list-header>\n\t\t\t<cds-list-row value=\"row1\">\n\t\t\t\t<cds-list-column>Row 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row2\">\n\t\t\t\t<cds-list-column>Row 2</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Two</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t</cds-structured-list>\n\t\t<p>{{valueSelected}}</p>\n\t`\n})"
|
|
74720
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-structured-list\n\t\t\t[border]=\"border\"\n\t\t\t[condensed]=\"condensed\"\n\t\t\t[nowrap]=\"nowrap\"\n\t\t\tselection=\"true\"\n\t\t\t[(ngModel)]=\"valueSelected\">\n\t\t\t<cds-list-header>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 2</cds-list-column>\n\t\t\t\t<cds-list-column>Column 3</cds-list-column>\n\t\t\t</cds-list-header>\n\t\t\t<cds-list-row value=\"row1\">\n\t\t\t\t<cds-list-column>Row 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row2\">\n\t\t\t\t<cds-list-column>Row 2</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Two</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row3\">\n\t\t\t\t<cds-list-column>Row 3</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Three</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row4\">\n\t\t\t\t<cds-list-column>Row 4</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Four</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t</cds-structured-list>\n\t\t<p>{{valueSelected}}</p>\n\t`\n})"
|
|
74703
74721
|
},
|
|
74704
74722
|
{
|
|
74705
74723
|
"name": "SideNavigation",
|
|
@@ -75069,7 +75087,7 @@
|
|
|
75069
75087
|
"deprecated": false,
|
|
75070
75088
|
"deprecationMessage": "",
|
|
75071
75089
|
"type": "",
|
|
75072
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\tlabel=\"Number input label\"\n\t\t\tskeleton=\"true\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
75090
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\tlabel=\"Number input label\"\n\t\t\tskeleton=\"true\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(change)=\"change($event)\">\n\t\t</cds-number>\n\t`\n})"
|
|
75073
75091
|
},
|
|
75074
75092
|
{
|
|
75075
75093
|
"name": "SkeletonTemplate",
|
|
@@ -75459,7 +75477,7 @@
|
|
|
75459
75477
|
"deprecated": false,
|
|
75460
75478
|
"deprecationMessage": "",
|
|
75461
75479
|
"type": "",
|
|
75462
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
75480
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(change)=\"change($event)\">\n\t\t</cds-number>\n\t`\n})"
|
|
75463
75481
|
},
|
|
75464
75482
|
{
|
|
75465
75483
|
"name": "Template",
|
|
@@ -75469,7 +75487,7 @@
|
|
|
75469
75487
|
"deprecated": false,
|
|
75470
75488
|
"deprecationMessage": "",
|
|
75471
75489
|
"type": "",
|
|
75472
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<!--\n\t\tapp-* components are for demo purposes only.\n\t\tYou can create your own implementation by using the component source found at:\n\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/pagination/pagination-nav/stories/pagination-nav-story.component.ts\n\t\t-->\n\t\t<app-pagination\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[totalDataLength]=\"totalDataLength\"\n\t\t\t[numOfItemsToShow]=\"numOfItemsToShow\"\n\t\t\t[skeleton]=\"skeleton\">\n\t\t</app-pagination>\n\t`\n})"
|
|
75490
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<!--\n\t\tapp-* components are for demo purposes only.\n\t\tYou can create your own implementation by using the component source found at:\n\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/pagination/pagination-nav/stories/pagination-nav-story.component.ts\n\t\t-->\n\t\t<app-pagination\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[totalDataLength]=\"totalDataLength\"\n\t\t\t[numOfItemsToShow]=\"numOfItemsToShow\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[size]=\"size\">\n\t\t</app-pagination>\n\t`\n})"
|
|
75473
75491
|
},
|
|
75474
75492
|
{
|
|
75475
75493
|
"name": "Template",
|
|
@@ -80419,7 +80437,7 @@
|
|
|
80419
80437
|
"deprecated": false,
|
|
80420
80438
|
"deprecationMessage": "",
|
|
80421
80439
|
"type": "",
|
|
80422
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
80440
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[size]=\"size\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[precision]=\"precision\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(change)=\"change($event)\">\n\t\t</cds-number>\n\t\t{{ value }}\n\t`\n})"
|
|
80423
80441
|
},
|
|
80424
80442
|
{
|
|
80425
80443
|
"name": "NgModel",
|
|
@@ -80449,7 +80467,7 @@
|
|
|
80449
80467
|
"deprecated": false,
|
|
80450
80468
|
"deprecationMessage": "",
|
|
80451
80469
|
"type": "",
|
|
80452
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\tlabel=\"Number input label\"\n\t\t\tskeleton=\"true\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
80470
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\tlabel=\"Number input label\"\n\t\t\tskeleton=\"true\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(change)=\"change($event)\">\n\t\t</cds-number>\n\t`\n})"
|
|
80453
80471
|
},
|
|
80454
80472
|
{
|
|
80455
80473
|
"name": "Template",
|
|
@@ -80459,7 +80477,7 @@
|
|
|
80459
80477
|
"deprecated": false,
|
|
80460
80478
|
"deprecationMessage": "",
|
|
80461
80479
|
"type": "",
|
|
80462
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[fluid]=\"fluid\">\n\t\t</cds-number>\n\t`\n})"
|
|
80480
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-number\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"[helperText]\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[min]=\"min\"\n\t\t\t[max]=\"max\"\n\t\t\t[step]=\"step\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[size]=\"size\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(change)=\"change($event)\">\n\t\t</cds-number>\n\t`\n})"
|
|
80463
80481
|
}
|
|
80464
80482
|
],
|
|
80465
80483
|
"src/pagination/pagination-nav.stories.ts": [
|
|
@@ -80481,7 +80499,7 @@
|
|
|
80481
80499
|
"deprecated": false,
|
|
80482
80500
|
"deprecationMessage": "",
|
|
80483
80501
|
"type": "",
|
|
80484
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<!--\n\t\tapp-* components are for demo purposes only.\n\t\tYou can create your own implementation by using the component source found at:\n\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/pagination/pagination-nav/stories/pagination-nav-story.component.ts\n\t\t-->\n\t\t<app-pagination\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[totalDataLength]=\"totalDataLength\"\n\t\t\t[numOfItemsToShow]=\"numOfItemsToShow\"\n\t\t\t[skeleton]=\"skeleton\">\n\t\t</app-pagination>\n\t`\n})"
|
|
80502
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<!--\n\t\tapp-* components are for demo purposes only.\n\t\tYou can create your own implementation by using the component source found at:\n\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/pagination/pagination-nav/stories/pagination-nav-story.component.ts\n\t\t-->\n\t\t<app-pagination\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[totalDataLength]=\"totalDataLength\"\n\t\t\t[numOfItemsToShow]=\"numOfItemsToShow\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[size]=\"size\">\n\t\t</app-pagination>\n\t`\n})"
|
|
80485
80503
|
}
|
|
80486
80504
|
],
|
|
80487
80505
|
"src/pagination/pagination.stories.ts": [
|
|
@@ -80869,7 +80887,7 @@
|
|
|
80869
80887
|
"deprecated": false,
|
|
80870
80888
|
"deprecationMessage": "",
|
|
80871
80889
|
"type": "",
|
|
80872
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-structured-list\n\t\t\t[border]=\"border\"\n\t\t\t[condensed]=\"condensed\"\n\t\t\t[nowrap]=\"nowrap\"\n\t\t\tselection=\"true\"\n\t\t\t[(ngModel)]=\"valueSelected\">\n\t\t\t<cds-list-header>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 2</cds-list-column>\n\t\t\t\t<cds-list-column>Column 3</cds-list-column>\n\t\t\t</cds-list-header>\n\t\t\t<cds-list-row value=\"row1\">\n\t\t\t\t<cds-list-column>Row 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row2\">\n\t\t\t\t<cds-list-column>Row 2</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Two</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t</cds-structured-list>\n\t\t<p>{{valueSelected}}</p>\n\t`\n})"
|
|
80890
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-structured-list\n\t\t\t[border]=\"border\"\n\t\t\t[condensed]=\"condensed\"\n\t\t\t[nowrap]=\"nowrap\"\n\t\t\tselection=\"true\"\n\t\t\t[(ngModel)]=\"valueSelected\">\n\t\t\t<cds-list-header>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Column 2</cds-list-column>\n\t\t\t\t<cds-list-column>Column 3</cds-list-column>\n\t\t\t</cds-list-header>\n\t\t\t<cds-list-row value=\"row1\">\n\t\t\t\t<cds-list-column>Row 1</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row One</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row2\">\n\t\t\t\t<cds-list-column>Row 2</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Two</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row3\">\n\t\t\t\t<cds-list-column>Row 3</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Three</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t\t<cds-list-row value=\"row4\">\n\t\t\t\t<cds-list-column>Row 4</cds-list-column>\n\t\t\t\t<cds-list-column nowrap=\"true\">Row Four</cds-list-column>\n\t\t\t\t<cds-list-column>\n\t\t\t\t\tLorem ipsum dolor sit amet,\n\t\t\t\t\tconsectetur adipiscing elit. Nunc dui magna,\n\t\t\t\t\tfinibus id tortor sed, aliquet bibendum augue.\n\t\t\t\t\tAenean posuere sem vel euismod dignissim. Nulla ut cursus dolor.\n\t\t\t\t\tPellentesque vulputate nisl a porttitor interdum.\n\t\t\t\t</cds-list-column>\n\t\t\t</cds-list-row>\n\t\t</cds-structured-list>\n\t\t<p>{{valueSelected}}</p>\n\t`\n})"
|
|
80873
80891
|
},
|
|
80874
80892
|
{
|
|
80875
80893
|
"name": "Skeleton",
|
|
@@ -87568,8 +87586,8 @@
|
|
|
87568
87586
|
"type": "component",
|
|
87569
87587
|
"linktype": "component",
|
|
87570
87588
|
"name": "PaginationNav",
|
|
87571
|
-
"coveragePercent":
|
|
87572
|
-
"coverageCount": "
|
|
87589
|
+
"coveragePercent": 38,
|
|
87590
|
+
"coverageCount": "7/18",
|
|
87573
87591
|
"status": "medium"
|
|
87574
87592
|
},
|
|
87575
87593
|
{
|
|
@@ -87596,7 +87614,7 @@
|
|
|
87596
87614
|
"linktype": "component",
|
|
87597
87615
|
"name": "PaginationNavStory",
|
|
87598
87616
|
"coveragePercent": 0,
|
|
87599
|
-
"coverageCount": "0/
|
|
87617
|
+
"coverageCount": "0/8",
|
|
87600
87618
|
"status": "low"
|
|
87601
87619
|
},
|
|
87602
87620
|
{
|
|
@@ -88423,8 +88441,8 @@
|
|
|
88423
88441
|
"type": "component",
|
|
88424
88442
|
"linktype": "component",
|
|
88425
88443
|
"name": "ListRow",
|
|
88426
|
-
"coveragePercent":
|
|
88427
|
-
"coverageCount": "6/
|
|
88444
|
+
"coveragePercent": 33,
|
|
88445
|
+
"coverageCount": "6/18",
|
|
88428
88446
|
"status": "medium"
|
|
88429
88447
|
},
|
|
88430
88448
|
{
|