@vue-start/element-pro 0.2.1 → 0.2.2

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/dist/index.d.ts CHANGED
@@ -3,12 +3,13 @@ import { VNode, DefineComponent, ExtractPropTypes, PropType, Component } from 'v
3
3
  import * as element_plus from 'element-plus';
4
4
  import { FormItemProps, ButtonProps as ButtonProps$1, ElSelect } from 'element-plus';
5
5
  import { FormItemRule } from 'element-plus/es/tokens/form';
6
- import { TTableColumn, ProFormProps as ProFormProps$1, ProSearchFormProps as ProSearchFormProps$1, ProFormListProps as ProFormListProps$1, ProTableProps as ProTableProps$1, ProCurdAddOrEditProps, TPageState } from '@vue-start/pro';
6
+ import { TTableColumn, ProFormProps as ProFormProps$1, ProSearchFormProps as ProSearchFormProps$1, ProFormListProps as ProFormListProps$1, ProTableProps as ProTableProps$1, ProCurdAddOrEditProps, TPageState, TOptions as TOptions$1 } from '@vue-start/pro';
7
7
  import { FilterMethods, Filters } from 'element-plus/es/components/table/src/table-column/defaults';
8
8
  import { ColSizeObject } from 'element-plus/es/components/col/src/col';
9
9
  import * as element_plus_es_utils from 'element-plus/es/utils';
10
10
  import { TableProps } from 'element-plus/es/components/table/src/table/defaults';
11
11
  import { Slots } from '@vue/runtime-core';
12
+ import { RadioGroupProps } from 'element-plus/es/components/radio/src/radio-group';
12
13
 
13
14
  interface ModalProps {
14
15
  appendToBody?: boolean;
@@ -1088,4 +1089,16 @@ declare const ProSelect: vue.DefineComponent<any, {}, {}, {}, {}, vue.ComponentO
1088
1089
  [x: string]: any;
1089
1090
  }>;
1090
1091
 
1091
- export { ButtonProps, DescriptionsProps, ModalProps, PaginationProps, ProCurdDesc, ProCurdDescConnect, ProCurdForm, ProCurdFormConnect, ProCurdFormProps, ProCurdList, ProCurdListConnect, ProCurdListProps, ProCurdModal, ProCurdModalConnect, ProForm, ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormItem, ProFormItemProps, ProFormList, ProFormListProps, ProFormProps, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextNumber, ProFormTimePicker, ProFormTreeSelect, ProGrid, ProGridProps, ProLoading, ProLoadingProps, ProSearchForm, ProSearchFormProps, ProSelect, ProSelectProps, ProSubmitButton, ProTable, ProTableProps, createFormItemComponent, createLoadingId };
1092
+ declare const proRadioProps: () => {
1093
+ options: {
1094
+ type: PropType<TOptions$1>;
1095
+ };
1096
+ buttonStyle: {
1097
+ type: PropType<"default" | "button">;
1098
+ default: string;
1099
+ };
1100
+ };
1101
+ declare type ProRadioProps = Partial<ExtractPropTypes<ReturnType<typeof proRadioProps>>> & RadioGroupProps;
1102
+ declare const ProRadio: vue.DefineComponent<ProRadioProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<ProRadioProps>, {}>;
1103
+
1104
+ export { ButtonProps, DescriptionsProps, ModalProps, PaginationProps, ProCurdDesc, ProCurdDescConnect, ProCurdForm, ProCurdFormConnect, ProCurdFormProps, ProCurdList, ProCurdListConnect, ProCurdListProps, ProCurdModal, ProCurdModalConnect, ProForm, ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormItem, ProFormItemProps, ProFormList, ProFormListProps, ProFormProps, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextNumber, ProFormTimePicker, ProFormTreeSelect, ProGrid, ProGridProps, ProLoading, ProLoadingProps, ProRadio, ProRadioProps, ProSearchForm, ProSearchFormProps, ProSelect, ProSelectProps, ProSubmitButton, ProTable, ProTableProps, createFormItemComponent, createLoadingId };
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, createVNode, mergeProps, reactive, ref, toRaw, isVNode } from 'vue';
2
- import { ElRow, ElCol, ElLoading, ElFormItem, ElForm, ElSelect, ElOption, ElInput, ElInputNumber, ElDatePicker, ElTimePicker, ElTreeSelect, ElCheckboxGroup, ElRadioGroup, ElSwitch, ElCascader, ElButton, ElTable, ElTableColumn, ElPagination, ElDescriptions, ElDescriptionsItem, ElDialog } from 'element-plus';
2
+ import { ElRow, ElCol, ElLoading, ElFormItem, ElForm, ElSelect, ElOption, ElRadioGroup, ElRadioButton, ElRadio, ElInput, ElInputNumber, ElDatePicker, ElTimePicker, ElTreeSelect, ElCheckboxGroup, ElSwitch, ElCascader, ElButton, ElTable, ElTableColumn, ElPagination, ElDescriptions, ElDescriptionsItem, ElDialog } from 'element-plus';
3
3
  import { isString, keys, omit, map, get } from 'lodash';
