@vrojs/element-plus 0.0.2 → 0.0.3
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 +16 -0
- package/dist/index.js +88 -0
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/index.js +7 -0
- package/dist/locale/lang/zh-cn.d.ts +47 -0
- package/dist/locale/lang/zh-cn.js +49 -0
- package/dist/locale/types.d.ts +7 -0
- package/dist/locale/types.js +1 -0
- package/dist/locale/useLocale.d.ts +53 -0
- package/dist/locale/useLocale.js +24 -0
- package/dist/style/css.js +4 -0
- package/dist/style/deps.js +26 -0
- package/dist/style/index.css +1 -0
- package/dist/style/index.d.ts +0 -0
- package/dist/style/index.js +30 -0
- package/dist/utils/datePickerValueFormat.d.ts +1 -0
- package/dist/utils/datePickerValueFormat.js +9 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +6 -0
- package/dist/vro-el-checkbox-group/index.d.ts +122 -0
- package/dist/vro-el-checkbox-group/index.js +9 -0
- package/dist/vro-el-checkbox-group/style/css.d.ts +0 -0
- package/dist/vro-el-checkbox-group/style/css.js +3 -0
- package/dist/vro-el-checkbox-group/style/deps.d.ts +0 -0
- package/dist/vro-el-checkbox-group/style/deps.js +2 -0
- package/dist/vro-el-checkbox-group/style/index.d.ts +0 -0
- package/dist/vro-el-checkbox-group/style/index.js +5 -0
- package/dist/vro-el-checkbox-group/types.d.ts +50 -0
- package/dist/vro-el-checkbox-group/types.js +16 -0
- package/dist/vro-el-checkbox-group/vro-el-checkbox-group.vue.d.ts +115 -0
- package/dist/vro-el-checkbox-group/vro-el-checkbox-group.vue.js +34 -0
- package/dist/vro-el-checkbox-group/vro-el-checkbox-group.vue2.js +4 -0
- package/dist/vro-el-config-provider/index.d.ts +46 -0
- package/dist/vro-el-config-provider/index.js +9 -0
- package/dist/vro-el-config-provider/style/css.d.ts +0 -0
- package/dist/vro-el-config-provider/style/css.js +3 -0
- package/dist/vro-el-config-provider/style/deps.d.ts +0 -0
- package/dist/vro-el-config-provider/style/deps.js +1 -0
- package/dist/vro-el-config-provider/style/index.d.ts +0 -0
- package/dist/vro-el-config-provider/style/index.js +3 -0
- package/dist/vro-el-config-provider/types.d.ts +14 -0
- package/dist/vro-el-config-provider/types.js +13 -0
- package/dist/vro-el-config-provider/vro-el-config-provider.vue.d.ts +29 -0
- package/dist/vro-el-config-provider/vro-el-config-provider.vue.js +17 -0
- package/dist/vro-el-config-provider/vro-el-config-provider.vue2.js +4 -0
- package/dist/vro-el-file-upload/index.d.ts +44 -0
- package/dist/vro-el-file-upload/index.js +12 -0
- package/dist/vro-el-file-upload/style/css.d.ts +0 -0
- package/dist/vro-el-file-upload/style/css.js +4 -0
- package/dist/vro-el-file-upload/style/deps.d.ts +0 -0
- package/dist/vro-el-file-upload/style/deps.js +2 -0
- package/dist/vro-el-file-upload/style/index.css +1 -0
- package/dist/vro-el-file-upload/style/index.d.ts +0 -0
- package/dist/vro-el-file-upload/style/index.js +6 -0
- package/dist/vro-el-file-upload/types.d.ts +39 -0
- package/dist/vro-el-file-upload/types.js +35 -0
- package/dist/vro-el-file-upload/utils.d.ts +2 -0
- package/dist/vro-el-file-upload/utils.js +6 -0
- package/dist/vro-el-file-upload/vro-el-file-upload.vue.d.ts +36 -0
- package/dist/vro-el-file-upload/vro-el-file-upload.vue.js +86 -0
- package/dist/vro-el-file-upload/vro-el-file-upload.vue2.js +4 -0
- package/dist/vro-el-icon/index.d.ts +82 -0
- package/dist/vro-el-icon/index.js +9 -0
- package/dist/vro-el-icon/style/css.d.ts +0 -0
- package/dist/vro-el-icon/style/css.js +3 -0
- package/dist/vro-el-icon/style/deps.d.ts +0 -0
- package/dist/vro-el-icon/style/deps.js +1 -0
- package/dist/vro-el-icon/style/index.d.ts +0 -0
- package/dist/vro-el-icon/style/index.js +4 -0
- package/dist/vro-el-icon/types.d.ts +20 -0
- package/dist/vro-el-icon/types.js +11 -0
- package/dist/vro-el-icon/vro-el-icon.vue.d.ts +53 -0
- package/dist/vro-el-icon/vro-el-icon.vue.js +33 -0
- package/dist/vro-el-icon/vro-el-icon.vue2.js +4 -0
- package/dist/vro-el-image-upload/index.d.ts +50 -0
- package/dist/vro-el-image-upload/index.js +12 -0
- package/dist/vro-el-image-upload/style/css.d.ts +0 -0
- package/dist/vro-el-image-upload/style/css.js +4 -0
- package/dist/vro-el-image-upload/style/deps.d.ts +0 -0
- package/dist/vro-el-image-upload/style/deps.js +4 -0
- package/dist/vro-el-image-upload/style/index.css +1 -0
- package/dist/vro-el-image-upload/style/index.d.ts +0 -0
- package/dist/vro-el-image-upload/style/index.js +8 -0
- package/dist/vro-el-image-upload/types.d.ts +38 -0
- package/dist/vro-el-image-upload/types.js +25 -0
- package/dist/vro-el-image-upload/utils.d.ts +2 -0
- package/dist/vro-el-image-upload/utils.js +6 -0
- package/dist/vro-el-image-upload/vro-el-image-upload.vue.d.ts +42 -0
- package/dist/vro-el-image-upload/vro-el-image-upload.vue.js +126 -0
- package/dist/vro-el-image-upload/vro-el-image-upload.vue2.js +4 -0
- package/dist/vro-el-radio-group/index.d.ts +79 -0
- package/dist/vro-el-radio-group/index.js +9 -0
- package/dist/vro-el-radio-group/style/css.d.ts +0 -0
- package/dist/vro-el-radio-group/style/css.js +3 -0
- package/dist/vro-el-radio-group/style/deps.d.ts +0 -0
- package/dist/vro-el-radio-group/style/deps.js +2 -0
- package/dist/vro-el-radio-group/style/index.d.ts +0 -0
- package/dist/vro-el-radio-group/style/index.js +5 -0
- package/dist/vro-el-radio-group/types.d.ts +38 -0
- package/dist/vro-el-radio-group/types.js +25 -0
- package/dist/vro-el-radio-group/vro-el-radio-group.vue.d.ts +72 -0
- package/dist/vro-el-radio-group/vro-el-radio-group.vue.js +34 -0
- package/dist/vro-el-radio-group/vro-el-radio-group.vue2.js +4 -0
- package/dist/vro-el-schema-filter/index.d.ts +596 -0
- package/dist/vro-el-schema-filter/index.js +9 -0
- package/dist/vro-el-schema-filter/style/css.d.ts +0 -0
- package/dist/vro-el-schema-filter/style/css.js +16 -0
- package/dist/vro-el-schema-filter/style/deps.d.ts +0 -0
- package/dist/vro-el-schema-filter/style/deps.js +22 -0
- package/dist/vro-el-schema-filter/style/index.css +1 -0
- package/dist/vro-el-schema-filter/style/index.d.ts +0 -0
- package/dist/vro-el-schema-filter/style/index.js +38 -0
- package/dist/vro-el-schema-filter/types.d.ts +41 -0
- package/dist/vro-el-schema-filter/types.js +26 -0
- package/dist/vro-el-schema-filter/vro-el-schema-filter.vue.d.ts +983 -0
- package/dist/vro-el-schema-filter/vro-el-schema-filter.vue.js +71 -0
- package/dist/vro-el-schema-filter/vro-el-schema-filter.vue2.js +4 -0
- package/dist/vro-el-schema-form/defineVroElSchemaFormCreateField.d.ts +2 -0
- package/dist/vro-el-schema-form/defineVroElSchemaFormCreateField.js +9 -0
- package/dist/vro-el-schema-form/defineVroElSchemaFormFieldTrigger.d.ts +9 -0
- package/dist/vro-el-schema-form/defineVroElSchemaFormFieldTrigger.js +6 -0
- package/dist/vro-el-schema-form/index.d.ts +563 -0
- package/dist/vro-el-schema-form/index.js +17 -0
- package/dist/vro-el-schema-form/style/css.d.ts +0 -0
- package/dist/vro-el-schema-form/style/css.js +14 -0
- package/dist/vro-el-schema-form/style/deps.d.ts +0 -0
- package/dist/vro-el-schema-form/style/deps.js +22 -0
- package/dist/vro-el-schema-form/style/index.css +1 -0
- package/dist/vro-el-schema-form/style/index.d.ts +0 -0
- package/dist/vro-el-schema-form/style/index.js +36 -0
- package/dist/vro-el-schema-form/types.d.ts +114 -0
- package/dist/vro-el-schema-form/types.js +42 -0
- package/dist/vro-el-schema-form/useVroElSchemaForm.d.ts +908 -0
- package/dist/vro-el-schema-form/useVroElSchemaForm.js +31 -0
- package/dist/vro-el-schema-form/vro-el-schema-form.vue.d.ts +391 -0
- package/dist/vro-el-schema-form/vro-el-schema-form.vue.js +120 -0
- package/dist/vro-el-schema-form/vro-el-schema-form.vue2.js +4 -0
- package/dist/vro-el-schema-form/vroElSchemaFormFieldManager.d.ts +2 -0
- package/dist/vro-el-schema-form/vroElSchemaFormFieldManager.js +32 -0
- package/dist/vro-el-schema-form-dialog/function-call.d.ts +3 -0
- package/dist/vro-el-schema-form-dialog/function-call.js +17 -0
- package/dist/vro-el-schema-form-dialog/index.d.ts +2182 -0
- package/dist/vro-el-schema-form-dialog/index.js +18 -0
- package/dist/vro-el-schema-form-dialog/injection.d.ts +9 -0
- package/dist/vro-el-schema-form-dialog/injection.js +9 -0
- package/dist/vro-el-schema-form-dialog/style/css.d.ts +0 -0
- package/dist/vro-el-schema-form-dialog/style/css.js +18 -0
- package/dist/vro-el-schema-form-dialog/style/deps.d.ts +0 -0
- package/dist/vro-el-schema-form-dialog/style/deps.js +24 -0
- package/dist/vro-el-schema-form-dialog/style/index.css +1 -0
- package/dist/vro-el-schema-form-dialog/style/index.d.ts +0 -0
- package/dist/vro-el-schema-form-dialog/style/index.js +42 -0
- package/dist/vro-el-schema-form-dialog/types.d.ts +79 -0
- package/dist/vro-el-schema-form-dialog/types.js +59 -0
- package/dist/vro-el-schema-form-dialog/useVroElSchemaFormDialog.d.ts +14 -0
- package/dist/vro-el-schema-form-dialog/useVroElSchemaFormDialog.js +18 -0
- package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.d.ts +1794 -0
- package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.js +135 -0
- package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue2.js +4 -0
- package/dist/vro-el-select/index.d.ts +259 -0
- package/dist/vro-el-select/index.js +9 -0
- package/dist/vro-el-select/style/css.d.ts +0 -0
- package/dist/vro-el-select/style/css.js +3 -0
- package/dist/vro-el-select/style/deps.d.ts +0 -0
- package/dist/vro-el-select/style/deps.js +2 -0
- package/dist/vro-el-select/style/index.d.ts +0 -0
- package/dist/vro-el-select/style/index.js +5 -0
- package/dist/vro-el-select/types.d.ts +105 -0
- package/dist/vro-el-select/types.js +16 -0
- package/dist/vro-el-select/vro-el-select.vue.d.ts +252 -0
- package/dist/vro-el-select/vro-el-select.vue.js +30 -0
- package/dist/vro-el-select/vro-el-select.vue2.js +4 -0
- package/dist/vro-el-skeleton/index.d.ts +154 -0
- package/dist/vro-el-skeleton/index.js +9 -0
- package/dist/vro-el-skeleton/style/css.d.ts +0 -0
- package/dist/vro-el-skeleton/style/css.js +5 -0
- package/dist/vro-el-skeleton/style/deps.d.ts +0 -0
- package/dist/vro-el-skeleton/style/deps.js +3 -0
- package/dist/vro-el-skeleton/style/index.css +1 -0
- package/dist/vro-el-skeleton/style/index.d.ts +0 -0
- package/dist/vro-el-skeleton/style/index.js +8 -0
- package/dist/vro-el-skeleton/types.d.ts +72 -0
- package/{src/vro-el-skeleton/types.ts → dist/vro-el-skeleton/types.js} +15 -29
- package/dist/vro-el-skeleton/vro-el-skeleton.vue.d.ts +95 -0
- package/dist/vro-el-skeleton/vro-el-skeleton.vue.js +85 -0
- package/dist/vro-el-skeleton/vro-el-skeleton.vue2.js +4 -0
- package/dist/vro-el-tags/index.d.ts +223 -0
- package/dist/vro-el-tags/index.js +9 -0
- package/dist/vro-el-tags/style/css.d.ts +0 -0
- package/dist/vro-el-tags/style/css.js +3 -0
- package/dist/vro-el-tags/style/deps.d.ts +0 -0
- package/dist/vro-el-tags/style/deps.js +3 -0
- package/dist/vro-el-tags/style/index.d.ts +0 -0
- package/dist/vro-el-tags/style/index.js +6 -0
- package/dist/vro-el-tags/types.d.ts +18 -0
- package/dist/vro-el-tags/types.js +19 -0
- package/dist/vro-el-tags/vro-el-tags.vue.d.ts +217 -0
- package/dist/vro-el-tags/vro-el-tags.vue.js +62 -0
- package/dist/vro-el-tags/vro-el-tags.vue2.js +4 -0
- package/dist/vro-el-tree/index.d.ts +86 -0
- package/dist/vro-el-tree/index.js +9 -0
- package/dist/vro-el-tree/style/css.d.ts +0 -0
- package/dist/vro-el-tree/style/css.js +4 -0
- package/dist/vro-el-tree/style/deps.d.ts +0 -0
- package/dist/vro-el-tree/style/deps.js +1 -0
- package/dist/vro-el-tree/style/index.css +1 -0
- package/dist/vro-el-tree/style/index.d.ts +0 -0
- package/dist/vro-el-tree/style/index.js +5 -0
- package/dist/vro-el-tree/types.d.ts +32 -0
- package/dist/vro-el-tree/types.js +26 -0
- package/dist/vro-el-tree/vro-el-tree.vue.d.ts +52 -0
- package/dist/vro-el-tree/vro-el-tree.vue.js +56 -0
- package/dist/vro-el-tree/vro-el-tree.vue2.js +4 -0
- package/dist/vro-el-with-config/index.d.ts +32 -0
- package/dist/vro-el-with-config/index.js +9 -0
- package/dist/vro-el-with-config/style/css.d.ts +0 -0
- package/dist/vro-el-with-config/style/css.js +4 -0
- package/dist/vro-el-with-config/style/deps.d.ts +0 -0
- package/dist/vro-el-with-config/style/deps.js +1 -0
- package/dist/vro-el-with-config/style/index.d.ts +0 -0
- package/dist/vro-el-with-config/style/index.js +5 -0
- package/dist/vro-el-with-config/types.d.ts +15 -0
- package/dist/vro-el-with-config/types.js +14 -0
- package/dist/vro-el-with-config/vro-el-with-config.vue.d.ts +25 -0
- package/dist/vro-el-with-config/vro-el-with-config.vue.js +32 -0
- package/dist/vro-el-with-config/vro-el-with-config.vue2.js +4 -0
- package/package.json +18 -12
- package/src/index.ts +0 -18
- package/src/locale/index.ts +0 -3
- package/src/locale/lang/zh-cn.ts +0 -46
- package/src/locale/types.ts +0 -8
- package/src/locale/useLocale.ts +0 -42
- package/src/style/base.scss +0 -2
- package/src/style/css.ts +0 -2
- package/src/style/deps.ts +0 -14
- package/src/style/index.scss +0 -17
- package/src/style/index.ts +0 -2
- package/src/utils/datePickerValueFormat.ts +0 -6
- package/src/utils/index.ts +0 -2
- package/src/vro-el-checkbox-group/README.md +0 -83
- package/src/vro-el-checkbox-group/index.ts +0 -16
- package/src/vro-el-checkbox-group/style/css.ts +0 -2
- package/src/vro-el-checkbox-group/style/deps.ts +0 -2
- package/src/vro-el-checkbox-group/style/index.scss +0 -1
- package/src/vro-el-checkbox-group/style/index.ts +0 -2
- package/src/vro-el-checkbox-group/types.ts +0 -18
- package/src/vro-el-checkbox-group/vro-el-checkbox-group.vue +0 -33
- package/src/vro-el-config-provider/README.md +0 -65
- package/src/vro-el-config-provider/index.ts +0 -16
- package/src/vro-el-config-provider/style/css.ts +0 -2
- package/src/vro-el-config-provider/style/index.ts +0 -2
- package/src/vro-el-config-provider/types.ts +0 -18
- package/src/vro-el-config-provider/vro-el-config-provider.vue +0 -19
- package/src/vro-el-file-upload/README.md +0 -89
- package/src/vro-el-file-upload/index.ts +0 -17
- package/src/vro-el-file-upload/style/css.ts +0 -2
- package/src/vro-el-file-upload/style/deps.ts +0 -2
- package/src/vro-el-file-upload/style/index.scss +0 -30
- package/src/vro-el-file-upload/style/index.ts +0 -2
- package/src/vro-el-file-upload/types.ts +0 -50
- package/src/vro-el-file-upload/utils.ts +0 -7
- package/src/vro-el-file-upload/vro-el-file-upload.vue +0 -95
- package/src/vro-el-icon/README.md +0 -68
- package/src/vro-el-icon/index.ts +0 -16
- package/src/vro-el-icon/style/css.ts +0 -2
- package/src/vro-el-icon/style/deps.ts +0 -1
- package/src/vro-el-icon/style/index.scss +0 -1
- package/src/vro-el-icon/style/index.ts +0 -2
- package/src/vro-el-icon/types.ts +0 -12
- package/src/vro-el-icon/vro-el-icon.vue +0 -28
- package/src/vro-el-image-upload/README.md +0 -99
- package/src/vro-el-image-upload/index.ts +0 -17
- package/src/vro-el-image-upload/style/css.ts +0 -2
- package/src/vro-el-image-upload/style/deps.ts +0 -4
- package/src/vro-el-image-upload/style/index.scss +0 -55
- package/src/vro-el-image-upload/style/index.ts +0 -2
- package/src/vro-el-image-upload/types.ts +0 -42
- package/src/vro-el-image-upload/utils.ts +0 -7
- package/src/vro-el-image-upload/vro-el-image-upload.vue +0 -134
- package/src/vro-el-radio-group/README.md +0 -83
- package/src/vro-el-radio-group/index.ts +0 -16
- package/src/vro-el-radio-group/style/css.ts +0 -2
- package/src/vro-el-radio-group/style/deps.ts +0 -2
- package/src/vro-el-radio-group/style/index.scss +0 -1
- package/src/vro-el-radio-group/style/index.ts +0 -2
- package/src/vro-el-radio-group/types.ts +0 -29
- package/src/vro-el-radio-group/vro-el-radio-group.vue +0 -34
- package/src/vro-el-schema-filter/README.md +0 -146
- package/src/vro-el-schema-filter/index.ts +0 -16
- package/src/vro-el-schema-filter/style/css.ts +0 -3
- package/src/vro-el-schema-filter/style/deps.ts +0 -4
- package/src/vro-el-schema-filter/style/index.scss +0 -20
- package/src/vro-el-schema-filter/style/index.ts +0 -2
- package/src/vro-el-schema-filter/types.ts +0 -31
- package/src/vro-el-schema-filter/vro-el-schema-filter.vue +0 -64
- package/src/vro-el-schema-form/README.md +0 -207
- package/src/vro-el-schema-form/defineVroElSchemaFormCreateField.ts +0 -12
- package/src/vro-el-schema-form/defineVroElSchemaFormFieldTrigger.ts +0 -9
- package/src/vro-el-schema-form/index.ts +0 -20
- package/src/vro-el-schema-form/style/css.ts +0 -9
- package/src/vro-el-schema-form/style/deps.ts +0 -20
- package/src/vro-el-schema-form/style/index.scss +0 -4
- package/src/vro-el-schema-form/style/index.ts +0 -2
- package/src/vro-el-schema-form/types.ts +0 -171
- package/src/vro-el-schema-form/useVroElSchemaForm.ts +0 -48
- package/src/vro-el-schema-form/vro-el-schema-form.vue +0 -177
- package/src/vro-el-schema-form/vroElSchemaFormFieldManager.ts +0 -59
- package/src/vro-el-schema-form-dialog/README.md +0 -173
- package/src/vro-el-schema-form-dialog/function-call.ts +0 -20
- package/src/vro-el-schema-form-dialog/index.ts +0 -22
- package/src/vro-el-schema-form-dialog/injection.ts +0 -10
- package/src/vro-el-schema-form-dialog/style/css.ts +0 -4
- package/src/vro-el-schema-form-dialog/style/deps.ts +0 -4
- package/src/vro-el-schema-form-dialog/style/index.scss +0 -4
- package/src/vro-el-schema-form-dialog/style/index.ts +0 -2
- package/src/vro-el-schema-form-dialog/types.ts +0 -73
- package/src/vro-el-schema-form-dialog/useVroElSchemaFormDialog.ts +0 -52
- package/src/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue +0 -142
- package/src/vro-el-select/README.md +0 -83
- package/src/vro-el-select/index.ts +0 -16
- package/src/vro-el-select/style/css.ts +0 -2
- package/src/vro-el-select/style/deps.ts +0 -2
- package/src/vro-el-select/style/index.scss +0 -1
- package/src/vro-el-select/style/index.ts +0 -2
- package/src/vro-el-select/types.ts +0 -18
- package/src/vro-el-select/vro-el-select.vue +0 -33
- package/src/vro-el-skeleton/README.md +0 -128
- package/src/vro-el-skeleton/index.ts +0 -16
- package/src/vro-el-skeleton/style/css.ts +0 -3
- package/src/vro-el-skeleton/style/deps.ts +0 -3
- package/src/vro-el-skeleton/style/index.scss +0 -24
- package/src/vro-el-skeleton/style/index.ts +0 -2
- package/src/vro-el-skeleton/vro-el-skeleton.vue +0 -73
- package/src/vro-el-tags/README.md +0 -73
- package/src/vro-el-tags/index.ts +0 -16
- package/src/vro-el-tags/style/css.ts +0 -2
- package/src/vro-el-tags/style/deps.ts +0 -3
- package/src/vro-el-tags/style/index.scss +0 -1
- package/src/vro-el-tags/style/index.ts +0 -2
- package/src/vro-el-tags/types.ts +0 -21
- package/src/vro-el-tags/vro-el-tags.vue +0 -69
- package/src/vro-el-tree/README.md +0 -85
- package/src/vro-el-tree/index.ts +0 -16
- package/src/vro-el-tree/style/css.ts +0 -2
- package/src/vro-el-tree/style/deps.ts +0 -1
- package/src/vro-el-tree/style/index.scss +0 -3
- package/src/vro-el-tree/style/index.ts +0 -2
- package/src/vro-el-tree/types.ts +0 -38
- package/src/vro-el-tree/vro-el-tree.vue +0 -78
- package/src/vro-el-with-config/README.md +0 -75
- package/src/vro-el-with-config/index.ts +0 -16
- package/src/vro-el-with-config/style/css.ts +0 -3
- package/src/vro-el-with-config/style/deps.ts +0 -2
- package/src/vro-el-with-config/style/index.ts +0 -2
- package/src/vro-el-with-config/types.ts +0 -18
- package/src/vro-el-with-config/vro-el-with-config.vue +0 -48
- /package/{src/vro-el-config-provider/style/deps.ts → dist/style/base.css} +0 -0
- /package/{src/vro-el-config-provider/style/index.scss → dist/style/css.d.ts} +0 -0
- /package/{src/vro-el-with-config/style/index.scss → dist/style/deps.d.ts} +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ComponentManager } from '@vrojs/base'
|
|
2
|
-
import {
|
|
3
|
-
ElCascader,
|
|
4
|
-
ElCheckboxGroup,
|
|
5
|
-
ElDatePicker,
|
|
6
|
-
ElDivider,
|
|
7
|
-
ElInput,
|
|
8
|
-
ElInputNumber,
|
|
9
|
-
ElRadioGroup,
|
|
10
|
-
ElSelect,
|
|
11
|
-
ElTreeSelect,
|
|
12
|
-
} from 'element-plus'
|
|
13
|
-
|
|
14
|
-
import { VroElCheckboxGroup } from '../vro-el-checkbox-group'
|
|
15
|
-
import { VroElFileUpload } from '../vro-el-file-upload'
|
|
16
|
-
import { VroElImageUpload } from '../vro-el-image-upload'
|
|
17
|
-
import { VroElRadioGroup } from '../vro-el-radio-group'
|
|
18
|
-
import { VroElSelect } from '../vro-el-select'
|
|
19
|
-
import { VroElTags } from '../vro-el-tags'
|
|
20
|
-
import { VroElTree } from '../vro-el-tree'
|
|
21
|
-
|
|
22
|
-
export const vroElSchemaFormFieldManager = new ComponentManager()
|
|
23
|
-
|
|
24
|
-
// 注册
|
|
25
|
-
vroElSchemaFormFieldManager
|
|
26
|
-
.add('ElInput', ElInput, {
|
|
27
|
-
clearable: true,
|
|
28
|
-
showWordLimit: true,
|
|
29
|
-
autosize: { minRows: 2 },
|
|
30
|
-
})
|
|
31
|
-
.add('ElSelect', ElSelect, {
|
|
32
|
-
clearable: true,
|
|
33
|
-
filterable: true,
|
|
34
|
-
})
|
|
35
|
-
.add('ElRadioGroup', ElRadioGroup)
|
|
36
|
-
.add('ElCheckboxGroup', ElCheckboxGroup)
|
|
37
|
-
.add('ElDatePicker', ElDatePicker, {
|
|
38
|
-
type: 'date',
|
|
39
|
-
clearable: true,
|
|
40
|
-
})
|
|
41
|
-
.add('ElInputNumber', ElInputNumber)
|
|
42
|
-
.add('ElTreeSelect', ElTreeSelect)
|
|
43
|
-
.add('ElCascader', ElCascader, {
|
|
44
|
-
clearable: true,
|
|
45
|
-
validateEvent: false,
|
|
46
|
-
})
|
|
47
|
-
.add('ElDivider', ElDivider, {
|
|
48
|
-
contentPosition: 'center',
|
|
49
|
-
})
|
|
50
|
-
.add('VroElSelect', VroElSelect, {
|
|
51
|
-
clearable: true,
|
|
52
|
-
filterable: true,
|
|
53
|
-
})
|
|
54
|
-
.add('VroElCheckboxGroup', VroElCheckboxGroup)
|
|
55
|
-
.add('VroElRadioGroup', VroElRadioGroup)
|
|
56
|
-
.add('VroElImageUpload', VroElImageUpload)
|
|
57
|
-
.add('VroElFileUpload', VroElFileUpload)
|
|
58
|
-
.add('VroElTags', VroElTags)
|
|
59
|
-
.add('VroElTree', VroElTree)
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# VroElSchemaFormDialog
|
|
2
|
-
|
|
3
|
-
### 介绍
|
|
4
|
-
|
|
5
|
-
基于 `ElDialog` 和 `VroElSchemaForm` 的弹窗表单组件。组件内置校验、提交 loading、确认/取消按钮,适合编辑、新建等弹窗表单场景,也支持通过函数方式调用。
|
|
6
|
-
|
|
7
|
-
## 代码演示
|
|
8
|
-
|
|
9
|
-
### 基础用法
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<template>
|
|
13
|
-
<el-button type="primary" @click="openDialog">打开弹窗</el-button>
|
|
14
|
-
<vro-el-schema-form-dialog
|
|
15
|
-
ref="dialogRef"
|
|
16
|
-
title="编辑用户"
|
|
17
|
-
:schema="schema"
|
|
18
|
-
:request="handleRequest"
|
|
19
|
-
@confirm="handleConfirm"
|
|
20
|
-
/>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script setup lang="ts">
|
|
24
|
-
import { ref } from 'vue'
|
|
25
|
-
import type { VroElSchemaFormDialogInstance, VroElSchemaFormSchema } from '@vrojs/element-plus'
|
|
26
|
-
|
|
27
|
-
const dialogRef = ref<VroElSchemaFormDialogInstance>()
|
|
28
|
-
const schema = ref<VroElSchemaFormSchema>({
|
|
29
|
-
username: {
|
|
30
|
-
label: '用户名',
|
|
31
|
-
value: '',
|
|
32
|
-
is: 'ElInput',
|
|
33
|
-
rules: [{ required: true, message: '请填写用户名', trigger: 'blur' }],
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const openDialog = () => {
|
|
38
|
-
dialogRef.value?.show()
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const handleRequest = async (data) => {
|
|
42
|
-
return data
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const handleConfirm = (data) => {
|
|
46
|
-
console.log(data)
|
|
47
|
-
}
|
|
48
|
-
</script>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### 函数调用
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
import { showVroElSchemaFormDialog } from '@vrojs/element-plus'
|
|
55
|
-
|
|
56
|
-
const data = await showVroElSchemaFormDialog({
|
|
57
|
-
title: '新建用户',
|
|
58
|
-
schema,
|
|
59
|
-
request: async (value) => value,
|
|
60
|
-
})
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 自定义底部按钮文本
|
|
64
|
-
|
|
65
|
-
```html
|
|
66
|
-
<vro-el-schema-form-dialog
|
|
67
|
-
ref="dialogRef"
|
|
68
|
-
title="编辑用户"
|
|
69
|
-
confirm-button-text="保存"
|
|
70
|
-
cancel-button-text="关闭"
|
|
71
|
-
:schema="schema"
|
|
72
|
-
/>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## API
|
|
76
|
-
|
|
77
|
-
### 属性 Props
|
|
78
|
-
|
|
79
|
-
<table>
|
|
80
|
-
<tbody>
|
|
81
|
-
<tr>
|
|
82
|
-
<td>名称</td>
|
|
83
|
-
<td>类型</td>
|
|
84
|
-
<td>默认值</td>
|
|
85
|
-
</tr>
|
|
86
|
-
<tr v-for="(item, key) in vroElSchemaFormDialogProps" :key="key">
|
|
87
|
-
<td>{{ key }}</td>
|
|
88
|
-
<td>{{ parseType(item.type || item) }}</td>
|
|
89
|
-
<td>{{ reserve(item.default, '-') }}</td>
|
|
90
|
-
</tr>
|
|
91
|
-
</tbody>
|
|
92
|
-
</table>
|
|
93
|
-
|
|
94
|
-
### 插槽 Slots
|
|
95
|
-
|
|
96
|
-
<table>
|
|
97
|
-
<tbody>
|
|
98
|
-
<tr>
|
|
99
|
-
<td>名称</td>
|
|
100
|
-
<td>说明</td>
|
|
101
|
-
</tr>
|
|
102
|
-
<tr>
|
|
103
|
-
<td>default</td>
|
|
104
|
-
<td>透传给内部 VroElSchemaForm 的默认插槽</td>
|
|
105
|
-
</tr>
|
|
106
|
-
</tbody>
|
|
107
|
-
</table>
|
|
108
|
-
|
|
109
|
-
### 实例方法
|
|
110
|
-
|
|
111
|
-
<table>
|
|
112
|
-
<tbody>
|
|
113
|
-
<tr>
|
|
114
|
-
<td>名称</td>
|
|
115
|
-
<td>说明</td>
|
|
116
|
-
</tr>
|
|
117
|
-
<tr>
|
|
118
|
-
<td>schemaFormInstance</td>
|
|
119
|
-
<td>内部 VroElSchemaForm 实例</td>
|
|
120
|
-
</tr>
|
|
121
|
-
<tr>
|
|
122
|
-
<td>show</td>
|
|
123
|
-
<td>打开弹窗,支持传入动态 props</td>
|
|
124
|
-
</tr>
|
|
125
|
-
<tr>
|
|
126
|
-
<td>hide</td>
|
|
127
|
-
<td>关闭弹窗</td>
|
|
128
|
-
</tr>
|
|
129
|
-
</tbody>
|
|
130
|
-
</table>
|
|
131
|
-
|
|
132
|
-
### 事件 Events
|
|
133
|
-
|
|
134
|
-
<table>
|
|
135
|
-
<tbody>
|
|
136
|
-
<tr>
|
|
137
|
-
<td>名称</td>
|
|
138
|
-
<td>参数</td>
|
|
139
|
-
<td>说明</td>
|
|
140
|
-
</tr>
|
|
141
|
-
<tr>
|
|
142
|
-
<td>confirm</td>
|
|
143
|
-
<td>data</td>
|
|
144
|
-
<td>确认成功后触发</td>
|
|
145
|
-
</tr>
|
|
146
|
-
<tr>
|
|
147
|
-
<td>cancel</td>
|
|
148
|
-
<td>reason</td>
|
|
149
|
-
<td>关闭弹窗时触发</td>
|
|
150
|
-
</tr>
|
|
151
|
-
<tr>
|
|
152
|
-
<td>closed</td>
|
|
153
|
-
<td>-</td>
|
|
154
|
-
<td>弹窗关闭动画结束后触发</td>
|
|
155
|
-
</tr>
|
|
156
|
-
<tr>
|
|
157
|
-
<td>change-field</td>
|
|
158
|
-
<td>{ key, value }</td>
|
|
159
|
-
<td>内部表单字段 change 时触发</td>
|
|
160
|
-
</tr>
|
|
161
|
-
<tr>
|
|
162
|
-
<td>input-field</td>
|
|
163
|
-
<td>{ key, value }</td>
|
|
164
|
-
<td>内部表单字段 input 时触发</td>
|
|
165
|
-
</tr>
|
|
166
|
-
</tbody>
|
|
167
|
-
</table>
|
|
168
|
-
|
|
169
|
-
<script setup lang="ts">
|
|
170
|
-
import { reserve } from '@daysnap/utils'
|
|
171
|
-
import { VroElSchemaFormDialog, vroElSchemaFormDialogProps } from '.'
|
|
172
|
-
import { parseType } from '../utils'
|
|
173
|
-
</script>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { showComponent } from '@vrojs/base'
|
|
2
|
-
import { type AppContext, markRaw } from 'vue'
|
|
3
|
-
|
|
4
|
-
import VroElWithConfig from '../vro-el-with-config'
|
|
5
|
-
import type { VroElSchemaFormDialogProps } from './types'
|
|
6
|
-
import VroElSchemaFormDialog from './vro-el-schema-form-dialog.vue'
|
|
7
|
-
|
|
8
|
-
export function showVroElSchemaFormDialog<T = any>(
|
|
9
|
-
props: Partial<VroElSchemaFormDialogProps>,
|
|
10
|
-
appContext: AppContext | null = null,
|
|
11
|
-
): Promise<T> {
|
|
12
|
-
return showComponent(
|
|
13
|
-
VroElWithConfig,
|
|
14
|
-
{
|
|
15
|
-
...props,
|
|
16
|
-
is: markRaw(VroElSchemaFormDialog),
|
|
17
|
-
},
|
|
18
|
-
appContext,
|
|
19
|
-
)
|
|
20
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { withInstall } from '@vrojs/base'
|
|
2
|
-
|
|
3
|
-
import Component from './vro-el-schema-form-dialog.vue'
|
|
4
|
-
|
|
5
|
-
export * from './function-call'
|
|
6
|
-
export * from './injection'
|
|
7
|
-
export * from './types'
|
|
8
|
-
export * from './useVroElSchemaFormDialog'
|
|
9
|
-
|
|
10
|
-
export const VroElSchemaFormDialog = withInstall<typeof Component>(Component, (app) => {
|
|
11
|
-
app.component((Component as any).name, Component)
|
|
12
|
-
;(Component as any)._context = app._context
|
|
13
|
-
})
|
|
14
|
-
export default VroElSchemaFormDialog
|
|
15
|
-
|
|
16
|
-
export type VroElSchemaFormDialogInstance = InstanceType<typeof VroElSchemaFormDialog>
|
|
17
|
-
|
|
18
|
-
declare module 'vue' {
|
|
19
|
-
export interface GlobalComponents {
|
|
20
|
-
VroElSchemaFormDialog: typeof VroElSchemaFormDialog
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { inject, type InjectionKey } from 'vue'
|
|
2
|
-
|
|
3
|
-
export const vroElSchemaFormDialogInjectionKey = Symbol() as InjectionKey<{
|
|
4
|
-
confirm: (...args: any[]) => Promise<void>
|
|
5
|
-
hide: (reason?: any) => Promise<void>
|
|
6
|
-
}>
|
|
7
|
-
|
|
8
|
-
export function useVroElSchemaFormDialogInstance() {
|
|
9
|
-
return inject(vroElSchemaFormDialogInjectionKey, null)
|
|
10
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'
|
|
2
|
-
|
|
3
|
-
import { vroElSchemaFormProps, type VroElSchemaFormSchema } from '../vro-el-schema-form'
|
|
4
|
-
|
|
5
|
-
export interface VroElSchemaFormDialogRequest {
|
|
6
|
-
(data: any, schema: VroElSchemaFormSchema): Promise<any>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const vroElSchemaFormDialogProps = {
|
|
10
|
-
...vroElSchemaFormProps,
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 弹窗标题。
|
|
14
|
-
*/
|
|
15
|
-
title: String,
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 弹窗样式。
|
|
19
|
-
*/
|
|
20
|
-
style: {
|
|
21
|
-
type: Object as PropType<CSSProperties>,
|
|
22
|
-
default: () => ({}),
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 确认前的提交请求,返回值会作为 confirm 事件参数。
|
|
27
|
-
*/
|
|
28
|
-
request: Function as PropType<VroElSchemaFormDialogRequest>,
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 表单标签位置。
|
|
32
|
-
*/
|
|
33
|
-
labelPosition: {
|
|
34
|
-
type: String as PropType<'left' | 'right' | 'top'>,
|
|
35
|
-
default: 'top',
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 表单标签宽度。
|
|
40
|
-
*/
|
|
41
|
-
labelWidth: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: '120px',
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 是否显示取消按钮。
|
|
48
|
-
*/
|
|
49
|
-
showCancelButton: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: true,
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* 是否显示确认按钮。
|
|
56
|
-
*/
|
|
57
|
-
showConfirmButton: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: true,
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 取消按钮文本。
|
|
64
|
-
*/
|
|
65
|
-
cancelButtonText: String,
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 确认按钮文本。
|
|
69
|
-
*/
|
|
70
|
-
confirmButtonText: String,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export type VroElSchemaFormDialogProps = ExtractPropTypes<typeof vroElSchemaFormDialogProps>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import banana from '@daysnap/banana'
|
|
2
|
-
import { getCurrentInstance, type Ref, ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
import type { VroElSchemaFormSchema, VroElSchemaFormSchemaField } from '../vro-el-schema-form'
|
|
5
|
-
import { showVroElSchemaFormDialog } from './function-call'
|
|
6
|
-
|
|
7
|
-
export interface UseVroElSchemaFormDialogOptions<S extends VroElSchemaFormSchema> {
|
|
8
|
-
instanceRef?: Ref<any>
|
|
9
|
-
onGenerate?: (schema: S, ...args: any[]) => void
|
|
10
|
-
onSuccess?: (schema: S, ...args: any[]) => void
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface UseVroElSchemaFormDialogInstance {
|
|
14
|
-
show: typeof showVroElSchemaFormDialog
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function useVroElSchemaFormDialog<
|
|
18
|
-
T extends VroElSchemaFormSchema,
|
|
19
|
-
S extends VroElSchemaFormSchema = { [P in keyof T]: VroElSchemaFormSchemaField },
|
|
20
|
-
>(
|
|
21
|
-
generator: () => T | Promise<T>,
|
|
22
|
-
task: (schema: S, instance: UseVroElSchemaFormDialogInstance, ...args: any[]) => Promise<any>,
|
|
23
|
-
options: UseVroElSchemaFormDialogOptions<S> = {},
|
|
24
|
-
) {
|
|
25
|
-
const { onGenerate, onSuccess, instanceRef } = options
|
|
26
|
-
|
|
27
|
-
const schema = ref<S>()
|
|
28
|
-
|
|
29
|
-
const instance = getCurrentInstance()
|
|
30
|
-
|
|
31
|
-
const trigger = async (...args: any[]) => {
|
|
32
|
-
schema.value = (await generator()) as unknown as S
|
|
33
|
-
if (args[0]) {
|
|
34
|
-
banana.assignment(args[0], schema.value as any)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
onGenerate?.(schema.value as any, ...args)
|
|
38
|
-
|
|
39
|
-
await task(
|
|
40
|
-
schema.value,
|
|
41
|
-
instanceRef?.value ?? {
|
|
42
|
-
show: (props, appContext) =>
|
|
43
|
-
showVroElSchemaFormDialog(props, appContext ?? instance?.appContext),
|
|
44
|
-
},
|
|
45
|
-
...args,
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
onSuccess?.(schema.value as any, ...args)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return [schema, trigger] as const
|
|
52
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
v-model="visible"
|
|
4
|
-
ref="containerRef"
|
|
5
|
-
class="vro-el-schema-form-dialog"
|
|
6
|
-
:class="[id]"
|
|
7
|
-
:title="computedProps.title"
|
|
8
|
-
destroy-on-close
|
|
9
|
-
append-to-body
|
|
10
|
-
:close-on-click-modal="false"
|
|
11
|
-
:style="computedProps.style"
|
|
12
|
-
@close="hide()"
|
|
13
|
-
@closed="$emit('closed')"
|
|
14
|
-
>
|
|
15
|
-
<vro-el-schema-form
|
|
16
|
-
v-bind="schemaFormProps"
|
|
17
|
-
ref="refVroElSchemaForm"
|
|
18
|
-
@change-field="$emit('change-field', $event)"
|
|
19
|
-
@input-field="$emit('input-field', $event)"
|
|
20
|
-
@submit.prevent="handleSubmit()"
|
|
21
|
-
>
|
|
22
|
-
<slot></slot>
|
|
23
|
-
</vro-el-schema-form>
|
|
24
|
-
|
|
25
|
-
<template v-if="computedProps.showCancelButton || computedProps.showConfirmButton" #footer>
|
|
26
|
-
<span class="dialog-footer">
|
|
27
|
-
<el-button v-if="computedProps.showCancelButton" @click="hide('cancel')">
|
|
28
|
-
{{ computedProps.cancelButtonText || t('schemaFormDialog.cancelText') }}
|
|
29
|
-
</el-button>
|
|
30
|
-
<el-button
|
|
31
|
-
v-if="computedProps.showConfirmButton"
|
|
32
|
-
type="primary"
|
|
33
|
-
@click="handleSubmit"
|
|
34
|
-
:loading="loading"
|
|
35
|
-
>
|
|
36
|
-
{{ computedProps.confirmButtonText || t('schemaFormDialog.confirmText') }}
|
|
37
|
-
</el-button>
|
|
38
|
-
</span>
|
|
39
|
-
</template>
|
|
40
|
-
</el-dialog>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<script setup lang="ts">
|
|
44
|
-
import { getRandom, pick } from '@daysnap/utils'
|
|
45
|
-
import { useAsyncTask, useVisible } from '@vrojs/use'
|
|
46
|
-
import { ElButton, ElDialog } from 'element-plus'
|
|
47
|
-
import { computed, nextTick, provide, ref, useTemplateRef, watch } from 'vue'
|
|
48
|
-
|
|
49
|
-
import { useLocale } from '../locale'
|
|
50
|
-
import { VroElSchemaForm, vroElSchemaFormProps } from '../vro-el-schema-form'
|
|
51
|
-
import { vroElSchemaFormDialogInjectionKey } from './injection'
|
|
52
|
-
import { type VroElSchemaFormDialogProps, vroElSchemaFormDialogProps } from './types'
|
|
53
|
-
|
|
54
|
-
defineOptions({ name: 'VroElSchemaFormDialog' })
|
|
55
|
-
|
|
56
|
-
const emit = defineEmits(['change-field', 'input-field', 'cancel', 'confirm', 'closed'])
|
|
57
|
-
|
|
58
|
-
const props = defineProps(vroElSchemaFormDialogProps)
|
|
59
|
-
const { t } = useLocale()
|
|
60
|
-
const dynamicProps = ref<Partial<VroElSchemaFormDialogProps>>()
|
|
61
|
-
const computedProps = computed<VroElSchemaFormDialogProps>(() =>
|
|
62
|
-
Object.assign({}, props, dynamicProps.value),
|
|
63
|
-
)
|
|
64
|
-
const schemaFormProps = computed(() => {
|
|
65
|
-
const value = pick(computedProps.value, Object.keys(vroElSchemaFormProps) as any)
|
|
66
|
-
return {
|
|
67
|
-
...value,
|
|
68
|
-
formProps: {
|
|
69
|
-
labelPosition: computedProps.value.labelPosition,
|
|
70
|
-
labelWidth: computedProps.value.labelWidth,
|
|
71
|
-
...value.formProps,
|
|
72
|
-
},
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const { show, hide, confirm, visible } = useVisible<Partial<VroElSchemaFormDialogProps>, any>({
|
|
77
|
-
showCallback: (options) => {
|
|
78
|
-
dynamicProps.value = options
|
|
79
|
-
},
|
|
80
|
-
hideCallback: (reason) => emit('cancel', reason),
|
|
81
|
-
confirmCallback: (data) => emit('confirm', data),
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
const id = `id_${getRandom(10)}`
|
|
85
|
-
watch(visible, (v) => {
|
|
86
|
-
if (v) {
|
|
87
|
-
nextTick(() => {
|
|
88
|
-
const els = document.querySelectorAll(`.${id}`)
|
|
89
|
-
if (els.length) {
|
|
90
|
-
els.forEach((el) => (el.parentElement!.scrollTop = 0))
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
const refVroElSchemaForm = useTemplateRef('refVroElSchemaForm')
|
|
97
|
-
const { loading, trigger: handleSubmit } = useAsyncTask(
|
|
98
|
-
async () => {
|
|
99
|
-
if (!refVroElSchemaForm.value) {
|
|
100
|
-
throw new Error('not fond VroElSchemaForm')
|
|
101
|
-
}
|
|
102
|
-
await refVroElSchemaForm.value.validate().catch(() => {
|
|
103
|
-
throw 'cancel'
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
// 执行方法
|
|
107
|
-
let isBlock = false
|
|
108
|
-
await refVroElSchemaForm.value.trigger({
|
|
109
|
-
confirm,
|
|
110
|
-
hide,
|
|
111
|
-
block: () => {
|
|
112
|
-
isBlock = true
|
|
113
|
-
setTimeout(() => (isBlock = true))
|
|
114
|
-
},
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
if (visible.value && !isBlock) {
|
|
118
|
-
// 获取数据
|
|
119
|
-
const data = await refVroElSchemaForm.value.extractValues()
|
|
120
|
-
const result = (await computedProps.value.request?.(data, props.schema!)) ?? data
|
|
121
|
-
|
|
122
|
-
confirm(result)
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
throwError: true,
|
|
127
|
-
},
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
provide(vroElSchemaFormDialogInjectionKey, {
|
|
131
|
-
confirm,
|
|
132
|
-
hide,
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
defineExpose({
|
|
136
|
-
get schemaFormInstance() {
|
|
137
|
-
return refVroElSchemaForm.value!
|
|
138
|
-
},
|
|
139
|
-
show,
|
|
140
|
-
hide,
|
|
141
|
-
})
|
|
142
|
-
</script>
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# VroElSelect
|
|
2
|
-
|
|
3
|
-
### 介绍
|
|
4
|
-
|
|
5
|
-
基于 `ElSelect` 和 `ElOption` 的选项化封装。适合通过 `options` 快速渲染下拉选项,同时保留 Element Plus Select 的原有属性和事件。
|
|
6
|
-
|
|
7
|
-
## 代码演示
|
|
8
|
-
|
|
9
|
-
### 基础用法
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<template>
|
|
13
|
-
<vro-el-select v-model="value" :options="options" placeholder="请选择" />
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup lang="ts">
|
|
17
|
-
import { ref } from 'vue'
|
|
18
|
-
|
|
19
|
-
const value = ref('')
|
|
20
|
-
const options = [
|
|
21
|
-
{ label: '苹果', value: 'apple' },
|
|
22
|
-
{ label: '香蕉', value: 'banana' },
|
|
23
|
-
{ label: '橙子', value: 'orange', props: { disabled: true } },
|
|
24
|
-
]
|
|
25
|
-
</script>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 自定义字段名
|
|
29
|
-
|
|
30
|
-
```html
|
|
31
|
-
<vro-el-select v-model="value" :options="options" label-key="name" value-key="id" />
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## API
|
|
35
|
-
|
|
36
|
-
### 属性 Props
|
|
37
|
-
|
|
38
|
-
<table>
|
|
39
|
-
<tbody>
|
|
40
|
-
<tr>
|
|
41
|
-
<td>名称</td>
|
|
42
|
-
<td>类型</td>
|
|
43
|
-
<td>默认值</td>
|
|
44
|
-
</tr>
|
|
45
|
-
<tr v-for="(item, key) in vroElSelectProps" :key="key">
|
|
46
|
-
<td>{{ key }}</td>
|
|
47
|
-
<td>{{ parseType(item.type || item) }}</td>
|
|
48
|
-
<td>{{ reserve(item.default, '-') }}</td>
|
|
49
|
-
</tr>
|
|
50
|
-
</tbody>
|
|
51
|
-
</table>
|
|
52
|
-
|
|
53
|
-
### 插槽 Slots
|
|
54
|
-
|
|
55
|
-
支持默认插槽,传入后会作为 `ElSelect` 的内容,覆盖 `options` 自动渲染的选项。
|
|
56
|
-
|
|
57
|
-
### 事件 Events
|
|
58
|
-
|
|
59
|
-
<table>
|
|
60
|
-
<tbody>
|
|
61
|
-
<tr>
|
|
62
|
-
<td>名称</td>
|
|
63
|
-
<td>参数</td>
|
|
64
|
-
<td>说明</td>
|
|
65
|
-
</tr>
|
|
66
|
-
<tr>
|
|
67
|
-
<td>update:modelValue</td>
|
|
68
|
-
<td>value</td>
|
|
69
|
-
<td>选中值变化时触发</td>
|
|
70
|
-
</tr>
|
|
71
|
-
<tr>
|
|
72
|
-
<td>change</td>
|
|
73
|
-
<td>value</td>
|
|
74
|
-
<td>同 Element Plus Select change 事件</td>
|
|
75
|
-
</tr>
|
|
76
|
-
</tbody>
|
|
77
|
-
</table>
|
|
78
|
-
|
|
79
|
-
<script setup lang="ts">
|
|
80
|
-
import { reserve } from '@daysnap/utils'
|
|
81
|
-
import { VroElSelect, vroElSelectProps } from '.'
|
|
82
|
-
import { parseType } from '../utils'
|
|
83
|
-
</script>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { withInstall } from '@vrojs/base'
|
|
2
|
-
|
|
3
|
-
import Component from './vro-el-select.vue'
|
|
4
|
-
|
|
5
|
-
export * from './types'
|
|
6
|
-
|
|
7
|
-
export const VroElSelect = withInstall<typeof Component>(Component)
|
|
8
|
-
export default VroElSelect
|
|
9
|
-
|
|
10
|
-
export type VroElSelectInstance = InstanceType<typeof VroElSelect>
|
|
11
|
-
|
|
12
|
-
declare module 'vue' {
|
|
13
|
-
export interface GlobalComponents {
|
|
14
|
-
VroElSelect: typeof VroElSelect
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.vro-el-select { }
|