hy-app 0.2.11 → 0.2.13

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.
Files changed (115) hide show
  1. package/component-helper.ts +177 -0
  2. package/components/hy-action-sheet/hy-action-sheet.vue +9 -3
  3. package/components/hy-action-sheet/props.ts +2 -2
  4. package/components/hy-action-sheet/typing.d.ts +49 -16
  5. package/components/hy-button/hy-button.vue +144 -13
  6. package/components/hy-button/props.ts +158 -32
  7. package/components/hy-button/typing.d.ts +71 -32
  8. package/components/index.ts +114 -122
  9. package/components.json +3287 -0
  10. package/dist/attributes.json +1 -0
  11. package/dist/docs/components/hy-action-sheet/hy-action-sheet.md +41 -0
  12. package/dist/docs/components/hy-address-picker/hy-address-picker.md +25 -0
  13. package/dist/docs/components/hy-avatar/hy-avatar.md +19 -0
  14. package/dist/docs/components/hy-back-top/hy-back-top.md +19 -0
  15. package/dist/docs/components/hy-badge/hy-badge.md +13 -0
  16. package/dist/docs/components/hy-button/hy-button.md +61 -0
  17. package/dist/docs/components/hy-calendar/header.md +17 -0
  18. package/dist/docs/components/hy-calendar/hy-calendar.md +27 -0
  19. package/dist/docs/components/hy-calendar/month.md +38 -0
  20. package/dist/docs/components/hy-card/hy-card.md +24 -0
  21. package/dist/docs/components/hy-cell/hy-cell.md +26 -0
  22. package/dist/docs/components/hy-check-button/hy-check-button.md +14 -0
  23. package/dist/docs/components/hy-checkbox/hy-checkbox.md +21 -0
  24. package/dist/docs/components/hy-code-input/hy-code-input.md +15 -0
  25. package/dist/docs/components/hy-config-provider/hy-config-provider.md +13 -0
  26. package/dist/docs/components/hy-count-down/hy-count-down.md +34 -0
  27. package/dist/docs/components/hy-count-to/hy-count-to.md +31 -0
  28. package/dist/docs/components/hy-datetime-picker/hy-datetime-picker.md +25 -0
  29. package/dist/docs/components/hy-divider/hy-divider.md +13 -0
  30. package/dist/docs/components/hy-dropdown/hy-dropdown.md +13 -0
  31. package/dist/docs/components/hy-dropdown-item/hy-dropdown-item.md +20 -0
  32. package/dist/docs/components/hy-empty/hy-empty.md +20 -0
  33. package/dist/docs/components/hy-float-button/hy-float-button.md +20 -0
  34. package/dist/docs/components/hy-folding-panel/hy-folding-panel.md +24 -0
  35. package/dist/docs/components/hy-form/hy-form.md +29 -0
  36. package/dist/docs/components/hy-grid/hy-grid.md +19 -0
  37. package/dist/docs/components/hy-icon/hy-icon.md +13 -0
  38. package/dist/docs/components/hy-image/hy-image.md +22 -0
  39. package/dist/docs/components/hy-input/hy-input.md +29 -0
  40. package/dist/docs/components/hy-line/hy-line.md +7 -0
  41. package/dist/docs/components/hy-line-progress/hy-line-progress.md +13 -0
  42. package/dist/docs/components/hy-list/hy-list.md +25 -0
  43. package/dist/docs/components/hy-loading/hy-loading.md +14 -0
  44. package/dist/docs/components/hy-login/ThePhoneLogin.md +20 -0
  45. package/dist/docs/components/hy-login/TheUserLogin.md +44 -0
  46. package/dist/docs/components/hy-login/hy-login.md +14 -0
  47. package/dist/docs/components/hy-menu/hy-menu.md +21 -0
  48. package/dist/docs/components/hy-modal/hy-modal.md +23 -0
  49. package/dist/docs/components/hy-navbar/hy-navbar.md +22 -0
  50. package/dist/docs/components/hy-notice-bar/hy-column-notice.md +20 -0
  51. package/dist/docs/components/hy-notice-bar/hy-notice-bar.md +14 -0
  52. package/dist/docs/components/hy-notice-bar/hy-row-notice.md +20 -0
  53. package/dist/docs/components/hy-notify/hy-notify.md +23 -0
  54. package/dist/docs/components/hy-number-step/hy-number-step.md +27 -0
  55. package/dist/docs/components/hy-overlay/hy-overlay.md +19 -0
  56. package/dist/docs/components/hy-pagination/hy-pagination.md +14 -0
  57. package/dist/docs/components/hy-parse/hy-parse.md +46 -0
  58. package/dist/docs/components/hy-parse/node/node.md +7 -0
  59. package/dist/docs/components/hy-picker/hy-picker.md +32 -0
  60. package/dist/docs/components/hy-popover/hy-popover.md +34 -0
  61. package/dist/docs/components/hy-popup/hy-popup.md +22 -0
  62. package/dist/docs/components/hy-price/hy-price.md +13 -0
  63. package/dist/docs/components/hy-qrcode/hy-qrcode.md +15 -0
  64. package/dist/docs/components/hy-radio/hy-radio.md +21 -0
  65. package/dist/docs/components/hy-rate/hy-rate.md +14 -0
  66. package/dist/docs/components/hy-read-more/hy-read-more.md +21 -0
  67. package/dist/docs/components/hy-scroll-list/hy-scroll-list.md +21 -0
  68. package/dist/docs/components/hy-search/hy-search.md +27 -0
  69. package/dist/docs/components/hy-signature/hy-signature.md +45 -0
  70. package/dist/docs/components/hy-slider/hy-slider.md +24 -0
  71. package/dist/docs/components/hy-status-bar/hy-status-bar.md +13 -0
  72. package/dist/docs/components/hy-steps/hy-steps.md +23 -0
  73. package/dist/docs/components/hy-submit-bar/hy-submit-bar.md +21 -0
  74. package/dist/docs/components/hy-subsection/hy-subsection.md +14 -0
  75. package/dist/docs/components/hy-swipe-action/hy-swipe-action.md +29 -0
  76. package/dist/docs/components/hy-swiper/hy-swiper-indicator.md +23 -0
  77. package/dist/docs/components/hy-swiper/hy-swiper.md +22 -0
  78. package/dist/docs/components/hy-switch/hy-switch.md +20 -0
  79. package/dist/docs/components/hy-tabBar/hy-tabBar.md +13 -0
  80. package/dist/docs/components/hy-tabs/hy-tabs.md +27 -0
  81. package/dist/docs/components/hy-tag/hy-tag.md +21 -0
  82. package/dist/docs/components/hy-text/hy-text.md +13 -0
  83. package/dist/docs/components/hy-textarea/hy-textarea.md +19 -0
  84. package/dist/docs/components/hy-toast/hy-toast.md +17 -0
  85. package/dist/docs/components/hy-tooltip/hy-tooltip.md +13 -0
  86. package/dist/docs/components/hy-transition/hy-transition.md +25 -0
  87. package/dist/docs/components/hy-upload/hy-upload.md +25 -0
  88. package/dist/docs/components/hy-warn/hy-warn.md +14 -0
  89. package/dist/docs/components/hy-waterfall/hy-waterfall.md +30 -0
  90. package/dist/docs/components/hy-watermark/hy-watermark.md +7 -0
  91. package/dist/docs/components/message/TheMessage.md +17 -0
  92. package/dist/docs/components/yk-dialog/yk-dialog.md +7 -0
  93. package/dist/tags.json +1 -0
  94. package/dist/web-types.json +1 -0
  95. package/docgen.config.js +14 -0
  96. package/global.d.ts +101 -0
  97. package/package.json +29 -33
  98. package/web-types.config.js +7 -0
  99. package/web-types.json +1 -0
  100. package/components/dialog/TheDialog.vue +0 -128
  101. package/components/dialog/index.ts +0 -38
  102. package/components/hy-safe-bottom/hy-safe-bottom.vue +0 -60
  103. package/components/hy-safe-bottom/index.scss +0 -5
  104. package/components/message/TheMessage.vue +0 -169
  105. package/components/message/index.ts +0 -54
  106. package/components/u-form/form.js +0 -22
  107. package/components/u-form/hy-form.vue +0 -324
  108. package/components/u-form/props.js +0 -49
  109. package/components/u-form/schema.js +0 -1451
  110. package/components/u-form/u-form.vue +0 -267
  111. package/components/u-form/utils.js +0 -65
  112. package/components/u-form-item/formItem.js +0 -24
  113. package/components/u-form-item/hy-form-item.vue +0 -360
  114. package/components/u-form-item/props.js +0 -57
  115. package/components/u-form-item/u-form-item.vue +0 -294
