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IAAI,CAAC,IAAI,EAAC;YACZ,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;SAChC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;IAEF,gBAAC;AAAD,CAAC,AAtFD,CAA+B,KAAK,GAsFnC;;AAED;;;;;GAKG;AACH,QAAQ,CAAC,iBAAiB,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC","sourcesContent":["/**\r\n * Axis Label module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Label, ILabelProperties, ILabelAdapters, ILabelEvents } from \"../../core/elements/Label\";\r\nimport { AxisItemLocation, AxisDataItem, Axis } from \"./Axis\";\r\nimport { registry } from \"../../core/Registry\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[AxisLabel]].\r\n */\r\nexport interface IAxisLabelProperties extends ILabelProperties {\r\n\r\n\t/**\r\n\t * Relative location of the label. (0-1)\r\n\t */\r\n\tlocation?: number;\r\n\r\n\t/**\r\n\t * Draw the label on the inside of the Axis?\r\n\t */\r\n\tinside?: boolean;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[AxisLabel]].\r\n */\r\nexport interface IAxisLabelEvents extends ILabelEvents { }\r\n\r\n/**\r\n * Defines adapters for [[AxisLabel]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IAxisLabelAdapters extends ILabelAdapters, IAxisLabelProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Use to create labels on Axis.\r\n *\r\n * @see {@link IAxisLabelEvents} for a list of available events\r\n * @see {@link IAxisLabelAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nexport class AxisLabel extends Label {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IAxisLabelProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IAxisLabelAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IAxisLabelEvents;\r\n\r\n\t/**\r\n\t * Related data item.\r\n\t */\r\n\tpublic _dataItem: AxisDataItem;\r\n\r\n\t/**\r\n\t * A referecent to Axis element this fill is applied to.\r\n\t */\r\n\tpublic axis: Axis;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"AxisLabel\";\r\n\t\tthis.isMeasured = false;\r\n\t\tthis.padding(10, 10, 10, 10);\r\n\t\tthis.location = 0.5;\r\n\t\t//this.nonScaling = true; // not good for perf\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Relative location of the label. (0-1)\r\n\t *\r\n\t * @param value Location (0-1)\r\n\t */\r\n\tpublic set location(value: AxisItemLocation) {\r\n\t\tthis.setPropertyValue(\"location\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Location (0-1)\r\n\t */\r\n\tpublic get location(): AxisItemLocation {\r\n\t\treturn this.getPropertyValue(\"location\");\r\n\t}\r\n\r\n\t/**\r\n\t * Sets if label should be drawn inside axis.\r\n\t *\r\n\t * @param value Inside?\r\n\t */\r\n\tpublic set inside(value: boolean) {\r\n\t\tthis.setPropertyValue(\"inside\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns if label is set to be drawn inside axis.\r\n\t *\r\n\t * @return Inside?\r\n\t */\r\n\tpublic get inside(): boolean {\r\n\t\treturn this.getPropertyValue(\"inside\");\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * @ignore\r\n\t */\r\n\tprotected setDisabled(value: boolean):boolean {\r\n\t\tlet changed = super.setDisabled(value);\r\n\t\tif(this.axis){\r\n\t\t\tthis.axis.invalidateDataItems();\r\n\t\t}\r\n\t\treturn changed;\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLabel\"] = AxisLabel;\r\n"]}
\No newline at end of file