@gct-paas/core-web 0.1.4-dev.7 → 0.1.4-dev.9

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 (262) hide show
  1. package/dist/index-BghCpvxN.js +76 -0
  2. package/dist/index-PLrMc0gl.cjs +76 -0
  3. package/dist/index-oVPMi6Ep.js +29160 -0
  4. package/dist/index.esm.min.mjs +34 -7924
  5. package/dist/index.min.cjs +1 -20
  6. package/dist/index.min.css +1 -0
  7. package/dist/index.system.min.js +1 -20
  8. package/dist/monaco-editor-B8X-ou0h.js +20245 -0
  9. package/dist/monaco-editor-Bdgpd_KL.cjs +19 -0
  10. package/dist/monaco-editor-NIWDtQNB.js +19 -0
  11. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  12. package/es/components/app-modal/app-modal-component.css +149 -0
  13. package/es/components/app-modal/app-modal-component.d.ts +26 -0
  14. package/es/components/app-modal/app-modal-component.mjs +140 -0
  15. package/es/components/assets-svg-icon/assets-svg-icon.css +188 -0
  16. package/es/components/assets-svg-icon/assets-svg-icon.d.ts +134 -0
  17. package/es/components/assets-svg-icon/assets-svg-icon.mjs +238 -0
  18. package/es/components/assets-svg-icon/request.d.ts +2 -0
  19. package/es/components/assets-svg-icon/request.mjs +51 -0
  20. package/es/components/assets-svg-icon/utils.d.ts +9 -0
  21. package/es/components/assets-svg-icon/utils.mjs +21 -0
  22. package/es/components/assets-svg-icon/validate.d.ts +4 -0
  23. package/es/components/assets-svg-icon/validate.mjs +43 -0
  24. package/es/components/base-button/base-button.css +74 -0
  25. package/es/components/base-button/base-button.vue.d.ts +173 -0
  26. package/es/components/base-button/base-button.vue.mjs +7 -0
  27. package/es/components/base-button/base-button.vue3.mjs +179 -0
  28. package/es/components/basic-button/basic-button.css +25 -0
  29. package/es/components/basic-button/basic-button.vue.d.ts +100 -0
  30. package/es/components/basic-button/basic-button.vue.mjs +7 -0
  31. package/es/components/basic-button/basic-button.vue3.mjs +130 -0
  32. package/es/components/code-editor/code-editor.css +67 -0
  33. package/es/components/code-editor/code-editor.d.ts +1 -1
  34. package/es/components/code-editor/code-editor.mjs +9 -10
  35. package/es/components/index.d.ts +10 -0
  36. package/es/components/index.mjs +21 -6
  37. package/es/components/layout/flex-container/flex-container.css +67 -0
  38. package/es/components/layout/flex-container/flex-container.mjs +13 -9
  39. package/es/components/layout/flex-item/flex-item.mjs +11 -9
  40. package/es/components/layout/grid-container/grid-container.mjs +11 -7
  41. package/es/components/layout/view-container/view-container.css +83 -0
  42. package/es/components/layout/view-container/view-container.mjs +6 -7
  43. package/es/components/svg-icon/svg-icon.css +73 -0
  44. package/es/components/svg-icon/svg-icon.vue.d.ts +40 -0
  45. package/es/components/svg-icon/svg-icon.vue.mjs +50 -0
  46. package/es/components/svg-icon/svg-icon.vue3.mjs +6 -0
  47. package/es/create-app-vue.d.ts +9 -0
  48. package/es/create-app-vue.mjs +17 -0
  49. package/es/directives/drag-resize.d.ts +4 -0
  50. package/es/directives/drag-resize.mjs +42 -0
  51. package/es/directives/index.d.ts +8 -0
  52. package/es/directives/index.mjs +9 -0
  53. package/es/directives/target-loading.d.ts +4 -0
  54. package/es/directives/target-loading.mjs +40 -0
  55. package/es/editor/gct-form-check-switch/gct-form-check-switch.d.ts +1 -1
  56. package/es/editor/gct-form-i18n/gct-form-i18n.d.ts +1 -1
  57. package/es/editor/gct-form-info/gct-form-info.d.ts +1 -1
  58. package/es/editor/gct-form-length-unit/gct-form-length-unit.d.ts +1 -1
  59. package/es/editor/gct-form-number/gct-form-number.d.ts +1 -1
  60. package/es/editor/gct-form-radio/gct-form-radio.d.ts +1 -1
  61. package/es/editor/gct-form-select/gct-form-select.d.ts +1 -1
  62. package/es/editor/gct-form-switch/gct-form-switch.d.ts +1 -1
  63. package/es/editor/gct-form-textarea/gct-form-textarea.d.ts +1 -1
  64. package/es/hooks/index.d.ts +3 -0
  65. package/es/hooks/useDragLine.d.ts +6 -0
  66. package/es/hooks/useDragLine.mjs +79 -0
  67. package/es/hooks/useLocale.d.ts +4 -0
  68. package/es/hooks/useLocale.mjs +32 -0
  69. package/es/hooks/useTheme.d.ts +8 -0
  70. package/es/hooks/useTheme.mjs +20 -0
  71. package/es/index.d.ts +7 -7
  72. package/es/index.mjs +35 -24
  73. package/es/modules/code-editor/index.d.ts +163 -0
  74. package/es/modules/code-editor/index.mjs +8 -0
  75. package/es/modules/code-editor/monaco-editor.css +49 -0
  76. package/es/modules/code-editor/monaco-editor.vue.d.ts +143 -0
  77. package/es/modules/code-editor/monaco-editor.vue.mjs +7 -0
  78. package/es/modules/code-editor/monaco-editor.vue2.mjs +440 -0
  79. package/es/modules/code-editor/useEditorConsole.d.ts +54 -0
  80. package/es/modules/code-editor/useEditorConsole.mjs +194 -0
  81. package/es/modules/code-editor/useMonacoEditor.d.ts +26 -0
  82. package/es/modules/code-editor/useMonacoEditor.mjs +26 -0
  83. package/es/modules/color-picker/index.d.ts +2 -0
  84. package/es/modules/color-picker/src/ColorPicker.css +16 -0
  85. package/es/modules/color-picker/src/ColorPicker.vue.d.ts +49 -0
  86. package/es/modules/color-picker/src/ColorPicker.vue.mjs +8 -0
  87. package/es/modules/color-picker/src/ColorPicker.vue2.mjs +545 -0
  88. package/es/modules/color-picker/src/ColorPicker2.css +156 -0
  89. package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.css +72 -0
  90. package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.d.ts +37 -0
  91. package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.mjs +195 -0
  92. package/es/modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.css +79 -0
  93. package/es/modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.d.ts +29 -0
  94. package/es/modules/gct-dnd/components/gct-dnd-drop-line/gct-dnd-drop-line.mjs +98 -0
  95. package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.css +70 -0
  96. package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.d.ts +50 -0
  97. package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.mjs +239 -0
  98. package/es/modules/gct-dnd/constants/index.d.ts +22 -0
  99. package/es/modules/gct-dnd/constants/index.mjs +20 -0
  100. package/es/modules/gct-dnd/index.d.ts +5 -0
  101. package/es/modules/gct-dnd/interface/i-gct-dnd-config.d.ts +101 -0
  102. package/es/modules/gct-dnd/interface/i-gct-dnd-data.d.ts +14 -0
  103. package/es/modules/gct-dnd/interface/i-gct-dnd-render-item-options.d.ts +28 -0
  104. package/es/modules/gct-dnd/interface/i-gct-drag-collect.d.ts +24 -0
  105. package/es/modules/gct-dnd/interface/i-gct-drag-dnd-data.d.ts +51 -0
  106. package/es/modules/gct-dnd/interface/i-gct-drop-collect.d.ts +32 -0
  107. package/es/modules/gct-dnd/interface/i-gct-drop-result.d.ts +47 -0
  108. package/es/modules/gct-dnd/interface/index.d.ts +7 -0
  109. package/es/modules/global-modal/index.d.ts +5 -0
  110. package/es/modules/global-modal/index.mjs +16 -0
  111. package/es/modules/global-modal/src/BasicModal.vue.d.ts +518 -0
  112. package/es/modules/global-modal/src/BasicModal.vue.mjs +221 -0
  113. package/es/modules/global-modal/src/BasicModal.vue2.mjs +5 -0
  114. package/es/modules/global-modal/src/components/GlboalModal.d.ts +251 -0
  115. package/es/modules/global-modal/src/components/GlboalModal.mjs +40 -0
  116. package/es/modules/global-modal/src/components/ModalClose.css +95 -0
  117. package/es/modules/global-modal/src/components/ModalClose.vue.d.ts +27 -0
  118. package/es/modules/global-modal/src/components/ModalClose.vue.mjs +79 -0
  119. package/es/modules/global-modal/src/components/ModalClose.vue3.mjs +6 -0
  120. package/es/modules/global-modal/src/components/ModalFooter.vue.d.ts +270 -0
  121. package/es/modules/global-modal/src/components/ModalFooter.vue.mjs +44 -0
  122. package/es/modules/global-modal/src/components/ModalFooter.vue2.mjs +5 -0
  123. package/es/modules/global-modal/src/components/ModalHeader.vue.d.ts +17 -0
  124. package/es/modules/global-modal/src/components/ModalHeader.vue.mjs +11 -0
  125. package/es/modules/global-modal/src/components/ModalHeader.vue2.mjs +13 -0
  126. package/es/modules/global-modal/src/components/ModalWrapper.vue.d.ts +95 -0
  127. package/es/modules/global-modal/src/components/ModalWrapper.vue.mjs +26 -0
  128. package/es/modules/global-modal/src/components/ModalWrapper.vue2.mjs +136 -0
  129. package/es/modules/global-modal/src/hooks/useModal.d.ts +6 -0
  130. package/es/modules/global-modal/src/hooks/useModal.mjs +120 -0
  131. package/es/modules/global-modal/src/hooks/useModalContext.d.ts +5 -0
  132. package/es/modules/global-modal/src/hooks/useModalContext.mjs +11 -0
  133. package/es/modules/global-modal/src/hooks/useModalDrag.d.ts +7 -0
  134. package/es/modules/global-modal/src/hooks/useModalDrag.mjs +82 -0
  135. package/es/modules/global-modal/src/hooks/useModalFullScreen.d.ts +11 -0
  136. package/es/modules/global-modal/src/hooks/useModalFullScreen.mjs +16 -0
  137. package/es/modules/global-modal/src/index.css +153 -0
  138. package/es/modules/global-modal/src/props.d.ts +156 -0
  139. package/es/modules/global-modal/src/props.mjs +57 -0
  140. package/es/modules/global-modal/src/typing.d.ts +174 -0
  141. package/es/modules/target-loading/index.d.ts +4 -0
  142. package/es/modules/target-loading/src/createLoading.d.ts +13 -0
  143. package/es/modules/target-loading/src/createLoading.mjs +57 -0
  144. package/es/modules/target-loading/src/target-loading.css +18 -0
  145. package/es/modules/target-loading/src/target-loading.vue.d.ts +57 -0
  146. package/es/modules/target-loading/src/target-loading.vue.mjs +52 -0
  147. package/es/modules/target-loading/src/target-loading.vue3.mjs +7 -0
  148. package/es/modules/target-loading/src/typing.d.ts +9 -0
  149. package/es/modules/target-loading/src/useLoading.d.ts +9 -0
  150. package/es/setup-app.d.ts +1 -0
  151. package/es/setup-app.mjs +4 -0
  152. package/es/types/index.d.ts +190 -0
  153. package/es/utils/index.d.ts +4 -1
  154. package/es/utils/message-util/message-util.d.ts +7 -0
  155. package/es/utils/message-util/message-util.mjs +26 -0
  156. package/es/utils/monaco-loader/monaco-loader.d.ts +59 -0
  157. package/es/utils/monaco-loader/monaco-loader.mjs +88 -0
  158. package/es/utils/overlay-controller/overlay-controller.d.ts +18 -0
  159. package/es/utils/overlay-controller/overlay-controller.mjs +23 -0
  160. package/es/utils/with-install.mjs +0 -1
  161. package/es/widgets/gct-edit-form/gct-edit-form.d.ts +1 -1
  162. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.d.ts +1 -1
  163. package/package.json +19 -8
  164. package/dist/index.min.css.css +0 -1
  165. package/es/components/code-editor/code-editor.scss +0 -3
  166. package/es/components/layout/flex-container/flex-container.scss +0 -3
  167. package/es/components/layout/flex-item/flex-item.scss +0 -17
  168. package/es/components/layout/view-container/view-container.scss +0 -19
  169. package/es/editor/gct-form-check-switch/gct-form-check-switch.mjs +0 -53
  170. package/es/editor/gct-form-check-switch/gct-form-check-switch.provider.mjs +0 -6
  171. package/es/editor/gct-form-check-switch/gct-form-check-switch.scss +0 -10
  172. package/es/editor/gct-form-check-switch/index.mjs +0 -12
  173. package/es/editor/gct-form-checkbox/gct-form-checkbox.mjs +0 -70
  174. package/es/editor/gct-form-checkbox/gct-form-checkbox.scss +0 -56
  175. package/es/editor/gct-form-checkbox/index.mjs +0 -19
  176. package/es/editor/gct-form-color/gct-form-color.mjs +0 -45
  177. package/es/editor/gct-form-color/gct-form-color.provider.mjs +0 -6
  178. package/es/editor/gct-form-color/gct-form-color.scss +0 -3
  179. package/es/editor/gct-form-color/index.mjs +0 -17
  180. package/es/editor/gct-form-field-select/gct-form-field-select.mjs +0 -48
  181. package/es/editor/gct-form-field-select/gct-form-field-select.provider.mjs +0 -6
  182. package/es/editor/gct-form-field-select/gct-form-field-select.scss +0 -7
  183. package/es/editor/gct-form-field-select/gct-model-select.vue +0 -70
  184. package/es/editor/gct-form-field-select/index.mjs +0 -12
  185. package/es/editor/gct-form-i18n/gct-form-i18n.mjs +0 -62
  186. package/es/editor/gct-form-i18n/gct-form-i18n.provider.mjs +0 -6
  187. package/es/editor/gct-form-i18n/index.mjs +0 -12
  188. package/es/editor/gct-form-icon-select/gct-form-icon-select.mjs +0 -74
  189. package/es/editor/gct-form-icon-select/gct-form-icon-select.scss +0 -14
  190. package/es/editor/gct-form-icon-select/index.mjs +0 -14
  191. package/es/editor/gct-form-info/gct-form-info.mjs +0 -40
  192. package/es/editor/gct-form-info/gct-form-info.scss +0 -8
  193. package/es/editor/gct-form-info/index.mjs +0 -14
  194. package/es/editor/gct-form-length-unit/gct-form-length-unit.mjs +0 -43
  195. package/es/editor/gct-form-length-unit/gct-form-length-unit.provider.mjs +0 -6
  196. package/es/editor/gct-form-length-unit/index.mjs +0 -12
  197. package/es/editor/gct-form-modal-select/gct-form-modal-select.mjs +0 -99
  198. package/es/editor/gct-form-modal-select/gct-form-modal-select.provider.mjs +0 -6
  199. package/es/editor/gct-form-modal-select/gct-form-modal-select.scss +0 -7
  200. package/es/editor/gct-form-modal-select/index.mjs +0 -12
  201. package/es/editor/gct-form-number/gct-form-number.mjs +0 -44
  202. package/es/editor/gct-form-number/gct-form-number.provider.mjs +0 -6
  203. package/es/editor/gct-form-number/gct-form-number.scss +0 -3
  204. package/es/editor/gct-form-number/index.mjs +0 -17
  205. package/es/editor/gct-form-picker/gct-form-picker.mjs +0 -92
  206. package/es/editor/gct-form-picker/gct-form-picker.provider.mjs +0 -6
  207. package/es/editor/gct-form-picker/index.mjs +0 -12
  208. package/es/editor/gct-form-radio/gct-form-radio.mjs +0 -70
  209. package/es/editor/gct-form-radio/gct-form-radio.scss +0 -68
  210. package/es/editor/gct-form-radio/index.mjs +0 -19
  211. package/es/editor/gct-form-select/gct-form-select.mjs +0 -50
  212. package/es/editor/gct-form-select/gct-form-select.provider.mjs +0 -6
  213. package/es/editor/gct-form-select/index.mjs +0 -12
  214. package/es/editor/gct-form-span/gct-form-span.mjs +0 -89
  215. package/es/editor/gct-form-span/gct-form-span.provider.mjs +0 -6
  216. package/es/editor/gct-form-span/gct-form-span.scss +0 -10
  217. package/es/editor/gct-form-span/index.mjs +0 -12
  218. package/es/editor/gct-form-switch/gct-form-switch.mjs +0 -35
  219. package/es/editor/gct-form-switch/gct-form-switch.provider.mjs +0 -6
  220. package/es/editor/gct-form-switch/index.mjs +0 -17
  221. package/es/editor/gct-form-text/gct-form-text.mjs +0 -45
  222. package/es/editor/gct-form-text/gct-form-text.provider.mjs +0 -6
  223. package/es/editor/gct-form-text/index.mjs +0 -17
  224. package/es/editor/gct-form-textarea/gct-form-textarea.mjs +0 -40
  225. package/es/editor/gct-form-textarea/gct-form-textarea.provider.mjs +0 -6
  226. package/es/editor/gct-form-textarea/index.mjs +0 -12
  227. package/es/editor/index.mjs +0 -51
  228. package/es/utils/index.mjs +0 -3
  229. package/es/vite-env.d.ts +0 -1
  230. package/es/widgets/gct-edit-form/gct-edit-form.mjs +0 -126
  231. package/es/widgets/gct-edit-form/index.mjs +0 -10
  232. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.mjs +0 -73
  233. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.provider.mjs +0 -11
  234. package/es/widgets/gct-form/gct-form-collapse/gct-form-collapse.scss +0 -62
  235. package/es/widgets/gct-form/gct-form-collapse/index.mjs +0 -15
  236. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.mjs +0 -71
  237. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.provider.mjs +0 -13
  238. package/es/widgets/gct-form/gct-form-collapse-pane/gct-form-collapse-pane.scss +0 -23
  239. package/es/widgets/gct-form/gct-form-collapse-pane/index.mjs +0 -15
  240. package/es/widgets/gct-form/gct-form-group/gct-form-group.mjs +0 -88
  241. package/es/widgets/gct-form/gct-form-group/gct-form-group.provider.mjs +0 -11
  242. package/es/widgets/gct-form/gct-form-group/gct-form-group.scss +0 -28
  243. package/es/widgets/gct-form/gct-form-group/index.mjs +0 -15
  244. package/es/widgets/gct-form/gct-form-hidden-item/gct-form-hidden-item.provider.mjs +0 -13
  245. package/es/widgets/gct-form/gct-form-item/gct-form-item.mjs +0 -141
  246. package/es/widgets/gct-form/gct-form-item/gct-form-item.provider.mjs +0 -11
  247. package/es/widgets/gct-form/gct-form-item/gct-form-item.scss +0 -115
  248. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.mjs +0 -53
  249. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.provider.mjs +0 -11
  250. package/es/widgets/gct-form/gct-form-tab/gct-form-tab.scss +0 -63
  251. package/es/widgets/gct-form/gct-form-tab/index.mjs +0 -12
  252. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.mjs +0 -65
  253. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.provider.mjs +0 -11
  254. package/es/widgets/gct-form/gct-form-tab-pane/gct-form-tab-pane.scss +0 -16
  255. package/es/widgets/gct-form/gct-form-tab-pane/index.mjs +0 -15
  256. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.mjs +0 -71
  257. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.provider.mjs +0 -11
  258. package/es/widgets/gct-form/gct-form-title-group/gct-form-title-group.scss +0 -25
  259. package/es/widgets/gct-form/gct-form-title-group/index.mjs +0 -16
  260. package/es/widgets/gct-form/gct-form.mjs +0 -112
  261. package/es/widgets/gct-form/gct-form.scss +0 -11
  262. package/es/widgets/gct-form/index.mjs +0 -31