4
4
  import { createGrid, generateId, createExpose, createForm, createSearchForm, createFormItemCompFn, useProForm, createFormList, createTable, createCurdForm, CurdCurrentMode, useProCurd, createCurdList, createCurdDesc, CurdAction } from '@vue-start/pro';
5
5
  import { useEffect, setReactiveValue } from '@vue-start/hooks';
@@ -277,7 +277,66 @@ var ProSelect = defineComponent({
277
277
  }, item), null);
278
278
  }), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
279
279
  }
280
- }, omit(props, "slots")));
280
+ }, omit(slots, "default")));
281
+ };
282
+ }
283
+ });
284
+
285
+ function _isSlot(s) {
286
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
287
+ }
288
+
289
+ var proRadioProps = function proRadioProps() {
290
+ return {
291
+ options: {
292
+ type: Array
293
+ },
294
+ buttonStyle: {
295
+ type: String,
296
+ "default": "default"
297
+ }
298
+ };
299
+ };
300
+
301
+ var ProRadio = defineComponent({
302
+ props: _objectSpread2(_objectSpread2({}, ElRadioGroup.props), proRadioProps()),
303
+ setup: function setup(props, _ref) {
304
+ var emit = _ref.emit;
305
+ var invalidKeys = keys(proRadioProps());
306
+ return function () {
307
+ var _slot;
308
+
309
+ return createVNode(ElRadioGroup, mergeProps(omit(props, invalidKeys), {
310
+ "onUpdate:modelValue": function onUpdateModelValue(v) {
311
+ emit("update:modelValue", v);
312
+ }
313
+ }), _isSlot(_slot = map(props.options, function (item) {
314
+ if (props.buttonStyle === "button") {
315
+ return createVNode(ElRadioButton, mergeProps({
316
+ "key": item.value
317
+ }, item, {
318
+ "label": item.value
319
+ }), {
320
+ "default": function _default() {
321
+ return [item.label];
322
+ }
323
+ });
324
+ }
325
+
326
+ return createVNode(ElRadio, mergeProps({
327
+ "key": item.value
328
+ }, item, {
329
+ "label": item.value
330
+ }), {
331
+ "default": function _default() {
332
+ return [item.label];
333
+ }
334
+ });
335
+ })) ? _slot : {
336
+ "default": function _default() {
337
+ return [_slot];
338
+ }
339
+ });
281
340
  };
282
341
  }
283
342
  });
@@ -318,7 +377,7 @@ var ProFormCheckbox = createFormItemComponent({
318
377
  name: "PFromCheckbox"
319
378
  });
320
379
  var ProFormRadio = createFormItemComponent({
321
- InputComp: ElRadioGroup,
380
+ InputComp: ProRadio,
322
381
  valueType: "radio",
323
382
  name: "PFromRadio"
324
383
  });
@@ -593,4 +652,4 @@ var ProCurdModalConnect = defineComponent({
593
652
  }
594
653
  });
595
654
 
