@taiga-ui/kit 2.37.1 → 2.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/input-slider.d.ts +9 -5
- package/abstract/taiga-ui-kit-abstract.metadata.json +1 -1
- package/bundles/taiga-ui-kit-abstract.umd.js +8 -10
- package/bundles/taiga-ui-kit-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-abstract.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-accordion.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-checkbox.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-checkbox.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.js +8 -0
- package/bundles/taiga-ui-kit-components-input-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-files.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.js +21 -14
- package/bundles/taiga-ui-kit-components-input-number.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-number.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.js +12 -2
- package/bundles/taiga-ui-kit-components-input-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-range.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.js +153 -117
- package/bundles/taiga-ui-kit-components-input-slider.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-input-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-input-tag.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-radio.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-select.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-slider.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-components-slider.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-text-area.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-text-area.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-text-area.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-text-area.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.js +2 -2
- package/bundles/taiga-ui-kit-components-toggle.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-toggle.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.js +25 -1
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.min.js +2 -2
- package/bundles/taiga-ui-kit-internal-primitive-calendar-range.umd.min.js.map +1 -1
- package/components/accordion/taiga-ui-kit-components-accordion.metadata.json +1 -1
- package/components/checkbox/taiga-ui-kit-components-checkbox.metadata.json +1 -1
- package/components/input-files/input-files.component.d.ts +1 -0
- package/components/input-files/taiga-ui-kit-components-input-files.metadata.json +1 -1
- package/components/input-number/input-number.component.d.ts +4 -2
- package/components/input-number/taiga-ui-kit-components-input-number.metadata.json +1 -1
- package/components/input-range/input-range.component.d.ts +2 -1
- package/components/input-range/taiga-ui-kit-components-input-range.metadata.json +1 -1
- package/components/input-slider/input-slider.component.d.ts +39 -22
- package/components/input-slider/taiga-ui-kit-components-input-slider.metadata.json +1 -1
- package/components/input-tag/taiga-ui-kit-components-input-tag.metadata.json +1 -1
- package/components/radio/taiga-ui-kit-components-radio.metadata.json +1 -1
- package/components/select/taiga-ui-kit-components-select.metadata.json +1 -1
- package/components/slider/taiga-ui-kit-components-slider.metadata.json +1 -1
- package/components/text-area/taiga-ui-kit-components-text-area.metadata.json +1 -1
- package/components/toggle/taiga-ui-kit-components-toggle.metadata.json +1 -1
- package/esm2015/abstract/input-slider.js +9 -7
- package/esm2015/components/accordion/accordion-item/accordion-item.component.js +1 -1
- package/esm2015/components/checkbox/checkbox.component.js +3 -3
- package/esm2015/components/input-files/input-files.component.js +5 -1
- package/esm2015/components/input-number/input-number.component.js +21 -15
- package/esm2015/components/input-number/input-number.module.js +5 -1
- package/esm2015/components/input-range/input-range.component.js +10 -4
- package/esm2015/components/input-slider/input-slider.component.js +155 -108
- package/esm2015/components/input-slider/input-slider.module.js +5 -2
- package/esm2015/components/input-tag/input-tag.component.js +1 -1
- package/esm2015/components/radio/radio.component.js +2 -2
- package/esm2015/components/select/select.component.js +2 -2
- package/esm2015/components/slider/slider.component.js +1 -1
- package/esm2015/components/text-area/text-area.component.js +3 -3
- package/esm2015/components/toggle/toggle.component.js +3 -3
- package/esm2015/internal/primitive-calendar-range/primitive-calendar-range.component.js +26 -2
- package/esm5/abstract/input-slider.js +9 -11
- package/esm5/components/accordion/accordion-item/accordion-item.component.js +1 -1
- package/esm5/components/checkbox/checkbox.component.js +3 -3
- package/esm5/components/input-files/input-files.component.js +9 -1
- package/esm5/components/input-number/input-number.component.js +18 -12
- package/esm5/components/input-number/input-number.module.js +5 -1
- package/esm5/components/input-range/input-range.component.js +14 -4
- package/esm5/components/input-slider/input-slider.component.js +153 -117
- package/esm5/components/input-slider/input-slider.module.js +5 -2
- package/esm5/components/input-tag/input-tag.component.js +1 -1
- package/esm5/components/radio/radio.component.js +2 -2
- package/esm5/components/select/select.component.js +2 -2
- package/esm5/components/slider/slider.component.js +1 -1
- package/esm5/components/text-area/text-area.component.js +3 -3
- package/esm5/components/toggle/toggle.component.js +3 -3
- package/esm5/internal/primitive-calendar-range/primitive-calendar-range.component.js +26 -2
- package/fesm2015/taiga-ui-kit-abstract.js +8 -6
- package/fesm2015/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-accordion.js +1 -1
- package/fesm2015/taiga-ui-kit-components-checkbox.js +2 -2
- package/fesm2015/taiga-ui-kit-components-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-files.js +4 -0
- package/fesm2015/taiga-ui-kit-components-input-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-number.js +24 -15
- package/fesm2015/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-range.js +8 -2
- package/fesm2015/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-slider.js +156 -107
- package/fesm2015/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-input-tag.js +1 -1
- package/fesm2015/taiga-ui-kit-components-radio.js +1 -1
- package/fesm2015/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-select.js +1 -1
- package/fesm2015/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-slider.js +1 -1
- package/fesm2015/taiga-ui-kit-components-text-area.js +2 -2
- package/fesm2015/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-toggle.js +2 -2
- package/fesm2015/taiga-ui-kit-components-toggle.js.map +1 -1
- package/fesm2015/taiga-ui-kit-internal-primitive-calendar-range.js +25 -1
- package/fesm2015/taiga-ui-kit-internal-primitive-calendar-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-abstract.js +8 -10
- package/fesm5/taiga-ui-kit-abstract.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-accordion.js +1 -1
- package/fesm5/taiga-ui-kit-components-checkbox.js +2 -2
- package/fesm5/taiga-ui-kit-components-checkbox.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-files.js +8 -0
- package/fesm5/taiga-ui-kit-components-input-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-number.js +21 -12
- package/fesm5/taiga-ui-kit-components-input-number.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-range.js +12 -2
- package/fesm5/taiga-ui-kit-components-input-range.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-slider.js +154 -116
- package/fesm5/taiga-ui-kit-components-input-slider.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-input-tag.js +1 -1
- package/fesm5/taiga-ui-kit-components-radio.js +1 -1
- package/fesm5/taiga-ui-kit-components-radio.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-select.js +1 -1
- package/fesm5/taiga-ui-kit-components-select.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-slider.js +1 -1
- package/fesm5/taiga-ui-kit-components-text-area.js +2 -2
- package/fesm5/taiga-ui-kit-components-text-area.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-toggle.js +2 -2
- package/fesm5/taiga-ui-kit-components-toggle.js.map +1 -1
- package/fesm5/taiga-ui-kit-internal-primitive-calendar-range.js +25 -1
- package/fesm5/taiga-ui-kit-internal-primitive-calendar-range.js.map +1 -1
- package/internal/primitive-calendar-range/primitive-calendar-range.component.d.ts +3 -0
- package/internal/primitive-calendar-range/taiga-ui-kit-internal-primitive-calendar-range.metadata.json +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-range.js","sources":["ng://@taiga-ui/kit/components/input-range/input-range.component.ts","ng://@taiga-ui/kit/components/input-range/input-range.module.ts","ng://@taiga-ui/kit/components/input-range/taiga-ui-kit-components-input-range.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n Inject,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n isNativeFocused,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_IS_MOBILE,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n maskedMoneyValueIsEmpty,\n maskedNumberStringToNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TUI_TEXTFIELD_APPEARANCE,\n TuiModeDirective,\n} from '@taiga-ui/core';\nimport {AbstractTuiInputSlider} from '@taiga-ui/kit/abstract';\n\n// @dynamic\n@Component({\n selector: 'tui-input-range',\n templateUrl: './input-range.template.html',\n styleUrls: ['./input-range.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputRangeComponent),\n },\n ],\n})\nexport class TuiInputRangeComponent\n extends AbstractTuiInputSlider<[number, number]>\n implements TuiFocusableElementAccessor\n{\n @ViewChild('nativeLeft')\n private readonly nativeLeft?: ElementRef<HTMLInputElement>;\n\n @ViewChild('nativeRight')\n private readonly nativeRight?: ElementRef<HTMLInputElement>;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Optional()\n @Inject(TuiModeDirective)\n protected readonly modeDirective: TuiModeDirective | null,\n @Inject(TUI_IS_MOBILE)\n private readonly isMobile: boolean,\n @Inject(TUI_NUMBER_FORMAT)\n protected readonly numberFormat: NumberFormatSettings,\n @Inject(TUI_TEXTFIELD_APPEARANCE)\n readonly appearance: string,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return !this.nativeLeft || this.disabled ? null : this.nativeLeft.nativeElement;\n }\n\n get focused(): boolean {\n return this.focusedLeft || this.focusedRight;\n }\n\n get focusedLeft(): boolean {\n return !!this.nativeLeft && isNativeFocused(this.nativeLeft.nativeElement);\n }\n\n get focusedRight(): boolean {\n return !!this.nativeRight && isNativeFocused(this.nativeRight.nativeElement);\n }\n\n @HostBinding('class._min-label')\n get showMinLabel(): boolean {\n return !this.focusedLeft && !!this.minLabel && this.value[0] === this.min;\n }\n\n @HostBinding('class._max-label')\n get showMaxLabel(): boolean {\n return !this.focusedRight && !!this.maxLabel && this.value[1] === this.max;\n }\n\n get inputValueLeft(): string {\n return this.nativeLeft ? this.nativeLeft.nativeElement.value : '';\n }\n\n get inputValueRight(): string {\n return this.nativeRight ? this.nativeRight.nativeElement.value : '';\n }\n\n get computedValueLeft(): string {\n return this.computedPureValueLeft(this.value[0]);\n }\n\n get computedValueRight(): string {\n return this.computedPureValueRight(this.value[1]);\n }\n\n onActiveZone(active: boolean) {\n this.updateFocused(active);\n }\n\n onMouseDown() {\n if (this.nativeRight && !this.isMobile) {\n setNativeFocused(this.nativeRight.nativeElement);\n }\n }\n\n onKeyDownArrowUpLeft(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(true, false);\n }\n\n onKeyDownArrowDownLeft(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(false, false);\n }\n\n onKeyDownArrowUpRight(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(true, true);\n }\n\n onKeyDownArrowDownRight(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(false, true);\n }\n\n onInputLeft() {\n const value = this.inputValueLeft;\n const capped = this.capInputValue(value, this.value[1]);\n const postfix = value.slice(-1)[0] === ',' ? ',' : '';\n\n if (maskedMoneyValueIsEmpty(value) || capped === null) {\n return;\n }\n\n const newValue = this.formatNumber(capped) + postfix;\n\n if (this.nativeLeft && this.inputValueLeft !== newValue) {\n this.nativeLeft.nativeElement.value = newValue;\n }\n\n this.updateValue([capped, this.value[1]]);\n }\n\n onInputRight() {\n const value = this.inputValueRight;\n const capped = this.capInputValue(value);\n const postfix = value.slice(-1)[0] === ',' ? ',' : '';\n\n if (maskedMoneyValueIsEmpty(value) || capped === null) {\n return;\n }\n\n const newValue = this.formatNumber(capped) + postfix;\n\n if (this.nativeRight && this.inputValueRight !== newValue) {\n this.nativeRight.nativeElement.value = newValue;\n }\n\n if (capped >= this.value[0]) {\n this.updateValue([this.value[0], capped]);\n }\n }\n\n onRangeValue(value: [number, number]) {\n const guardedValue = value.map(item => this.valueGuard(item)) as [number, number];\n\n if (\n !this.nativeLeft ||\n !this.nativeRight ||\n (guardedValue[0] === this.value[0] && guardedValue[1] === this.value[1])\n ) {\n return;\n }\n\n if (!this.isMobile) {\n const element =\n guardedValue[0] !== this.value[0]\n ? this.nativeLeft.nativeElement\n : this.nativeRight.nativeElement;\n\n setNativeFocused(element);\n }\n\n this.updateValue(guardedValue);\n this.nativeLeft.nativeElement.value = this.formatNumber(guardedValue[0]);\n }\n\n onLeftFocused(focused: boolean) {\n if (focused || !this.nativeLeft) {\n return;\n }\n\n const inputValue = maskedNumberStringToNumber(\n this.computedValueLeft,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n const value = isNaN(inputValue) ? this.min : this.valueGuard(inputValue);\n\n this.nativeLeft.nativeElement.value = this.formatNumber(value);\n\n if (value !== this.value[0]) {\n this.updateValue([value, this.value[1]]);\n }\n }\n\n onRightFocused(focused: boolean) {\n if (focused || !this.nativeRight) {\n return;\n }\n\n const inputValue = maskedNumberStringToNumber(\n this.computedValueRight,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n\n const value = isNaN(inputValue)\n ? this.value[0]\n : this.valueGuard(Math.max(inputValue, this.value[0]));\n\n this.nativeRight.nativeElement.value = this.formatNumber(value);\n\n if (value !== this.value[1]) {\n this.updateValue([this.value[0], value]);\n }\n }\n\n protected getFallbackValue(): [number, number] {\n return [0, 0];\n }\n\n @tuiPure\n private computedPureValueLeft(value: number) {\n return this.formatNumber(value);\n }\n\n @tuiPure\n private computedPureValueRight(value: number) {\n return this.formatNumber(value);\n }\n\n private formatNumber(value: number): string {\n return formatNumber(\n value,\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n private processStep(increment: boolean, right: boolean) {\n const start = this.valueGuard(\n increment ? this.value[0] + this.step : this.value[0] - this.step,\n );\n const end = this.valueGuard(\n increment ? this.value[1] + this.step : this.value[1] - this.step,\n );\n const value: [number, number] = [\n right ? this.value[0] : Math.min(start, this.value[1]),\n right ? Math.max(end, this.value[0]) : this.value[1],\n ];\n\n if (value[0] !== this.value[0] || value[1] !== this.value[1]) {\n this.updateValue(value);\n }\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiMapperPipeModule,\n TuiPressedModule,\n} from '@taiga-ui/cdk';\nimport {TuiWrapperModule} from '@taiga-ui/core';\nimport {TuiRangeModule} from '@taiga-ui/kit/components/range';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputRangeComponent} from './input-range.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n TextMaskModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiPressedModule,\n TuiMapperPipeModule,\n TuiInputModeModule,\n TuiActiveZoneModule,\n TuiRangeModule,\n TuiWrapperModule,\n ],\n declarations: [TuiInputRangeComponent],\n exports: [TuiInputRangeComponent],\n})\nexport class TuiInputRangeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAiCA;IAaa,sBAAsB,8BAAnC,MAAa,sBACT,SAAQ,sBAAwC;IAShD,YAII,OAAyB,EACE,iBAAoC,EAG5C,aAAsC,EAExC,QAAiB,EAEf,YAAkC,EAE5C,UAAkB;QAE3B,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QARf,kBAAa,GAAb,aAAa,CAAyB;QAExC,aAAQ,GAAR,QAAQ,CAAS;QAEf,iBAAY,GAAZ,YAAY,CAAsB;QAE5C,eAAU,GAAV,UAAU,CAAQ;KAG9B;IAED,IAAI,sBAAsB;QACtB,OAAO,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;KACnF;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,YAAY,CAAC;KAChD;IAED,IAAI,WAAW;QACX,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;KAC9E;IAED,IAAI,YAAY;QACZ,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;KAChF;IAGD,IAAI,YAAY;QACZ,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,C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,WAAA,IAAI,EAAE,CAAA;IACN,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;IAEjB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,QAAQ,EAAE,CAAA;IACV,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAExB,WAAA,MAAM,CAAC,aAAa,CAAC,CAAA;IAErB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,MAAM,CAAC,wBAAwB,CAAC,CAAA;GAvB5B,sBAAsB,CAmQlC;;IC5QY,mBAAmB,GAAhC,MAAa,mBAAmB;EAAG;AAAtB,mBAAmB;IAnB/B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,cAAc;YACd,kBAAkB;YAClB,gBAAgB;YAChB,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,cAAc;YACd,gBAAgB;SACnB;QACD,YAAY,EAAE,CAAC,sBAAsB,CAAC;QACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;KACpC,CAAC;GACW,mBAAmB,CAAG;;ACrCnC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-range.js","sources":["ng://@taiga-ui/kit/components/input-range/input-range.component.ts","ng://@taiga-ui/kit/components/input-range/input-range.module.ts","ng://@taiga-ui/kit/components/input-range/taiga-ui-kit-components-input-range.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n HostBinding,\n Inject,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n isNativeFocused,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TUI_IS_MOBILE,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n maskedMoneyValueIsEmpty,\n maskedNumberStringToNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TUI_TEXTFIELD_APPEARANCE,\n TuiBrightness,\n TuiModeDirective,\n} from '@taiga-ui/core';\nimport {AbstractTuiInputSlider} from '@taiga-ui/kit/abstract';\n\n// @dynamic\n@Component({\n selector: 'tui-input-range',\n templateUrl: './input-range.template.html',\n styleUrls: ['./input-range.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputRangeComponent),\n },\n ],\n})\nexport class TuiInputRangeComponent\n extends AbstractTuiInputSlider<[number, number]>\n implements TuiFocusableElementAccessor\n{\n @ViewChild('nativeLeft')\n private readonly nativeLeft?: ElementRef<HTMLInputElement>;\n\n @ViewChild('nativeRight')\n private readonly nativeRight?: ElementRef<HTMLInputElement>;\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Optional()\n @Inject(TuiModeDirective)\n protected readonly modeDirective: TuiModeDirective | null,\n @Inject(TUI_IS_MOBILE)\n private readonly isMobile: boolean,\n @Inject(TUI_NUMBER_FORMAT)\n protected readonly numberFormat: NumberFormatSettings,\n @Inject(TUI_TEXTFIELD_APPEARANCE)\n readonly appearance: string,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return !this.nativeLeft || this.disabled ? null : this.nativeLeft.nativeElement;\n }\n\n get focused(): boolean {\n return this.focusedLeft || this.focusedRight;\n }\n\n get focusedLeft(): boolean {\n return !!this.nativeLeft && isNativeFocused(this.nativeLeft.nativeElement);\n }\n\n get focusedRight(): boolean {\n return !!this.nativeRight && isNativeFocused(this.nativeRight.nativeElement);\n }\n\n @HostBinding('class._min-label')\n get showMinLabel(): boolean {\n return !this.focusedLeft && !!this.minLabel && this.value[0] === this.min;\n }\n\n @HostBinding('class._max-label')\n get showMaxLabel(): boolean {\n return !this.focusedRight && !!this.maxLabel && this.value[1] === this.max;\n }\n\n @HostBinding('attr.data-mode')\n get hostMode(): TuiBrightness | null {\n return this.modeDirective && this.modeDirective.mode;\n }\n\n get inputValueLeft(): string {\n return this.nativeLeft ? this.nativeLeft.nativeElement.value : '';\n }\n\n get inputValueRight(): string {\n return this.nativeRight ? this.nativeRight.nativeElement.value : '';\n }\n\n get computedValueLeft(): string {\n return this.computedPureValueLeft(this.value[0]);\n }\n\n get computedValueRight(): string {\n return this.computedPureValueRight(this.value[1]);\n }\n\n onActiveZone(active: boolean) {\n this.updateFocused(active);\n }\n\n onMouseDown() {\n if (this.nativeRight && !this.isMobile) {\n setNativeFocused(this.nativeRight.nativeElement);\n }\n }\n\n onKeyDownArrowUpLeft(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(true, false);\n }\n\n onKeyDownArrowDownLeft(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(false, false);\n }\n\n onKeyDownArrowUpRight(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(true, true);\n }\n\n onKeyDownArrowDownRight(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(false, true);\n }\n\n onInputLeft() {\n const value = this.inputValueLeft;\n const capped = this.capInputValue(value, this.value[1]);\n const postfix = value.slice(-1)[0] === ',' ? ',' : '';\n\n if (maskedMoneyValueIsEmpty(value) || capped === null) {\n return;\n }\n\n const newValue = this.formatNumber(capped) + postfix;\n\n if (this.nativeLeft && this.inputValueLeft !== newValue) {\n this.nativeLeft.nativeElement.value = newValue;\n }\n\n this.updateValue([capped, this.value[1]]);\n }\n\n onInputRight() {\n const value = this.inputValueRight;\n const capped = this.capInputValue(value);\n const postfix = value.slice(-1)[0] === ',' ? ',' : '';\n\n if (maskedMoneyValueIsEmpty(value) || capped === null) {\n return;\n }\n\n const newValue = this.formatNumber(capped) + postfix;\n\n if (this.nativeRight && this.inputValueRight !== newValue) {\n this.nativeRight.nativeElement.value = newValue;\n }\n\n if (capped >= this.value[0]) {\n this.updateValue([this.value[0], capped]);\n }\n }\n\n onRangeValue(value: [number, number]) {\n const guardedValue = value.map(item => this.valueGuard(item)) as [number, number];\n\n if (\n !this.nativeLeft ||\n !this.nativeRight ||\n (guardedValue[0] === this.value[0] && guardedValue[1] === this.value[1])\n ) {\n return;\n }\n\n if (!this.isMobile) {\n const element =\n guardedValue[0] !== this.value[0]\n ? this.nativeLeft.nativeElement\n : this.nativeRight.nativeElement;\n\n setNativeFocused(element);\n }\n\n this.updateValue(guardedValue);\n this.nativeLeft.nativeElement.value = this.formatNumber(guardedValue[0]);\n }\n\n onLeftFocused(focused: boolean) {\n if (focused || !this.nativeLeft) {\n return;\n }\n\n const inputValue = maskedNumberStringToNumber(\n this.computedValueLeft,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n const value = isNaN(inputValue) ? this.min : this.valueGuard(inputValue);\n\n this.nativeLeft.nativeElement.value = this.formatNumber(value);\n\n if (value !== this.value[0]) {\n this.updateValue([value, this.value[1]]);\n }\n }\n\n onRightFocused(focused: boolean) {\n if (focused || !this.nativeRight) {\n return;\n }\n\n const inputValue = maskedNumberStringToNumber(\n this.computedValueRight,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n\n const value = isNaN(inputValue)\n ? this.value[0]\n : this.valueGuard(Math.max(inputValue, this.value[0]));\n\n this.nativeRight.nativeElement.value = this.formatNumber(value);\n\n if (value !== this.value[1]) {\n this.updateValue([this.value[0], value]);\n }\n }\n\n protected getFallbackValue(): [number, number] {\n return [0, 0];\n }\n\n @tuiPure\n private computedPureValueLeft(value: number) {\n return this.formatNumber(value);\n }\n\n @tuiPure\n private computedPureValueRight(value: number) {\n return this.formatNumber(value);\n }\n\n private formatNumber(value: number): string {\n return formatNumber(\n value,\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n private processStep(increment: boolean, right: boolean) {\n const start = this.valueGuard(\n increment ? this.value[0] + this.step : this.value[0] - this.step,\n );\n const end = this.valueGuard(\n increment ? this.value[1] + this.step : this.value[1] - this.step,\n );\n const value: [number, number] = [\n right ? this.value[0] : Math.min(start, this.value[1]),\n right ? Math.max(end, this.value[0]) : this.value[1],\n ];\n\n if (value[0] !== this.value[0] || value[1] !== this.value[1]) {\n this.updateValue(value);\n }\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n TuiActiveZoneModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiMapperPipeModule,\n TuiPressedModule,\n} from '@taiga-ui/cdk';\nimport {TuiWrapperModule} from '@taiga-ui/core';\nimport {TuiRangeModule} from '@taiga-ui/kit/components/range';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {TuiInputRangeComponent} from './input-range.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n TextMaskModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiPressedModule,\n TuiMapperPipeModule,\n TuiInputModeModule,\n TuiActiveZoneModule,\n TuiRangeModule,\n TuiWrapperModule,\n ],\n declarations: [TuiInputRangeComponent],\n exports: [TuiInputRangeComponent],\n})\nexport class TuiInputRangeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAkCA;IAaa,sBAAsB,8BAAnC,MAAa,sBACT,SAAQ,sBAAwC;IAShD,YAII,OAAyB,EACE,iBAAoC,EAG5C,aAAsC,EAExC,QAAiB,EAEf,YAAkC,EAE5C,UAAkB;QAE3B,KAAK,CAAC,OAAO,EAAE,iB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sB,CAwQlC;;IClRY,mBAAmB,GAAhC,MAAa,mBAAmB;EAAG;AAAtB,mBAAmB;IAnB/B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,cAAc;YACd,kBAAkB;YAClB,gBAAgB;YAChB,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,cAAc;YACd,gBAAgB;SACnB;QACD,YAAY,EAAE,CAAC,sBAAsB,CAAC;QACtC,OAAO,EAAE,CAAC,sBAAsB,CAAC;KACpC,CAAC;GACW,mBAAmB,CAAG;;ACrCnC;;;;;;"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __decorate, __param } from 'tslib';
|
|
2
|
-
import { Directive, Optional, Self, Inject, ChangeDetectorRef, ViewChild, ElementRef, Input,
|
|
2
|
+
import { Directive, Optional, Self, Inject, ChangeDetectorRef, ViewChild, ElementRef, Input, Component, ChangeDetectionStrategy, forwardRef, NgModule } from '@angular/core';
|
|
3
3
|
import { NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { isNativeFocused, setNativeFocused, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiFocusableModule, TuiFocusedModule, TuiHoveredModule, TuiPressedModule, TuiMapperPipeModule, TuiInputModeModule, TuiRepeatTimesModule } from '@taiga-ui/cdk';
|
|
5
|
-
import {
|
|
4
|
+
import { isNativeFocused, tuiAssert, setNativeFocused, round, clamp, tuiDefaultProp, TUI_FOCUSABLE_ITEM_ACCESSOR, TuiFocusableModule, TuiFocusedModule, TuiHoveredModule, TuiPressedModule, TuiMapperPipeModule, TuiInputModeModule, TuiRepeatTimesModule } from '@taiga-ui/cdk';
|
|
5
|
+
import { getFractionPartPadded, TuiTextfieldController, TUI_TEXTFIELD_WATCHED_CONTROLLER, TUI_NUMBER_FORMAT, HINT_CONTROLLER_PROVIDER, TEXTFIELD_CONTROLLER_PROVIDER, TuiTooltipModule, TuiWrapperModule, TuiFormatNumberPipeModule, TuiTextfieldControllerModule } from '@taiga-ui/core';
|
|
6
6
|
import { AbstractTuiInputSlider } from '@taiga-ui/kit/abstract';
|
|
7
|
+
import { TuiInputNumberComponent, TuiInputNumberModule } from '@taiga-ui/kit/components/input-number';
|
|
7
8
|
import { TuiSliderComponent, tuiSliderOptionsProvider, TuiSliderModule } from '@taiga-ui/kit/components/slider';
|
|
9
|
+
import { TUI_FLOATING_PRECISION } from '@taiga-ui/kit/constants';
|
|
8
10
|
import { TUI_FROM_TO_TEXTS } from '@taiga-ui/kit/tokens';
|
|
9
11
|
import { Observable } from 'rxjs';
|
|
10
12
|
import { CommonModule } from '@angular/common';
|
|
@@ -25,16 +27,32 @@ TuiNewInputSliderDirective = __decorate([
|
|
|
25
27
|
})
|
|
26
28
|
], TuiNewInputSliderDirective);
|
|
27
29
|
// @dynamic
|
|
28
|
-
let TuiInputSliderComponent = TuiInputSliderComponent_1 =
|
|
29
|
-
|
|
30
|
+
let TuiInputSliderComponent = TuiInputSliderComponent_1 =
|
|
31
|
+
/**
|
|
32
|
+
* TODO replace `extends AbstractTuiInputSlider<number>` by `extends AbstractTuiControl<number> implements TuiWithOptionalMinMax<number>`
|
|
33
|
+
* in v3.0
|
|
34
|
+
*/
|
|
35
|
+
class TuiInputSliderComponent extends AbstractTuiInputSlider {
|
|
36
|
+
constructor(control, changeDetectorRef, controller, numberFormat, fromToTexts$, isNew) {
|
|
30
37
|
super(control, changeDetectorRef);
|
|
31
|
-
this.modeDirective = modeDirective;
|
|
32
|
-
this.hintController = hintController;
|
|
33
38
|
this.controller = controller;
|
|
34
39
|
this.numberFormat = numberFormat;
|
|
35
|
-
this.appearance = appearance;
|
|
36
40
|
this.fromToTexts$ = fromToTexts$;
|
|
37
41
|
this.isNew = isNew;
|
|
42
|
+
this.min = 0;
|
|
43
|
+
this.max = Infinity;
|
|
44
|
+
this.quantum = 1;
|
|
45
|
+
this.steps = 0;
|
|
46
|
+
this.segments = 0;
|
|
47
|
+
this.keySteps = null;
|
|
48
|
+
this.valueContent = '';
|
|
49
|
+
this.prefix = '';
|
|
50
|
+
this.postfix = '';
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated use `tuiTextfieldSize` instead
|
|
53
|
+
* TODO delete in v3.0
|
|
54
|
+
*/
|
|
55
|
+
this.size = 'l';
|
|
38
56
|
/**
|
|
39
57
|
* @deprecated use `tuiTextfieldCustomContent` instead
|
|
40
58
|
* TODO delete in v3.0
|
|
@@ -42,147 +60,156 @@ let TuiInputSliderComponent = TuiInputSliderComponent_1 = class TuiInputSliderCo
|
|
|
42
60
|
this.secondary = '';
|
|
43
61
|
}
|
|
44
62
|
get nativeFocusableElement() {
|
|
45
|
-
|
|
63
|
+
var _a;
|
|
64
|
+
return !((_a = this.inputNumberRef) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) || this.computedDisabled
|
|
46
65
|
? null
|
|
47
|
-
: this.
|
|
66
|
+
: this.inputNumberRef.nativeFocusableElement;
|
|
48
67
|
}
|
|
49
68
|
get focused() {
|
|
50
69
|
var _a;
|
|
51
70
|
return (isNativeFocused(this.nativeFocusableElement) ||
|
|
52
71
|
isNativeFocused(((_a = this.sliderRef) === null || _a === void 0 ? void 0 : _a.nativeElement) || null));
|
|
53
72
|
}
|
|
54
|
-
get
|
|
55
|
-
return
|
|
73
|
+
get computedSteps() {
|
|
74
|
+
return this.steps || (this.max - this.min) / this.quantum;
|
|
56
75
|
}
|
|
57
|
-
get
|
|
58
|
-
return
|
|
76
|
+
get precision() {
|
|
77
|
+
return getFractionPartPadded(this.quantum).length;
|
|
59
78
|
}
|
|
60
|
-
get
|
|
61
|
-
return
|
|
79
|
+
get decimal() {
|
|
80
|
+
return this.precision ? 'not-zero' : 'never';
|
|
62
81
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
82
|
+
/**
|
|
83
|
+
* TODO remove old property `size` in v3.0
|
|
84
|
+
*/
|
|
85
|
+
get computedSize() {
|
|
86
|
+
if (this.isNew) {
|
|
87
|
+
tuiAssert.assert(this.controller.size !== 's', "Size 's' is not supported by this input.");
|
|
88
|
+
return this.controller.size === 'l' ? 'l' : 'm';
|
|
66
89
|
}
|
|
67
|
-
return this.
|
|
90
|
+
return this.size;
|
|
68
91
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.focusableElement.nativeElement.value = value;
|
|
78
|
-
}
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated for backward compatibility
|
|
94
|
+
* TODO replace by just `this.valueContent` in v3.0
|
|
95
|
+
*/
|
|
96
|
+
get computedValueContent() {
|
|
97
|
+
return this.minLabel || this.maxLabel
|
|
98
|
+
? legacyMinMaxLabel(this)
|
|
99
|
+
: this.valueContent;
|
|
79
100
|
}
|
|
80
101
|
focusTextInput() {
|
|
81
|
-
|
|
82
|
-
|
|
102
|
+
var _a;
|
|
103
|
+
const focusableElement = (_a = this.inputNumberRef) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement;
|
|
104
|
+
if (focusableElement) {
|
|
105
|
+
setNativeFocused(focusableElement);
|
|
83
106
|
}
|
|
84
107
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
event.preventDefault();
|
|
90
|
-
this.processStep(true);
|
|
91
|
-
this.inputValue = this.formattedValue;
|
|
108
|
+
safelyUpdateValue(value) {
|
|
109
|
+
this.updateValue(this.valueGuard(value !== null && value !== void 0 ? value : this.safeCurrentValue));
|
|
92
110
|
}
|
|
93
|
-
|
|
111
|
+
onVerticalArrowKeyDown(coefficient) {
|
|
94
112
|
if (this.readOnly) {
|
|
95
113
|
return;
|
|
96
114
|
}
|
|
97
|
-
|
|
98
|
-
this.
|
|
99
|
-
|
|
115
|
+
const value = this.value + coefficient * this.step;
|
|
116
|
+
if (value !== this.value) {
|
|
117
|
+
this.safelyUpdateValue(value);
|
|
118
|
+
}
|
|
119
|
+
this.updateTextInputValue(this.valueGuard(value));
|
|
100
120
|
}
|
|
101
121
|
onFocused(focused) {
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const inputValue = maskedNumberStringToNumber(this.computedValue, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
|
|
107
|
-
const value = isNaN(inputValue) ? this.min : this.valueGuard(inputValue);
|
|
108
|
-
this.updateValue(value);
|
|
109
|
-
this.inputValue = this.formattedValue;
|
|
110
|
-
}
|
|
111
|
-
onValue(value) {
|
|
112
|
-
const capped = this.capInputValue(value);
|
|
113
|
-
const postfix = value.slice(-1)[0] === ',' ? ',' : '';
|
|
114
|
-
if (maskedMoneyValueIsEmpty(value) || capped === null) {
|
|
115
|
-
return;
|
|
122
|
+
if (!focused && !this.textInputValue) {
|
|
123
|
+
this.updateTextInputValue(this.safeCurrentValue);
|
|
116
124
|
}
|
|
117
|
-
|
|
118
|
-
if (value !== newValue) {
|
|
119
|
-
this.inputValue = newValue;
|
|
120
|
-
}
|
|
121
|
-
this.updateValue(capped);
|
|
125
|
+
this.updateFocused(focused);
|
|
122
126
|
}
|
|
123
|
-
|
|
124
|
-
this.
|
|
125
|
-
|
|
127
|
+
onPressed(pressed) {
|
|
128
|
+
this.updatePressed(pressed);
|
|
129
|
+
}
|
|
130
|
+
onHovered(hovered) {
|
|
131
|
+
this.updateHovered(hovered);
|
|
132
|
+
}
|
|
133
|
+
get textInputValue() {
|
|
134
|
+
var _a;
|
|
135
|
+
return ((_a = this.inputNumberRef) === null || _a === void 0 ? void 0 : _a.nativeValue) || '';
|
|
126
136
|
}
|
|
127
137
|
getFallbackValue() {
|
|
128
138
|
return 0;
|
|
129
139
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
get isInputValueNotFinished() {
|
|
134
|
-
if (this.inputValue === '') {
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
const nativeNumberValue = maskedNumberStringToNumber(this.inputValue, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
|
|
138
|
-
return nativeNumberValue < 0
|
|
139
|
-
? nativeNumberValue > this.max
|
|
140
|
-
: nativeNumberValue < this.min;
|
|
140
|
+
valueGuard(value) {
|
|
141
|
+
const roundedValue = round(Math.round(value / this.quantum) * this.quantum, TUI_FLOATING_PRECISION);
|
|
142
|
+
return clamp(roundedValue, this.min, this.max);
|
|
141
143
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
updateTextInputValue(value) {
|
|
145
|
+
if (this.inputNumberRef) {
|
|
146
|
+
this.inputNumberRef.nativeValue =
|
|
147
|
+
this.inputNumberRef.getFormattedValue(value);
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
|
-
formatNumber(value) {
|
|
149
|
-
return formatNumber(value, null, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
|
|
150
|
-
}
|
|
151
150
|
};
|
|
152
151
|
TuiInputSliderComponent.ctorParameters = () => [
|
|
153
152
|
{ type: NgControl, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [NgControl,] }] },
|
|
154
153
|
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
155
|
-
{ type: TuiModeDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiModeDirective,] }] },
|
|
156
|
-
{ type: TuiHintControllerDirective, decorators: [{ type: Inject, args: [TUI_HINT_WATCHED_CONTROLLER,] }] },
|
|
157
154
|
{ type: TuiTextfieldController, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_WATCHED_CONTROLLER,] }] },
|
|
158
155
|
{ type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] },
|
|
159
|
-
{ type: String, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_APPEARANCE,] }] },
|
|
160
156
|
{ type: Observable, decorators: [{ type: Inject, args: [TUI_FROM_TO_TEXTS,] }] },
|
|
161
157
|
{ type: TuiNewInputSliderDirective, decorators: [{ type: Optional }, { type: Inject, args: [TuiNewInputSliderDirective,] }] }
|
|
162
158
|
];
|
|
163
159
|
__decorate([
|
|
164
|
-
ViewChild(
|
|
165
|
-
], TuiInputSliderComponent.prototype, "
|
|
160
|
+
ViewChild(TuiInputNumberComponent)
|
|
161
|
+
], TuiInputSliderComponent.prototype, "inputNumberRef", void 0);
|
|
166
162
|
__decorate([
|
|
167
163
|
ViewChild(TuiSliderComponent, { read: ElementRef })
|
|
168
164
|
], TuiInputSliderComponent.prototype, "sliderRef", void 0);
|
|
169
165
|
__decorate([
|
|
170
166
|
Input(),
|
|
171
167
|
tuiDefaultProp()
|
|
172
|
-
], TuiInputSliderComponent.prototype, "
|
|
168
|
+
], TuiInputSliderComponent.prototype, "min", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
Input(),
|
|
171
|
+
tuiDefaultProp()
|
|
172
|
+
], TuiInputSliderComponent.prototype, "max", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
Input(),
|
|
175
|
+
tuiDefaultProp(quantumAssertion, 'Quantum must be positive')
|
|
176
|
+
], TuiInputSliderComponent.prototype, "quantum", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
Input(),
|
|
179
|
+
tuiDefaultProp()
|
|
180
|
+
], TuiInputSliderComponent.prototype, "steps", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
Input(),
|
|
183
|
+
tuiDefaultProp()
|
|
184
|
+
], TuiInputSliderComponent.prototype, "segments", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
Input(),
|
|
187
|
+
tuiDefaultProp()
|
|
188
|
+
], TuiInputSliderComponent.prototype, "keySteps", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
Input(),
|
|
191
|
+
tuiDefaultProp()
|
|
192
|
+
], TuiInputSliderComponent.prototype, "valueContent", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
Input(),
|
|
195
|
+
tuiDefaultProp()
|
|
196
|
+
], TuiInputSliderComponent.prototype, "prefix", void 0);
|
|
173
197
|
__decorate([
|
|
174
|
-
|
|
175
|
-
|
|
198
|
+
Input(),
|
|
199
|
+
tuiDefaultProp()
|
|
200
|
+
], TuiInputSliderComponent.prototype, "postfix", void 0);
|
|
176
201
|
__decorate([
|
|
177
|
-
|
|
178
|
-
|
|
202
|
+
Input(),
|
|
203
|
+
tuiDefaultProp()
|
|
204
|
+
], TuiInputSliderComponent.prototype, "size", void 0);
|
|
179
205
|
__decorate([
|
|
180
|
-
|
|
181
|
-
|
|
206
|
+
Input(),
|
|
207
|
+
tuiDefaultProp()
|
|
208
|
+
], TuiInputSliderComponent.prototype, "secondary", void 0);
|
|
182
209
|
TuiInputSliderComponent = TuiInputSliderComponent_1 = __decorate([
|
|
183
210
|
Component({
|
|
184
211
|
selector: 'tui-input-slider',
|
|
185
|
-
template: "<tui-
|
|
212
|
+
template: "<tui-input-number\n [min]=\"min\"\n [max]=\"max\"\n [precision]=\"precision\"\n [decimal]=\"decimal\"\n [prefix]=\"prefix\"\n [postfix]=\"postfix || (value | i18nPlural: pluralizeMap || pluralizeMapFallback)\"\n [tuiTextfieldCustomContent]=\"controller.customContent || deprecatedSecondary\"\n [tuiTextfieldSize]=\"computedSize\"\n [tuiTextfieldLabelOutside]=\"computedSize !== 'l'\"\n [readOnly]=\"readOnly\"\n [pseudoFocused]=\"computedFocused\"\n [pseudoHovered]=\"computedHovered\"\n [pseudoPressed]=\"computedPressed\"\n [pseudoInvalid]=\"pseudoInvalid\"\n [ngModel]=\"value\"\n (ngModelChange)=\"safelyUpdateValue($event)\"\n (focusedChange)=\"onFocused($event)\"\n (hoveredChange)=\"onHovered($event)\"\n (pressedChange)=\"onPressed($event)\"\n (keydown.arrowUp.prevent)=\"onVerticalArrowKeyDown(1)\"\n (keydown.arrowDown.prevent)=\"onVerticalArrowKeyDown(-1)\"\n>\n <ng-content></ng-content>\n <div\n *ngIf=\"computedValueContent && !focused\"\n polymorpheus-outlet\n automation-id=\"tui-input-slider__value-content\"\n [content]=\"computedValueContent\"\n [context]=\"{$implicit: value}\"\n ></div>\n</tui-input-number>\n\n<!--TODO: remove in v3.0-->\n<ng-template #deprecatedSecondary>{{secondary}}</ng-template>\n\n<!--TODO: remove wrapper + ticks labels (leave only slider) in v3.0-->\n<div class=\"t-slider-wrapper\">\n <input\n tuiSlider\n type=\"range\"\n [tuiFocusable]=\"false\"\n [max]=\"computedSteps\"\n [segments]=\"segments\"\n [keySteps]=\"computedKeySteps\"\n [attr.disabled]=\"readOnly || disabled || null\"\n [ngModel]=\"value\"\n (keyStepsInput)=\"safelyUpdateValue($event)\"\n (click)=\"focusTextInput()\"\n />\n\n <!--TODO delete ticks labels in v3.0-->\n <div *ngIf=\"segments && !isNew\" class=\"t-ticks-labels\">\n <span\n *tuiRepeatTimes=\"let tickIndex of segments + 1\"\n automation-id=\"tui-slider__segment\"\n >\n <span *ngIf=\"fromToTexts$ | async as fromToText\">\n {{ getTickPrefix(tickIndex, segments, fromToText) }} {{\n tickIndex | tuiSliderTickLabel:segments:computedKeySteps |\n tuiFormatNumber}}\n <span *ngIf=\"segmentsPluralizeMap\">\n {{ tickIndex | tuiSliderTickLabel:segments:computedKeySteps\n | i18nPlural: segmentsPluralizeMap }}\n </span>\n </span>\n </span>\n </div>\n</div>\n",
|
|
186
213
|
host: {
|
|
187
214
|
/**
|
|
188
215
|
* TODO delete it in v3.0
|
|
@@ -200,22 +227,42 @@ TuiInputSliderComponent = TuiInputSliderComponent_1 = __decorate([
|
|
|
200
227
|
HINT_CONTROLLER_PROVIDER,
|
|
201
228
|
TEXTFIELD_CONTROLLER_PROVIDER,
|
|
202
229
|
],
|
|
203
|
-
styles: [":host{position:relative;z-index:0;display:block
|
|
204
|
-
})
|
|
230
|
+
styles: [":host{position:relative;z-index:0;display:block}:host._segmented._show-ticks-labels{border-bottom:26px solid transparent}.t-slider-wrapper{position:absolute;top:100%;left:calc(var(--tui-radius-m)/ 2);right:0;margin:-.5625rem 0 0}input[type=range]{border-top-left-radius:0;border-bottom-left-radius:calc(var(--tui-radius-m) * 5) calc(var(--tui-radius-m) * 1.5)}.t-ticks-labels{display:flex;margin:0 .5rem;font:var(--tui-font-text-s);color:var(--tui-text-02)}.t-ticks-labels>*{position:relative;flex:2;text-align:center}.t-ticks-labels>:first-child{left:-.5rem;flex:1;text-align:left}.t-ticks-labels>:last-child{right:-.5rem;flex:1;text-align:right}tui-input-slider+.t-ticks-labels{margin-left:calc(var(--tui-radius-m)/ 2 + .5rem)}"]
|
|
231
|
+
})
|
|
232
|
+
/**
|
|
233
|
+
* TODO replace `extends AbstractTuiInputSlider<number>` by `extends AbstractTuiControl<number> implements TuiWithOptionalMinMax<number>`
|
|
234
|
+
* in v3.0
|
|
235
|
+
*/
|
|
236
|
+
,
|
|
205
237
|
__param(0, Optional()),
|
|
206
238
|
__param(0, Self()),
|
|
207
239
|
__param(0, Inject(NgControl)),
|
|
208
240
|
__param(1, Inject(ChangeDetectorRef)),
|
|
209
|
-
__param(2,
|
|
210
|
-
__param(
|
|
211
|
-
__param(
|
|
212
|
-
__param(
|
|
213
|
-
__param(5, Inject(
|
|
214
|
-
__param(6, Inject(TUI_TEXTFIELD_APPEARANCE)),
|
|
215
|
-
__param(7, Inject(TUI_FROM_TO_TEXTS)),
|
|
216
|
-
__param(8, Optional()),
|
|
217
|
-
__param(8, Inject(TuiNewInputSliderDirective))
|
|
241
|
+
__param(2, Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)),
|
|
242
|
+
__param(3, Inject(TUI_NUMBER_FORMAT)),
|
|
243
|
+
__param(4, Inject(TUI_FROM_TO_TEXTS)),
|
|
244
|
+
__param(5, Optional()),
|
|
245
|
+
__param(5, Inject(TuiNewInputSliderDirective))
|
|
218
246
|
], TuiInputSliderComponent);
|
|
247
|
+
function quantumAssertion(quantum) {
|
|
248
|
+
return quantum > 0;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* @deprecated helper for backward compatibility.
|
|
252
|
+
* TODO remove in v3.0
|
|
253
|
+
*/
|
|
254
|
+
function legacyMinMaxLabel({ min, max, minLabel, maxLabel }) {
|
|
255
|
+
return ({ $implicit: value }) => {
|
|
256
|
+
switch (value) {
|
|
257
|
+
case min:
|
|
258
|
+
return minLabel || value;
|
|
259
|
+
case max:
|
|
260
|
+
return maxLabel || value;
|
|
261
|
+
default:
|
|
262
|
+
return value;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
219
266
|
|
|
220
267
|
let TuiInputSliderModule = class TuiInputSliderModule {
|
|
221
268
|
};
|
|
@@ -238,6 +285,8 @@ TuiInputSliderModule = __decorate([
|
|
|
238
285
|
TuiFormatNumberPipeModule,
|
|
239
286
|
TuiRepeatTimesModule,
|
|
240
287
|
PolymorpheusModule,
|
|
288
|
+
TuiInputNumberModule,
|
|
289
|
+
TuiTextfieldControllerModule,
|
|
241
290
|
],
|
|
242
291
|
declarations: [TuiInputSliderComponent, TuiNewInputSliderDirective],
|
|
243
292
|
exports: [TuiInputSliderComponent, TuiNewInputSliderDirective],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-slider.js","sources":["ng://@taiga-ui/kit/components/input-slider/input-slider.component.ts","ng://@taiga-ui/kit/components/input-slider/input-slider.module.ts","ng://@taiga-ui/kit/components/input-slider/taiga-ui-kit-components-input-slider.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n ElementRef,\n forwardRef,\n HostBinding,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n isNativeFocused,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n HINT_CONTROLLER_PROVIDER,\n maskedMoneyValueIsEmpty,\n maskedNumberStringToNumber,\n NumberFormatSettings,\n TEXTFIELD_CONTROLLER_PROVIDER,\n TUI_HINT_WATCHED_CONTROLLER,\n TUI_NUMBER_FORMAT,\n TUI_TEXTFIELD_APPEARANCE,\n TUI_TEXTFIELD_WATCHED_CONTROLLER,\n TuiHintControllerDirective,\n TuiModeDirective,\n TuiTextfieldController,\n} from '@taiga-ui/core';\nimport {AbstractTuiInputSlider} from '@taiga-ui/kit/abstract';\nimport {\n TuiSliderComponent,\n tuiSliderOptionsProvider,\n} from '@taiga-ui/kit/components/slider';\nimport {TUI_FROM_TO_TEXTS} from '@taiga-ui/kit/tokens';\nimport {Observable} from 'rxjs';\n\n/**\n * Turn on new `InputSlider`'s version.\n * The new version will behave almost the same as `InputSlider` from the next major release.\n * @deprecated TODO remove me in v3.0 and make `InputSlider` always \"new\".\n */\n@Directive({\n selector: 'tui-input-slider[new]',\n})\nexport class TuiNewInputSliderDirective {}\n\n// @dynamic\n@Component({\n selector: 'tui-input-slider',\n templateUrl: './input-slider.template.html',\n styleUrls: ['./input-slider.style.less'],\n host: {\n /**\n * TODO delete it in v3.0\n * Dont forget to clear html-tags\n */\n '[class._show-ticks-labels]': '!isNew',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputSliderComponent),\n },\n tuiSliderOptionsProvider({trackColor: 'transparent'}),\n HINT_CONTROLLER_PROVIDER,\n TEXTFIELD_CONTROLLER_PROVIDER,\n ],\n})\nexport class TuiInputSliderComponent\n extends AbstractTuiInputSlider<number>\n implements TuiFocusableElementAccessor\n{\n @ViewChild('focusableElement')\n private readonly focusableElement?: ElementRef<HTMLInputElement>;\n\n @ViewChild(TuiSliderComponent, {read: ElementRef})\n private readonly sliderRef?: ElementRef<HTMLInputElement>;\n\n /**\n * @deprecated use `tuiTextfieldCustomContent` instead\n * TODO delete in v3.0\n */\n @Input()\n @tuiDefaultProp()\n secondary = '';\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Optional()\n @Inject(TuiModeDirective)\n protected readonly modeDirective: TuiModeDirective | null,\n @Inject(TUI_HINT_WATCHED_CONTROLLER)\n readonly hintController: TuiHintControllerDirective,\n @Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)\n readonly controller: TuiTextfieldController,\n @Inject(TUI_NUMBER_FORMAT)\n protected readonly numberFormat: NumberFormatSettings,\n @Inject(TUI_TEXTFIELD_APPEARANCE)\n readonly appearance: string,\n @Inject(TUI_FROM_TO_TEXTS) readonly fromToTexts$: Observable<[string, string]>,\n @Optional()\n @Inject(TuiNewInputSliderDirective)\n readonly isNew: TuiNewInputSliderDirective | null,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return !this.focusableElement || this.computedDisabled\n ? null\n : this.focusableElement.nativeElement;\n }\n\n get focused(): boolean {\n return (\n isNativeFocused(this.nativeFocusableElement) ||\n isNativeFocused(this.sliderRef?.nativeElement || null)\n );\n }\n\n @HostBinding('class._has-tooltip')\n get hasTooltip(): boolean {\n return !!this.hintController.content && !this.disabled;\n }\n\n @HostBinding('class._min-label')\n get showMinLabel(): boolean {\n return !this.focused && this.value === this.min && !!this.minLabel;\n }\n\n @HostBinding('class._max-label')\n get showMaxLabel(): boolean {\n return !this.focused && this.value === this.max && !!this.maxLabel;\n }\n\n get computedValue(): string {\n if (this.focused && this.isInputValueNotFinished) {\n return this.inputValue;\n }\n\n return this.formattedValue;\n }\n\n get showValue(): boolean {\n return !this.showMinLabel && !this.showMaxLabel;\n }\n\n get inputValue(): string {\n return this.focusableElement ? this.focusableElement.nativeElement.value : '';\n }\n\n set inputValue(value: string) {\n if (this.focusableElement) {\n this.focusableElement.nativeElement.value = value;\n }\n }\n\n focusTextInput() {\n if (this.focusableElement) {\n setNativeFocused(this.focusableElement.nativeElement);\n }\n }\n\n onKeyDownArrowUp(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(true);\n this.inputValue = this.formattedValue;\n }\n\n onKeyDownArrowDown(event: KeyboardEvent) {\n if (this.readOnly) {\n return;\n }\n\n event.preventDefault();\n this.processStep(false);\n this.inputValue = this.formattedValue;\n }\n\n onFocused(focused: boolean) {\n this.updateFocused(focused);\n\n if (focused) {\n return;\n }\n\n const inputValue = maskedNumberStringToNumber(\n this.computedValue,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n const value = isNaN(inputValue) ? this.min : this.valueGuard(inputValue);\n\n this.updateValue(value);\n this.inputValue = this.formattedValue;\n }\n\n onValue(value: string) {\n const capped = this.capInputValue(value);\n const postfix = value.slice(-1)[0] === ',' ? ',' : '';\n\n if (maskedMoneyValueIsEmpty(value) || capped === null) {\n return;\n }\n\n const newValue = this.formatNumber(capped) + postfix;\n\n if (value !== newValue) {\n this.inputValue = newValue;\n }\n\n this.updateValue(capped);\n }\n\n onSliderValue(value: number) {\n this.updateValue(this.valueGuard(value));\n this.inputValue = this.formattedValue;\n }\n\n protected getFallbackValue(): number {\n return 0;\n }\n\n private get formattedValue(): string {\n return this.formatNumber(this.value);\n }\n\n private get isInputValueNotFinished(): boolean {\n if (this.inputValue === '') {\n return true;\n }\n\n const nativeNumberValue = maskedNumberStringToNumber(\n this.inputValue,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n\n return nativeNumberValue < 0\n ? nativeNumberValue > this.max\n : nativeNumberValue < this.min;\n }\n\n private processStep(increment: boolean) {\n const value = this.valueGuard(\n increment ? this.value + this.step : this.value - this.step,\n );\n\n if (value !== this.value) {\n this.updateValue(value);\n }\n }\n\n private formatNumber(value: number): string {\n return formatNumber(\n value,\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiMapperPipeModule,\n TuiPressedModule,\n TuiRepeatTimesModule,\n} from '@taiga-ui/cdk';\nimport {\n TuiFormatNumberPipeModule,\n TuiTooltipModule,\n TuiWrapperModule,\n} from '@taiga-ui/core';\nimport {TuiSliderModule} from '@taiga-ui/kit/components/slider';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {\n TuiInputSliderComponent,\n TuiNewInputSliderDirective,\n} from './input-slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n TextMaskModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiPressedModule,\n TuiMapperPipeModule,\n TuiInputModeModule,\n TuiTooltipModule,\n TuiSliderModule,\n TuiWrapperModule,\n TuiFormatNumberPipeModule,\n TuiRepeatTimesModule,\n PolymorpheusModule,\n ],\n declarations: [TuiInputSliderComponent, TuiNewInputSliderDirective],\n exports: [TuiInputSliderComponent, TuiNewInputSliderDirective],\n})\nexport class TuiInputSliderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA8CA;;;;;IAQa,0BAA0B,GAAvC,MAAa,0BAA0B;EAAG;AAA7B,0BAA0B;IAHtC,SAAS,CAAC;QACP,QAAQ,EAAE,uBAAuB;KACpC,CAAC;GACW,0BAA0B,CAAG;AAE1C;IAuBa,uBAAuB,+BAApC,MAAa,uBACT,SAAQ,sBAA8B;IAiBtC,YAII,OAAyB,EACE,iBAAoC,EAG5C,aAAsC,EAEhD,cAA0C,EAE1C,UAAkC,EAExB,YAAkC,EAE5C,UAAkB,EACS,YAA0C,EAGrE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nB,kBAAkB;YAClB,gBAAgB;YAChB,eAAe;YACf,gBAAgB;YAChB,yBAAyB;YACzB,oBAAoB;YACpB,kBAAkB;SACrB;QACD,YAAY,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;QACnE,OAAO,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;KACjE,CAAC;GACW,oBAAoB,CAAG;;AChDpC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-input-slider.js","sources":["ng://@taiga-ui/kit/components/input-slider/input-slider.component.ts","ng://@taiga-ui/kit/components/input-slider/input-slider.module.ts","ng://@taiga-ui/kit/components/input-slider/taiga-ui-kit-components-input-slider.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n ElementRef,\n forwardRef,\n Inject,\n Input,\n Optional,\n Self,\n ViewChild,\n} from '@angular/core';\nimport {NgControl} from '@angular/forms';\nimport {\n clamp,\n isNativeFocused,\n round,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n tuiAssert,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {\n getFractionPartPadded,\n HINT_CONTROLLER_PROVIDER,\n NumberFormatSettings,\n TEXTFIELD_CONTROLLER_PROVIDER,\n TUI_NUMBER_FORMAT,\n TUI_TEXTFIELD_WATCHED_CONTROLLER,\n TuiDecimalT,\n TuiSizeL,\n TuiTextfieldController,\n} from '@taiga-ui/core';\nimport {AbstractTuiInputSlider} from '@taiga-ui/kit/abstract';\nimport {TuiInputNumberComponent} from '@taiga-ui/kit/components/input-number';\nimport {\n TuiSliderComponent,\n tuiSliderOptionsProvider,\n} from '@taiga-ui/kit/components/slider';\nimport {TUI_FLOATING_PRECISION} from '@taiga-ui/kit/constants';\nimport {TUI_FROM_TO_TEXTS} from '@taiga-ui/kit/tokens';\nimport {TuiKeySteps} from '@taiga-ui/kit/types';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\n/**\n * Turn on new `InputSlider`'s version.\n * The new version will behave almost the same as `InputSlider` from the next major release.\n * @deprecated TODO remove me in v3.0 and make `InputSlider` always \"new\".\n */\n@Directive({\n selector: 'tui-input-slider[new]',\n})\nexport class TuiNewInputSliderDirective {}\n\n// @dynamic\n@Component({\n selector: 'tui-input-slider',\n templateUrl: './input-slider.template.html',\n styleUrls: ['./input-slider.style.less'],\n host: {\n /**\n * TODO delete it in v3.0\n * Dont forget to clear html-tags\n */\n '[class._show-ticks-labels]': '!isNew',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiInputSliderComponent),\n },\n tuiSliderOptionsProvider({trackColor: 'transparent'}),\n HINT_CONTROLLER_PROVIDER,\n TEXTFIELD_CONTROLLER_PROVIDER,\n ],\n})\n/**\n * TODO replace `extends AbstractTuiInputSlider<number>` by `extends AbstractTuiControl<number> implements TuiWithOptionalMinMax<number>`\n * in v3.0\n */\nexport class TuiInputSliderComponent\n extends AbstractTuiInputSlider<number>\n implements TuiFocusableElementAccessor\n{\n @ViewChild(TuiInputNumberComponent)\n private readonly inputNumberRef?: TuiInputNumberComponent;\n\n @ViewChild(TuiSliderComponent, {read: ElementRef})\n private readonly sliderRef?: ElementRef<HTMLInputElement>;\n\n @Input()\n @tuiDefaultProp()\n min = 0;\n\n @Input()\n @tuiDefaultProp()\n max = Infinity;\n\n @Input()\n @tuiDefaultProp(quantumAssertion, 'Quantum must be positive')\n quantum = 1;\n\n @Input()\n @tuiDefaultProp()\n steps = 0;\n\n @Input()\n @tuiDefaultProp()\n segments = 0;\n\n @Input()\n @tuiDefaultProp()\n keySteps: TuiKeySteps | null = null;\n\n @Input()\n @tuiDefaultProp()\n valueContent: PolymorpheusContent<TuiContextWithImplicit<number>> = '';\n\n @Input()\n @tuiDefaultProp()\n prefix = '';\n\n @Input()\n @tuiDefaultProp()\n postfix = '';\n\n /**\n * @deprecated use `tuiTextfieldSize` instead\n * TODO delete in v3.0\n */\n @Input()\n @tuiDefaultProp()\n size: TuiSizeL = 'l';\n\n /**\n * @deprecated use `tuiTextfieldCustomContent` instead\n * TODO delete in v3.0\n */\n @Input()\n @tuiDefaultProp()\n secondary = '';\n\n constructor(\n @Optional()\n @Self()\n @Inject(NgControl)\n control: NgControl | null,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TUI_TEXTFIELD_WATCHED_CONTROLLER)\n readonly controller: TuiTextfieldController,\n @Inject(TUI_NUMBER_FORMAT)\n protected readonly numberFormat: NumberFormatSettings,\n @Inject(TUI_FROM_TO_TEXTS) readonly fromToTexts$: Observable<[string, string]>,\n @Optional()\n @Inject(TuiNewInputSliderDirective)\n readonly isNew: TuiNewInputSliderDirective | null,\n ) {\n super(control, changeDetectorRef);\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return !this.inputNumberRef?.nativeFocusableElement || this.computedDisabled\n ? null\n : this.inputNumberRef.nativeFocusableElement;\n }\n\n get focused(): boolean {\n return (\n isNativeFocused(this.nativeFocusableElement) ||\n isNativeFocused(this.sliderRef?.nativeElement || null)\n );\n }\n\n get computedSteps(): number {\n return this.steps || (this.max - this.min) / this.quantum;\n }\n\n get precision(): number {\n return getFractionPartPadded(this.quantum).length;\n }\n\n get decimal(): TuiDecimalT {\n return this.precision ? 'not-zero' : 'never';\n }\n\n /**\n * TODO remove old property `size` in v3.0\n */\n get computedSize(): TuiSizeL {\n if (this.isNew) {\n tuiAssert.assert(\n this.controller.size !== 's',\n \"Size 's' is not supported by this input.\",\n );\n\n return this.controller.size === 'l' ? 'l' : 'm';\n }\n\n return this.size;\n }\n\n /**\n * @deprecated for backward compatibility\n * TODO replace by just `this.valueContent` in v3.0\n */\n get computedValueContent(): PolymorpheusContent<TuiContextWithImplicit<number>> {\n return this.minLabel || this.maxLabel\n ? legacyMinMaxLabel(this)\n : this.valueContent;\n }\n\n focusTextInput() {\n const focusableElement = this.inputNumberRef?.nativeFocusableElement;\n\n if (focusableElement) {\n setNativeFocused(focusableElement);\n }\n }\n\n safelyUpdateValue(value: number | null) {\n this.updateValue(this.valueGuard(value ?? this.safeCurrentValue));\n }\n\n onVerticalArrowKeyDown(coefficient: number) {\n if (this.readOnly) {\n return;\n }\n\n const value = this.value + coefficient * this.step;\n\n if (value !== this.value) {\n this.safelyUpdateValue(value);\n }\n\n this.updateTextInputValue(this.valueGuard(value));\n }\n\n onFocused(focused: boolean) {\n if (!focused && !this.textInputValue) {\n this.updateTextInputValue(this.safeCurrentValue);\n }\n\n this.updateFocused(focused);\n }\n\n onPressed(pressed: boolean) {\n this.updatePressed(pressed);\n }\n\n onHovered(hovered: boolean) {\n this.updateHovered(hovered);\n }\n\n private get textInputValue(): string {\n return this.inputNumberRef?.nativeValue || '';\n }\n\n protected getFallbackValue(): number {\n return 0;\n }\n\n protected valueGuard(value: number): number {\n const roundedValue = round(\n Math.round(value / this.quantum) * this.quantum,\n TUI_FLOATING_PRECISION,\n );\n\n return clamp(roundedValue, this.min, this.max);\n }\n\n private updateTextInputValue(value: number) {\n if (this.inputNumberRef) {\n this.inputNumberRef.nativeValue =\n this.inputNumberRef.getFormattedValue(value);\n }\n }\n}\n\nfunction quantumAssertion(quantum: number): boolean {\n return quantum > 0;\n}\n\n/**\n * @deprecated helper for backward compatibility.\n * TODO remove in v3.0\n */\nfunction legacyMinMaxLabel({min, max, minLabel, maxLabel}: TuiInputSliderComponent) {\n return ({$implicit: value}: TuiContextWithImplicit<number>) => {\n switch (value) {\n case min:\n return minLabel || value;\n case max:\n return maxLabel || value;\n default:\n return value;\n }\n };\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiInputModeModule,\n TuiMapperPipeModule,\n TuiPressedModule,\n TuiRepeatTimesModule,\n} from '@taiga-ui/cdk';\nimport {\n TuiFormatNumberPipeModule,\n TuiTextfieldControllerModule,\n TuiTooltipModule,\n TuiWrapperModule,\n} from '@taiga-ui/core';\nimport {TuiInputNumberModule} from '@taiga-ui/kit/components/input-number';\nimport {TuiSliderModule} from '@taiga-ui/kit/components/slider';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\nimport {TextMaskModule} from 'angular2-text-mask';\n\nimport {\n TuiInputSliderComponent,\n TuiNewInputSliderDirective,\n} from './input-slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n TextMaskModule,\n TuiFocusableModule,\n TuiFocusedModule,\n TuiHoveredModule,\n TuiPressedModule,\n TuiMapperPipeModule,\n TuiInputModeModule,\n TuiTooltipModule,\n TuiSliderModule,\n TuiWrapperModule,\n TuiFormatNumberPipeModule,\n TuiRepeatTimesModule,\n PolymorpheusModule,\n TuiInputNumberModule,\n TuiTextfieldControllerModule,\n ],\n declarations: [TuiInputSliderComponent, TuiNewInputSliderDirective],\n exports: [TuiInputSliderComponent, TuiNewInputSliderDirective],\n})\nexport class TuiInputSliderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiDA;;;;;IAQa,0BAA0B,GAAvC,MAAa,0BAA0B;EAAG;AAA7B,0BAA0B;IAHtC,SAAS,CAAC;QACP,QAAQ,EAAE,uBAAuB;KACpC,CAAC;GACW,0BAA0B,CAAG;AAE1C;IA2Ba,uBAAuB;AAJpC;;;;AAIA,MAAa,uBACT,SAAQ,sBAA8B;IA6DtC,YAII,OAAyB,EACE,iBAAoC,EAEtD,UAAkC,EAExB,YAAkC,EACjB,YAA0C,EAGrE,KAAwC;QAEjD,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QARzB,eAAU,GAAV,UAAU,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CAAC,OAAe;IACrC,OAAO,OAAO,GAAG,CAAC,CAAC;AACvB,CAAC;AAED;;;;AAIA,SAAS,iBAAiB,CAAC,EAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAA0B;IAC9E,OAAO,CAAC,EAAC,SAAS,EAAE,KAAK,EAAiC;QACtD,QAAQ,KAAK;YACT,KAAK,GAAG;gBACJ,OAAO,QAAQ,IAAI,KAAK,CAAC;YAC7B,KAAK,GAAG;gBACJ,OAAO,QAAQ,IAAI,KAAK,CAAC;YAC7B;gBACI,OAAO,KAAK,CAAC;SACpB;KACJ,CAAC;AACN;;IC3Pa,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAxBhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,cAAc;YACd,kBAAkB;YAClB,gBAAgB;YAChB,gBAAgB;YAChB,gBAAgB;YAChB,mBAAmB;YACnB,kBAAkB;YAClB,gBAAgB;YAChB,eAAe;YACf,gBAAgB;YAChB,yBAAyB;YACzB,oBAAoB;YACpB,kBAAkB;YAClB,oBAAoB;YACpB,4BAA4B;SAC/B;QACD,YAAY,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;QACnE,OAAO,EAAE,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;KACjE,CAAC;GACW,oBAAoB,CAAG;;ACpDpC;;;;;;"}
|
|
@@ -410,7 +410,7 @@ TuiInputTagComponent = TuiInputTagComponent_1 = __decorate([
|
|
|
410
410
|
TEXTFIELD_CONTROLLER_PROVIDER,
|
|
411
411
|
HINT_CONTROLLER_PROVIDER,
|
|
412
412
|
],
|
|
413
|
-
styles: [":host{font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:block;border-radius:var(--tui-radius-m);text-align:left}:host[data-size='s']{height:var(--tui-height-s);min-height:var(--tui-height-s);max-height:var(--tui-height-s)}:host[data-size='m']{height:var(--tui-height-m);min-height:var(--tui-height-m);max-height:var(--tui-height-m)}:host[data-size='l']{height:var(--tui-height-l);min-height:var(--tui-height-l);max-height:var(--tui-height-l);font:var(--tui-font-text-m);line-height:1.25rem}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0;border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:solid transparent;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill-night) inset!important}.t-input :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-input{padding:0 var(--tui-padding-s)}.t-input :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-input{padding:0 var(--tui-padding-l)}.t-input :host-context(tui-primitive-textfield._disabled),.t-input :host-context(tui-text-area._disabled),:host._disabled .t-input{pointer-events:none}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='l']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='m']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-input{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-content{display:flex;height:100%;width:100%;padding:0 var(--tui-padding-m);box-sizing:border-box;align-items:center;overflow:hidden}:host[data-size='s'] .t-content{padding:0 var(--tui-padding-s)}:host[data-size='l'] .t-content{padding:0 var(--tui-padding-l)}.t-content:after{content:'';margin-right:-.25rem}:host[data-size='m'] .t-content:after{display:none}.t-wrapper{flex:1;min-width:0;-webkit-padding-end:.25rem;padding-inline-end:.25rem;-webkit-padding-start:0;padding-inline-start:0}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font:var(--tui-font-text-xs);transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused)._hovered .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused)._hovered .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-size='l']._focused._label-outside .t-placeholder,:host[data-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-size='l'] .t-placeholder{font-size:.9375rem}:host[data-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}@supports (-webkit-hyphens:none){.t-placeholder{transition-property:transform,color,letter-spacing}}.t-cleaner{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-cleaner:hover{color:var(--tui-text-02)}:host._disabled .t-cleaner,:host._readonly .t-cleaner{pointer-events:none}:host[data-mode=onDark] .t-cleaner{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-cleaner:hover{color:var(--tui-text-01-night)}.t-icon{display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03)}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}.t-icon_left{margin:0 .5rem 0 -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}:host[data-size='s'] .t-icon_left{margin-right:.25rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem}:host{cursor:text}:host._expandable{height:auto;max-height:none}:host._disabled{pointer-events:none}:host._readonly{cursor:default}.t-hosted{display:block;border-radius:inherit}.t-scrollbar{margin:0 -.25rem;padding:0 .25rem}.t-tags{display:flex;align-items:center;box-sizing:border-box}:host._expandable .t-tags{flex-wrap:wrap;white-space:normal}:host._readonly .t-tags{pointer-events:none}:host[data-size='s'] .t-tags{min-height:var(--tui-height-s);padding:.25rem .25rem .25rem 0}:host[data-size='m'] .t-tags{min-height:var(--tui-height-m);padding:.5rem .25rem .5rem 0}:host[data-size='l'] .t-tags{min-height:var(--tui-height-l);padding:.625rem .25rem .625rem 0}:host[data-size='m']:not(._label-outside) .t-tags{padding:1.1875rem 1rem 0 0}:host[data-size='l']:not(._label-outside) .t-tags{padding:1.6875rem 1rem .5625rem 0}.t-tags :host[data-size]{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:.25rem;padding-inline-end:.25rem}:host[data-size]:not(._label-outside) .t-tags{-webkit-padding-end:1rem;padding-inline-end:1rem}.t-content{align-items:flex-start}.t-icons{display:flex;align-items:center;padding:0 0 0 .75rem;-webkit-padding-start:.75rem;padding-inline-start:.75rem;-webkit-padding-end:0;padding-inline-end:0}.t-icons_left{padding:0;margin:0 .5rem 0 -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}:host._expandable .t-icons_right{margin:0 0 0 -.625rem;-webkit-margin-start:-.625rem;margin-inline-start:-.625rem;-webkit-margin-end:0;margin-inline-end:0}:host[data-size='s'] .t-icons{height:var(--tui-height-s)}:host[data-size='m'] .t-icons{height:var(--tui-height-m)}:host[data-size='l'] .t-icons{height:var(--tui-height-l)}.t-absolute-wrapper{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center}:host[data-size='m'] .t-absolute-wrapper{height:var(--tui-height-m)}:host[data-size='l'] .t-absolute-wrapper{height:var(--tui-height-l)}.t-wrapper{position:relative;padding:0}.t-tag{margin:.125rem .5rem .125rem -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem;max-width:100%;flex-shrink:0}.t-text:after{content:',\\00a0'}.t-text_disabled{color:var(--tui-text-03)}.t-text_error{color:var(--tui-negative)}:host:not(._expandable) .t-text{white-space:nowrap}:host:not(._focused) .t-text:last-of-type:after{content:''}.t-input-wrapper{position:relative;flex:1;max-width:100%}.t-input-wrapper_collapsed{flex:0;margin:0 0 0 -.5rem;-webkit-margin-start:-.5rem;margin-inline-start:-.5rem;-webkit-margin-end:0;margin-inline-end:0}:host[data-size='s'] .t-input-wrapper{min-height:1.5rem}:host[data-size='m'] .t-input-wrapper{min-height:calc(var(--tui-height-xs) + 2 * .125rem)}:host[data-size='l'] .t-input-wrapper{min-height:calc(var(--tui-height-s) + 2 * .125rem)}:host:not(._label-outside) .t-input-wrapper{min-height:1.25rem}.t-ghost{visibility:hidden;white-space:pre;text-overflow:clip;min-width:.125rem}:host:not(._expandable) .t-ghost{min-width:2rem}.t-native{border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;padding:0;cursor:inherit}.t-native:-webkit-autofill,.t-native:-webkit-autofill:focus,.t-native:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}.t-native_hidden{opacity:0;text-indent:-10em}.t-native::-ms-input-placeholder{color:var(--tui-text-03);opacity:0}.t-native::placeholder{color:var(--tui-text-03);opacity:0}:host[data-mode=onDark] .t-native::-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-native::placeholder{color:var(--tui-text-03-night)}:host._focused .t-native:not(:read-only)::-ms-input-placeholder{opacity:1}:host._focused .t-native:not(:-moz-read-only)::placeholder{opacity:1}:host._focused .t-native:not(:read-only)::placeholder{opacity:1}.t-error-icon{display:block;color:var(--tui-error-fill);width:1rem;height:1rem}"]
|
|
413
|
+
styles: [":host{font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:block;border-radius:var(--tui-radius-m);text-align:left}:host[data-size='s']{height:var(--tui-height-s);min-height:var(--tui-height-s);max-height:var(--tui-height-s)}:host[data-size='m']{height:var(--tui-height-m);min-height:var(--tui-height-m);max-height:var(--tui-height-m)}:host[data-size='l']{height:var(--tui-height-l);min-height:var(--tui-height-l);max-height:var(--tui-height-l);font:var(--tui-font-text-m);line-height:1.25rem}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0;border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:solid transparent;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-text-area[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill-night) inset!important}.t-input :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='s']):not(tui-text-area),:host[data-size='s'] .t-input{padding:0 var(--tui-padding-s)}.t-input :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),.t-input :host-context(tui-text-area[data-size='l']):not(tui-text-area),:host[data-size='l'] .t-input{padding:0 var(--tui-padding-l)}.t-input :host-context(tui-primitive-textfield._disabled),.t-input :host-context(tui-text-area._disabled),:host._disabled .t-input{pointer-events:none}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='l']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='m']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-input{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-content{display:flex;height:100%;width:100%;padding:0 var(--tui-padding-m);box-sizing:border-box;align-items:center;overflow:hidden}:host[data-size='s'] .t-content{padding:0 var(--tui-padding-s)}:host[data-size='l'] .t-content{padding:0 var(--tui-padding-l)}.t-content:after{content:'';margin-right:-.25rem}:host[data-size='m'] .t-content:after{display:none}.t-wrapper{flex:1;min-width:0;-webkit-padding-end:.25rem;padding-inline-end:.25rem;-webkit-padding-start:0;padding-inline-start:0}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font:var(--tui-font-text-xs);transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused):hover .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-size='l']._focused._label-outside .t-placeholder,:host[data-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-size='l'] .t-placeholder{font-size:.9375rem}:host[data-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}@supports (-webkit-hyphens:none){.t-placeholder{transition-property:transform,color,letter-spacing}}.t-cleaner{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-cleaner:hover{color:var(--tui-text-02)}:host._disabled .t-cleaner,:host._readonly .t-cleaner{pointer-events:none}:host[data-mode=onDark] .t-cleaner{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-cleaner:hover{color:var(--tui-text-01-night)}.t-icon{display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03)}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}.t-icon_left{margin:0 .5rem 0 -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}:host[data-size='s'] .t-icon_left{margin-right:.25rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem}:host{cursor:text}:host._expandable{height:auto;max-height:none}:host._disabled{pointer-events:none}:host._readonly{cursor:default}.t-hosted{display:block;border-radius:inherit}.t-scrollbar{margin:0 -.25rem;padding:0 .25rem}.t-tags{display:flex;align-items:center;box-sizing:border-box}:host._expandable .t-tags{flex-wrap:wrap;white-space:normal}:host._readonly .t-tags{pointer-events:none}:host[data-size='s'] .t-tags{min-height:var(--tui-height-s);padding:.25rem .25rem .25rem 0}:host[data-size='m'] .t-tags{min-height:var(--tui-height-m);padding:.5rem .25rem .5rem 0}:host[data-size='l'] .t-tags{min-height:var(--tui-height-l);padding:.625rem .25rem .625rem 0}:host[data-size='m']:not(._label-outside) .t-tags{padding:1.1875rem 1rem 0 0}:host[data-size='l']:not(._label-outside) .t-tags{padding:1.6875rem 1rem .5625rem 0}.t-tags :host[data-size]{-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:.25rem;padding-inline-end:.25rem}:host[data-size]:not(._label-outside) .t-tags{-webkit-padding-end:1rem;padding-inline-end:1rem}.t-content{align-items:flex-start}.t-icons{display:flex;align-items:center;padding:0 0 0 .75rem;-webkit-padding-start:.75rem;padding-inline-start:.75rem;-webkit-padding-end:0;padding-inline-end:0}.t-icons_left{padding:0;margin:0 .5rem 0 -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}:host._expandable .t-icons_right{margin:0 0 0 -.625rem;-webkit-margin-start:-.625rem;margin-inline-start:-.625rem;-webkit-margin-end:0;margin-inline-end:0}:host[data-size='s'] .t-icons{height:var(--tui-height-s)}:host[data-size='m'] .t-icons{height:var(--tui-height-m)}:host[data-size='l'] .t-icons{height:var(--tui-height-l)}.t-absolute-wrapper{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center}:host[data-size='m'] .t-absolute-wrapper{height:var(--tui-height-m)}:host[data-size='l'] .t-absolute-wrapper{height:var(--tui-height-l)}.t-wrapper{position:relative;padding:0}.t-tag{margin:.125rem .5rem .125rem -.25rem;-webkit-margin-start:-.25rem;margin-inline-start:-.25rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem;max-width:100%;flex-shrink:0}.t-text:after{content:',\\00a0'}.t-text_disabled{color:var(--tui-text-03)}.t-text_error{color:var(--tui-negative)}:host:not(._expandable) .t-text{white-space:nowrap}:host:not(._focused) .t-text:last-of-type:after{content:''}.t-input-wrapper{position:relative;flex:1;max-width:100%}.t-input-wrapper_collapsed{flex:0;margin:0 0 0 -.5rem;-webkit-margin-start:-.5rem;margin-inline-start:-.5rem;-webkit-margin-end:0;margin-inline-end:0}:host[data-size='s'] .t-input-wrapper{min-height:1.5rem}:host[data-size='m'] .t-input-wrapper{min-height:calc(var(--tui-height-xs) + 2 * .125rem)}:host[data-size='l'] .t-input-wrapper{min-height:calc(var(--tui-height-s) + 2 * .125rem)}:host:not(._label-outside) .t-input-wrapper{min-height:1.25rem}.t-ghost{visibility:hidden;white-space:pre;text-overflow:clip;min-width:.125rem}:host:not(._expandable) .t-ghost{min-width:2rem}.t-native{border:0;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;padding:0;cursor:inherit}.t-native:-webkit-autofill,.t-native:-webkit-autofill:focus,.t-native:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}.t-native_hidden{opacity:0;text-indent:-10em}.t-native::-ms-input-placeholder{color:var(--tui-text-03);opacity:0}.t-native::placeholder{color:var(--tui-text-03);opacity:0}:host[data-mode=onDark] .t-native::-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-native::placeholder{color:var(--tui-text-03-night)}:host._focused .t-native:not(:read-only)::-ms-input-placeholder{opacity:1}:host._focused .t-native:not(:-moz-read-only)::placeholder{opacity:1}:host._focused .t-native:not(:read-only)::placeholder{opacity:1}.t-error-icon{display:block;color:var(--tui-error-fill);width:1rem;height:1rem}"]
|
|
414
414
|
}),
|
|
415
415
|
__param(0, Optional()),
|
|
416
416
|
__param(0, Self()),
|