{"version":3,"file":"select-group.mjs","sources":["../../../../../../packages/components/select-group/src/select-group.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\r\n\r\nimport { buildProps, definePropType } from '@ll-plus/utils'\r\n\r\nimport type SelectGroup from './select-group.vue'\r\n\r\nexport interface ISelectGroupItem {\r\n  name?: string\r\n  value?: any\r\n  [key: string]: any\r\n}\r\n\r\nexport const selectGroupFormType = [\r\n  'input',\r\n  'select',\r\n  'range-picker',\r\n  'treeSelect'\r\n] as const\r\n\r\nexport const selectGroupData = buildProps({\r\n  // buildProps和defineprops一样\r\n  /**\r\n   * @description 表单提示占位符\r\n   */\r\n  placeholder: {\r\n    type: String\r\n  },\r\n  /**\r\n   * @description 表单的字段 name\r\n   */\r\n  name: {\r\n    type: String,\r\n    required: true\r\n  },\r\n  /**\r\n   * @description 右边表单的 value\r\n   */\r\n  value: {\r\n    type: String,\r\n    required: true\r\n  },\r\n  /**\r\n   * @description SVG 图标的大小，size x size\r\n   */\r\n  showFormType: {\r\n    type: String,\r\n    values: selectGroupFormType\r\n  },\r\n  /**\r\n   * @description 格式化属性例如tree/select\r\n   */\r\n  fieldNames: {\r\n    type: definePropType<object>(Object)\r\n  },\r\n  /**\r\n   * @description select的options\r\n   */\r\n  options: {\r\n    type: definePropType<any[]>(Array)\r\n  },\r\n  /**\r\n   * @description 左侧选择的options\r\n   */\r\n  list: {\r\n    type: definePropType<ISelectGroupItem[]>(Array)\r\n  },\r\n  /**\r\n   * @description 是否在下拉框select最前面添加全部\r\n   */\r\n  noFirstAddAll: {\r\n    type: Boolean\r\n  }\r\n} as const)\r\nexport const selectGroupProps = buildProps({\r\n  /**\r\n   * @description 选中select中的某一项（和value对应）\r\n   */\r\n  selectValue: {\r\n    type: String\r\n  },\r\n  /**\r\n   * @description 右边表单的 value\r\n   */\r\n  value: {\r\n    type: [Array, String, Number, Boolean, Object],\r\n    default: undefined\r\n  },\r\n  /**\r\n   * @description select的options\r\n   */\r\n  data: {\r\n    type: definePropType<SelectGroupData[]>(Array),\r\n    default: () => []\r\n  }\r\n} as const)\r\n\r\nexport const selectGroupEmits = {\r\n  change: (selectV: string, value?: any) => !!selectV || !!value,\r\n  onSelectChange: (selectV: string, item: SelectGroupData) =>\r\n    !!selectV && !!item // 左侧selectchange\r\n}\r\n\r\nexport const LEFT_SELECT_MIN_WIDTH = 84 // 左侧select的宽度\r\n\r\n// props\r\nexport type SelectGroupProps = ExtractPropTypes<typeof selectGroupProps>\r\nexport type SelectGroupData = ExtractPropTypes<typeof selectGroupData>\r\nexport type SelectGroupFormType = SelectGroupData['showFormType']\r\n\r\nexport type SelectGroupEmits = typeof selectGroupEmits\r\n\r\n// instance\r\nexport type SelectGroupInstance = InstanceType<typeof SelectGroup>\r\n"],"names":[],"mappings":";;;;AAYO,MAAM,mBAAA,GAAsB;AAAA,EACjC,OAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF;AAEO,MAAM,kBAAkB,UAAA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA,EAKxC,WAAA,EAAa;AAAA,IACX,IAAA,EAAM;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,QAAA,EAAU;AAAA,GACZ;AAAA;AAAA;AAAA;AAAA,EAIA,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,QAAA,EAAU;AAAA,GACZ;AAAA;AAAA;AAAA;AAAA,EAIA,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,MAAA;AAAA,IACN,MAAA,EAAQ;AAAA,GACV;AAAA;AAAA;AAAA;AAAA,EAIA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,eAAuB,MAAM;AAAA,GACrC;AAAA;AAAA;AAAA;AAAA,EAIA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,eAAsB,KAAK;AAAA,GACnC;AAAA;AAAA;AAAA;AAAA,EAIA,IAAA,EAAM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