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AAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC;oBACvE,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC;iBACxE,CAAC;gBAEF,OAAO,cAAc,CAAC;YACxB,CAAC;YACD,SAAS;gBACP,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACzD,CAAC;YACD,QAAQ;gBACN,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAC9B,CAAC;YACD,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;gBACpC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YACxD,CAAC;SACF,CAAC;IAOJ,CAAC;IALC,mBAAmB;IACnB,KAAK;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF,CAAA;AAjEoB,MAAM;IAD1B,WAAW,EAAE;GACO,MAAM,CAiE1B;eAjEoB,MAAM","file":"picker.js","sourcesContent":["import { SuperComponent, wxComponent } from '../common/src/index';\nimport config from '../common/config';\nimport props from './props';\n\nconst { prefix } = config;\nconst name = `${prefix}-picker`;\n\n@wxComponent()\nexport default class Picker extends SuperComponent {\n /**\n * Component properties\n */\n properties = props;\n\n externalClasses = ['t-class', 't-class-confirm', 't-class-cancel', 't-class-title'];\n\n options = {\n multipleSlots: true,\n };\n\n relations = {\n './picker-column': {\n type: 'child' as 'child',\n },\n };\n\n /**\n * Component initial data\n */\n data = {\n classPrefix: name,\n };\n\n /**\n * Component methods\n */\n methods = {\n getPickerColumns() {\n const pickerColumns = this.getRelationNodes('./picker-column');\n if (Array.isArray(pickerColumns)) {\n return pickerColumns;\n }\n return [];\n },\n getSelectedValues() {\n const pickerColumns = this.getPickerColumns();\n if (pickerColumns?.length === 0) {\n return { index: undefined, value: undefined };\n }\n\n const selectedValues = {\n index: pickerColumns.map((pickerColumn) => pickerColumn._selectedIndex),\n value: pickerColumns.map((pickerColumn) => pickerColumn._selectedValue),\n };\n\n return selectedValues;\n },\n onConfirm() {\n this.triggerEvent('confirm', this.getSelectedValues());\n },\n onCancel() {\n this.triggerEvent('cancel');\n },\n triggerChange({ column, index, value }) {\n this.triggerEvent('change', { column, index, value });\n },\n };\n\n // 给 column 打标 标识顺序\n ready() {\n const columns = this.getPickerColumns();\n columns.map((column, index) => (column.columnIndex = index));\n }\n}\n"]}