@@ -0,0 +1,238 @@
1
+ import { defineComponent, createVNode, getCurrentInstance, ref, onMounted, nextTick, onUnmounted, watch, computed } from 'vue';
2
+ import { useNamespace } from '@gct-paas/core';
3
+ import { ioniconContent, getSvgContent } from './request.mjs';
4
+ import { isRTL, getSrc } from './utils.mjs';
5
+ import './assets-svg-icon.css';/* empty css */
6
+
7
+ /**
8
+ * Create color classes for the icon.
9
+ * @param color - The color of the icon.
10
+ * @returns The color classes for the icon.
11
+ */
12
+ const createColorClasses = color => {
13
+ return color ? {
14
+ 'ion-color': true,
15
+ [`ion-color-${color}`]: true
16
+ } : null;
17
+ };
18
+
19
+ /**
20
+ * SVG图标组件 - 简化版本 (仅浏览器环境)
21
+ *
22
+ * 此组件是基于Stencil ion-icon组件简化的Vue实现,
23
+ * 专门用于浏览器环境,仅支持通过src属性加载SVG。
24
+ *
25
+ * ## 功能
26
+ * - 支持通过直接URL加载SVG图标
27
+ * - 支持懒加载
28
+ * - 支持RTL文本方向自动翻转
29
+ * - 支持颜色和大小变化
30
+ * - 支持SVG内容安全检查
31
+ *
32
+ * ## 使用示例
33
+ *
34
+ * // 使用 src 属性
35
+ * <SvgIcon src="/path/to/icon.svg" />
36
+ *
37
+ * // 设置大小和颜色
38
+ * <SvgIcon src="/path/to/icon.svg" size="large" color="primary" />
39
+ *
40
+ * // RTL 支持
41
+ * <SvgIcon src="/path/to/icon.svg" flipRtl={true} />
42
+ *
43
+ * // 懒加载
44
+ * <SvgIcon src="/path/to/icon.svg" lazy={true} />
45
+ *
46
+ * // 禁用 SVG 清理
47
+ * <SvgIcon src="/path/to/icon.svg" sanitize={false} />
48
+ */
49
+ const AssetsSvgIcon = /* @__PURE__ */ defineComponent({
50
+ name: 'AssetsSvgIcon',
51
+ props: {
52
+ /**
53
+ * The color to use for the background of the item.
54
+ */
55
+ color: {
56
+ type: String
57
+ },
58
+ /**
59
+ * Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
60
+ */
61
+ flipRtl: {
62
+ type: Boolean
63
+ },
64
+ /**
65
+ * Specifies the exact `src` of an SVG file to use.
66
+ */
67
+ src: {
68
+ type: String,
69
+ required: true
70
+ },
71
+ /**
72
+ * The size of the icon.
73
+ * Available options are: `"small"` and `"large"`.
74
+ */
75
+ size: {
76
+ type: String
77
+ },
78
+ /**
79
+ * If enabled, ion-icon will be loaded lazily when it's visible in the viewport.
80
+ * Default, `false`.
81
+ */
82
+ lazy: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ /**
87
+ * When set to `false`, SVG content that is HTTP fetched will not be checked
88
+ * if the response SVG content has any `<script>` elements, or any attributes
89
+ * that start with `on`, such as `onclick`.
90
+ * @default true
91
+ */
92
+ sanitize: {
93
+ type: Boolean,
94
+ default: true
95
+ }
96
+ },
97
+ setup(props) {
98
+ const ns = useNamespace('assets-svg-icon');
99
+ const instance = getCurrentInstance();
100
+
101
+ // Private state
102
+ let io;
103
+ const didLoadIcon = ref(false);
104
+
105
+ // Reactive state
106
+ const svgContent = ref(undefined);
107
+ const isVisible = ref(false);
108
+
109
+ /**
110
+ * Wait until the icon is visible in the viewport.
111
+ * @param el - The element to observe.
112
+ * @param rootMargin - The root margin of the observer.
113
+ * @param cb - The callback to call when the element is visible.
114
+ */
115
+ const waitUntilVisible = (el, rootMargin, cb) => {
116
+ /**
117
+ * IntersectionObserver is a browser API that allows you to observe
118
+ * the visibility of an element relative to a root element. It is
119
+ * supported in all modern browsers, except IE and when server-side
120
+ * rendering.
121
+ */
122
+ const hasIntersectionObserverSupport = Boolean(typeof window !== 'undefined' && props.lazy && window.IntersectionObserver);
123
+
124
+ /**
125
+ * browser doesn't support IntersectionObserver
126
+ * so just fallback to always show it
127
+ */
128
+ if (!hasIntersectionObserverSupport) {
129
+ return cb();
130
+ }
131
+ const intersectionObserver = io = new window.IntersectionObserver(data => {
132
+ if (data[0]?.isIntersecting) {
133
+ intersectionObserver.disconnect();
134
+ io = undefined;
135
+ cb();
136
+ }
137
+ }, {
138
+ rootMargin
139
+ });
140
+ intersectionObserver.observe(el);
141
+ };
142
+
143
+ /**
144
+ * Load the icon using only src URL
145
+ */
146
+ const loadIcon = () => {
147
+ if (typeof window !== 'undefined' && isVisible.value && props.src) {
148
+ const url = getSrc(props.src);
149
+ if (url) {
150
+ if (ioniconContent.has(url)) {
151
+ // sync if it's already loaded
152
+ svgContent.value = ioniconContent.get(url);
153
+ } else {
154
+ // async if it hasn't been loaded
155
+ getSvgContent(url, props.sanitize).then(() => {
156
+ svgContent.value = ioniconContent.get(url);
157
+ });
158
+ }
159
+ didLoadIcon.value = true;
160
+ }
161
+ }
162
+ };
163
+
164
+ // Component lifecycle hooks
165
+ onMounted(() => {
166
+ const el = instance?.vnode.el;
167
+ if (el) {
168
+ /**
169
+ * purposely do not return the promise here because loading
170
+ * the svg file should not hold up loading the app
171
+ * only load the svg if it's visible
172
+ */
173
+ waitUntilVisible(el, '50px', () => {
174
+ isVisible.value = true;
175
+ loadIcon();
176
+ });
177
+ }
178
+ nextTick(() => {
179
+ if (!didLoadIcon.value) {
180
+ loadIcon();
181
+ }
182
+ });
183
+ });
184
+ onUnmounted(() => {
185
+ if (io) {
186
+ io.disconnect();
187
+ io = undefined;
188
+ }
189
+ });
190
+
191
+ // Watch for src prop changes
192
+ watch(() => props.src, () => {
193
+ loadIcon();
194
+ });
195
+ const classes = computed(() => {
196
+ const {
197
+ flipRtl,
198
+ size,
199
+ color
200
+ } = props;
201
+ const el = instance?.vnode.el;
202
+
203
+ /**
204
+ * if flipRtl is true, the icon should change direction when `dir` changes
205
+ */
206
+ const shouldBeFlippable = flipRtl;
207
+ return {
208
+ ...createColorClasses(color),
209
+ [`icon-${size}`]: !!size,
210
+ 'flip-rtl': shouldBeFlippable,
211
+ 'icon-rtl': shouldBeFlippable && isRTL(el),
212
+ [ns.b()]: true
213
+ };
214
+ });
215
+ return {
216
+ ns,
217
+ svgContent,
218
+ classes
219
+ };
220
+ },
221
+ render() {
222
+ const {
223
+ svgContent,
224
+ classes
225
+ } = this;
226
+ return createVNode("div", {
227
+ "role": "img",
228
+ "class": classes
229
+ }, [typeof window !== 'undefined' && svgContent ? createVNode("div", {
230
+ "class": "icon-inner",
231
+ "innerHTML": svgContent
232
+ }, null) : createVNode("div", {
233
+ "class": "icon-inner"
234
+ }, null)]);
235
+ }
236
+ });
237
+
238
+ export { AssetsSvgIcon };
@@ -0,0 +1,2 @@
1
+ export declare const ioniconContent: Map<string, string>;
2
+ export declare const getSvgContent: (url: string, sanitize: boolean) => Promise<string>;
@@ -0,0 +1,51 @@
1
+ import { isSvgDataUrl, isEncodedDataUrl, validateContent } from './validate.mjs';
2
+
3
+ const ioniconContent = /* @__PURE__ */ new Map();
4
+ const requests = /* @__PURE__ */ new Map();
5
+ let parser;
6
+ function safeFallback(url) {
7
+ const svg = "";
8
+ ioniconContent.set(url, svg);
9
+ return svg;
10
+ }
11
+ const getSvgContent = (url, sanitize) => {
12
+ const req = requests.get(url);
13
+ if (req) {
14
+ return req;
15
+ }
16
+ if (typeof fetch !== "undefined" && typeof document !== "undefined") {
17
+ if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {
18
+ return Promise.resolve(getSvgByUrl(url));
19
+ }
20
+ return fetchSvg(url, sanitize);
21
+ }
22
+ return Promise.resolve(safeFallback(url));
23
+ };
24
+ function getSvgByUrl(url) {
25
+ if (!parser) {
26
+ parser = new DOMParser();
27
+ }
28
+ const doc = parser.parseFromString(url, "text/html");
29
+ const svg = doc.querySelector("svg");
30
+ if (svg) {
31
+ ioniconContent.set(url, svg.outerHTML);
32
+ return svg.outerHTML;
33
+ }
34
+ throw new Error(`Could not parse svg from ${url}`);
35
+ }
36
+ function fetchSvg(url, sanitize) {
37
+ const req = fetch(url).then((rsp) => {
38
+ return rsp.text().then((svgContent) => {
39
+ if (svgContent && sanitize !== false) {
40
+ svgContent = validateContent(svgContent);
41
+ }
42
+ const svg = svgContent || "";
43
+ ioniconContent.set(url, svg);
44
+ return svg;
45
+ }).catch(() => safeFallback(url));
46
+ }).catch(() => safeFallback(url));
47
+ requests.set(url, req);
48
+ return req;
49
+ }
50
+
51
+ export { getSvgContent, ioniconContent };
@@ -0,0 +1,9 @@
1
+ export declare const isStr: (val: any) => val is string;
2
+ export declare const isSrc: (str: string) => boolean;
3
+ export declare const getSrc: (src: string | undefined) => string | null;
4
+ /**
5
+ * Returns `true` if the document or host element
6
+ * has a `dir` set to `rtl`. The host value will always
7
+ * take priority over the root document value.
8
+ */
9
+ export declare const isRTL: (hostEl?: Pick<HTMLElement, "dir">) => boolean;
@@ -0,0 +1,21 @@
1
+ const isStr = (val) => typeof val === "string";
2
+ const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
3
+ const getSrc = (src) => {
4
+ if (isStr(src)) {
5
+ src = src.trim();
6
+ if (isSrc(src)) {
7
+ return src;
8
+ }
9
+ }
10
+ return null;
11
+ };
12
+ const isRTL = (hostEl) => {
13
+ if (hostEl) {
14
+ if (hostEl.dir !== "") {
15
+ return hostEl.dir.toLowerCase() === "rtl";
16
+ }
17
+ }
18
+ return document?.dir.toLowerCase() === "rtl";
19
+ };
20
+
21
+ export { getSrc, isRTL, isSrc, isStr };
@@ -0,0 +1,4 @@
1
+ export declare const validateContent: (svgContent: string) => string;
2
+ export declare const isValid: (elm: HTMLElement) => boolean;
3
+ export declare const isSvgDataUrl: (url: string) => boolean;
4
+ export declare const isEncodedDataUrl: (url: string) => boolean;
@@ -0,0 +1,43 @@
1
+ import { isStr } from './utils.mjs';
2
+
3
+ const validateContent = (svgContent) => {
4
+ const div = document.createElement("div");
5
+ div.innerHTML = svgContent;
6
+ for (let i = div.childNodes.length - 1; i >= 0; i--) {
7
+ if (div.childNodes[i].nodeName.toLowerCase() !== "svg") {
8
+ div.removeChild(div.childNodes[i]);
9
+ }
10
+ }
11
+ const svgElm = div.firstElementChild;
12
+ if (svgElm && svgElm.nodeName.toLowerCase() === "svg") {
13
+ const svgClass = svgElm.getAttribute("class") || "";
14
+ svgElm.setAttribute("class", (svgClass + " s-ion-icon").trim());
15
+ if (isValid(svgElm)) {
16
+ return div.innerHTML;
17
+ }
18
+ }
19
+ return "";
20
+ };
21
+ const isValid = (elm) => {
22
+ if (elm.nodeType === 1) {
23
+ if (elm.nodeName.toLowerCase() === "script") {
24
+ return false;
25
+ }
26
+ for (let i = 0; i < elm.attributes.length; i++) {
27
+ const name = elm.attributes[i].name;
28
+ if (isStr(name) && name.toLowerCase().indexOf("on") === 0) {
29
+ return false;
30
+ }
31
+ }
32
+ for (let i = 0; i < elm.childNodes.length; i++) {
33
+ if (!isValid(elm.childNodes[i])) {
34
+ return false;
35
+ }
36
+ }
37
+ }
38
+ return true;
39
+ };
40
+ const isSvgDataUrl = (url) => url.startsWith("data:image/svg+xml");
41
+ const isEncodedDataUrl = (url) => url.indexOf(";utf8,") !== -1;
42
+
43
+ export { isEncodedDataUrl, isSvgDataUrl, isValid, validateContent };
@@ -0,0 +1,74 @@
1
+ .ant-btn[data-v-5375ec2b] {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ }
6
+ .ant-btn.btn-font-color[data-v-5375ec2b] {
7
+ color: var(--v8d035854) !important;
8
+ }
9
+ .ant-btn.btn-bg-style[data-v-5375ec2b] {
10
+ border-color: var(--e376d652) !important;
11
+ background: var(--v4ee5fd6d) !important;
12
+ }
13
+ .square[data-v-5375ec2b] {
14
+ display: flex;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ justify-content: center;
18
+ width: 72px;
19
+ height: 72px;
20
+ padding: 0;
21
+ border-radius: 4px;
22
+ }
23
+ .square .icon-next[data-v-5375ec2b] {
24
+ margin: 0 !important;
25
+ }
26
+ .square .btn-title[data-v-5375ec2b] {
27
+ width: inherit;
28
+ padding: 0 8px;
29
+ }
30
+ .square.ant-btn-sm[data-v-5375ec2b] {
31
+ width: 72px;
32
+ height: 64px;
33
+ font-size: 14px;
34
+ }
35
+ .square.ant-btn-sm .btn-title[data-v-5375ec2b] {
36
+ padding: 0 4px;
37
+ }
38
+ .square.ant-btn-lg[data-v-5375ec2b] {
39
+ width: 80px;
40
+ height: 88px;
41
+ }
42
+ .squaref[data-v-5375ec2b] {
43
+ min-width: 72px;
44
+ height: 56px;
45
+ padding: 0;
46
+ }
47
+ .line[data-v-5375ec2b] {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ }
52
+ [data-v-5375ec2b] .group .ant-btn {
53
+ height: 100%;
54
+ }
55
+ [data-v-5375ec2b] .ant-btn-loading-icon {
56
+ width: 0;
57
+ height: 0;
58
+ line-height: 0;
59
+ }
60
+ [data-v-5375ec2b] .ant-btn-icon-only {
61
+ vertical-align: -2px;
62
+ }
63
+ .gct-text-overflow-2[data-v-5375ec2b] {
64
+ display: -webkit-inline-box;
65
+ display: -moz-inline-box;
66
+ display: inline-flexbox;
67
+ overflow: hidden;
68
+ text-overflow: ellipsis;
69
+ -webkit-line-clamp: 2;
70
+ line-clamp: 2;
71
+ -webkit-box-orient: vertical;
72
+ -moz-box-orient: vertical;
73
+ box-orient: 2;
74
+ }
@@ -0,0 +1,173 @@
1
+ import { PropType } from 'vue';
2
+ import { ButtonSize, ButtonStyle } from '@gct-paas/core';
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ block: {
5
+ type: BooleanConstructor;
6
+ default: boolean;
7
+ };
8
+ disabled: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ loading: {
13
+ type: BooleanConstructor;
14
+ default: boolean;
15
+ };
16
+ title: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ size: {
21
+ type: PropType<ButtonSize>;
22
+ default: string;
23
+ };
24
+ icon: {
25
+ type: StringConstructor;
26
+ default: string;
27
+ };
28
+ type: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
32
+ hasIcon: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ hasText: {
37
+ type: BooleanConstructor;
38
+ default: boolean;
39
+ };
40
+ danger: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ buttonStyle: {
45
+ type: PropType<ButtonStyle>;
46
+ default: string;
47
+ };
48
+ i18nConfig: {
49
+ type: StringConstructor;
50
+ default: string;
51
+ };
52
+ hidden: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ confirm: {
57
+ type: BooleanConstructor;
58
+ default: boolean;
59
+ };
60
+ confirmText: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
64
+ enableCustomColor: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
68
+ backgroundColor: {
69
+ type: StringConstructor;
70
+ default: string;
71
+ };
72
+ fontColor: {
73
+ type: StringConstructor;
74
+ default: string;
75
+ };
76
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
77
+ click: (...args: any[]) => void;
78
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
79
+ block: {
80
+ type: BooleanConstructor;
81
+ default: boolean;
82
+ };
83
+ disabled: {
84
+ type: BooleanConstructor;
85
+ default: boolean;
86
+ };
87
+ loading: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
91
+ title: {
92
+ type: StringConstructor;
93
+ default: string;
94
+ };
95
+ size: {
96
+ type: PropType<ButtonSize>;
97
+ default: string;
98
+ };
99
+ icon: {
100
+ type: StringConstructor;
101
+ default: string;
102
+ };
103
+ type: {
104
+ type: StringConstructor;
105
+ default: string;
106
+ };
107
+ hasIcon: {
108
+ type: BooleanConstructor;
109
+ default: boolean;
110
+ };
111
+ hasText: {
112
+ type: BooleanConstructor;
113
+ default: boolean;
114
+ };
115
+ danger: {
116
+ type: BooleanConstructor;
117
+ default: boolean;
118
+ };
119
+ buttonStyle: {
120
+ type: PropType<ButtonStyle>;
121
+ default: string;
122
+ };
123
+ i18nConfig: {
124
+ type: StringConstructor;
125
+ default: string;
126
+ };
127
+ hidden: {
128
+ type: BooleanConstructor;
129
+ default: boolean;
130
+ };
131
+ confirm: {
132
+ type: BooleanConstructor;
133
+ default: boolean;
134
+ };
135
+ confirmText: {
136
+ type: StringConstructor;
137
+ default: string;
138
+ };
139
+ enableCustomColor: {
140
+ type: BooleanConstructor;
141
+ default: boolean;
142
+ };
143
+ backgroundColor: {
144
+ type: StringConstructor;
145
+ default: string;
146
+ };
147
+ fontColor: {
148
+ type: StringConstructor;
149
+ default: string;
150
+ };
151
+ }>> & Readonly<{
152
+ onClick?: ((...args: any[]) => any) | undefined;
153
+ }>, {
154
+ type: string;
155
+ title: string;
156
+ loading: boolean;
157
+ size: ButtonSize;
158
+ disabled: boolean;
159
+ block: boolean;
160
+ danger: boolean;
161
+ icon: string;
162
+ hidden: boolean;
163
+ confirm: boolean;
164
+ hasIcon: boolean;
165
+ hasText: boolean;
166
+ buttonStyle: ButtonStyle;
167
+ i18nConfig: string;
168
+ confirmText: string;
169
+ enableCustomColor: boolean;
170
+ backgroundColor: string;
171
+ fontColor: string;
172
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
173
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import _sfc_main from './base-button.vue3.mjs';
2
+ import './base-button.css';/* empty css */
3
+ import _export_sfc from '../../_virtual/_plugin-vue_export-helper.mjs';
4
+
5
+ const baseButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5375ec2b"]]);
6
+
7
+ export { baseButton as default };