596
- export { ProCurdDesc, ProCurdDescConnect, ProCurdForm, ProCurdFormConnect, ProCurdList, ProCurdListConnect, ProCurdModal, ProCurdModalConnect, ProForm, ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormItem, ProFormList, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextNumber, ProFormTimePicker, ProFormTreeSelect, ProGrid, ProLoading, ProSearchForm, ProSelect, ProSubmitButton, ProTable, createFormItemComponent, createLoadingId };
655
+ export { ProCurdDesc, ProCurdDescConnect, ProCurdForm, ProCurdFormConnect, ProCurdList, ProCurdListConnect, ProCurdModal, ProCurdModalConnect, ProForm, ProFormCascader, ProFormCheckbox, ProFormDatePicker, ProFormItem, ProFormList, ProFormRadio, ProFormSelect, ProFormSwitch, ProFormText, ProFormTextNumber, ProFormTimePicker, ProFormTreeSelect, ProGrid, ProLoading, ProRadio, ProSearchForm, ProSelect, ProSubmitButton, ProTable, createFormItemComponent, createLoadingId };
package/dist/index.js CHANGED
@@ -281,7 +281,66 @@ var ProSelect = vue.defineComponent({
281
281
  }, item), null);
282
282
  }), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
283
283
  }
284
- }, lodash.omit(props, "slots")));
284
+ }, lodash.omit(slots, "default")));
285
+ };
286
+ }
287
+ });
288
+
289
+ function _isSlot(s) {
290
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
291
+ }
292
+
293
+ var proRadioProps = function proRadioProps() {
294
+ return {
295
+ options: {
296
+ type: Array
297
+ },
298
+ buttonStyle: {
299
+ type: String,
300
+ "default": "default"
301
+ }
302
+ };
303
+ };
304
+
305
+ var ProRadio = vue.defineComponent({
306
+ props: _objectSpread2(_objectSpread2({}, elementPlus.ElRadioGroup.props), proRadioProps()),
307
+ setup: function setup(props, _ref) {
308
+ var emit = _ref.emit;
309
+ var invalidKeys = lodash.keys(proRadioProps());
310
+ return function () {
311
+ var _slot;
312
+
313
+ return vue.createVNode(elementPlus.ElRadioGroup, vue.mergeProps(lodash.omit(props, invalidKeys), {
314
+ "onUpdate:modelValue": function onUpdateModelValue(v) {
315
+ emit("update:modelValue", v);
316
+ }
317
+ }), _isSlot(_slot = lodash.map(props.options, function (item) {
318
+ if (props.buttonStyle === "button") {
319
+ return vue.createVNode(elementPlus.ElRadioButton, vue.mergeProps({
320
+ "key": item.value
321
+ }, item, {
322
+ "label": item.value
323
+ }), {
324
+ "default": function _default() {
325
+ return [item.label];
326
+ }
327
+ });
328
+ }
329
+
330
+ return vue.createVNode(elementPlus.ElRadio, vue.mergeProps({
331
+ "key": item.value
332
+ }, item, {
333
+ "label": item.value
334
+ }), {
335
+ "default": function _default() {
336
+ return [item.label];
337
+ }
338
+ });
339
+ })) ? _slot : {
340
+ "default": function _default() {
341
+ return [_slot];
342
+ }
343
+ });
285
344
  };
286
345
  }
287
346
  });
@@ -322,7 +381,7 @@ var ProFormCheckbox = createFormItemComponent({
322
381
  name: "PFromCheckbox"
323
382
  });
324
383
  var ProFormRadio = createFormItemComponent({
325
- InputComp: elementPlus.ElRadioGroup,
384
+ InputComp: ProRadio,
326
385
  valueType: "radio",
327
386
  name: "PFromRadio"
328
387
  });
@@ -620,6 +679,7 @@ exports.ProFormTimePicker = ProFormTimePicker;
620
679
  exports.ProFormTreeSelect = ProFormTreeSelect;
621
680
  exports.ProGrid = ProGrid;
622
681
  exports.ProLoading = ProLoading;
682
+ exports.ProRadio = ProRadio;
623
683
  exports.ProSearchForm = ProSearchForm;
624
684
  exports.ProSelect = ProSelect;
625
685
  exports.ProSubmitButton = ProSubmitButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-start/element-pro",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "> TODO: description",
5
5
  "author": "zx <zxpstudy@163.com>",
6
6
  "homepage": "https://github.com/zxeryu/vue-start#readme",
@@ -32,5 +32,5 @@
32
32
  "rxjs": ">=7.x",
33
33
  "vue": ">= 3.x"
34
34
  },
35
- "gitHead": "c075692298700095cc58c30d657ef48a2a47d7a4"
35
+ "gitHead": "adf3a978c60ccb84172c2287b67d2e5ead0d0dcf"
36
36
  }