carbon-components-angular 5.38.0 → 5.38.2
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/components/DatePicker.html +1 -1
- package/docs/documentation/components/DatePickerInput.html +48 -38
- package/docs/documentation/components/PasswordInputLabelComponent.html +1 -1
- package/docs/documentation/components/TextInputLabelComponent.html +1 -1
- 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/ContentSwitcherModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ContentSwitcherModule.html +4 -4
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +37 -41
- package/docs/documentation/modules/DatePickerInputModule.html +37 -41
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +38 -38
- package/docs/documentation/modules/DatePickerModule.html +38 -38
- package/docs/documentation/modules/GridModule/dependencies.svg +60 -60
- package/docs/documentation/modules/GridModule.html +60 -60
- package/docs/documentation/modules/LoadingModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LoadingModule.html +4 -4
- package/docs/documentation/modules/NFormsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NFormsModule.html +4 -4
- package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NumberModule.html +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule.html +4 -4
- package/docs/documentation/modules/RadioModule/dependencies.svg +4 -4
- package/docs/documentation/modules/RadioModule.html +4 -4
- package/docs/documentation/modules/SelectModule/dependencies.svg +58 -58
- package/docs/documentation/modules/SelectModule.html +58 -58
- package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SliderModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +216 -216
- package/docs/documentation/modules/TableModule.html +216 -216
- package/docs/documentation/modules/TabsModule/dependencies.svg +69 -69
- package/docs/documentation/modules/TabsModule.html +69 -69
- package/docs/documentation/modules/TagModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TagModule.html +4 -4
- package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ThemeModule.html +4 -4
- package/docs/documentation/modules/TilesModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TilesModule.html +4 -4
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TimePickerModule.html +4 -4
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +30 -30
- package/docs/documentation/modules/TimePickerSelectModule.html +30 -30
- package/docs/documentation/modules/ToggleModule/dependencies.svg +18 -18
- package/docs/documentation/modules/ToggleModule.html +18 -18
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +37 -37
- package/docs/documentation/modules/ToggletipModule.html +37 -37
- package/docs/documentation/modules/TooltipModule/dependencies.svg +29 -29
- package/docs/documentation/modules/TooltipModule.html +29 -29
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation.json +119 -119
- package/docs/storybook/{1345.99dc9be1.iframe.bundle.js → 1345.9201efca.iframe.bundle.js} +1 -1
- package/docs/storybook/{datepicker-datepicker-stories.fb6b3054.iframe.bundle.js → datepicker-datepicker-stories.adb85d77.iframe.bundle.js} +1 -1
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.99dffacb.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.b5fc6cdc.iframe.bundle.js → runtime~main.b26c0bbe.iframe.bundle.js} +1 -1
- package/esm2020/datepicker/datepicker.component.mjs +2 -2
- package/esm2020/datepicker-input/datepicker-input.component.mjs +15 -5
- package/esm2020/input/password-input-label.component.mjs +2 -2
- package/esm2020/input/text-input-label.component.mjs +2 -2
- package/fesm2015/carbon-components-angular-datepicker-input.mjs +14 -4
- package/fesm2015/carbon-components-angular-datepicker-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-datepicker.mjs +1 -1
- package/fesm2015/carbon-components-angular-datepicker.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-input.mjs +4 -4
- package/fesm2015/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-datepicker-input.mjs +14 -4
- package/fesm2020/carbon-components-angular-datepicker-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-datepicker.mjs +1 -1
- package/fesm2020/carbon-components-angular-datepicker.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-input.mjs +2 -2
- package/fesm2020/carbon-components-angular-input.mjs.map +1 -1
- package/package.json +1 -1
- package/docs/storybook/main.c3732b9e.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -26045,7 +26045,7 @@
|
|
|
26045
26045
|
},
|
|
26046
26046
|
{
|
|
26047
26047
|
"name": "DatePicker",
|
|
26048
|
-
"id": "component-DatePicker-
|
|
26048
|
+
"id": "component-DatePicker-1f0b9e935ec897e4d099c9ca3d8fc393d0c402c52c032f9f96bd9f1b3252f3a61d5c50defda466e553041dd584c327b583c5fa50edf4dce0a34339dc4d9ce386",
|
|
26049
26049
|
"file": "src/datepicker/datepicker.component.ts",
|
|
26050
26050
|
"encapsulation": [
|
|
26051
26051
|
"ViewEncapsulation.None"
|
|
@@ -26726,7 +26726,7 @@
|
|
|
26726
26726
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { DatePickerModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-date-picker--single\">See demo</a></p>\n",
|
|
26727
26727
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { DatePickerModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-date-picker--single)\n",
|
|
26728
26728
|
"type": "component",
|
|
26729
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tViewEncapsulation,\n\tElementRef,\n\tOnDestroy,\n\tHostListener,\n\tTemplateRef,\n\tOnChanges,\n\tSimpleChanges,\n\tAfterViewChecked,\n\tAfterViewInit,\n\tViewChild,\n\tOnInit,\n\tSimpleChange\n} from \"@angular/core\";\nimport rangePlugin from \"flatpickr/dist/plugins/rangePlugin\";\nimport flatpickr from \"flatpickr\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { carbonFlatpickrMonthSelectPlugin } from \"./carbon-flatpickr-month-select\";\nimport * as languages from \"flatpickr/dist/l10n/index\";\nimport { Options } from \"flatpickr/dist/types/options\";\nimport { DatePickerInput } from \"carbon-components-angular/datepicker-input\";\nimport { I18n } from \"carbon-components-angular/i18n\";\n\n/**\n * Due to type error, we have to use square brackets property accessor\n * There is a webpack issue when attempting to access exported languages from flatpickr l10n Angular 14+ apps\n * languages.default[locale] fails in app consuming CCA library but passes in test\n * languages.default.default[locale] fails in test but works in app consuming CCA library.\n *\n * To please both scenarios, we are adding a condition to prevent tests from failing\n */\nif (languages.default?.default[\"en\"]?.weekdays) {\n\t(languages.default.default[\"en\"].weekdays.shorthand as string[]) = languages.default.default[\"en\"].weekdays.longhand.map(day => {\n\t\tif (day === \"Thursday\") {\n\t\t\treturn \"Th\";\n\t\t}\n\t\treturn day.charAt(0);\n\t});\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { DatePickerModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-date-picker--single)\n */\n@Component({\n\tselector: \"cds-date-picker, ibm-date-picker\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div\n\t\t\tclass=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--range' : range,\n\t\t\t\t'cds--date-picker--single' : !range,\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#input\n\t\t\t\t\t[label]=\"label\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-input'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? false : true)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t\t[warn]=\"warn\"\n\t\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t\t(valueChange)=\"onValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(input)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\n\t\t\t<div *ngIf=\"range\" class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#rangeInput\n\t\t\t\t\t[label]=\"rangeLabel\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-rangeInput'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? true : null)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"rangeInvalid\"\n\t\t\t\t\t[invalidText]=\"rangeInvalidText\"\n\t\t\t\t\t[warn]=\"rangeWarn\"\n\t\t\t\t\t[warnText]=\"rangeWarnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"rangeHelperText\"\n\t\t\t\t\t(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(rangeInput)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: DatePicker,\n\t\t\tmulti: true\n\t\t}\n\t],\n\tencapsulation: ViewEncapsulation.None\n})\nexport class DatePicker implements\n\tOnInit,\n\tOnDestroy,\n\tOnChanges,\n\tAfterViewChecked,\n\tAfterViewInit {\n\tprivate static datePickerCount = 0;\n\n\t/**\n\t * Select calendar range mode\n\t */\n\t@Input() range = false;\n\n\t/**\n\t * Format of date\n\t *\n\t * For reference: https://flatpickr.js.org/formatting/\n\t */\n\t@Input() dateFormat = \"m/d/Y\";\n\n\t/**\n\t * Language of the flatpickr calendar.\n\t *\n\t * For reference of the possible locales:\n\t * https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts\n\t */\n\t@Input() language = \"en\";\n\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() helperText: string | TemplateRef<any>;\n\t@Input() rangeHelperText: string | TemplateRef<any>;\n\t@Input() rangeLabel: string;\n\n\t@Input() placeholder = \"mm/dd/yyyy\";\n\n\t/**\n\t * Aria label added to datepicker's calendar container.\n\t */\n\t@Input() ariaLabel = \"calendar container\";\n\n\t/**\n\t * The pattern for the underlying input element\n\t */\n\t@Input() inputPattern = \"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\";\n\n\t@Input() id = `datepicker-${DatePicker.datePickerCount++}`;\n\n\t@Input() set value(v: (Date | string)[]) {\n\t\tif (!v) {\n\t\t\tv = [];\n\t\t}\n\t\tthis._value = v;\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * Set to `\"light\"` to apply the light style\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@Input() disabled = false;\n\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` to display the invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if datepicker is in an invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\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\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Set to `true` to display the invalid state for the second datepicker input.\n\t */\n\t@Input() rangeInvalid = false;\n\t/**\n\t * Value displayed if the second datepicker input is in an invalid state.\n\t */\n\t@Input() rangeInvalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning in the second datepicker input (contents set by rangeWarningText)\n\t */\n\t@Input() rangeWarn = false;\n\t/**\n\t * Sets the warning text for the second datepicker input\n\t */\n\t@Input() rangeWarnText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() plugins = [];\n\n\t@Input()\n\tset flatpickrOptions(options: Partial<Options>) {\n\t\tthis._flatpickrOptions = Object.assign({}, this._flatpickrOptions, options);\n\t}\n\tget flatpickrOptions(): Partial<Options> {\n\t\tconst plugins = [...this.plugins, carbonFlatpickrMonthSelectPlugin];\n\t\tif (this.range) {\n\t\t\tplugins.push(rangePlugin({ input: `#${this.id}-rangeInput`, position: \"left\" }));\n\t\t}\n\t\treturn Object.assign({}, this._flatpickrOptions, this.flatpickrBaseOptions, {\n\t\t\tmode: this.range ? \"range\" : \"single\",\n\t\t\tplugins,\n\t\t\tdateFormat: this.dateFormat,\n\t\t\tlocale: languages.default?.default[this.language] || languages.default[this.language],\n\t\t\t// Little trick force \"readonly mode\" on datepicker input.\n\t\t\t// Docs: Whether clicking on the input should open the picker. You could disable this if you wish to open the calendar manually with.open().\n\t\t\tclickOpens: !this.readonly\n\t\t});\n\t}\n\n\t@ViewChild(\"input\", { static: true }) input: DatePickerInput;\n\t@ViewChild(\"rangeInput\") rangeInput: DatePickerInput;\n\n\t@Output() valueChange: EventEmitter<any> = new EventEmitter();\n\n\t/**\n\t * We are overriding onClose event even if users pass it via flatpickr options\n\t * Emits an event when date picker closes\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter();\n\n\tprotected _value = [];\n\n\tprotected _flatpickrOptions: Partial<Options> = {\n\t\tallowInput: true\n\t};\n\n\tprotected flatpickrBaseOptions = {\n\t\tmode: \"single\",\n\t\tdateFormat: \"m/d/Y\",\n\t\tplugins: this.plugins,\n\t\tonOpen: () => {\n\t\t\tthis.updateClassNames();\n\t\t\tthis.updateAttributes();\n\t\t\tthis.updateCalendarListeners();\n\t\t},\n\t\tonClose: (date) => {\n\t\t\t// This makes sure that the `flatpickrInstance selectedDates` are in sync with the values of\n\t\t\t// the inputs when the calendar closes.\n\t\t\tif (this.range && this.flatpickrInstance) {\n\t\t\t\tconst inputValue = this.input.input.nativeElement.value;\n\t\t\t\tconst rangeInputValue = this.rangeInput.input.nativeElement.value;\n\t\t\t\tif (inputValue || rangeInputValue) {\n\t\t\t\t\tconst parseDate = (date: string) => this.flatpickrInstance.parseDate(date, this.dateFormat);\n\t\t\t\t\tthis.setDateValues([parseDate(inputValue), parseDate(rangeInputValue || inputValue)]);\n\t\t\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onClose.emit(date);\n\t\t},\n\t\tonDayCreate: (_dObj, _dStr, _fp, dayElem) => {\n\t\t\tdayElem.classList.add(\"cds--date-picker__day\");\n\t\t},\n\t\tnextArrow: this.rightArrowHTML(),\n\t\tprevArrow: this.leftArrowHTML(),\n\t\tvalue: this.value\n\t};\n\n\tprotected flatpickrInstance = null;\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// if i18n is set to anything other than en we'll want to change the language\n\t\t// otherwise we'll just use the local setting\n\t\tif (this.i18n.getLocale() !== \"en\") {\n\t\t\tthis.i18n.getLocaleObservable().subscribe(locale => {\n\t\t\t\tthis.language = locale;\n\t\t\t\tthis.resetFlatpickrInstance();\n\t\t\t});\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\t// Reset the flatpickr instance on input changes that affect flatpickr.\n\t\tconst flatpickrChangeKeys = [\n\t\t\t\"range\",\n\t\t\t\"dateFormat\",\n\t\t\t\"language\",\n\t\t\t\"id\",\n\t\t\t\"value\",\n\t\t\t\"plugins\",\n\t\t\t\"flatpickrOptions\",\n\t\t\t\"readonly\"\n\t\t];\n\t\tconst changeKeys = Object.keys(changes);\n\t\tif (changeKeys.some(key => flatpickrChangeKeys.includes(key))) {\n\t\t\tthis.resetFlatpickrInstance(changes.value);\n\t\t}\n\t}\n\n\tngAfterViewInit() {\n\t\tif (!this.skeleton) {\n\t\t\tthis.input.input.nativeElement.value = this._value[0] ?? \"\";\n\t\t\tif (this.range) {\n\t\t\t\tthis.rangeInput.input.nativeElement.value = this._value[1] ?? \"\";\n\t\t\t}\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles opening the calendar \"properly\" when the calendar icon is clicked.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput) {\n\t\tif (this.readonly) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.range) {\n\t\t\tdatepickerInput.input.nativeElement.click();\n\n\t\t\t// If the first input's calendar icon is clicked when calendar is in range mode, then\n\t\t\t// the month and year needs to be manually changed to the current selected month and\n\t\t\t// year otherwise the calendar view will not be updated upon opening.\n\t\t\tif (datepickerInput === this.input && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t\tthis.flatpickrInstance.currentYear = this.flatpickrInstance.selectedDates[0].getFullYear();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single-mode flatpickr handles mousedown but not click, so nativeElement.click() won't\n\t\t\t// work when the calendar icon is clicked. In this case we simply use flatpickr.open().\n\t\t\tthis.flatpickrInstance.open();\n\t\t}\n\t}\n\n\tprotected updateCalendarListeners() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.removeEventListener(\"click\", this.preventCalendarClose);\n\t\t\tcalendar.addEventListener(\"click\", this.preventCalendarClose);\n\t\t});\n\t}\n\n\t/**\n\t * Handles the initialization of event listeners for the datepicker input and range input fields.\n\t */\n\tprotected addInputListeners() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows focus transition from the datepicker input or range input field to\n\t\t// flatpickr calendar using a keyboard.\n\t\tconst addFocusCalendarListener = (element: HTMLInputElement) => {\n\t\t\telement.addEventListener(\"keydown\", (event: KeyboardEvent) => {\n\t\t\t\t// Listeners are added just once, so a check is needed here.\n\t\t\t\tif (this.readonly) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t\t}\n\t\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\t\tif (!this.flatpickrInstance.isOpen) {\n\t\t\t\t\t\tthis.flatpickrInstance.open();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst calendarContainer = this.flatpickrInstance.calendarContainer;\n\t\t\t\t\tconst dayElement = calendarContainer && calendarContainer.querySelector(\".flatpickr-day[tabindex]\");\n\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\tdayElement.focus();\n\n\t\t\t\t\t\t// If the user manually inputs a value into the date field and presses arrow down,\n\t\t\t\t\t\t// datepicker input onchange will be triggered when focus is removed from it and\n\t\t\t\t\t\t// `flatpickrInstance.setDate` and `flatpickrInstance.changeMonth` will be invoked\n\t\t\t\t\t\t// which will automatically change focus to the beginning of the document.\n\t\t\t\t\t\tif (document.activeElement !== dayElement && this.flatpickrInstance.selectedDateElem) {\n\t\t\t\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (this.input && this.input.input) {\n\t\t\taddFocusCalendarListener(this.input.input.nativeElement);\n\t\t}\n\n\t\tif (this.rangeInput && this.rangeInput.input) {\n\t\t\taddFocusCalendarListener(this.rangeInput.input.nativeElement);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the flatpickr instance while keeping the date values (or updating them if newDates is provided)\n\t *\n\t * Used to pick up input changes or locale changes.\n\t *\n\t * @param newDates An optional SimpleChange of date values\n\t */\n\tprotected resetFlatpickrInstance(newDates?: SimpleChange) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tlet dates = this.flatpickrInstance.selectedDates;\n\t\t\tif (newDates && this.didDateValueChange(newDates.currentValue, newDates.previousValue)) {\n\t\t\t\tdates = newDates.currentValue;\n\t\t\t}\n\t\t\t// only reset the flatpickr instance on Input changes\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\tthis.setDateValues(dates);\n\t\t}\n\t}\n\n\t/**\n\t * Carbon uses a number of specific classnames for parts of the flatpickr - this idempotent method applies them if needed.\n\t */\n\tprotected updateClassNames() {\n\t\tif (!this.elementRef) { return; }\n\t\t// get all the possible flatpickrs in the document - we need to add classes to (potentially) all of them\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tconst monthContainer = document.querySelectorAll(\".flatpickr-month\");\n\t\tconst weekdaysContainer = document.querySelectorAll(\".flatpickr-weekdays\");\n\t\tconst weekdayContainer = document.querySelectorAll(\".flatpickr-weekday\");\n\t\tconst daysContainer = document.querySelectorAll(\".flatpickr-days\");\n\t\tconst dayContainer = document.querySelectorAll(\".flatpickr-day\");\n\n\t\t// add classes to lists of elements\n\t\tconst addClassIfNotExists = (classname: string, elementList: NodeListOf<Element>) => {\n\t\t\tArray.from(elementList).forEach(element => {\n\t\t\t\tif (!element.classList.contains(classname)) {\n\t\t\t\t\telement.classList.add(classname);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add classes (but only if they don't exist, small perf win)\n\t\taddClassIfNotExists(\"cds--date-picker__calendar\", calendarContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__month\", monthContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__weekdays\", weekdaysContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__days\", daysContainer);\n\n\t\t// add weekday classes and format the text\n\t\tArray.from(weekdayContainer).forEach(element => {\n\t\t\telement.innerHTML = element.innerHTML.replace(/\\s+/g, \"\");\n\t\t\telement.classList.add(\"cds--date-picker__weekday\");\n\t\t});\n\n\t\t// add day classes and special case the \"today\" element based on `this.value`\n\t\tArray.from(dayContainer).forEach(element => {\n\t\t\telement.classList.add(\"cds--date-picker__day\");\n\t\t\tif (!this.value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (element.classList.contains(\"today\") && this.value.length > 0) {\n\t\t\t\telement.classList.add(\"no-border\");\n\t\t\t} else if (element.classList.contains(\"today\") && this.value.length === 0) {\n\t\t\t\telement.classList.remove(\"no-border\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected updateAttributes() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.setAttribute(\"role\", \"region\");\n\t\t\tcalendar.setAttribute(\"aria-label\", this.ariaLabel);\n\t\t});\n\t}\n\n\t/**\n\t * Applies the given date value array to both the flatpickr instance and the `input`(s)\n\t * @param dates the date values to apply\n\t */\n\tprotected setDateValues(dates: (Date | string)[]) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst singleInput = this.elementRef.nativeElement.querySelector(`#${this.id}-input`);\n\t\t\tconst rangeInput = this.elementRef.nativeElement.querySelector(`#${this.id}-rangeInput`);\n\n\t\t\t// `flatpickrInstance.setDate` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.setDate` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\t// set the date on the instance\n\t\t\tthis.flatpickrInstance.setDate(dates);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\tlet singleDate = \"\";\n\t\t\t// if date is a string, parse and format\n\t\t\tif (typeof this.flatpickrInstance.selectedDates[0] === \"string\") {\n\t\t\t\tsingleDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(singleDate, this.dateFormat);\n\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t} else if (!!this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t}\n\n\t\t\tif (rangeInput) {\n\t\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\t\tlet rangeDate = \"\";\n\t\t\t\t// if date is a string, parse and format\n\t\t\t\tif (typeof this.flatpickrInstance.selectedDates[1] === \"string\") {\n\t\t\t\t\trangeDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[1].toString(), this.dateFormat);\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(rangeDate, this.dateFormat);\n\t\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t\t} else if (!!this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[1], this.dateFormat);\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// apply the values\n\t\t\t\t\trangeInput.value = rangeDate;\n\t\t\t\t\tsingleInput.value = singleDate;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected preventCalendarClose = event => event.stopPropagation();\n\n\tprotected doSelect(selectedValue: (Date | string)[]) {\n\t\t// In range mode, if a date is selected from the first calendar that is from the previous month,\n\t\t// the month will not be updated on the calendar until the calendar is re-opened.\n\t\t// This will make sure the calendar is updated with the correct month.\n\t\tif (this.range && this.flatpickrInstance.selectedDates[0]) {\n\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t// `flatpickrInstance.changeMonth` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.changeMonth` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t}\n\t\tthis.valueChange.emit(selectedValue);\n\t\tthis.propagateChange(selectedValue);\n\t}\n\n\tprotected didDateValueChange(currentValue, previousValue) {\n\t\treturn currentValue[0] !== previousValue[0] || currentValue[1] !== previousValue[1];\n\t}\n\n\t/**\n\t * More advanced checking of the loaded state of flatpickr\n\t */\n\tprotected isFlatpickrLoaded() {\n\t\t// cast the instance to a boolean, and some method that has to exist for the library to be loaded in this case `setDate`\n\t\treturn !!this.flatpickrInstance && !!this.flatpickrInstance.setDate;\n\t}\n\n\t/**\n\t * Right arrow HTML passed to flatpickr\n\t */\n\tprotected rightArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n\n\t/**\n\t * Left arrow HTML passed to flatpickr\n\t */\n\tprotected leftArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n}\n",
|
|
26729
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tViewEncapsulation,\n\tElementRef,\n\tOnDestroy,\n\tHostListener,\n\tTemplateRef,\n\tOnChanges,\n\tSimpleChanges,\n\tAfterViewChecked,\n\tAfterViewInit,\n\tViewChild,\n\tOnInit,\n\tSimpleChange\n} from \"@angular/core\";\nimport rangePlugin from \"flatpickr/dist/plugins/rangePlugin\";\nimport flatpickr from \"flatpickr\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { carbonFlatpickrMonthSelectPlugin } from \"./carbon-flatpickr-month-select\";\nimport * as languages from \"flatpickr/dist/l10n/index\";\nimport { Options } from \"flatpickr/dist/types/options\";\nimport { DatePickerInput } from \"carbon-components-angular/datepicker-input\";\nimport { I18n } from \"carbon-components-angular/i18n\";\n\n/**\n * Due to type error, we have to use square brackets property accessor\n * There is a webpack issue when attempting to access exported languages from flatpickr l10n Angular 14+ apps\n * languages.default[locale] fails in app consuming CCA library but passes in test\n * languages.default.default[locale] fails in test but works in app consuming CCA library.\n *\n * To please both scenarios, we are adding a condition to prevent tests from failing\n */\nif (languages.default?.default[\"en\"]?.weekdays) {\n\t(languages.default.default[\"en\"].weekdays.shorthand as string[]) = languages.default.default[\"en\"].weekdays.longhand.map(day => {\n\t\tif (day === \"Thursday\") {\n\t\t\treturn \"Th\";\n\t\t}\n\t\treturn day.charAt(0);\n\t});\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { DatePickerModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-date-picker--single)\n */\n@Component({\n\tselector: \"cds-date-picker, ibm-date-picker\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div\n\t\t\tclass=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--range' : range,\n\t\t\t\t'cds--date-picker--single' : !range,\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#input\n\t\t\t\t\t[label]=\"label\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-input'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? false : true)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t\t[warn]=\"warn\"\n\t\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t\t(valueChange)=\"onValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(input)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\n\t\t\t<div *ngIf=\"range\" class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#rangeInput\n\t\t\t\t\t[label]=\"rangeLabel\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-rangeInput'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? true : null)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"rangeInvalid\"\n\t\t\t\t\t[invalidText]=\"rangeInvalidText\"\n\t\t\t\t\t[warn]=\"rangeWarn\"\n\t\t\t\t\t[warnText]=\"rangeWarnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"rangeHelperText\"\n\t\t\t\t\t(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(rangeInput)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: DatePicker,\n\t\t\tmulti: true\n\t\t}\n\t],\n\tencapsulation: ViewEncapsulation.None\n})\nexport class DatePicker implements\n\tOnInit,\n\tOnDestroy,\n\tOnChanges,\n\tAfterViewChecked,\n\tAfterViewInit {\n\tprivate static datePickerCount = 0;\n\n\t/**\n\t * Select calendar range mode\n\t */\n\t@Input() range = false;\n\n\t/**\n\t * Format of date\n\t *\n\t * For reference: https://flatpickr.js.org/formatting/\n\t */\n\t@Input() dateFormat = \"m/d/Y\";\n\n\t/**\n\t * Language of the flatpickr calendar.\n\t *\n\t * For reference of the possible locales:\n\t * https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts\n\t */\n\t@Input() language = \"en\";\n\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() helperText: string | TemplateRef<any>;\n\t@Input() rangeHelperText: string | TemplateRef<any>;\n\t@Input() rangeLabel: string;\n\n\t@Input() placeholder = \"mm/dd/yyyy\";\n\n\t/**\n\t * Aria label added to datepicker's calendar container.\n\t */\n\t@Input() ariaLabel = \"calendar container\";\n\n\t/**\n\t * The pattern for the underlying input element\n\t */\n\t@Input() inputPattern = \"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\";\n\n\t@Input() id = `datepicker-${DatePicker.datePickerCount++}`;\n\n\t@Input() set value(v: (Date | string)[]) {\n\t\tif (!v) {\n\t\t\tv = [];\n\t\t}\n\t\tthis._value = v;\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * Set to `\"light\"` to apply the light style\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@Input() disabled = false;\n\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` to display the invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if datepicker is in an invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\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\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Set to `true` to display the invalid state for the second datepicker input.\n\t */\n\t@Input() rangeInvalid = false;\n\t/**\n\t * Value displayed if the second datepicker input is in an invalid state.\n\t */\n\t@Input() rangeInvalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning in the second datepicker input (contents set by rangeWarningText)\n\t */\n\t@Input() rangeWarn = false;\n\t/**\n\t * Sets the warning text for the second datepicker input\n\t */\n\t@Input() rangeWarnText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() plugins = [];\n\n\t@Input()\n\tset flatpickrOptions(options: Partial<Options>) {\n\t\tthis._flatpickrOptions = Object.assign({}, this._flatpickrOptions, options);\n\t}\n\tget flatpickrOptions(): Partial<Options> {\n\t\tconst plugins = [...this.plugins, carbonFlatpickrMonthSelectPlugin];\n\t\tif (this.range) {\n\t\t\tplugins.push(rangePlugin({ input: `#${this.id}-rangeInput`, position: \"left\" }));\n\t\t}\n\t\treturn Object.assign({}, this._flatpickrOptions, this.flatpickrBaseOptions, {\n\t\t\tmode: this.range ? \"range\" : \"single\",\n\t\t\tplugins,\n\t\t\tdateFormat: this.dateFormat,\n\t\t\tlocale: languages.default?.default[this.language] || languages.default[this.language],\n\t\t\t// Little trick force \"readonly mode\" on datepicker input.\n\t\t\t// Docs: Whether clicking on the input should open the picker. You could disable this if you wish to open the calendar manually with.open().\n\t\t\tclickOpens: !this.readonly\n\t\t});\n\t}\n\n\t@ViewChild(\"input\", { static: true }) input: DatePickerInput;\n\t@ViewChild(\"rangeInput\") rangeInput: DatePickerInput;\n\n\t@Output() valueChange: EventEmitter<any> = new EventEmitter();\n\n\t/**\n\t * We are overriding onClose event even if users pass it via flatpickr options\n\t * Emits an event when date picker closes\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter();\n\n\tprotected _value = [];\n\n\tprotected _flatpickrOptions: Partial<Options> = {\n\t\tallowInput: true\n\t};\n\n\tprotected flatpickrBaseOptions = {\n\t\tmode: \"single\",\n\t\tdateFormat: \"m/d/Y\",\n\t\tplugins: this.plugins,\n\t\tonOpen: () => {\n\t\t\tthis.updateClassNames();\n\t\t\tthis.updateAttributes();\n\t\t\tthis.updateCalendarListeners();\n\t\t},\n\t\tonClose: (date) => {\n\t\t\t// This makes sure that the `flatpickrInstance selectedDates` are in sync with the values of\n\t\t\t// the inputs when the calendar closes.\n\t\t\tif (this.range && this.flatpickrInstance) {\n\t\t\t\tconst inputValue = this.input.input.nativeElement.value;\n\t\t\t\tconst rangeInputValue = this.rangeInput.input.nativeElement.value;\n\t\t\t\tif (inputValue || rangeInputValue) {\n\t\t\t\t\tconst parseDate = (date: string) => this.flatpickrInstance.parseDate(date, this.dateFormat);\n\t\t\t\t\tthis.setDateValues([parseDate(inputValue), parseDate(rangeInputValue || inputValue)]);\n\t\t\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onClose.emit(date);\n\t\t},\n\t\tonDayCreate: (_dObj, _dStr, _fp, dayElem) => {\n\t\t\tdayElem.classList.add(\"cds--date-picker__day\");\n\t\t},\n\t\tnextArrow: this.rightArrowHTML(),\n\t\tprevArrow: this.leftArrowHTML(),\n\t\tvalue: this.value\n\t};\n\n\tprotected flatpickrInstance = null;\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// if i18n is set to anything other than en we'll want to change the language\n\t\t// otherwise we'll just use the local setting\n\t\tif (this.i18n.getLocale() !== \"en\") {\n\t\t\tthis.i18n.getLocaleObservable().subscribe(locale => {\n\t\t\t\tthis.language = locale;\n\t\t\t\tthis.resetFlatpickrInstance();\n\t\t\t});\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\t// Reset the flatpickr instance on input changes that affect flatpickr.\n\t\tconst flatpickrChangeKeys = [\n\t\t\t\"range\",\n\t\t\t\"dateFormat\",\n\t\t\t\"language\",\n\t\t\t\"id\",\n\t\t\t\"value\",\n\t\t\t\"plugins\",\n\t\t\t\"flatpickrOptions\",\n\t\t\t\"readonly\"\n\t\t];\n\t\tconst changeKeys = Object.keys(changes);\n\t\tif (changeKeys.some(key => flatpickrChangeKeys.includes(key))) {\n\t\t\tthis.resetFlatpickrInstance(changes.value);\n\t\t}\n\t}\n\n\tngAfterViewInit() {\n\t\tif (!this.skeleton) {\n\t\t\tthis.input.input.nativeElement.value = this._value[0] ?? \"\";\n\t\t\tif (this.range) {\n\t\t\t\tthis.rangeInput.input.nativeElement.value = this._value[1] ?? \"\";\n\t\t\t}\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles opening the calendar \"properly\" when the calendar icon is clicked.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput) {\n\t\tif (this.readonly || this.skeleton) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.range) {\n\t\t\tdatepickerInput.input.nativeElement.click();\n\n\t\t\t// If the first input's calendar icon is clicked when calendar is in range mode, then\n\t\t\t// the month and year needs to be manually changed to the current selected month and\n\t\t\t// year otherwise the calendar view will not be updated upon opening.\n\t\t\tif (datepickerInput === this.input && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t\tthis.flatpickrInstance.currentYear = this.flatpickrInstance.selectedDates[0].getFullYear();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single-mode flatpickr handles mousedown but not click, so nativeElement.click() won't\n\t\t\t// work when the calendar icon is clicked. In this case we simply use flatpickr.open().\n\t\t\tthis.flatpickrInstance.open();\n\t\t}\n\t}\n\n\tprotected updateCalendarListeners() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.removeEventListener(\"click\", this.preventCalendarClose);\n\t\t\tcalendar.addEventListener(\"click\", this.preventCalendarClose);\n\t\t});\n\t}\n\n\t/**\n\t * Handles the initialization of event listeners for the datepicker input and range input fields.\n\t */\n\tprotected addInputListeners() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows focus transition from the datepicker input or range input field to\n\t\t// flatpickr calendar using a keyboard.\n\t\tconst addFocusCalendarListener = (element: HTMLInputElement) => {\n\t\t\telement.addEventListener(\"keydown\", (event: KeyboardEvent) => {\n\t\t\t\t// Listeners are added just once, so a check is needed here.\n\t\t\t\tif (this.readonly) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t\t}\n\t\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\t\tif (!this.flatpickrInstance.isOpen) {\n\t\t\t\t\t\tthis.flatpickrInstance.open();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst calendarContainer = this.flatpickrInstance.calendarContainer;\n\t\t\t\t\tconst dayElement = calendarContainer && calendarContainer.querySelector(\".flatpickr-day[tabindex]\");\n\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\tdayElement.focus();\n\n\t\t\t\t\t\t// If the user manually inputs a value into the date field and presses arrow down,\n\t\t\t\t\t\t// datepicker input onchange will be triggered when focus is removed from it and\n\t\t\t\t\t\t// `flatpickrInstance.setDate` and `flatpickrInstance.changeMonth` will be invoked\n\t\t\t\t\t\t// which will automatically change focus to the beginning of the document.\n\t\t\t\t\t\tif (document.activeElement !== dayElement && this.flatpickrInstance.selectedDateElem) {\n\t\t\t\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (this.input && this.input.input) {\n\t\t\taddFocusCalendarListener(this.input.input.nativeElement);\n\t\t}\n\n\t\tif (this.rangeInput && this.rangeInput.input) {\n\t\t\taddFocusCalendarListener(this.rangeInput.input.nativeElement);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the flatpickr instance while keeping the date values (or updating them if newDates is provided)\n\t *\n\t * Used to pick up input changes or locale changes.\n\t *\n\t * @param newDates An optional SimpleChange of date values\n\t */\n\tprotected resetFlatpickrInstance(newDates?: SimpleChange) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tlet dates = this.flatpickrInstance.selectedDates;\n\t\t\tif (newDates && this.didDateValueChange(newDates.currentValue, newDates.previousValue)) {\n\t\t\t\tdates = newDates.currentValue;\n\t\t\t}\n\t\t\t// only reset the flatpickr instance on Input changes\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\tthis.setDateValues(dates);\n\t\t}\n\t}\n\n\t/**\n\t * Carbon uses a number of specific classnames for parts of the flatpickr - this idempotent method applies them if needed.\n\t */\n\tprotected updateClassNames() {\n\t\tif (!this.elementRef) { return; }\n\t\t// get all the possible flatpickrs in the document - we need to add classes to (potentially) all of them\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tconst monthContainer = document.querySelectorAll(\".flatpickr-month\");\n\t\tconst weekdaysContainer = document.querySelectorAll(\".flatpickr-weekdays\");\n\t\tconst weekdayContainer = document.querySelectorAll(\".flatpickr-weekday\");\n\t\tconst daysContainer = document.querySelectorAll(\".flatpickr-days\");\n\t\tconst dayContainer = document.querySelectorAll(\".flatpickr-day\");\n\n\t\t// add classes to lists of elements\n\t\tconst addClassIfNotExists = (classname: string, elementList: NodeListOf<Element>) => {\n\t\t\tArray.from(elementList).forEach(element => {\n\t\t\t\tif (!element.classList.contains(classname)) {\n\t\t\t\t\telement.classList.add(classname);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add classes (but only if they don't exist, small perf win)\n\t\taddClassIfNotExists(\"cds--date-picker__calendar\", calendarContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__month\", monthContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__weekdays\", weekdaysContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__days\", daysContainer);\n\n\t\t// add weekday classes and format the text\n\t\tArray.from(weekdayContainer).forEach(element => {\n\t\t\telement.innerHTML = element.innerHTML.replace(/\\s+/g, \"\");\n\t\t\telement.classList.add(\"cds--date-picker__weekday\");\n\t\t});\n\n\t\t// add day classes and special case the \"today\" element based on `this.value`\n\t\tArray.from(dayContainer).forEach(element => {\n\t\t\telement.classList.add(\"cds--date-picker__day\");\n\t\t\tif (!this.value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (element.classList.contains(\"today\") && this.value.length > 0) {\n\t\t\t\telement.classList.add(\"no-border\");\n\t\t\t} else if (element.classList.contains(\"today\") && this.value.length === 0) {\n\t\t\t\telement.classList.remove(\"no-border\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected updateAttributes() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.setAttribute(\"role\", \"region\");\n\t\t\tcalendar.setAttribute(\"aria-label\", this.ariaLabel);\n\t\t});\n\t}\n\n\t/**\n\t * Applies the given date value array to both the flatpickr instance and the `input`(s)\n\t * @param dates the date values to apply\n\t */\n\tprotected setDateValues(dates: (Date | string)[]) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst singleInput = this.elementRef.nativeElement.querySelector(`#${this.id}-input`);\n\t\t\tconst rangeInput = this.elementRef.nativeElement.querySelector(`#${this.id}-rangeInput`);\n\n\t\t\t// `flatpickrInstance.setDate` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.setDate` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\t// set the date on the instance\n\t\t\tthis.flatpickrInstance.setDate(dates);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\tlet singleDate = \"\";\n\t\t\t// if date is a string, parse and format\n\t\t\tif (typeof this.flatpickrInstance.selectedDates[0] === \"string\") {\n\t\t\t\tsingleDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(singleDate, this.dateFormat);\n\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t} else if (!!this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t}\n\n\t\t\tif (rangeInput) {\n\t\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\t\tlet rangeDate = \"\";\n\t\t\t\t// if date is a string, parse and format\n\t\t\t\tif (typeof this.flatpickrInstance.selectedDates[1] === \"string\") {\n\t\t\t\t\trangeDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[1].toString(), this.dateFormat);\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(rangeDate, this.dateFormat);\n\t\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t\t} else if (!!this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[1], this.dateFormat);\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// apply the values\n\t\t\t\t\trangeInput.value = rangeDate;\n\t\t\t\t\tsingleInput.value = singleDate;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected preventCalendarClose = event => event.stopPropagation();\n\n\tprotected doSelect(selectedValue: (Date | string)[]) {\n\t\t// In range mode, if a date is selected from the first calendar that is from the previous month,\n\t\t// the month will not be updated on the calendar until the calendar is re-opened.\n\t\t// This will make sure the calendar is updated with the correct month.\n\t\tif (this.range && this.flatpickrInstance.selectedDates[0]) {\n\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t// `flatpickrInstance.changeMonth` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.changeMonth` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t}\n\t\tthis.valueChange.emit(selectedValue);\n\t\tthis.propagateChange(selectedValue);\n\t}\n\n\tprotected didDateValueChange(currentValue, previousValue) {\n\t\treturn currentValue[0] !== previousValue[0] || currentValue[1] !== previousValue[1];\n\t}\n\n\t/**\n\t * More advanced checking of the loaded state of flatpickr\n\t */\n\tprotected isFlatpickrLoaded() {\n\t\t// cast the instance to a boolean, and some method that has to exist for the library to be loaded in this case `setDate`\n\t\treturn !!this.flatpickrInstance && !!this.flatpickrInstance.setDate;\n\t}\n\n\t/**\n\t * Right arrow HTML passed to flatpickr\n\t */\n\tprotected rightArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n\n\t/**\n\t * Left arrow HTML passed to flatpickr\n\t */\n\tprotected leftArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n}\n",
|
|
26730
26730
|
"assetsDirs": [],
|
|
26731
26731
|
"styleUrlsData": "",
|
|
26732
26732
|
"stylesData": "",
|
|
@@ -26856,7 +26856,7 @@
|
|
|
26856
26856
|
},
|
|
26857
26857
|
{
|
|
26858
26858
|
"name": "DatePickerInput",
|
|
26859
|
-
"id": "component-DatePickerInput-
|
|
26859
|
+
"id": "component-DatePickerInput-bec03ed7095aa2b07d47458bb551fab7e6736a64529f457cdc52a6613ee9c0deb34f9a320037c5840bc9fecd9ecd08adae1bfaa465926fd6af13a899a1f1363e",
|
|
26860
26860
|
"file": "src/datepicker-input/datepicker-input.component.ts",
|
|
26861
26861
|
"encapsulation": [],
|
|
26862
26862
|
"entryComponents": [],
|
|
@@ -26870,7 +26870,7 @@
|
|
|
26870
26870
|
"selector": "cds-date-picker-input, ibm-date-picker-input",
|
|
26871
26871
|
"styleUrls": [],
|
|
26872
26872
|
"styles": [],
|
|
26873
|
-
"template": "\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === 'range',\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<label\n\t\t\t\t\t*ngIf=\"label\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\
|
|
26873
|
+
"template": "\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === 'range',\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<!-- Skeleton structure -->\n\t\t\t\t<ng-container *ngIf=\"skeleton\">\n\t\t\t\t\t<span class=\"cds--label cds--skeleton\"></span>\n\t\t\t\t\t<div class=\"cds--date-picker__input cds--skeleton\"></div>\n\t\t\t\t</ng-container>\n\t\t\t\t<label\n\t\t\t\t\t*ngIf=\"label && !skeleton\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cds--date-picker__input\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--date-picker__input--sm': size === 'sm',\n\t\t\t\t\t\t\t'cds--date-picker__input--md': size === 'md',\n\t\t\t\t\t\t\t'cds--date-picker__input--lg': size === 'lg'\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t[attr.data-invalid]=\"invalid ? true : undefined\"\n\t\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t\t[pattern]=\"pattern\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t\t[id]= \"id\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t\t\t(change)=\"onChange($event)\"/>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"type !== 'simple' && !warn && !invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"calendar\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--warn\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\t",
|
|
26874
26874
|
"templateUrl": [],
|
|
26875
26875
|
"viewProviders": [],
|
|
26876
26876
|
"hostDirectives": [],
|
|
@@ -26880,7 +26880,7 @@
|
|
|
26880
26880
|
"defaultValue": "false",
|
|
26881
26881
|
"deprecated": false,
|
|
26882
26882
|
"deprecationMessage": "",
|
|
26883
|
-
"line":
|
|
26883
|
+
"line": 136,
|
|
26884
26884
|
"type": "boolean",
|
|
26885
26885
|
"decorators": []
|
|
26886
26886
|
},
|
|
@@ -26889,7 +26889,7 @@
|
|
|
26889
26889
|
"defaultValue": "false",
|
|
26890
26890
|
"deprecated": false,
|
|
26891
26891
|
"deprecationMessage": "",
|
|
26892
|
-
"line":
|
|
26892
|
+
"line": 120,
|
|
26893
26893
|
"type": "boolean",
|
|
26894
26894
|
"decorators": []
|
|
26895
26895
|
},
|
|
@@ -26899,7 +26899,7 @@
|
|
|
26899
26899
|
"deprecationMessage": "",
|
|
26900
26900
|
"rawdescription": "\n\nSets the optional helper text.\n",
|
|
26901
26901
|
"description": "<p>Sets the optional helper text.</p>\n",
|
|
26902
|
-
"line":
|
|
26902
|
+
"line": 159,
|
|
26903
26903
|
"type": "string | TemplateRef<any>",
|
|
26904
26904
|
"decorators": []
|
|
26905
26905
|
},
|
|
@@ -26908,7 +26908,7 @@
|
|
|
26908
26908
|
"defaultValue": "`datepicker-${DatePickerInput.datePickerCount++}`",
|
|
26909
26909
|
"deprecated": false,
|
|
26910
26910
|
"deprecationMessage": "",
|
|
26911
|
-
"line":
|
|
26911
|
+
"line": 118,
|
|
26912
26912
|
"type": "string",
|
|
26913
26913
|
"decorators": []
|
|
26914
26914
|
},
|
|
@@ -26919,7 +26919,7 @@
|
|
|
26919
26919
|
"deprecationMessage": "",
|
|
26920
26920
|
"rawdescription": "\n\nSet to `true` for invalid state.\n",
|
|
26921
26921
|
"description": "<p>Set to <code>true</code> for invalid state.</p>\n",
|
|
26922
|
-
"line":
|
|
26922
|
+
"line": 142,
|
|
26923
26923
|
"type": "boolean",
|
|
26924
26924
|
"decorators": []
|
|
26925
26925
|
},
|
|
@@ -26929,7 +26929,7 @@
|
|
|
26929
26929
|
"deprecationMessage": "",
|
|
26930
26930
|
"rawdescription": "\n\nValue displayed if dropdown is in invalid state.\n",
|
|
26931
26931
|
"description": "<p>Value displayed if dropdown is in invalid state.</p>\n",
|
|
26932
|
-
"line":
|
|
26932
|
+
"line": 146,
|
|
26933
26933
|
"type": "string | TemplateRef<any>",
|
|
26934
26934
|
"decorators": []
|
|
26935
26935
|
},
|
|
@@ -26937,7 +26937,7 @@
|
|
|
26937
26937
|
"name": "label",
|
|
26938
26938
|
"deprecated": false,
|
|
26939
26939
|
"deprecationMessage": "",
|
|
26940
|
-
"line":
|
|
26940
|
+
"line": 122,
|
|
26941
26941
|
"type": "string | TemplateRef<any>",
|
|
26942
26942
|
"decorators": []
|
|
26943
26943
|
},
|
|
@@ -26946,7 +26946,7 @@
|
|
|
26946
26946
|
"defaultValue": "\"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\"",
|
|
26947
26947
|
"deprecated": false,
|
|
26948
26948
|
"deprecationMessage": "",
|
|
26949
|
-
"line":
|
|
26949
|
+
"line": 126,
|
|
26950
26950
|
"type": "string",
|
|
26951
26951
|
"decorators": []
|
|
26952
26952
|
},
|
|
@@ -26955,7 +26955,7 @@
|
|
|
26955
26955
|
"defaultValue": "\"mm/dd/yyyy\"",
|
|
26956
26956
|
"deprecated": false,
|
|
26957
26957
|
"deprecationMessage": "",
|
|
26958
|
-
"line":
|
|
26958
|
+
"line": 124,
|
|
26959
26959
|
"type": "string",
|
|
26960
26960
|
"decorators": []
|
|
26961
26961
|
},
|
|
@@ -26964,7 +26964,7 @@
|
|
|
26964
26964
|
"defaultValue": "false",
|
|
26965
26965
|
"deprecated": false,
|
|
26966
26966
|
"deprecationMessage": "",
|
|
26967
|
-
"line":
|
|
26967
|
+
"line": 138,
|
|
26968
26968
|
"type": "boolean",
|
|
26969
26969
|
"decorators": []
|
|
26970
26970
|
},
|
|
@@ -26973,7 +26973,7 @@
|
|
|
26973
26973
|
"defaultValue": "\"md\"",
|
|
26974
26974
|
"deprecated": false,
|
|
26975
26975
|
"deprecationMessage": "",
|
|
26976
|
-
"line":
|
|
26976
|
+
"line": 165,
|
|
26977
26977
|
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
26978
26978
|
"decorators": []
|
|
26979
26979
|
},
|
|
@@ -26982,7 +26982,7 @@
|
|
|
26982
26982
|
"defaultValue": "false",
|
|
26983
26983
|
"deprecated": false,
|
|
26984
26984
|
"deprecationMessage": "",
|
|
26985
|
-
"line":
|
|
26985
|
+
"line": 161,
|
|
26986
26986
|
"type": "boolean",
|
|
26987
26987
|
"decorators": []
|
|
26988
26988
|
},
|
|
@@ -26993,15 +26993,15 @@
|
|
|
26993
26993
|
"deprecationMessage": "since v5 - Use `cdsLayer` directive instead\nSet to `\"light\"` to apply the light style",
|
|
26994
26994
|
"jsdoctags": [
|
|
26995
26995
|
{
|
|
26996
|
-
"pos":
|
|
26997
|
-
"end":
|
|
26996
|
+
"pos": 3927,
|
|
26997
|
+
"end": 4031,
|
|
26998
26998
|
"flags": 16842752,
|
|
26999
26999
|
"modifierFlagsCache": 0,
|
|
27000
27000
|
"transformFlags": 0,
|
|
27001
27001
|
"kind": 338,
|
|
27002
27002
|
"tagName": {
|
|
27003
|
-
"pos":
|
|
27004
|
-
"end":
|
|
27003
|
+
"pos": 3928,
|
|
27004
|
+
"end": 3938,
|
|
27005
27005
|
"flags": 16842752,
|
|
27006
27006
|
"modifierFlagsCache": 0,
|
|
27007
27007
|
"transformFlags": 0,
|
|
@@ -27011,7 +27011,7 @@
|
|
|
27011
27011
|
"comment": "<p>since v5 - Use <code>cdsLayer</code> directive instead\nSet to <code>"light"</code> to apply the light style</p>\n"
|
|
27012
27012
|
}
|
|
27013
27013
|
],
|
|
27014
|
-
"line":
|
|
27014
|
+
"line": 134,
|
|
27015
27015
|
"type": "\"light\" | \"dark\"",
|
|
27016
27016
|
"decorators": []
|
|
27017
27017
|
},
|
|
@@ -27022,7 +27022,7 @@
|
|
|
27022
27022
|
"deprecationMessage": "",
|
|
27023
27023
|
"rawdescription": "\n\nSelect a calendar type for the `model`.\nInternal purposes only.\n",
|
|
27024
27024
|
"description": "<p>Select a calendar type for the <code>model</code>.\nInternal purposes only.</p>\n",
|
|
27025
|
-
"line":
|
|
27025
|
+
"line": 116,
|
|
27026
27026
|
"type": "\"simple\" | \"single\" | \"range\"",
|
|
27027
27027
|
"decorators": []
|
|
27028
27028
|
},
|
|
@@ -27031,7 +27031,7 @@
|
|
|
27031
27031
|
"defaultValue": "\"\"",
|
|
27032
27032
|
"deprecated": false,
|
|
27033
27033
|
"deprecationMessage": "",
|
|
27034
|
-
"line":
|
|
27034
|
+
"line": 163,
|
|
27035
27035
|
"type": "string",
|
|
27036
27036
|
"decorators": []
|
|
27037
27037
|
},
|
|
@@ -27042,7 +27042,7 @@
|
|
|
27042
27042
|
"deprecationMessage": "",
|
|
27043
27043
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warnText)\n",
|
|
27044
27044
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warnText)</p>\n",
|
|
27045
|
-
"line":
|
|
27045
|
+
"line": 150,
|
|
27046
27046
|
"type": "boolean",
|
|
27047
27047
|
"decorators": []
|
|
27048
27048
|
},
|
|
@@ -27052,7 +27052,7 @@
|
|
|
27052
27052
|
"deprecationMessage": "",
|
|
27053
27053
|
"rawdescription": "\n\nSets the warning text\n",
|
|
27054
27054
|
"description": "<p>Sets the warning text</p>\n",
|
|
27055
|
-
"line":
|
|
27055
|
+
"line": 154,
|
|
27056
27056
|
"type": "string | TemplateRef<any>",
|
|
27057
27057
|
"decorators": []
|
|
27058
27058
|
}
|
|
@@ -27063,7 +27063,7 @@
|
|
|
27063
27063
|
"defaultValue": "new EventEmitter()",
|
|
27064
27064
|
"deprecated": false,
|
|
27065
27065
|
"deprecationMessage": "",
|
|
27066
|
-
"line":
|
|
27066
|
+
"line": 128,
|
|
27067
27067
|
"type": "EventEmitter<string>"
|
|
27068
27068
|
}
|
|
27069
27069
|
],
|
|
@@ -27075,7 +27075,7 @@
|
|
|
27075
27075
|
"type": "ElementRef",
|
|
27076
27076
|
"optional": false,
|
|
27077
27077
|
"description": "",
|
|
27078
|
-
"line":
|
|
27078
|
+
"line": 167,
|
|
27079
27079
|
"decorators": [
|
|
27080
27080
|
{
|
|
27081
27081
|
"name": "ViewChild",
|
|
@@ -27094,7 +27094,7 @@
|
|
|
27094
27094
|
"type": "function",
|
|
27095
27095
|
"optional": false,
|
|
27096
27096
|
"description": "",
|
|
27097
|
-
"line":
|
|
27097
|
+
"line": 190
|
|
27098
27098
|
},
|
|
27099
27099
|
{
|
|
27100
27100
|
"name": "propagateChange",
|
|
@@ -27104,7 +27104,7 @@
|
|
|
27104
27104
|
"type": "",
|
|
27105
27105
|
"optional": false,
|
|
27106
27106
|
"description": "",
|
|
27107
|
-
"line":
|
|
27107
|
+
"line": 192
|
|
27108
27108
|
}
|
|
27109
27109
|
],
|
|
27110
27110
|
"methodsClass": [
|
|
@@ -27121,7 +27121,7 @@
|
|
|
27121
27121
|
"optional": false,
|
|
27122
27122
|
"returnType": "boolean",
|
|
27123
27123
|
"typeParameters": [],
|
|
27124
|
-
"line":
|
|
27124
|
+
"line": 194,
|
|
27125
27125
|
"deprecated": false,
|
|
27126
27126
|
"deprecationMessage": "",
|
|
27127
27127
|
"modifierKind": [
|
|
@@ -27152,7 +27152,7 @@
|
|
|
27152
27152
|
"optional": false,
|
|
27153
27153
|
"returnType": "void",
|
|
27154
27154
|
"typeParameters": [],
|
|
27155
|
-
"line":
|
|
27155
|
+
"line": 171,
|
|
27156
27156
|
"deprecated": false,
|
|
27157
27157
|
"deprecationMessage": "",
|
|
27158
27158
|
"jsdoctags": [
|
|
@@ -27180,7 +27180,7 @@
|
|
|
27180
27180
|
"optional": false,
|
|
27181
27181
|
"returnType": "void",
|
|
27182
27182
|
"typeParameters": [],
|
|
27183
|
-
"line":
|
|
27183
|
+
"line": 182,
|
|
27184
27184
|
"deprecated": false,
|
|
27185
27185
|
"deprecationMessage": "",
|
|
27186
27186
|
"modifierKind": [
|
|
@@ -27211,7 +27211,7 @@
|
|
|
27211
27211
|
"optional": false,
|
|
27212
27212
|
"returnType": "void",
|
|
27213
27213
|
"typeParameters": [],
|
|
27214
|
-
"line":
|
|
27214
|
+
"line": 186,
|
|
27215
27215
|
"deprecated": false,
|
|
27216
27216
|
"deprecationMessage": "",
|
|
27217
27217
|
"modifierKind": [
|
|
@@ -27242,7 +27242,7 @@
|
|
|
27242
27242
|
"optional": false,
|
|
27243
27243
|
"returnType": "void",
|
|
27244
27244
|
"typeParameters": [],
|
|
27245
|
-
"line":
|
|
27245
|
+
"line": 178,
|
|
27246
27246
|
"deprecated": false,
|
|
27247
27247
|
"deprecationMessage": "",
|
|
27248
27248
|
"modifierKind": [
|
|
@@ -27270,7 +27270,7 @@
|
|
|
27270
27270
|
"description": "",
|
|
27271
27271
|
"rawdescription": "\n",
|
|
27272
27272
|
"type": "component",
|
|
27273
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tTemplateRef,\n\tViewChild\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\n@Component({\n\tselector: \"cds-date-picker-input, ibm-date-picker-input\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === 'range',\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<label\n\t\t\t\t\t*ngIf=\"label\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\
|
|
27273
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tTemplateRef,\n\tViewChild\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\n@Component({\n\tselector: \"cds-date-picker-input, ibm-date-picker-input\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === 'range',\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<!-- Skeleton structure -->\n\t\t\t\t<ng-container *ngIf=\"skeleton\">\n\t\t\t\t\t<span class=\"cds--label cds--skeleton\"></span>\n\t\t\t\t\t<div class=\"cds--date-picker__input cds--skeleton\"></div>\n\t\t\t\t</ng-container>\n\t\t\t\t<label\n\t\t\t\t\t*ngIf=\"label && !skeleton\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cds--date-picker__input\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--date-picker__input--sm': size === 'sm',\n\t\t\t\t\t\t\t'cds--date-picker__input--md': size === 'md',\n\t\t\t\t\t\t\t'cds--date-picker__input--lg': size === 'lg'\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t[attr.data-invalid]=\"invalid ? true : undefined\"\n\t\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t\t[pattern]=\"pattern\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t\t[id]= \"id\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t\t\t(change)=\"onChange($event)\"/>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"type !== 'simple' && !warn && !invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"calendar\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--warn\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: DatePickerInput,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class DatePickerInput {\n\tprivate static datePickerCount = 0;\n\t/**\n\t * Select a calendar type for the `model`.\n\t * Internal purposes only.\n\t */\n\t@Input() type: \"simple\" | \"single\" | \"range\" = \"simple\";\n\n\t@Input() id = `datepicker-${DatePickerInput.datePickerCount++}`;\n\n\t@Input() hasIcon = false;\n\n\t@Input() label: string | TemplateRef<any>;\n\n\t@Input() placeholder = \"mm/dd/yyyy\";\n\n\t@Input() pattern = \"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\";\n\n\t@Output() valueChange: EventEmitter<string> = new EventEmitter();\n\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * Set to `\"light\"` to apply the light style\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@Input() disabled = false;\n\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` for invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if dropdown is in invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning (contents set by warnText)\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\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() value = \"\";\n\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\n\t@ViewChild(\"input\") input: ElementRef;\n\n\tconstructor(protected elementRef: ElementRef) { }\n\n\tonChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.valueChange.emit(this.value);\n\t\tthis.propagateChange(this.value);\n\t\tthis.onTouched();\n\t}\n\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n",
|
|
27274
27274
|
"assetsDirs": [],
|
|
27275
27275
|
"styleUrlsData": "",
|
|
27276
27276
|
"stylesData": "",
|
|
@@ -27287,7 +27287,7 @@
|
|
|
27287
27287
|
"deprecationMessage": ""
|
|
27288
27288
|
}
|
|
27289
27289
|
],
|
|
27290
|
-
"line":
|
|
27290
|
+
"line": 167,
|
|
27291
27291
|
"jsdoctags": [
|
|
27292
27292
|
{
|
|
27293
27293
|
"name": "elementRef",
|
|
@@ -42393,7 +42393,7 @@
|
|
|
42393
42393
|
},
|
|
42394
42394
|
{
|
|
42395
42395
|
"name": "PasswordInputLabelComponent",
|
|
42396
|
-
"id": "component-PasswordInputLabelComponent-
|
|
42396
|
+
"id": "component-PasswordInputLabelComponent-bdf59639f1e7e3881c59e6c091bbac5cd869c69dea799b0ccee5cabb9a1b1bacca79e8946a89b275174e24d1b802f6931d7ece15aa95b8f171dde4453403e6c1",
|
|
42397
42397
|
"file": "src/input/password-input-label.component.ts",
|
|
42398
42398
|
"encapsulation": [],
|
|
42399
42399
|
"entryComponents": [],
|
|
@@ -42832,8 +42832,8 @@
|
|
|
42832
42832
|
"jsdoctags": [
|
|
42833
42833
|
{
|
|
42834
42834
|
"name": {
|
|
42835
|
-
"pos":
|
|
42836
|
-
"end":
|
|
42835
|
+
"pos": 6424,
|
|
42836
|
+
"end": 6429,
|
|
42837
42837
|
"flags": 16842752,
|
|
42838
42838
|
"modifierFlagsCache": 0,
|
|
42839
42839
|
"transformFlags": 0,
|
|
@@ -42844,8 +42844,8 @@
|
|
|
42844
42844
|
"deprecated": false,
|
|
42845
42845
|
"deprecationMessage": "",
|
|
42846
42846
|
"tagName": {
|
|
42847
|
-
"pos":
|
|
42848
|
-
"end":
|
|
42847
|
+
"pos": 6418,
|
|
42848
|
+
"end": 6423,
|
|
42849
42849
|
"flags": 16842752,
|
|
42850
42850
|
"modifierFlagsCache": 0,
|
|
42851
42851
|
"transformFlags": 0,
|
|
@@ -42856,8 +42856,8 @@
|
|
|
42856
42856
|
},
|
|
42857
42857
|
{
|
|
42858
42858
|
"tagName": {
|
|
42859
|
-
"pos":
|
|
42860
|
-
"end":
|
|
42859
|
+
"pos": 6453,
|
|
42860
|
+
"end": 6460,
|
|
42861
42861
|
"flags": 16842752,
|
|
42862
42862
|
"modifierFlagsCache": 0,
|
|
42863
42863
|
"transformFlags": 0,
|
|
@@ -42916,7 +42916,7 @@
|
|
|
42916
42916
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { InputModule } from 'carbon-components-angular';</code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-password-label>\n Label\n <input cdsPassword>\n</cds-password-label></code></pre></div><p><a href=\"../../?path=/story/components-input--basic\">See demo</a></p>\n",
|
|
42917
42917
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { InputModule } from 'carbon-components-angular';\n```\n\n```html\n<cds-password-label>\n\tLabel\n\t<input cdsPassword>\n</cds-password-label>\n```\n\n[See demo](../../?path=/story/components-input--basic)\n",
|
|
42918
42918
|
"type": "component",
|
|
42919
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tChangeDetectorRef,\n\tContentChild\n} from \"@angular/core\";\nimport { PasswordInput } from \"./password.directive\";\nimport { BaseIconButton } from \"carbon-components-angular/button\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { InputModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-password-label>\n * \tLabel\n *\t<input cdsPassword>\n * </cds-password-label>\n * ```\n *\n * [See demo](../../?path=/story/components-input--basic)\n */\n@Component({\n\tselector: \"cds-password-label, ibm-password-label\",\n\ttemplate: `\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t<ng-template #labelContent>\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-template>\n\t\t</label>\n\n\t\t<div class=\"cds--text-input__field-outer-wrapper\">\n\t\t\t<div\n\t\t\tclass=\"cds--text-input__field-wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--text-input__field-wrapper--warning': warn\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"invalid ? true : null\"\n\t\t\t#wrapper>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!warn && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--text-input__invalid-icon\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!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--text-input__invalid-icon cds--text-input__invalid-icon--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<ng-content select=\"[cdsPassword], [ibmPassword]\"></ng-content>\n\t\t\t\t<cds-tooltip\n\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t[description]=\"passwordIsVisible ? hidePasswordLabel : showPasswordLabel\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[caret]=\"caret\"\n\t\t\t\t\t[dropShadow]=\"dropShadow\"\n\t\t\t\t\t[highContrast]=\"highContrast\"\n\t\t\t\t\t[isOpen]=\"isOpen\"\n\t\t\t\t\t[align]=\"align\"\n\t\t\t\t\t[autoAlign]=\"autoAlign\"\n\t\t\t\t\t[enterDelayMs]=\"enterDelayMs\"\n\t\t\t\t\t[leaveDelayMs]=\"leaveDelayMs\"\n\t\t\t\t\tclass=\"cds--toggle-password-tooltip\">\n\t\t\t\t\t\t<div class=\"cds--tooltip-trigger__wrapper\">\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclass=\"cds--text-input--password__visibility__toggle cds--btn cds--tooltip__trigger cds--tooltip--a11y\"\n\t\t\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t(click)=\"handleTogglePasswordVisibility($event)\">\n\t\t\t\t\t\t\t\t<svg *ngIf=\"passwordIsVisible\" cdsIcon=\"view--off\" class=\"cds--icon-visibility-off\" size=\"16\"></svg>\n\t\t\t\t\t\t\t\t<svg *ngIf=\"!passwordIsVisible\" cdsIcon=\"view\" class=\"cds--icon-visibility-on\" size=\"16\"></svg>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t</cds-tooltip>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"!skeleton && helperText && !invalid && !warn\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{ 'cds--form__helper-text--disabled': disabled }\">\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\n\t\t\t<div *ngIf=\"!warn && 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\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 `\n})\n/**\n * Represents the Password Input Label Component.\n */\nexport class PasswordInputLabelComponent extends BaseIconButton implements AfterViewInit {\n\t/**\n\t * Counter for generating unique labelInputID.\n\t */\n\tstatic labelCounter = 0;\n\n\t@ContentChild(PasswordInput) textInput: PasswordInput;\n\n\t/**\n\t * ID for the input item associated with the label.\n\t */\n\t@Input() labelInputID = \"cds-password-input-\" + PasswordInputLabelComponent.labelCounter++;\n\n\t/**\n\t * Type for input field, either password or text.\n\t */\n\tinputType: \"password\" | \"text\" = \"password\";\n\n\t/**\n\t* Flag for checking if password is visible.\n\t*/\n\tpasswordIsVisible = false;\n\n\t/**\n\t * Flag for disabled label.\n\t */\n\t@Input() disabled = false;\n\n\t/**\n\t * Flag for loading (skeleton) label.\n\t */\n\t@Input() skeleton = false;\n\n\t/**\n\t * Template for label content.\n\t */\n\t@Input() labelTemplate: TemplateRef<any>;\n\n\t/**\n\t * Template for password input.\n\t */\n\t@Input() passwordInputTemplate: TemplateRef<any>;\n\n\t/**\n\t * Optional helper text under the label.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\n\t/**\n\t * Flag for an invalid label component.\n\t */\n\t@Input() invalid = false;\n\n\t/**\n\t * Flag for showing a warning.\n\t */\n\t@Input() warn = false;\n\n\t/**\n\t * Warning text.\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\n\t/**\n\t * Aria label for label.\n\t */\n\t@Input() ariaLabel: string;\n\n\t/**\n\t * Tooltip text for hiding password.\n\t */\n\t@Input() hidePasswordLabel = \"Hide password\";\n\n\t/**\n\t * Tooltip text for showing password.\n\t */\n\t@Input() showPasswordLabel = \"Show password\";\n\n\t/**\n\t * Reference to the wrapper element.\n\t */\n\t@ViewChild(\"wrapper\", { static: true }) wrapper: ElementRef<HTMLDivElement>;\n\n\t/**\n\t * Binding for applying class to host element.\n\t */\n\t@HostBinding(\"class.cds--form-item\") labelClass = true;\n\t@HostBinding(\"class.cds--password-input-wrapper\") passwordInputWrapper = true;\n\t@HostBinding(\"class.cds--text-input-wrapper\") textInputWrapper = true;\n\t@HostBinding(\"class.cds--text-input-wrapper--readonly\") get isReadonly() {\n\t\treturn this.wrapper?.nativeElement.querySelector(\"input\")?.readOnly;\n\t}\n\n\t/**\n\t * Constructor for PasswordInputLabelComponent.\n\t * @param changeDetectorRef - Reference to ChangeDetectorRef.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Lifecycle hook called after the view has been initialized to set the ID of the input element\n\t */\n\tngAfterViewInit() {\n\t\tif (this.wrapper) {\n\t\t\tconst inputElement =\n\t\t\t\tthis.wrapper.nativeElement.querySelector(\"input\");\n\t\t\tif (inputElement) {\n\t\t\t\tif (inputElement.id) {\n\t\t\t\t\tthis.labelInputID = inputElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tinputElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Function to check if a value is a TemplateRef.\n\t * @param value - Value to check.\n\t * @returns Whether the value is a TemplateRef.\n\t */\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\t/**\n\t * Handler for toggling password visibility.\n\t */\n\tpublic handleTogglePasswordVisibility() {\n\t\tthis.inputType = this.inputType === \"password\" ? \"text\" : \"password\";\n\t\tthis.textInput.type = this.inputType;\n\t\tthis.passwordIsVisible = this.inputType === \"text\";\n\t}\n}\n",
|
|
42919
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tChangeDetectorRef,\n\tContentChild\n} from \"@angular/core\";\nimport { PasswordInput } from \"./password.directive\";\nimport { BaseIconButton } from \"carbon-components-angular/button\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { InputModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-password-label>\n * \tLabel\n *\t<input cdsPassword>\n * </cds-password-label>\n * ```\n *\n * [See demo](../../?path=/story/components-input--basic)\n */\n@Component({\n\tselector: \"cds-password-label, ibm-password-label\",\n\ttemplate: `\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t<ng-template #labelContent>\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-template>\n\t\t</label>\n\n\t\t<div class=\"cds--text-input__field-outer-wrapper\">\n\t\t\t<div\n\t\t\tclass=\"cds--text-input__field-wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--text-input__field-wrapper--warning': warn\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"invalid ? true : null\"\n\t\t\t#wrapper>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!warn && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--text-input__invalid-icon\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!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--text-input__invalid-icon cds--text-input__invalid-icon--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<ng-content select=\"[cdsPassword], [ibmPassword]\"></ng-content>\n\t\t\t\t<cds-tooltip\n\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t[description]=\"passwordIsVisible ? hidePasswordLabel : showPasswordLabel\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[caret]=\"caret\"\n\t\t\t\t\t[dropShadow]=\"dropShadow\"\n\t\t\t\t\t[highContrast]=\"highContrast\"\n\t\t\t\t\t[isOpen]=\"isOpen\"\n\t\t\t\t\t[align]=\"align\"\n\t\t\t\t\t[autoAlign]=\"autoAlign\"\n\t\t\t\t\t[enterDelayMs]=\"enterDelayMs\"\n\t\t\t\t\t[leaveDelayMs]=\"leaveDelayMs\"\n\t\t\t\t\tclass=\"cds--toggle-password-tooltip\">\n\t\t\t\t\t\t<div class=\"cds--tooltip-trigger__wrapper\">\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclass=\"cds--text-input--password__visibility__toggle cds--btn cds--tooltip__trigger cds--tooltip--a11y\"\n\t\t\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t(click)=\"handleTogglePasswordVisibility($event)\">\n\t\t\t\t\t\t\t\t<svg *ngIf=\"passwordIsVisible\" cdsIcon=\"view--off\" class=\"cds--icon-visibility-off\" size=\"16\"></svg>\n\t\t\t\t\t\t\t\t<svg *ngIf=\"!passwordIsVisible\" cdsIcon=\"view\" class=\"cds--icon-visibility-on\" size=\"16\"></svg>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t</cds-tooltip>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"!skeleton && helperText && !invalid && !warn\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{ 'cds--form__helper-text--disabled': disabled }\">\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\n\t\t\t<div *ngIf=\"!warn && 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\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 `\n})\n/**\n * Represents the Password Input Label Component.\n */\nexport class PasswordInputLabelComponent extends BaseIconButton implements AfterViewInit {\n\t/**\n\t * Counter for generating unique labelInputID.\n\t */\n\tstatic labelCounter = 0;\n\n\t@ContentChild(PasswordInput) textInput: PasswordInput;\n\n\t/**\n\t * ID for the input item associated with the label.\n\t */\n\t@Input() labelInputID = \"cds-password-input-\" + PasswordInputLabelComponent.labelCounter++;\n\n\t/**\n\t * Type for input field, either password or text.\n\t */\n\tinputType: \"password\" | \"text\" = \"password\";\n\n\t/**\n\t* Flag for checking if password is visible.\n\t*/\n\tpasswordIsVisible = false;\n\n\t/**\n\t * Flag for disabled label.\n\t */\n\t@Input() disabled = false;\n\n\t/**\n\t * Flag for loading (skeleton) label.\n\t */\n\t@Input() skeleton = false;\n\n\t/**\n\t * Template for label content.\n\t */\n\t@Input() labelTemplate: TemplateRef<any>;\n\n\t/**\n\t * Template for password input.\n\t */\n\t@Input() passwordInputTemplate: TemplateRef<any>;\n\n\t/**\n\t * Optional helper text under the label.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\n\t/**\n\t * Flag for an invalid label component.\n\t */\n\t@Input() invalid = false;\n\n\t/**\n\t * Flag for showing a warning.\n\t */\n\t@Input() warn = false;\n\n\t/**\n\t * Warning text.\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\n\t/**\n\t * Aria label for label.\n\t */\n\t@Input() ariaLabel: string;\n\n\t/**\n\t * Tooltip text for hiding password.\n\t */\n\t@Input() hidePasswordLabel = \"Hide password\";\n\n\t/**\n\t * Tooltip text for showing password.\n\t */\n\t@Input() showPasswordLabel = \"Show password\";\n\n\t/**\n\t * Reference to the wrapper element.\n\t */\n\t@ViewChild(\"wrapper\", { static: true }) wrapper: ElementRef<HTMLDivElement>;\n\n\t/**\n\t * Binding for applying class to host element.\n\t */\n\t@HostBinding(\"class.cds--form-item\") labelClass = true;\n\t@HostBinding(\"class.cds--password-input-wrapper\") passwordInputWrapper = true;\n\t@HostBinding(\"class.cds--text-input-wrapper\") textInputWrapper = true;\n\t@HostBinding(\"class.cds--text-input-wrapper--readonly\") get isReadonly() {\n\t\treturn this.wrapper?.nativeElement.querySelector(\"input\")?.readOnly ?? false;\n\t}\n\n\t/**\n\t * Constructor for PasswordInputLabelComponent.\n\t * @param changeDetectorRef - Reference to ChangeDetectorRef.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Lifecycle hook called after the view has been initialized to set the ID of the input element\n\t */\n\tngAfterViewInit() {\n\t\tif (this.wrapper) {\n\t\t\tconst inputElement =\n\t\t\t\tthis.wrapper.nativeElement.querySelector(\"input\");\n\t\t\tif (inputElement) {\n\t\t\t\tif (inputElement.id) {\n\t\t\t\t\tthis.labelInputID = inputElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tinputElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Function to check if a value is a TemplateRef.\n\t * @param value - Value to check.\n\t * @returns Whether the value is a TemplateRef.\n\t */\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\t/**\n\t * Handler for toggling password visibility.\n\t */\n\tpublic handleTogglePasswordVisibility() {\n\t\tthis.inputType = this.inputType === \"password\" ? \"text\" : \"password\";\n\t\tthis.textInput.type = this.inputType;\n\t\tthis.passwordIsVisible = this.inputType === \"text\";\n\t}\n}\n",
|
|
42920
42920
|
"assetsDirs": [],
|
|
42921
42921
|
"styleUrlsData": "",
|
|
42922
42922
|
"stylesData": "",
|
|
@@ -42938,8 +42938,8 @@
|
|
|
42938
42938
|
"jsdoctags": [
|
|
42939
42939
|
{
|
|
42940
42940
|
"name": {
|
|
42941
|
-
"pos":
|
|
42942
|
-
"end":
|
|
42941
|
+
"pos": 5769,
|
|
42942
|
+
"end": 5786,
|
|
42943
42943
|
"flags": 16842752,
|
|
42944
42944
|
"modifierFlagsCache": 0,
|
|
42945
42945
|
"transformFlags": 0,
|
|
@@ -42950,8 +42950,8 @@
|
|
|
42950
42950
|
"deprecated": false,
|
|
42951
42951
|
"deprecationMessage": "",
|
|
42952
42952
|
"tagName": {
|
|
42953
|
-
"pos":
|
|
42954
|
-
"end":
|
|
42953
|
+
"pos": 5763,
|
|
42954
|
+
"end": 5768,
|
|
42955
42955
|
"flags": 16842752,
|
|
42956
42956
|
"modifierFlagsCache": 0,
|
|
42957
42957
|
"transformFlags": 0,
|
|
@@ -60982,7 +60982,7 @@
|
|
|
60982
60982
|
},
|
|
60983
60983
|
{
|
|
60984
60984
|
"name": "TextInputLabelComponent",
|
|
60985
|
-
"id": "component-TextInputLabelComponent-
|
|
60985
|
+
"id": "component-TextInputLabelComponent-40a5fa4a99975f64709f8c663f9f594f16d2aef26597ae1695aeb483431ffb3d85328e3802a0c33cf1aafce2bb9ab78987fa1a1f0c477d2c40cf6413467f0102",
|
|
60986
60986
|
"file": "src/input/text-input-label.component.ts",
|
|
60987
60987
|
"encapsulation": [],
|
|
60988
60988
|
"entryComponents": [],
|
|
@@ -61225,7 +61225,7 @@
|
|
|
61225
61225
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { InputModule } from 'carbon-components-angular';</code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-text-label>\n Label\n <input cdsText type="text" class="input-field">\n</cds-text-label></code></pre></div><p><a href=\"../../?path=/story/components-input--basic\">See demo</a></p>\n",
|
|
61226
61226
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { InputModule } from 'carbon-components-angular';\n```\n\n```html\n<cds-text-label>\n\tLabel\n\t<input cdsText type=\"text\" class=\"input-field\">\n</cds-text-label>\n```\n\n[See demo](../../?path=/story/components-input--basic)\n",
|
|
61227
61227
|
"type": "component",
|
|
61228
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tChangeDetectorRef\n} from \"@angular/core\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { InputModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-text-label>\n * \tLabel\n * \t<input cdsText type=\"text\" class=\"input-field\">\n * </cds-text-label>\n * ```\n *\n * [See demo](../../?path=/story/components-input--basic)\n */\n@Component({\n\tselector: \"cds-text-label, ibm-text-label\",\n\ttemplate: `\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t<ng-template #labelContent>\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--text-input__field-wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--text-input__field-wrapper--warning': warn\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\t#wrapper>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--text-input__invalid-icon\">\n\t\t\t</svg>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--text-input__invalid-icon cds--text-input__invalid-icon--warning\">\n\t\t\t</svg>\n\t\t\t<ng-template *ngIf=\"textInputTemplate; else textInputContent\" [ngTemplateOutlet]=\"textInputTemplate\"></ng-template>\n\t\t\t<ng-template #textInputContent>\n\t\t\t\t<ng-content select=\"[cdsText],[ibmText],input[type=text],div\"></ng-content>\n\t\t\t</ng-template>\n\t\t</div>\n\t\t<div\n\t\t\t*ngIf=\"!skeleton && helperText && !invalid && !warn\"\n\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t</div>\n\t`\n})\nexport class TextInputLabelComponent implements AfterViewInit {\n\t/**\n\t * Used to build the id of the input item associated with the `Label`.\n\t */\n\tstatic labelCounter = 0;\n\t/**\n\t * The id of the input item associated with the `Label`. This value is also used to associate the `Label` with\n\t * its input counterpart through the 'for' attribute.\n\t*/\n\t@Input() labelInputID = \"ibm-text-input-\" + TextInputLabelComponent.labelCounter++;\n\n\t/**\n\t * Set to `true` for a disabled label.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading label.\n\t */\n\t@Input() skeleton = false;\n\n\t/**\n\t * Helper input property for ease of migration\n\t * Since we cannot pass ng-content down easily from label component, we will accept the templates\n\t */\n\t@Input() labelTemplate: TemplateRef<any>;\n\t@Input() textInputTemplate: TemplateRef<any>;\n\t/**\n\t * Optional helper text that appears under the label.\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 * Set to `true` for an invalid label component.\n\t */\n\t@Input() invalid = false;\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 * Set the arialabel for label\n\t */\n\t@Input() ariaLabel: string;\n\n\t// @ts-ignore\n\t@ViewChild(\"wrapper\", { static: false }) wrapper: ElementRef<HTMLDivElement>;\n\n\t@HostBinding(\"class.cds--form-item\") labelClass = true;\n\n\t@HostBinding(\"class.cds--text-input-wrapper--readonly\") get isReadonly() {\n\t\treturn this.wrapper?.nativeElement.querySelector(\"input\")?.readOnly;\n\t}\n\n\t/**\n\t * Creates an instance of Label.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef) {}\n\n\t/**\n\t * Sets the id on the input item associated with the `Label`.\n\t */\n\tngAfterViewInit() {\n\t\tif (this.wrapper) {\n\t\t\t// Prioritize setting id to `input` over div\n\t\t\tconst inputElement = this.wrapper.nativeElement.querySelector(\"input\");\n\t\t\tif (inputElement) {\n\t\t\t\t// avoid overriding ids already set by the user reuse it instead\n\t\t\t\tif (inputElement.id) {\n\t\t\t\t\tthis.labelInputID = inputElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tinputElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst divElement = this.wrapper.nativeElement.querySelector(\"div\");\n\t\t\tif (divElement) {\n\t\t\t\tif (divElement.id) {\n\t\t\t\t\tthis.labelInputID = divElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tdivElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n",
|
|
61228
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tChangeDetectorRef\n} from \"@angular/core\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { InputModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-text-label>\n * \tLabel\n * \t<input cdsText type=\"text\" class=\"input-field\">\n * </cds-text-label>\n * ```\n *\n * [See demo](../../?path=/story/components-input--basic)\n */\n@Component({\n\tselector: \"cds-text-label, ibm-text-label\",\n\ttemplate: `\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t'cds--skeleton': skeleton\n\t\t\t}\">\n\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t<ng-template #labelContent>\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--text-input__field-wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--text-input__field-wrapper--warning': warn\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\t#wrapper>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--text-input__invalid-icon\">\n\t\t\t</svg>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--text-input__invalid-icon cds--text-input__invalid-icon--warning\">\n\t\t\t</svg>\n\t\t\t<ng-template *ngIf=\"textInputTemplate; else textInputContent\" [ngTemplateOutlet]=\"textInputTemplate\"></ng-template>\n\t\t\t<ng-template #textInputContent>\n\t\t\t\t<ng-content select=\"[cdsText],[ibmText],input[type=text],div\"></ng-content>\n\t\t\t</ng-template>\n\t\t</div>\n\t\t<div\n\t\t\t*ngIf=\"!skeleton && helperText && !invalid && !warn\"\n\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t</div>\n\t`\n})\nexport class TextInputLabelComponent implements AfterViewInit {\n\t/**\n\t * Used to build the id of the input item associated with the `Label`.\n\t */\n\tstatic labelCounter = 0;\n\t/**\n\t * The id of the input item associated with the `Label`. This value is also used to associate the `Label` with\n\t * its input counterpart through the 'for' attribute.\n\t*/\n\t@Input() labelInputID = \"ibm-text-input-\" + TextInputLabelComponent.labelCounter++;\n\n\t/**\n\t * Set to `true` for a disabled label.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading label.\n\t */\n\t@Input() skeleton = false;\n\n\t/**\n\t * Helper input property for ease of migration\n\t * Since we cannot pass ng-content down easily from label component, we will accept the templates\n\t */\n\t@Input() labelTemplate: TemplateRef<any>;\n\t@Input() textInputTemplate: TemplateRef<any>;\n\t/**\n\t * Optional helper text that appears under the label.\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 * Set to `true` for an invalid label component.\n\t */\n\t@Input() invalid = false;\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 * Set the arialabel for label\n\t */\n\t@Input() ariaLabel: string;\n\n\t// @ts-ignore\n\t@ViewChild(\"wrapper\", { static: false }) wrapper: ElementRef<HTMLDivElement>;\n\n\t@HostBinding(\"class.cds--form-item\") labelClass = true;\n\n\t@HostBinding(\"class.cds--text-input-wrapper--readonly\") get isReadonly() {\n\t\treturn this.wrapper?.nativeElement.querySelector(\"input\")?.readOnly ?? false;\n\t}\n\n\t/**\n\t * Creates an instance of Label.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef) {}\n\n\t/**\n\t * Sets the id on the input item associated with the `Label`.\n\t */\n\tngAfterViewInit() {\n\t\tif (this.wrapper) {\n\t\t\t// Prioritize setting id to `input` over div\n\t\t\tconst inputElement = this.wrapper.nativeElement.querySelector(\"input\");\n\t\t\tif (inputElement) {\n\t\t\t\t// avoid overriding ids already set by the user reuse it instead\n\t\t\t\tif (inputElement.id) {\n\t\t\t\t\tthis.labelInputID = inputElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tinputElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst divElement = this.wrapper.nativeElement.querySelector(\"div\");\n\t\t\tif (divElement) {\n\t\t\t\tif (divElement.id) {\n\t\t\t\t\tthis.labelInputID = divElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tdivElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n",
|
|
61229
61229
|
"assetsDirs": [],
|
|
61230
61230
|
"styleUrlsData": "",
|
|
61231
61231
|
"stylesData": "",
|
|
@@ -71408,7 +71408,7 @@
|
|
|
71408
71408
|
"name": "Basic",
|
|
71409
71409
|
"ctype": "miscellaneous",
|
|
71410
71410
|
"subtype": "variable",
|
|
71411
|
-
"file": "src/
|
|
71411
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
71412
71412
|
"deprecated": false,
|
|
71413
71413
|
"deprecationMessage": "",
|
|
71414
71414
|
"type": "",
|
|
@@ -71418,7 +71418,7 @@
|
|
|
71418
71418
|
"name": "Basic",
|
|
71419
71419
|
"ctype": "miscellaneous",
|
|
71420
71420
|
"subtype": "variable",
|
|
71421
|
-
"file": "src/button/button.stories.ts",
|
|
71421
|
+
"file": "src/button/button-set.stories.ts",
|
|
71422
71422
|
"deprecated": false,
|
|
71423
71423
|
"deprecationMessage": "",
|
|
71424
71424
|
"type": "",
|
|
@@ -71428,7 +71428,7 @@
|
|
|
71428
71428
|
"name": "Basic",
|
|
71429
71429
|
"ctype": "miscellaneous",
|
|
71430
71430
|
"subtype": "variable",
|
|
71431
|
-
"file": "src/button/
|
|
71431
|
+
"file": "src/button/button.stories.ts",
|
|
71432
71432
|
"deprecated": false,
|
|
71433
71433
|
"deprecationMessage": "",
|
|
71434
71434
|
"type": "",
|
|
@@ -71438,7 +71438,7 @@
|
|
|
71438
71438
|
"name": "Basic",
|
|
71439
71439
|
"ctype": "miscellaneous",
|
|
71440
71440
|
"subtype": "variable",
|
|
71441
|
-
"file": "src/
|
|
71441
|
+
"file": "src/button/icon-button.stories.ts",
|
|
71442
71442
|
"deprecated": false,
|
|
71443
71443
|
"deprecationMessage": "",
|
|
71444
71444
|
"type": "",
|
|
@@ -74120,41 +74120,41 @@
|
|
|
74120
74120
|
"name": "Template",
|
|
74121
74121
|
"ctype": "miscellaneous",
|
|
74122
74122
|
"subtype": "variable",
|
|
74123
|
-
"file": "src/
|
|
74123
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
74124
74124
|
"deprecated": false,
|
|
74125
74125
|
"deprecationMessage": "",
|
|
74126
74126
|
"type": "",
|
|
74127
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-
|
|
74127
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
74128
74128
|
},
|
|
74129
74129
|
{
|
|
74130
74130
|
"name": "Template",
|
|
74131
74131
|
"ctype": "miscellaneous",
|
|
74132
74132
|
"subtype": "variable",
|
|
74133
|
-
"file": "src/button/button.stories.ts",
|
|
74133
|
+
"file": "src/button/button-set.stories.ts",
|
|
74134
74134
|
"deprecated": false,
|
|
74135
74135
|
"deprecationMessage": "",
|
|
74136
74136
|
"type": "",
|
|
74137
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button
|
|
74137
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-button-set>\n\t\t\t<button cdsButton=\"secondary\" [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t\t<button cdsButton [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t</cds-button-set>\n\t`\n})"
|
|
74138
74138
|
},
|
|
74139
74139
|
{
|
|
74140
74140
|
"name": "Template",
|
|
74141
74141
|
"ctype": "miscellaneous",
|
|
74142
74142
|
"subtype": "variable",
|
|
74143
|
-
"file": "src/button/
|
|
74143
|
+
"file": "src/button/button.stories.ts",
|
|
74144
74144
|
"deprecated": false,
|
|
74145
74145
|
"deprecationMessage": "",
|
|
74146
74146
|
"type": "",
|
|
74147
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<
|
|
74147
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tButton\n\t\t</button>\n\t`\n})"
|
|
74148
74148
|
},
|
|
74149
74149
|
{
|
|
74150
74150
|
"name": "Template",
|
|
74151
74151
|
"ctype": "miscellaneous",
|
|
74152
74152
|
"subtype": "variable",
|
|
74153
|
-
"file": "src/
|
|
74153
|
+
"file": "src/button/icon-button.stories.ts",
|
|
74154
74154
|
"deprecated": false,
|
|
74155
74155
|
"deprecationMessage": "",
|
|
74156
74156
|
"type": "",
|
|
74157
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-
|
|
74157
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-icon-button\n\t\t\tbuttonId=\"icon-btn1\"\n\t\t\ttype=\"button\"\n\t\t\t[kind]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[align]=\"align\"\n\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t[buttonAttributes]=\"buttonAttributes\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\tdescription=\"Icon Description\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"copy\" size=\"16\"></svg>\n\t\t</cds-icon-button>\n\t`\n})"
|
|
74158
74158
|
},
|
|
74159
74159
|
{
|
|
74160
74160
|
"name": "Template",
|
|
@@ -77920,199 +77920,199 @@
|
|
|
77920
77920
|
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<div style=\"width: 500px\">\n\t\t\t<cds-accordion>\n\t\t\t\t<cds-accordion-item [title]=\"title\" (selected)=\"selected($event)\">\n\t\t\t\t\tLorem ipsum dolor sit amet, \\\n\t\t\t\t\tconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore \\\n\t\t\t\t\tet dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation \\\n\t\t\t\t\tullamco laboris nisi ut aliquip ex ea commodo consequat.\n\t\t\t\t</cds-accordion-item>\n\t\t\t\t<cds-accordion-item [title]=\"titleWithContext\" [context]=\"{ index: 2 }\" (selected)=\"selected($event)\">\n\t\t\t\t\tLorem ipsum dolor sit amet, \\\n\t\t\t\t\tconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore \\\n\t\t\t\t\tet dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation \\\n\t\t\t\t\tullamco laboris nisi ut aliquip ex ea commodo consequat.\n\t\t\t\t</cds-accordion-item>\n\t\t\t</cds-accordion>\n\t\t</div>\n\t\t<ng-template #title>\n\t\t\t<p class=\"cds--accordion__title\">Section 1 title</p>\n\t\t</ng-template>\n\t\t<ng-template #titleWithContext let-index=\"index\">\n\t\t\t<p class=\"cds--accordion__title\">Section {{ index }} title</p>\n\t\t</ng-template>\n\t`\n})"
|
|
77921
77921
|
}
|
|
77922
77922
|
],
|
|
77923
|
-
"src/
|
|
77923
|
+
"src/breadcrumb/breadcrumb.stories.ts": [
|
|
77924
77924
|
{
|
|
77925
77925
|
"name": "Basic",
|
|
77926
77926
|
"ctype": "miscellaneous",
|
|
77927
77927
|
"subtype": "variable",
|
|
77928
|
-
"file": "src/
|
|
77928
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
77929
77929
|
"deprecated": false,
|
|
77930
77930
|
"deprecationMessage": "",
|
|
77931
77931
|
"type": "",
|
|
77932
77932
|
"defaultValue": "Template.bind({})"
|
|
77933
77933
|
},
|
|
77934
77934
|
{
|
|
77935
|
-
"name": "
|
|
77935
|
+
"name": "breadcrumbItems",
|
|
77936
77936
|
"ctype": "miscellaneous",
|
|
77937
77937
|
"subtype": "variable",
|
|
77938
|
-
"file": "src/
|
|
77938
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
77939
77939
|
"deprecated": false,
|
|
77940
77940
|
"deprecationMessage": "",
|
|
77941
|
-
"type": ""
|
|
77942
|
-
|
|
77943
|
-
}
|
|
77944
|
-
],
|
|
77945
|
-
"src/button/button.stories.ts": [
|
|
77941
|
+
"type": ""
|
|
77942
|
+
},
|
|
77946
77943
|
{
|
|
77947
|
-
"name": "
|
|
77944
|
+
"name": "createBreadcrumbItems",
|
|
77948
77945
|
"ctype": "miscellaneous",
|
|
77949
77946
|
"subtype": "variable",
|
|
77950
|
-
"file": "src/
|
|
77947
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
77951
77948
|
"deprecated": false,
|
|
77952
77949
|
"deprecationMessage": "",
|
|
77953
77950
|
"type": "",
|
|
77954
|
-
"defaultValue": "
|
|
77951
|
+
"defaultValue": "(count: number, content = \"Breadcrumb\"): Array<BreadcrumbItem> => {\n\tif (breadcrumbItems && count === breadcrumbItems.length) {\n\t\treturn breadcrumbItems;\n\t}\n\tbreadcrumbItems = Array(count).fill(0).map((x, i) => ({\n\t\tcontent: `${content} ${i + 1}`,\n\t\thref: \"#\" + (i + 1)\n\t}));\n\treturn breadcrumbItems;\n}"
|
|
77955
77952
|
},
|
|
77956
77953
|
{
|
|
77957
|
-
"name": "
|
|
77954
|
+
"name": "CurrentPage",
|
|
77958
77955
|
"ctype": "miscellaneous",
|
|
77959
77956
|
"subtype": "variable",
|
|
77960
|
-
"file": "src/
|
|
77957
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
77961
77958
|
"deprecated": false,
|
|
77962
77959
|
"deprecationMessage": "",
|
|
77963
77960
|
"type": "",
|
|
77964
|
-
"defaultValue": "(
|
|
77961
|
+
"defaultValue": "CurrentPageTemplate.bind({})"
|
|
77965
77962
|
},
|
|
77966
77963
|
{
|
|
77967
|
-
"name": "
|
|
77964
|
+
"name": "CurrentPageTemplate",
|
|
77968
77965
|
"ctype": "miscellaneous",
|
|
77969
77966
|
"subtype": "variable",
|
|
77970
|
-
"file": "src/
|
|
77967
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
77971
77968
|
"deprecated": false,
|
|
77972
77969
|
"deprecationMessage": "",
|
|
77973
77970
|
"type": "",
|
|
77974
|
-
"defaultValue": "
|
|
77971
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb>\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item current=\"true\" href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
77975
77972
|
},
|
|
77976
77973
|
{
|
|
77977
|
-
"name": "
|
|
77974
|
+
"name": "Model",
|
|
77978
77975
|
"ctype": "miscellaneous",
|
|
77979
77976
|
"subtype": "variable",
|
|
77980
|
-
"file": "src/
|
|
77977
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
77981
77978
|
"deprecated": false,
|
|
77982
77979
|
"deprecationMessage": "",
|
|
77983
77980
|
"type": "",
|
|
77984
|
-
"defaultValue": "(
|
|
77985
|
-
}
|
|
77986
|
-
],
|
|
77987
|
-
"src/breadcrumb/breadcrumb.stories.ts": [
|
|
77981
|
+
"defaultValue": "ModelTemplate.bind({})"
|
|
77982
|
+
},
|
|
77988
77983
|
{
|
|
77989
|
-
"name": "
|
|
77984
|
+
"name": "ModelTemplate",
|
|
77990
77985
|
"ctype": "miscellaneous",
|
|
77991
77986
|
"subtype": "variable",
|
|
77992
77987
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
77993
77988
|
"deprecated": false,
|
|
77994
77989
|
"deprecationMessage": "",
|
|
77995
77990
|
"type": "",
|
|
77996
|
-
"defaultValue": "
|
|
77991
|
+
"defaultValue": "(args) => ({\n\tprops: {\n\t\t...args,\n\t\tcreateBreadcrumbItems\n\t},\n\ttemplate: `\n\t\t<cds-breadcrumb\n\t\t\t[noTrailingSlash]=\"noTrailingSlash\"\n\t\t\t[threshold]=\"threshold\"\n\t\t\t[items]=\"createBreadcrumbItems(itemCount, content)\">\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
77997
77992
|
},
|
|
77998
77993
|
{
|
|
77999
|
-
"name": "
|
|
77994
|
+
"name": "ModelWithTemplate",
|
|
78000
77995
|
"ctype": "miscellaneous",
|
|
78001
77996
|
"subtype": "variable",
|
|
78002
77997
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78003
77998
|
"deprecated": false,
|
|
78004
77999
|
"deprecationMessage": "",
|
|
78005
|
-
"type": ""
|
|
78000
|
+
"type": "",
|
|
78001
|
+
"defaultValue": "ModelWTemplate.bind({})"
|
|
78006
78002
|
},
|
|
78007
78003
|
{
|
|
78008
|
-
"name": "
|
|
78004
|
+
"name": "ModelWTemplate",
|
|
78009
78005
|
"ctype": "miscellaneous",
|
|
78010
78006
|
"subtype": "variable",
|
|
78011
78007
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78012
78008
|
"deprecated": false,
|
|
78013
78009
|
"deprecationMessage": "",
|
|
78014
78010
|
"type": "",
|
|
78015
|
-
"defaultValue": "(
|
|
78011
|
+
"defaultValue": "(args) => ({\n\tprops: {\n\t\t...args,\n\t\tcreateBreadcrumbItems,\n\t\twithTemplate\n\t},\n\ttemplate: `\n\t\t<ng-template #breadcrumbTemplate let-item>\n\t\t\t{{ templateContent }}{{ item.content }}\n\t\t</ng-template>\n\t\t<cds-breadcrumb\n\t\t\t[noTrailingSlash]=\"noTrailingSlash\"\n\t\t\t[threshold]=\"threshold\"\n\t\t\t[items]=\"withTemplate(breadcrumbTemplate, createBreadcrumbItems(itemCount, content))\">\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78016
78012
|
},
|
|
78017
78013
|
{
|
|
78018
|
-
"name": "
|
|
78014
|
+
"name": "Skeleton",
|
|
78019
78015
|
"ctype": "miscellaneous",
|
|
78020
78016
|
"subtype": "variable",
|
|
78021
78017
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78022
78018
|
"deprecated": false,
|
|
78023
78019
|
"deprecationMessage": "",
|
|
78024
78020
|
"type": "",
|
|
78025
|
-
"defaultValue": "
|
|
78021
|
+
"defaultValue": "WithSkeleton.bind({})"
|
|
78026
78022
|
},
|
|
78027
78023
|
{
|
|
78028
|
-
"name": "
|
|
78024
|
+
"name": "Template",
|
|
78029
78025
|
"ctype": "miscellaneous",
|
|
78030
78026
|
"subtype": "variable",
|
|
78031
78027
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78032
78028
|
"deprecated": false,
|
|
78033
78029
|
"deprecationMessage": "",
|
|
78034
78030
|
"type": "",
|
|
78035
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb>\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item
|
|
78031
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78036
78032
|
},
|
|
78037
78033
|
{
|
|
78038
|
-
"name": "
|
|
78034
|
+
"name": "WithSkeleton",
|
|
78039
78035
|
"ctype": "miscellaneous",
|
|
78040
78036
|
"subtype": "variable",
|
|
78041
78037
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78042
78038
|
"deprecated": false,
|
|
78043
78039
|
"deprecationMessage": "",
|
|
78044
78040
|
"type": "",
|
|
78045
|
-
"defaultValue": "
|
|
78041
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb skeleton=\"true\" [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78046
78042
|
},
|
|
78047
78043
|
{
|
|
78048
|
-
"name": "
|
|
78044
|
+
"name": "withTemplate",
|
|
78049
78045
|
"ctype": "miscellaneous",
|
|
78050
78046
|
"subtype": "variable",
|
|
78051
78047
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78052
78048
|
"deprecated": false,
|
|
78053
78049
|
"deprecationMessage": "",
|
|
78054
78050
|
"type": "",
|
|
78055
|
-
"defaultValue": "(
|
|
78056
|
-
}
|
|
78051
|
+
"defaultValue": "(templateRef, items) => items.map(item => Object.assign(item, { template: templateRef }))"
|
|
78052
|
+
}
|
|
78053
|
+
],
|
|
78054
|
+
"src/button/button-set.stories.ts": [
|
|
78057
78055
|
{
|
|
78058
|
-
"name": "
|
|
78056
|
+
"name": "Basic",
|
|
78059
78057
|
"ctype": "miscellaneous",
|
|
78060
78058
|
"subtype": "variable",
|
|
78061
|
-
"file": "src/
|
|
78059
|
+
"file": "src/button/button-set.stories.ts",
|
|
78062
78060
|
"deprecated": false,
|
|
78063
78061
|
"deprecationMessage": "",
|
|
78064
78062
|
"type": "",
|
|
78065
|
-
"defaultValue": "
|
|
78063
|
+
"defaultValue": "Template.bind({})"
|
|
78066
78064
|
},
|
|
78067
78065
|
{
|
|
78068
|
-
"name": "
|
|
78066
|
+
"name": "Template",
|
|
78069
78067
|
"ctype": "miscellaneous",
|
|
78070
78068
|
"subtype": "variable",
|
|
78071
|
-
"file": "src/
|
|
78069
|
+
"file": "src/button/button-set.stories.ts",
|
|
78072
78070
|
"deprecated": false,
|
|
78073
78071
|
"deprecationMessage": "",
|
|
78074
78072
|
"type": "",
|
|
78075
|
-
"defaultValue": "(args) => ({\n\tprops:
|
|
78076
|
-
}
|
|
78073
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-button-set>\n\t\t\t<button cdsButton=\"secondary\" [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t\t<button cdsButton [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t</cds-button-set>\n\t`\n})"
|
|
78074
|
+
}
|
|
78075
|
+
],
|
|
78076
|
+
"src/button/button.stories.ts": [
|
|
78077
78077
|
{
|
|
78078
|
-
"name": "
|
|
78078
|
+
"name": "Basic",
|
|
78079
78079
|
"ctype": "miscellaneous",
|
|
78080
78080
|
"subtype": "variable",
|
|
78081
|
-
"file": "src/
|
|
78081
|
+
"file": "src/button/button.stories.ts",
|
|
78082
78082
|
"deprecated": false,
|
|
78083
78083
|
"deprecationMessage": "",
|
|
78084
78084
|
"type": "",
|
|
78085
|
-
"defaultValue": "
|
|
78085
|
+
"defaultValue": "Template.bind({})"
|
|
78086
78086
|
},
|
|
78087
78087
|
{
|
|
78088
78088
|
"name": "Template",
|
|
78089
78089
|
"ctype": "miscellaneous",
|
|
78090
78090
|
"subtype": "variable",
|
|
78091
|
-
"file": "src/
|
|
78091
|
+
"file": "src/button/button.stories.ts",
|
|
78092
78092
|
"deprecated": false,
|
|
78093
78093
|
"deprecationMessage": "",
|
|
78094
78094
|
"type": "",
|
|
78095
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<
|
|
78095
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tButton\n\t\t</button>\n\t`\n})"
|
|
78096
78096
|
},
|
|
78097
78097
|
{
|
|
78098
|
-
"name": "
|
|
78098
|
+
"name": "WithIcon",
|
|
78099
78099
|
"ctype": "miscellaneous",
|
|
78100
78100
|
"subtype": "variable",
|
|
78101
|
-
"file": "src/
|
|
78101
|
+
"file": "src/button/button.stories.ts",
|
|
78102
78102
|
"deprecated": false,
|
|
78103
78103
|
"deprecationMessage": "",
|
|
78104
78104
|
"type": "",
|
|
78105
|
-
"defaultValue": "(
|
|
78105
|
+
"defaultValue": "WithIconTemplate.bind({})"
|
|
78106
78106
|
},
|
|
78107
78107
|
{
|
|
78108
|
-
"name": "
|
|
78108
|
+
"name": "WithIconTemplate",
|
|
78109
78109
|
"ctype": "miscellaneous",
|
|
78110
78110
|
"subtype": "variable",
|
|
78111
|
-
"file": "src/
|
|
78111
|
+
"file": "src/button/button.stories.ts",
|
|
78112
78112
|
"deprecated": false,
|
|
78113
78113
|
"deprecationMessage": "",
|
|
78114
78114
|
"type": "",
|
|
78115
|
-
"defaultValue": "(
|
|
78115
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseleave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tWith icon\n\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n\t\t</button>\n\t`\n})"
|
|
78116
78116
|
}
|
|
78117
78117
|
],
|
|
78118
78118
|
"src/checkbox/checkbox.stories.ts": [
|