package/global.d.ts ADDED
@@ -0,0 +1,101 @@
1
+ declare module 'vue' {
2
+ // Helper for Volar
3
+ export interface GlobalComponents {
4
+ HyActionSheet: (typeof import('./components/hy-action-sheet/hy-action-sheet.vue'))['default']
5
+ HyBadge: (typeof import('./components/hy-badge/hy-badge.vue'))['default']
6
+ HyButton: (typeof import('./components/hy-button/hy-button.vue'))['default']
7
+ HyCalendar: (typeof import('./components/hy-calendar/hy-calendar.vue'))['default']
8
+ HyCalendarView: (typeof import('./components/hy-calendar-view/hy-calendar-view.vue'))['default']
9
+ HyCard: (typeof import('./components/hy-card/hy-card.vue'))['default']
10
+ HyCell: (typeof import('./components/hy-cell/hy-cell.vue'))['default']
11
+ HyCellGroup: (typeof import('./components/hy-cell-group/hy-cell-group.vue'))['default']
12
+ HyCheckbox: (typeof import('./components/hy-checkbox/hy-checkbox.vue'))['default']
13
+ HyCheckboxGroup: (typeof import('./components/hy-checkbox-group/hy-checkbox-group.vue'))['default']
14
+ HyCol: (typeof import('./components/hy-col/hy-col.vue'))['default']
15
+ HyColPicker: (typeof import('./components/hy-col-picker/hy-col-picker.vue'))['default']
16
+ HyCollapse: (typeof import('./components/hy-collapse/hy-collapse.vue'))['default']
17
+ HyCollapseItem: (typeof import('./components/hy-collapse-item/hy-collapse-item.vue'))['default']
18
+ HyConfigProvider: (typeof import('./components/hy-config-provider/hy-config-provider.vue'))['default']
19
+ HyCurtain: (typeof import('./components/hy-curtain/hy-curtain.vue'))['default']
20
+ HyDatetimePicker: (typeof import('./components/hy-datetime-picker/hy-datetime-picker.vue'))['default']
21
+ HyDatetimePickerView: (typeof import('./components/hy-datetime-picker-view/hy-datetime-picker-view.vue'))['default']
22
+ HyDivider: (typeof import('./components/hy-divider/hy-divider.vue'))['default']
23
+ HyDropMenu: (typeof import('./components/hy-drop-menu/hy-drop-menu.vue'))['default']
24
+ HyDropMenuItem: (typeof import('./components/hy-drop-menu-item/hy-drop-menu-item.vue'))['default']
25
+ HyGrid: (typeof import('./components/hy-grid/hy-grid.vue'))['default']
26
+ HyGridItem: (typeof import('./components/hy-grid-item/hy-grid-item.vue'))['default']
27
+ HyIcon: (typeof import('./components/hy-icon/hy-icon.vue'))['default']
28
+ HyImg: (typeof import('./components/hy-img/hy-img.vue'))['default']
29
+ HyImgCropper: (typeof import('./components/hy-img-cropper/hy-img-cropper.vue'))['default']
30
+ HyInput: (typeof import('./components/hy-input/hy-input.vue'))['default']
31
+ HyInputNumber: (typeof import('./components/hy-input-number/hy-input-number.vue'))['default']
32
+ HyLoading: (typeof import('./components/hy-loading/hy-loading.vue'))['default']
33
+ HyLoadmore: (typeof import('./components/hy-loadmore/hy-loadmore.vue'))['default']
34
+ HyMessageBox: (typeof import('./components/hy-message-box/hy-message-box.vue'))['default']
35
+ HyOverlay: (typeof import('./components/hy-overlay/hy-overlay.vue'))['default']
36
+ HyNoticeBar: (typeof import('./components/hy-notice-bar/hy-notice-bar.vue'))['default']
37
+ HyPagination: (typeof import('./components/hy-pagination/hy-pagination.vue'))['default']
38
+ HyPicker: (typeof import('./components/hy-picker/hy-picker.vue'))['default']
39
+ HyPickerView: (typeof import('./components/hy-picker-view/hy-picker-view.vue'))['default']
40
+ HyPopover: (typeof import('./components/hy-popover/hy-popover.vue'))['default']
41
+ HyPopup: (typeof import('./components/hy-popup/hy-popup.vue'))['default']
42
+ HyProgress: (typeof import('./components/hy-progress/hy-progress.vue'))['default']
43
+ HyRadio: (typeof import('./components/hy-radio/hy-radio.vue'))['default']
44
+ HyRadioGroup: (typeof import('./components/hy-radio-group/hy-radio-group.vue'))['default']
45
+ HyRate: (typeof import('./components/hy-rate/hy-rate.vue'))['default']
46
+ HyResize: (typeof import('./components/hy-resize/hy-resize.vue'))['default']
47
+ HyRow: (typeof import('./components/hy-row/hy-row.vue'))['default']
48
+ HySearch: (typeof import('./components/hy-search/hy-search.vue'))['default']
49
+ HySelectPicker: (typeof import('./components/hy-select-picker/hy-select-picker.vue'))['default']
50
+ HySlider: (typeof import('./components/hy-slider/hy-slider.vue'))['default']
51
+ HySortButton: (typeof import('./components/hy-sort-button/hy-sort-button.vue'))['default']
52
+ HyStatusTip: (typeof import('./components/hy-status-tip/hy-status-tip.vue'))['default']
53
+ HyStep: (typeof import('./components/hy-step/hy-step.vue'))['default']
54
+ HySteps: (typeof import('./components/hy-steps/hy-steps.vue'))['default']
55
+ HySticky: (typeof import('./components/hy-sticky/hy-sticky.vue'))['default']
56
+ HyStickyBox: (typeof import('./components/hy-sticky-box/hy-sticky-box.vue'))['default']
57
+ HySwipeAction: (typeof import('./components/hy-swipe-action/hy-swipe-action.vue'))['default']
58
+ HySwitch: (typeof import('./components/hy-switch/hy-switch.vue'))['default']
59
+ HyTab: (typeof import('./components/hy-tab/hy-tab.vue'))['default']
60
+ HyTabs: (typeof import('./components/hy-tabs/hy-tabs.vue'))['default']
61
+ HyTag: (typeof import('./components/hy-tag/hy-tag.vue'))['default']
62
+ HyToast: (typeof import('./components/hy-toast/hy-toast.vue'))['default']
63
+ HyTooltip: (typeof import('./components/hy-tooltip/hy-tooltip.vue'))['default']
64
+ HyTransition: (typeof import('./components/hy-transition/hy-transition.vue'))['default']
65
+ HyUpload: (typeof import('./components/hy-upload/hy-upload.vue'))['default']
66
+ HyNotify: (typeof import('./components/hy-notify/hy-notify.vue'))['default']
67
+ HyWatermark: (typeof import('./components/hy-watermark/hy-watermark.vue'))['default']
68
+ HyCircle: (typeof import('./components/hy-circle/hy-circle.vue'))['default']
69
+ HySwiper: (typeof import('./components/hy-swiper/hy-swiper.vue'))['default']
70
+ HySwiperNav: (typeof import('./components/hy-swiper-nav/hy-swiper-nav.vue'))['default']
71
+ HySegmented: (typeof import('./components/hy-segmented/hy-segmented.vue'))['default']
72
+ HyTabbar: (typeof import('./components/hy-tabbar/hy-tabbar.vue'))['default']
73
+ HyTabbarItem: (typeof import('./components/hy-tabbar-item/hy-tabbar-item.vue'))['default']
74
+ HyNavbar: (typeof import('./components/hy-navbar/hy-navbar.vue'))['default']
75
+ HyNavbarCapsule: (typeof import('./components/hy-navbar-capsule/hy-navbar-capsule.vue'))['default']
76
+ HyTable: (typeof import('./components/hy-table/hy-table.vue'))['default']
77
+ HyTableCol: (typeof import('./components/hy-table-col/hy-table-col.vue'))['default']
78
+ HySidebar: (typeof import('./components/hy-sidebar/hy-sidebar.vue'))['default']
79
+ HySidebarItem: (typeof import('./components/hy-sidebar-item/hy-sidebar-item.vue'))['default']
80
+ HyFab: (typeof import('./components/hy-fab/hy-fab.vue'))['default']
81
+ HyCountDown: (typeof import('./components/hy-count-down/hy-count-down.vue'))['default']
82
+ HyNumberKeyboard: (typeof import('./components/hy-number-keyboard/hy-number-keyboard.vue'))['default']
83
+ HyKeyboard: (typeof import('./components/hy-keyboard/hy-keyboard.vue'))['default']
84
+ HyGap: (typeof import('./components/hy-gap/hy-gap.vue'))['default']
85
+ HyPasswordInput: (typeof import('./components/hy-password-input/hy-password-input.vue'))['default']
86
+ HyForm: (typeof import('./components/hy-form/hy-form.vue'))['default']
87
+ HyTextarea: (typeof import('./components/hy-textarea/hy-textarea.vue'))['default']
88
+ HyVideoPreview: (typeof import('./components/hy-video-preview/hy-video-preview.vue'))['default']
89
+ HyBacktop: (typeof import('./components/hy-backtop/hy-backtop.vue'))['default']
90
+ HySkeleton: (typeof import('./components/hy-skeleton/hy-skeleton.vue'))['default']
91
+ HyIndexBar: (typeof import('./components/hy-index-bar/hy-index-bar.vue'))['default']
92
+ HyIndexAnchor: (typeof import('./components/hy-index-anchor/hy-index-anchor.vue'))['default']
93
+ HyText: (typeof import('./components/hy-text/hy-text.vue'))['default']
94
+ HyCountTo: (typeof import('./components/hy-count-to/hy-count-to.vue'))['default']
95
+ HyFloatingPanel: (typeof import('./components/hy-floating-panel/hy-floating-panel.vue'))['default']
96
+ HySignature: (typeof import('./components/hy-signature/hy-signature.vue'))['default']
97
+ HyRootPortal: (typeof import('./components/hy-root-portal/hy-root-portal.vue'))['default']
98
+ }
99
+ }
100
+
101
+ export {}
package/package.json CHANGED
@@ -1,33 +1,29 @@
1
- {
2
- "name": "hy-app",
3
- "version": "0.2.11",
4
- "description": "增加修改组件提示",
5
- "main": "./index.ts",
6
- "private": false,
7
- "scripts": {},
8
- "files": [
9
- "common/",
10
- "components/",
11
- "composables/",
12
- "global/",
13
- "public/",
14
- "store/",
15
- "typing/",
16
- "utils/",
17
- "api/",
18
- "config/",
19
- "libs/",
20
- "index.ts",
21
- "index.scss",
22
- "theme.scss",
23
- "README.md"
24
- ],
25
- "keywords": [
26
- "华玥组件库",
27
- "ui组件库",
28
- "暗黑模式"
29
- ],
30
- "web-types": "web-types.json",
31
- "author": "gaoxianhua",
32
- "license": "MIT"
33
- }
1
+ {
2
+ "name": "hy-app",
3
+ "version": "0.2.13",
4
+ "description": "测试组件提示",
5
+ "main": "./index.ts",
6
+ "private": false,
7
+ "scripts": {
8
+ "web-types": "vue-docgen-web-types --configFile web-types.config.js",
9
+ "web": "npx web-types-generator --name hy-app --src ./components --out ./web-types.json",
10
+ "doc": "npx vue-docgen -c docgen.config.js",
11
+ "gen:web-types": "tsx ./component-helper.ts"
12
+ },
13
+ "keywords": [
14
+ "华玥组件库",
15
+ "ui组件库",
16
+ "暗黑模式"
17
+ ],
18
+ "web-types": "./web-types.json",
19
+ "author": "gaoxianhua",
20
+ "license": "MIT",
21
+ "devDependencies": {
22
+ "component-helper": "1.3.1-rc.1",
23
+ "components-helper": "^2.2.0",
24
+ "tsx": "^4.20.3",
25
+ "vue-docgen-api": "^4.79.2",
26
+ "vue-docgen-cli": "^4.79.0",
27
+ "vue-docgen-web-types": "^0.1.8"
28
+ }
29
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ // 1. 告诉扫描器去哪里找组件
3
+ components: './components/**/*.vue',
4
+
5
+ // 2. 输出生成的文件
6
+ outFile: './web-types.json',
7
+ }
package/web-types.json ADDED
@@ -0,0 +1 @@
1
+ {"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"hy-app","version":"0.2.13","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{"vue-components":[{"name":"hy-button","source":{"symbol":"hy-button"},"description":"我是 按钮啊啊啊","props":[{"name":"hairline","description":"","type":["boolean"],"default":"false","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"type","description":"","type":["string"],"default":"'primary'","attribute-value":{"type":"enum"},"values":[{"name":"`info`"},{"name":"`primary`"},{"name":"`error`"},{"name":"`warning`"},{"name":"`success`"}]},{"name":"size","description":"","type":["string"],"default":"'medium'","attribute-value":{"type":"enum"},"values":[{"name":"`large`"},{"name":"`medium`"},{"name":"`small`"},{"name":"`mini`"}]},{"name":"shape","description":"","type":["string"],"default":"'square'","attribute-value":{"type":"enum"},"values":[{"name":"`circle`"},{"name":"`square`"}]},{"name":"plain","description":"","type":["boolean"],"default":"false","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"disabled","description":"","type":["boolean"],"default":"false","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"loading","description":"","type":["boolean"],"default":"false","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"loadingText","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"loadingMode","description":"","type":["string"],"default":"'spinner'","attribute-value":{"type":"enum"},"values":[{"name":"`spinner`"},{"name":"`circle`"},{"name":"`semicircle`"}]},{"name":"loadingSize","description":"","type":["number"],"default":"13","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"openType","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"formType","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"appParameter","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"hoverStopPropagation","description":"","type":["boolean"],"default":"true","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"lang","description":"","type":["string"],"default":"'en'","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"sessionFrom","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"sendMessageTitle","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"sendMessagePath","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"sendMessageImg","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"showMessageCard","description":"","type":["boolean"],"default":"false","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"dataName","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"throttleTime","description":"","type":["number"],"default":"0","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"hoverStartTime","description":"","type":["number"],"default":"0","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"hoverStayTime","description":"","type":["number"],"default":"200","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"text","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"icon","description":"","type":["object"],"default":"{}","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"color","description":"","type":["string"],"default":"''","attribute-value":{"type":"enum"},"values":[{"name":"-"}]},{"name":"stop","description":"","type":["boolean"],"default":"true","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"customStyle","description":"","type":[{"name":"CSSProperties","source":{"symbol":"CSSProperties"}}],"default":"","attribute-value":{"type":"of-match"},"values":[{"name":"-"}]},{"name":"customClass","description":"","type":["string"],"default":"","attribute-value":{"type":"enum"},"values":[{"name":"-"}]}],"slots":[{"name":"default","description":"插入默认的值"}],"js":{"events":[{"name":"click","description":"点击按钮事件"},{"name":"error","description":"仅限微信小程序,当使用开放能力时,发生错误的回调"},{"name":"getphonenumber","description":"微信小程序获取手机号"},{"name":"getuserinfo","description":"微信小程序用户点击该按钮时,会返回获取到的用户信息,从返回参数的 detail 中获取到的值同 uni.getUserInfo"},{"name":"opensetting","description":"仅限微信小程序,在打开授权设置页并关闭后回调"},{"name":"launchapp","description":"仅限微信小程序,打开 APP 成功的回调"},{"name":"agreeprivacyauthorization","description":"仅限微信小程序,用户同意隐私协议事件回调,open-type=\"agreePrivacyAuthorization\"时有效"}]}}]}}}
@@ -1,128 +0,0 @@
1
- <template>
2
- <view class="dialog dialog-shade">
3
- <view class="dialog-container">
4
- <u-image
5
- class="dialog-container__icon"
6
- bgColor="transparent"
7
- :src="icon"
8
- :width="140"
9
- :height="140"
10
- ></u-image>
11
- <view class="dialog-container__title">{{ title }}</view>
12
- <view class="dialog-container__content">{{ content }}</view>
13
-
14
- <view class="dialog-container__btn">
15
- <u-button
16
- v-if="showCancel"
17
- :text="cancelText"
18
- :color="cancelColor"
19
- :shape="shape"
20
- size="large"
21
- @click="result(false)"
22
- ></u-button>
23
- <u-button
24
- :text="confirmText"
25
- :color="confirmColor"
26
- :shape="shape"
27
- size="large"
28
- @click="result(true)"
29
- ></u-button>
30
- </view>
31
- </view>
32
- </view>
33
- </template>
34
-
35
- <script lang="ts" setup>
36
- /**
37
- * @用途
38
- * @author Pino
39
- * @创建时间 2023-01-11 15:19
40
- **/
41
- import dialog from "./index";
42
-
43
- export interface DialogParam {
44
- icon?: string;
45
- title?: string;
46
- content?: string;
47
- confirmText?: string;
48
- cancelText?: string;
49
- shape?: "circle" | "square";
50
- confirmColor?: string;
51
- cancelColor?: string;
52
- showCancel?: boolean;
53
- result?: Function; // 回调用户操作结果
54
- }
55
- const props = withDefaults(defineProps<DialogParam>(), {
56
- icon: "https://pic1.imgdb.cn/item/67a74cbdd0e0a243d4fd160b.png",
57
- title: "提示",
58
- content: "",
59
- confirmText: "确认",
60
- cancelText: "取消",
61
- shape: "circle",
62
- confirmColor: "#906FFE",
63
- cancelColor: "",
64
- showCancel: false,
65
- result: () => {}
66
- });
67
-
68
- const close = () => dialog.close();
69
-
70
- const result = (isSure: boolean) => {
71
- console.log(props);
72
- console.log(props.result);
73
- if (props.result)
74
- props.result({
75
- confirm: isSure,
76
- cancel: isSure
77
- });
78
- close();
79
- };
80
- </script>
81
-
82
- <style lang="scss" scoped>
83
- .dialog {
84
- position: fixed;
85
- z-index: 999999;
86
- &-shade {
87
- top: 0;
88
- width: 100%;
89
- height: 100%;
90
- background: rgba(0, 0, 0, 0.5);
91
- }
92
- &-container {
93
- position: absolute;
94
- transform: translate(-50%, -50%);
95
- left: 50%;
96
- top: 50%;
97
- border-radius: 40px;
98
- background: #ffffff;
99
- width: 90%;
100
- //height: 300px;
101
- padding: 40px 20px;
102
- text-align: center;
103
-
104
- &__icon {
105
- position: absolute;
106
- top: -100px;
107
- left: 50%;
108
- transform: translateX(-50%);
109
- }
110
-
111
- &__title {
112
- margin: 20px 0;
113
- font-size: 50rpx;
114
- }
115
- &__content {
116
- margin: 20px 0;
117
- font-size: 30rpx;
118
- color: #c3d8db;
119
- }
120
- &__btn {
121
- display: flex;
122
- .u-button {
123
- margin: 30px 10px 20px;
124
- }
125
- }
126
- }
127
- }
128
- </style>
@@ -1,38 +0,0 @@
1
- import { createApp } from "vue";
2
- import AlertDialogCom, { type DialogParam } from "./TheDialog.vue";
3
- import type { ResultParam } from "../../typing";
4
-
5
- export default class Dialog {
6
- private static mountNode: HTMLElement | null = null;
7
-
8
- public static show(param: DialogParam) {
9
- let app = createApp(AlertDialogCom, { ...param });
10
- this.mountNode = document.createElement("div");
11
- app.mount(this.mountNode);
12
- document.body.appendChild(this.mountNode);
13
- }
14
-
15
- // await用法
16
- // let res = await DialogAialog.showByAwait({
17
- // title: '提示',
18
- // content: '确定要作废该条订单吗?',
19
- // })
20
- // if (res.confirm) {
21
- //
22
- // } else if (res.cancle) {
23
- // console.log('web', '用户取消')
24
- // }
25
- public static showByAwait(param: DialogParam): Promise<ResultParam> {
26
- return new Promise((resolve, reject) => {
27
- param.result = (res: ResultParam) => resolve(res);
28
- this.show(param);
29
- });
30
- }
31
-
32
- public static close() {
33
- if (!this.mountNode) return;
34
- document.body.removeChild(this.mountNode);
35
- this.mountNode = null;
36
- // console.log('close', 'DialogAialog已销毁')
37
- }
38
- }
@@ -1,60 +0,0 @@
1
- <template>
2
- <view
3
- class="u-safe-bottom"
4
- :style="[style]"
5
- :class="[!isNvue && 'u-safe-area-inset-bottom']"
6
- >
7
- </view>
8
- </template>
9
-
10
- <script>
11
- import { props } from "./props.js";
12
- import { mpMixin } from "../../libs/mixin/mpMixin";
13
- import { mixin } from "../../libs/mixin/mixin";
14
- import {
15
- addStyle,
16
- deepMerge,
17
- addUnit,
18
- getWindowInfo,
19
- } from "../../libs/function/index";
20
- /**
21
- * SafeBottom 底部安全区
22
- * @description 这个适配,主要是针对IPhone X等一些底部带指示条的机型,指示条的操作区域与页面底部存在重合,容易导致用户误操作,因此我们需要针对这些机型进行底部安全区适配。
23
- * @tutorial https://ijry.github.io/uview-plus/components/safeAreaInset.html
24
- * @property {type} prop_name
25
- * @property {Object} customStyle 定义需要用到的外部样式
26
- *
27
- * @event {Function()}
28
- * @example <u-status-bar></u-status-bar>
29
- */
30
- export default {
31
- name: "u-safe-bottom",
32
- mixins: [mpMixin, mixin, props],
33
- data() {
34
- return {
35
- safeAreaBottomHeight: 0,
36
- isNvue: false,
37
- };
38
- },
39
- computed: {
40
- style() {
41
- const style = {};
42
- // #ifdef APP-NVUE || MP-TOUTIAO
43
- // nvue下,高度使用js计算填充
44
- style.height = addUnit(getWindowInfo().safeAreaInsets.bottom, "px");
45
- // #endif
46
- return deepMerge(style, addStyle(this.customStyle));
47
- },
48
- },
49
- mounted() {
50
- // #ifdef APP-NVUE
51
- // 标识为是否nvue
52
- this.isNvue = true;
53
- // #endif
54
- },
55
- };
56
- </script>
57
-
58
- <style lang="scss" scoped>
59
- @import "./index.scss";
60
- </style>
@@ -1,5 +0,0 @@
1
- .u-safe-bottom {
2
- /* #ifndef APP-NVUE */
3
- width: 100%;
4
- /* #endif */
5
- }
@@ -1,169 +0,0 @@
1
- <template>
2
- <Transition name="fade">
3
- <view class="dialog dialog-shade" v-if="show">
4
- <view class="dialog-container" v-if="show">
5
- <image class="dialog-container__icon" :src="param.icon"></image>
6
- <view class="dialog-container__title">{{ param.title }}</view>
7
- <view class="dialog-container__content">{{ param.content }}</view>
8
-
9
- <view class="dialog-container__btn">
10
- <u-button
11
- v-if="param.showCancel"
12
- :text="param.cancelText"
13
- :color="param.cancelColor"
14
- :shape="param.shape"
15
- size="large"
16
- @click="result(false)"
17
- ></u-button>
18
- <u-button
19
- :text="param.confirmText"
20
- :color="param.confirmColor"
21
- :shape="param.shape"
22
- size="large"
23
- @click="result(true)"
24
- ></u-button>
25
- </view>
26
- </view>
27
- </view>
28
- </Transition>
29
- </template>
30
-
31
- <script lang="ts" setup>
32
- import { ref, toRefs } from "vue";
33
- import DialogService from "./index";
34
- /**
35
- * @用途
36
- * @author Pino
37
- * @创建时间 2023-01-11 15:19
38
- **/
39
-
40
- export interface DialogParam {
41
- icon?: string;
42
- title?: string;
43
- content?: string;
44
- confirmText?: string;
45
- cancelText?: string;
46
- shape?: "circle" | "square";
47
- confirmColor?: string;
48
- cancelColor?: string;
49
- showCancel?: boolean;
50
- result?: Function; // 回调用户操作结果
51
- }
52
- // const props = withDefaults(defineProps<DialogParam>(), {
53
- // icon: "https://pic1.imgdb.cn/item/67a74cbdd0e0a243d4fd160b.png",
54
- // title: "提示",
55
- // content: "",
56
- // confirmText: "确认",
57
- // cancelText: "取消",
58
- // shape: "circle",
59
- // confirmColor: "#906FFE",
60
- // cancelColor: "",
61
- // showCancel: false,
62
- // result: () => {}
63
- // });
64
- const show = ref(false);
65
- const param = ref<DialogParam>({
66
- icon: "https://pic1.imgdb.cn/item/67a74cbdd0e0a243d4fd160b.png",
67
- title: "提示",
68
- content: "",
69
- confirmText: "确认",
70
- cancelText: "取消",
71
- shape: "circle",
72
- confirmColor: "#906FFE",
73
- cancelColor: "",
74
- showCancel: false,
75
- result: () => {}
76
- });
77
-
78
- const open = (options: DialogParam) => {
79
- show.value = true;
80
- param.value = Object.assign(param.value, options);
81
- };
82
-
83
- const close = () => {
84
- show.value = false;
85
- DialogService.close();
86
- };
87
-
88
- const result = (isSure: boolean) => {
89
- if (param.value.result) {
90
- param.value.result({
91
- confirm: isSure,
92
- cancel: !isSure
93
- });
94
- }
95
- close();
96
- };
97
-
98
- defineExpose({ open, close }); // 暴露方法供外部调用
99
- </script>
100
-
101
- <style lang="scss" scoped>
102
- /* Vue Transition */
103
- .fade-enter-active,
104
- .fade-leave-active {
105
- transition: opacity 0.3s ease;
106
- }
107
-
108
- .fade-enter-from,
109
- .fade-leave-to {
110
- opacity: 0;
111
- }
112
- .dialog {
113
- position: fixed;
114
- z-index: 999999;
115
- &-shade {
116
- top: 0;
117
- width: 100%;
118
- height: 100%;
119
- background: rgba(0, 0, 0, 0.5);
120
- }
121
- &-container {
122
- position: absolute;
123
- transform: translate(-50%, -50%);
124
- left: 50%;
125
- top: 50%;
126
- border-radius: 40px;
127
- background: #ffffff;
128
- width: 90%;
129
- padding: 40px 20px;
130
- text-align: center;
131
- animation: slideIn 0.4s ease;
132
- @keyframes slideIn {
133
- from {
134
- transform: translate(-50%, 50%);
135
- opacity: 0;
136
- }
137
- to {
138
- transform: translate(-50%, -50%);
139
- opacity: 1;
140
- }
141
- }
142
-
143
- &__icon {
144
- width: 140px;
145
- height: 140px;
146
- position: absolute;
147
- top: -110px;
148
- left: 50%;
149
- transform: translateX(-50%);
150
- }
151
-
152
- &__title {
153
- margin: 20px 0;
154
- font-size: 50rpx;
155
- }
156
- &__content {
157
- margin: 20px 0;
158
- font-size: 30rpx;
159
- color: #c3d8db;
160
- }
161
- &__btn {
162
- display: flex;
163
- .u-button {
164
- margin: 30px 10px 20px;
165
- }
166
- }
167
- }
168
- }
169
- </style>
@@ -1,54 +0,0 @@
1
- import { createVNode, render } from "vue";
2
- import Dialog, { type DialogParam } from "./TheMessage.vue";
3
-
4
- let instance: any = null;
5
-
6
- const successIcon = "https://pic1.imgdb.cn/item/67a74cbdd0e0a243d4fd160b.png";
7
- const errorIcon = "https://pic1.imgdb.cn/item/67b03ba3d0e0a243d4ff9078.png";
8
- const warningIcon = "https://pic1.imgdb.cn/item/67b03ba3d0e0a243d4ff9079.png";
9
- /**
10
- * @description 创建div添加dialog组件
11
- * */
12
- const mountDialog = () => {
13
- if (!instance) {
14
- const container = document.createElement("div");
15
- document.body.appendChild(container); // 先添加到 body
16
- instance = createVNode(Dialog);
17
- render(instance, container);
18
- }
19
- };
20
- /**
21
- * @description 打开传参
22
- * */
23
- const openParams = (options: DialogParam, icon: string) => {
24
- instance.component.exposed.open(
25
- Object.assign(
26
- {
27
- icon,
28
- },
29
- options,
30
- ),
31
- );
32
- };
33
-
34
- const DialogService = {
35
- success(options: DialogParam) {
36
- mountDialog();
37
- openParams(options, successIcon);
38
- },
39
- error(options: DialogParam) {
40
- mountDialog();
41
- openParams(options, errorIcon);
42
- },
43
- warning(options: DialogParam) {
44
- mountDialog();
45
- openParams(options, warningIcon);
46
- },
47
- close() {
48
- if (instance) {
49
- instance.component.exposed.close();
50
- }
51
- },
52
- };
53
-
54
- export default DialogService;