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AAC,CAAC;aACzG;QACL,CAAC;QAEO,gDAA0B,GAAlC;YACI,IAAI,CAAC,gBAAgB,GAAG,mDAAwB,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC9E,mDAAwB,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxD,CAAC;QACL,kBAAC;IAAD,CAtCA,AAsCC,CAtCwC,qBAAU,GAsClD;;IAED,IAAM,aAAa,GAAG,cAAc,CAAC;IACrC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACxC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,EAAE;QAClC,SAAS,EAAE,WAAW;QACtB,QAAQ,EAAE,EAAE,OAAO,EAAE,+CAAwC,aAAa,UAAO,EAAE;KACtF,CAAC,CAAC","file":"input-select.js","sourcesContent":["import * as ko from \"knockout\";\nimport * as localisationHelper from \"localisationHelper\";\n\nimport \"@legend/knockout/binding/id\";\r\nimport \"@legend/knockout/binding/overriddenByTemplate\";\n\n// Models\nimport { SelectDropdownOptions } from \"Content/ts/Models/Controls/inputSelectOptions\";\n\nimport InputsBase, { IInputsBase } from \"Content/ts/Shared/Inputs/inputs-base\";\r\n\n// Services\nimport { UniqueIdentifierServices } from \"Content/ts/Shared/KnockoutBindings/Services/uniqueIdentifierServices\";\n\nexport const Deps = {\n LocalisationHelper: localisationHelper\n}\n\nexport interface IInputSelect extends IInputsBase {\n PlaceholderMessage: string; // Optional\n TestId: string; // Optional\n ShowCaption: boolean; // Optional\n ShowLabel: boolean; // Optional\n AriaLabel: string; // Optional\n AriaDescribedById: string; // Optional\n ElementId: string; // Optional (Allows the html id attribute to be set)\n\n Options: Array | KnockoutObservableArray; // Required\n}\n\nexport default class InputSelect extends InputsBase {\n placeholderMessage: string;\n testId: string;\n showCaption: boolean;\n showLabel: boolean;\n ariaLabel: string;\n ariaDescribedById: string;\n uniqueIdentifier: string;\n options: Array | KnockoutObservableArray;\n\n constructor(params: IInputSelect) {\n super(params);\n\n // Provided Component Properties\n this.options = params.Options;\n this.ariaDescribedById = params.AriaDescribedById || \"\";\n this.placeholderMessage = params.PlaceholderMessage || Deps.LocalisationHelper.getString(\"GenericResources\", \"StandardSelectDefaultPlaceholderMessage\");\n this.testId = params.TestId ?? '';\n this.showCaption = params.ShowCaption ?? true;\n this.showLabel = params.ShowLabel ?? true;\n this.ariaLabel = params.AriaLabel;\n this.uniqueIdentifier = params.ElementId ?? '';\n if (!this.uniqueIdentifier) {\n // auto generate the id if no custom element id has been passed in\n this.configureUniqueIdentifiers();\r\n }\n }\n\n setOptionBindings(option: Node, item: SelectDropdownOptions) {\n if (this.testId) {\n ko.applyBindingsToNode(option, { TestId: [this.testId, item ? item.Id || '' : 'placeholder'] }, item);\n }\n }\n\n private configureUniqueIdentifiers(): void {\n this.uniqueIdentifier = UniqueIdentifierServices.AddNewIdentifier(this.value);\n UniqueIdentifierServices.RemoveLinkHash(this.value);\n }\n}\n\nconst componentName = \"input-select\";\nko.components.unregister(componentName);\nko.components.register(componentName, {\n viewModel: InputSelect,\n template: { require: `text!Content/ts/Shared/Inputs/Select/${componentName}.html` }\n});"]}