@ncds/ui-admin 1.6.3 → 1.6.4-alpha.0

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 (260) hide show
  1. package/mcp/bin/server.d.ts +1 -0
  2. package/mcp/bin/server.js +62 -0
  3. package/mcp/bin/server.mjs +14 -0
  4. package/mcp/bin/tools/getComponentHtml.d.ts +3 -0
  5. package/mcp/bin/tools/getComponentHtml.js +30 -0
  6. package/mcp/bin/tools/getComponentProps.d.ts +3 -0
  7. package/mcp/bin/tools/getComponentProps.js +16 -0
  8. package/mcp/bin/tools/listComponents.d.ts +3 -0
  9. package/mcp/bin/tools/listComponents.js +15 -0
  10. package/mcp/bin/tools/searchComponent.d.ts +3 -0
  11. package/mcp/bin/tools/searchComponent.js +20 -0
  12. package/mcp/bin/tools/validateHtml.d.ts +10 -0
  13. package/mcp/bin/tools/validateHtml.js +142 -0
  14. package/mcp/bin/types.d.ts +28 -0
  15. package/mcp/bin/types.js +5 -0
  16. package/mcp/bin/utils/dataLoader.d.ts +11 -0
  17. package/mcp/bin/utils/dataLoader.js +68 -0
  18. package/mcp/bin/utils/logger.d.ts +18 -0
  19. package/mcp/bin/utils/logger.js +27 -0
  20. package/mcp/bin/utils/response.d.ts +23 -0
  21. package/mcp/bin/utils/response.js +31 -0
  22. package/mcp/bin/version.d.ts +1 -0
  23. package/mcp/bin/version.js +4 -0
  24. package/mcp/data/.gitkeep +0 -0
  25. package/mcp/data/_meta.json +7 -0
  26. package/mcp/data/badge-group.json +73 -0
  27. package/mcp/data/badge.json +86 -0
  28. package/mcp/data/bread-crumb.json +22 -0
  29. package/mcp/data/breadcrumb.json +31 -0
  30. package/mcp/data/button-group.json +65 -0
  31. package/mcp/data/button.json +114 -0
  32. package/mcp/data/carousel-arrow.json +59 -0
  33. package/mcp/data/carousel-number-group.json +57 -0
  34. package/mcp/data/carousel.json +22 -0
  35. package/mcp/data/checkbox.json +31 -0
  36. package/mcp/data/combobox.json +114 -0
  37. package/mcp/data/date-picker.json +77 -0
  38. package/mcp/data/divider.json +56 -0
  39. package/mcp/data/dot.json +55 -0
  40. package/mcp/data/dropdown.json +81 -0
  41. package/mcp/data/empty-state.json +34 -0
  42. package/mcp/data/featured-icon.json +83 -0
  43. package/mcp/data/file-input.json +76 -0
  44. package/mcp/data/horizontal-tab.json +71 -0
  45. package/mcp/data/image-file-input.json +97 -0
  46. package/mcp/data/input.json +104 -0
  47. package/mcp/data/modal.json +85 -0
  48. package/mcp/data/notification.json +116 -0
  49. package/mcp/data/number-input.json +128 -0
  50. package/mcp/data/pagination.json +65 -0
  51. package/mcp/data/password-input.json +47 -0
  52. package/mcp/data/progress-bar.json +51 -0
  53. package/mcp/data/progress-circle.json +54 -0
  54. package/mcp/data/radio.json +31 -0
  55. package/mcp/data/range-date-picker-with-buttons.json +64 -0
  56. package/mcp/data/range-date-picker.json +55 -0
  57. package/mcp/data/select-dropdown.json +32 -0
  58. package/mcp/data/select.json +64 -0
  59. package/mcp/data/selectbox.json +129 -0
  60. package/mcp/data/slider.json +57 -0
  61. package/mcp/data/spinner.json +54 -0
  62. package/mcp/data/switch.json +71 -0
  63. package/mcp/data/tab.json +122 -0
  64. package/mcp/data/tag.json +66 -0
  65. package/mcp/data/textarea.json +88 -0
  66. package/mcp/data/toggle.json +59 -0
  67. package/mcp/data/tooltip.json +123 -0
  68. package/mcp/data/vertical-tab.json +64 -0
  69. package/mcp/templates/.mcp.json.example +8 -0
  70. package/mcp/templates/README.md +31 -0
  71. package/package.json +24 -3
  72. package/dist/cjs/assets/scripts/comboBox.js +0 -280
  73. package/dist/cjs/assets/scripts/datePicker.js +0 -706
  74. package/dist/cjs/assets/scripts/featuredIcon.js +0 -95
  75. package/dist/cjs/assets/scripts/fileInput/FileInput.js +0 -183
  76. package/dist/cjs/assets/scripts/fileInput/FileInputModel.js +0 -246
  77. package/dist/cjs/assets/scripts/fileInput/FileInputView.js +0 -455
  78. package/dist/cjs/assets/scripts/fileInput/const/classNames.js +0 -35
  79. package/dist/cjs/assets/scripts/fileInput/const/index.js +0 -27
  80. package/dist/cjs/assets/scripts/fileInput/const/types.js +0 -13
  81. package/dist/cjs/assets/scripts/fileInput/index.js +0 -44
  82. package/dist/cjs/assets/scripts/imageFileInput/ImageFileInput.js +0 -187
  83. package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputModel.js +0 -255
  84. package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputView.js +0 -354
  85. package/dist/cjs/assets/scripts/imageFileInput/const/classNames.js +0 -41
  86. package/dist/cjs/assets/scripts/imageFileInput/const/index.js +0 -27
  87. package/dist/cjs/assets/scripts/imageFileInput/const/types.js +0 -13
  88. package/dist/cjs/assets/scripts/imageFileInput/index.js +0 -44
  89. package/dist/cjs/assets/scripts/index.js +0 -30
  90. package/dist/cjs/assets/scripts/modal/Modal.js +0 -116
  91. package/dist/cjs/assets/scripts/modal/ModalActions.js +0 -128
  92. package/dist/cjs/assets/scripts/modal/ModalContent.js +0 -46
  93. package/dist/cjs/assets/scripts/modal/ModalHeader.js +0 -115
  94. package/dist/cjs/assets/scripts/modal/const/classNames.js +0 -41
  95. package/dist/cjs/assets/scripts/modal/const/index.js +0 -27
  96. package/dist/cjs/assets/scripts/modal/const/types.js +0 -5
  97. package/dist/cjs/assets/scripts/modal/index.js +0 -61
  98. package/dist/cjs/assets/scripts/modal/utils/contentUtils.js +0 -35
  99. package/dist/cjs/assets/scripts/notification/FloatingNotification.js +0 -180
  100. package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +0 -120
  101. package/dist/cjs/assets/scripts/notification/MessageNotification.js +0 -146
  102. package/dist/cjs/assets/scripts/notification/Notification.js +0 -116
  103. package/dist/cjs/assets/scripts/notification/const/classNames.js +0 -50
  104. package/dist/cjs/assets/scripts/notification/const/icons.js +0 -45
  105. package/dist/cjs/assets/scripts/notification/const/index.js +0 -87
  106. package/dist/cjs/assets/scripts/notification/const/sizes.js +0 -54
  107. package/dist/cjs/assets/scripts/notification/const/types.js +0 -14
  108. package/dist/cjs/assets/scripts/notification/index.js +0 -92
  109. package/dist/cjs/assets/scripts/notification/utils.js +0 -92
  110. package/dist/cjs/assets/scripts/progress-bar/ProgressBar.js +0 -272
  111. package/dist/cjs/assets/scripts/progress-bar/index.js +0 -12
  112. package/dist/cjs/assets/scripts/selectBox.js +0 -319
  113. package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +0 -46
  114. package/dist/cjs/assets/scripts/tab.js +0 -40
  115. package/dist/cjs/assets/scripts/tag/Tag.js +0 -268
  116. package/dist/cjs/assets/scripts/tag/const/classNames.js +0 -24
  117. package/dist/cjs/assets/scripts/tag/const/index.js +0 -38
  118. package/dist/cjs/assets/scripts/tag/const/sizes.js +0 -13
  119. package/dist/cjs/assets/scripts/tag/const/types.js +0 -5
  120. package/dist/cjs/assets/scripts/tag/index.js +0 -44
  121. package/dist/cjs/assets/scripts/tooltip/Tooltip.js +0 -380
  122. package/dist/cjs/assets/scripts/tooltip/TooltipLayerManager.js +0 -84
  123. package/dist/cjs/assets/scripts/tooltip/const/classNames.js +0 -29
  124. package/dist/cjs/assets/scripts/tooltip/const/constants.js +0 -56
  125. package/dist/cjs/assets/scripts/tooltip/const/icons.js +0 -15
  126. package/dist/cjs/assets/scripts/tooltip/const/index.js +0 -123
  127. package/dist/cjs/assets/scripts/tooltip/const/templates.js +0 -49
  128. package/dist/cjs/assets/scripts/tooltip/const/types.js +0 -5
  129. package/dist/cjs/assets/scripts/tooltip/index.js +0 -57
  130. package/dist/cjs/assets/scripts/tooltip/utils.js +0 -41
  131. package/dist/cjs/assets/scripts/utils/unifiedBox/DOMRenderer.js +0 -384
  132. package/dist/cjs/assets/scripts/utils/unifiedBox/DropdownModel.js +0 -368
  133. package/dist/cjs/assets/scripts/utils/unifiedBox/UnifiedBoxController.js +0 -681
  134. package/dist/cjs/assets/scripts/utils/unifiedBox/UnifiedBoxManager.js +0 -711
  135. package/dist/esm/assets/scripts/comboBox.js +0 -275
  136. package/dist/esm/assets/scripts/datePicker.js +0 -699
  137. package/dist/esm/assets/scripts/featuredIcon.js +0 -90
  138. package/dist/esm/assets/scripts/fileInput/FileInput.js +0 -178
  139. package/dist/esm/assets/scripts/fileInput/FileInputModel.js +0 -241
  140. package/dist/esm/assets/scripts/fileInput/FileInputView.js +0 -450
  141. package/dist/esm/assets/scripts/fileInput/const/classNames.js +0 -25
  142. package/dist/esm/assets/scripts/fileInput/const/index.js +0 -2
  143. package/dist/esm/assets/scripts/fileInput/const/types.js +0 -7
  144. package/dist/esm/assets/scripts/fileInput/index.js +0 -9
  145. package/dist/esm/assets/scripts/imageFileInput/ImageFileInput.js +0 -182
  146. package/dist/esm/assets/scripts/imageFileInput/ImageFileInputModel.js +0 -250
  147. package/dist/esm/assets/scripts/imageFileInput/ImageFileInputView.js +0 -349
  148. package/dist/esm/assets/scripts/imageFileInput/const/classNames.js +0 -30
  149. package/dist/esm/assets/scripts/imageFileInput/const/index.js +0 -2
  150. package/dist/esm/assets/scripts/imageFileInput/const/types.js +0 -7
  151. package/dist/esm/assets/scripts/imageFileInput/index.js +0 -9
  152. package/dist/esm/assets/scripts/index.js +0 -28
  153. package/dist/esm/assets/scripts/modal/Modal.js +0 -110
  154. package/dist/esm/assets/scripts/modal/ModalActions.js +0 -123
  155. package/dist/esm/assets/scripts/modal/ModalContent.js +0 -41
  156. package/dist/esm/assets/scripts/modal/ModalHeader.js +0 -110
  157. package/dist/esm/assets/scripts/modal/const/classNames.js +0 -31
  158. package/dist/esm/assets/scripts/modal/const/index.js +0 -2
  159. package/dist/esm/assets/scripts/modal/const/types.js +0 -1
  160. package/dist/esm/assets/scripts/modal/index.js +0 -15
  161. package/dist/esm/assets/scripts/modal/utils/contentUtils.js +0 -28
  162. package/dist/esm/assets/scripts/notification/FloatingNotification.js +0 -176
  163. package/dist/esm/assets/scripts/notification/FullWidthNotification.js +0 -115
  164. package/dist/esm/assets/scripts/notification/MessageNotification.js +0 -141
  165. package/dist/esm/assets/scripts/notification/Notification.js +0 -111
  166. package/dist/esm/assets/scripts/notification/const/classNames.js +0 -44
  167. package/dist/esm/assets/scripts/notification/const/icons.js +0 -39
  168. package/dist/esm/assets/scripts/notification/const/index.js +0 -4
  169. package/dist/esm/assets/scripts/notification/const/sizes.js +0 -48
  170. package/dist/esm/assets/scripts/notification/const/types.js +0 -8
  171. package/dist/esm/assets/scripts/notification/index.js +0 -11
  172. package/dist/esm/assets/scripts/notification/utils.js +0 -79
  173. package/dist/esm/assets/scripts/progress-bar/ProgressBar.js +0 -267
  174. package/dist/esm/assets/scripts/progress-bar/index.js +0 -1
  175. package/dist/esm/assets/scripts/selectBox.js +0 -314
  176. package/dist/esm/assets/scripts/shared/ButtonCloseX.js +0 -38
  177. package/dist/esm/assets/scripts/tab.js +0 -35
  178. package/dist/esm/assets/scripts/tag/Tag.js +0 -263
  179. package/dist/esm/assets/scripts/tag/const/classNames.js +0 -16
  180. package/dist/esm/assets/scripts/tag/const/index.js +0 -3
  181. package/dist/esm/assets/scripts/tag/const/sizes.js +0 -7
  182. package/dist/esm/assets/scripts/tag/const/types.js +0 -1
  183. package/dist/esm/assets/scripts/tag/index.js +0 -9
  184. package/dist/esm/assets/scripts/tooltip/Tooltip.js +0 -375
  185. package/dist/esm/assets/scripts/tooltip/TooltipLayerManager.js +0 -79
  186. package/dist/esm/assets/scripts/tooltip/const/classNames.js +0 -23
  187. package/dist/esm/assets/scripts/tooltip/const/constants.js +0 -50
  188. package/dist/esm/assets/scripts/tooltip/const/icons.js +0 -9
  189. package/dist/esm/assets/scripts/tooltip/const/index.js +0 -4
  190. package/dist/esm/assets/scripts/tooltip/const/templates.js +0 -42
  191. package/dist/esm/assets/scripts/tooltip/const/types.js +0 -1
  192. package/dist/esm/assets/scripts/tooltip/index.js +0 -10
  193. package/dist/esm/assets/scripts/tooltip/utils.js +0 -35
  194. package/dist/esm/assets/scripts/utils/unifiedBox/DOMRenderer.js +0 -379
  195. package/dist/esm/assets/scripts/utils/unifiedBox/DropdownModel.js +0 -363
  196. package/dist/esm/assets/scripts/utils/unifiedBox/UnifiedBoxController.js +0 -676
  197. package/dist/esm/assets/scripts/utils/unifiedBox/UnifiedBoxManager.js +0 -706
  198. package/dist/types/assets/scripts/comboBox.d.ts +0 -91
  199. package/dist/types/assets/scripts/datePicker.d.ts +0 -87
  200. package/dist/types/assets/scripts/featuredIcon.d.ts +0 -23
  201. package/dist/types/assets/scripts/fileInput/FileInput.d.ts +0 -67
  202. package/dist/types/assets/scripts/fileInput/FileInputModel.d.ts +0 -70
  203. package/dist/types/assets/scripts/fileInput/FileInputView.d.ts +0 -77
  204. package/dist/types/assets/scripts/fileInput/const/classNames.d.ts +0 -17
  205. package/dist/types/assets/scripts/fileInput/const/index.d.ts +0 -3
  206. package/dist/types/assets/scripts/fileInput/const/types.d.ts +0 -132
  207. package/dist/types/assets/scripts/fileInput/index.d.ts +0 -4
  208. package/dist/types/assets/scripts/imageFileInput/ImageFileInput.d.ts +0 -64
  209. package/dist/types/assets/scripts/imageFileInput/ImageFileInputModel.d.ts +0 -74
  210. package/dist/types/assets/scripts/imageFileInput/ImageFileInputView.d.ts +0 -80
  211. package/dist/types/assets/scripts/imageFileInput/const/classNames.d.ts +0 -20
  212. package/dist/types/assets/scripts/imageFileInput/const/index.d.ts +0 -3
  213. package/dist/types/assets/scripts/imageFileInput/const/types.d.ts +0 -126
  214. package/dist/types/assets/scripts/imageFileInput/index.d.ts +0 -4
  215. package/dist/types/assets/scripts/index.d.ts +0 -33
  216. package/dist/types/assets/scripts/modal/Modal.d.ts +0 -28
  217. package/dist/types/assets/scripts/modal/ModalActions.d.ts +0 -19
  218. package/dist/types/assets/scripts/modal/ModalContent.d.ts +0 -14
  219. package/dist/types/assets/scripts/modal/ModalHeader.d.ts +0 -16
  220. package/dist/types/assets/scripts/modal/const/classNames.d.ts +0 -23
  221. package/dist/types/assets/scripts/modal/const/index.d.ts +0 -3
  222. package/dist/types/assets/scripts/modal/const/types.d.ts +0 -62
  223. package/dist/types/assets/scripts/modal/index.d.ts +0 -8
  224. package/dist/types/assets/scripts/modal/utils/contentUtils.d.ts +0 -11
  225. package/dist/types/assets/scripts/notification/FloatingNotification.d.ts +0 -25
  226. package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +0 -22
  227. package/dist/types/assets/scripts/notification/MessageNotification.d.ts +0 -23
  228. package/dist/types/assets/scripts/notification/Notification.d.ts +0 -22
  229. package/dist/types/assets/scripts/notification/const/classNames.d.ts +0 -44
  230. package/dist/types/assets/scripts/notification/const/icons.d.ts +0 -26
  231. package/dist/types/assets/scripts/notification/const/index.d.ts +0 -6
  232. package/dist/types/assets/scripts/notification/const/sizes.d.ts +0 -33
  233. package/dist/types/assets/scripts/notification/const/types.d.ts +0 -20
  234. package/dist/types/assets/scripts/notification/index.d.ts +0 -8
  235. package/dist/types/assets/scripts/notification/utils.d.ts +0 -9
  236. package/dist/types/assets/scripts/progress-bar/ProgressBar.d.ts +0 -68
  237. package/dist/types/assets/scripts/progress-bar/index.d.ts +0 -2
  238. package/dist/types/assets/scripts/selectBox.d.ts +0 -77
  239. package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +0 -6
  240. package/dist/types/assets/scripts/tab.d.ts +0 -8
  241. package/dist/types/assets/scripts/tag/Tag.d.ts +0 -28
  242. package/dist/types/assets/scripts/tag/const/classNames.d.ts +0 -12
  243. package/dist/types/assets/scripts/tag/const/index.d.ts +0 -4
  244. package/dist/types/assets/scripts/tag/const/sizes.d.ts +0 -8
  245. package/dist/types/assets/scripts/tag/const/types.d.ts +0 -34
  246. package/dist/types/assets/scripts/tag/index.d.ts +0 -4
  247. package/dist/types/assets/scripts/tooltip/Tooltip.d.ts +0 -55
  248. package/dist/types/assets/scripts/tooltip/TooltipLayerManager.d.ts +0 -22
  249. package/dist/types/assets/scripts/tooltip/const/classNames.d.ts +0 -18
  250. package/dist/types/assets/scripts/tooltip/const/constants.d.ts +0 -34
  251. package/dist/types/assets/scripts/tooltip/const/icons.d.ts +0 -5
  252. package/dist/types/assets/scripts/tooltip/const/index.d.ts +0 -6
  253. package/dist/types/assets/scripts/tooltip/const/templates.d.ts +0 -17
  254. package/dist/types/assets/scripts/tooltip/const/types.d.ts +0 -15
  255. package/dist/types/assets/scripts/tooltip/index.d.ts +0 -7
  256. package/dist/types/assets/scripts/tooltip/utils.d.ts +0 -3
  257. package/dist/types/assets/scripts/utils/unifiedBox/DOMRenderer.d.ts +0 -108
  258. package/dist/types/assets/scripts/utils/unifiedBox/DropdownModel.d.ts +0 -158
  259. package/dist/types/assets/scripts/utils/unifiedBox/UnifiedBoxController.d.ts +0 -171
  260. package/dist/types/assets/scripts/utils/unifiedBox/UnifiedBoxManager.d.ts +0 -99
@@ -1,455 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FileInputView = void 0;
7
- var _Tag = require("../tag/Tag");
8
- var _classNames = require("./const/classNames");
9
- var __spreadArray = void 0 && (void 0).__spreadArray || function (to, from, pack) {
10
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
11
- if (ar || !(i in from)) {
12
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
13
- ar[i] = from[i];
14
- }
15
- }
16
- return to.concat(ar || Array.prototype.slice.call(from));
17
- };
18
- var FileInputView = exports.FileInputView = /** @class */function () {
19
- function FileInputView(options, model) {
20
- this.tagInstances = [];
21
- this.renderedFiles = []; // 이미 렌더링된 파일들 추적
22
- this.options = options;
23
- this.model = model;
24
- this.element = this.createElement();
25
- this.fileInputElement = this.element.querySelector('input[type="file"]');
26
- this.buttonElement = this.element.querySelector('button');
27
- this.fileTagsContainer = this.element.querySelector(".".concat(_classNames.FILE_INPUT_CLASS_NAMES.fileTags));
28
- }
29
- /**
30
- * 메인 DOM 요소 생성
31
- */
32
- FileInputView.prototype.createElement = function () {
33
- var container = document.createElement('div');
34
- var baseClasses = "".concat(_classNames.FILE_INPUT_CLASS_NAMES.fileInput, " ").concat((0, _classNames.getFileInputSizeClassName)(this.options.size));
35
- var customClasses = this.options.className ? " ".concat(this.options.className) : '';
36
- container.className = baseClasses + customClasses;
37
- // Hidden file input
38
- container.appendChild(this.createFileInput());
39
- // Input container
40
- container.appendChild(this.createInputContainer());
41
- // Hint list
42
- if (this.options.hintItems && this.options.hintItems.length > 0) {
43
- container.appendChild(this.createHintList());
44
- }
45
- // File tags container
46
- var fileTagsContainer = document.createElement('div');
47
- fileTagsContainer.className = _classNames.FILE_INPUT_CLASS_NAMES.fileTags;
48
- fileTagsContainer.style.display = 'none';
49
- container.appendChild(fileTagsContainer);
50
- return container;
51
- };
52
- /**
53
- * Hidden file input 생성
54
- */
55
- FileInputView.prototype.createFileInput = function () {
56
- var input = document.createElement('input');
57
- input.type = 'file';
58
- input.hidden = true;
59
- input.tabIndex = -1;
60
- input.setAttribute('aria-hidden', 'true');
61
- input.classList.add('no-filestyle');
62
- if (this.options.accept) {
63
- input.accept = this.options.accept;
64
- }
65
- if (this.options.multiple) {
66
- input.multiple = true;
67
- }
68
- if (this.options.fileInputName) {
69
- input.name = this.options.fileInputName;
70
- }
71
- return input;
72
- };
73
- /**
74
- * Input container 생성
75
- */
76
- FileInputView.prototype.createInputContainer = function () {
77
- var container = document.createElement('div');
78
- container.className = _classNames.FILE_INPUT_CLASS_NAMES.inputContainer;
79
- // Label
80
- if (this.options.label) {
81
- container.appendChild(this.createLabelContainer());
82
- }
83
- // Button
84
- container.appendChild(this.createButton());
85
- // Hint text
86
- if (this.options.hintText) {
87
- container.appendChild(this.createHintText());
88
- }
89
- return container;
90
- };
91
- /**
92
- * Label container 생성
93
- */
94
- FileInputView.prototype.createLabelContainer = function () {
95
- var container = document.createElement('div');
96
- container.className = _classNames.FILE_INPUT_CLASS_NAMES.label;
97
- var label = document.createElement('label');
98
- label.className = (0, _classNames.getLabelClassName)(this.options.isRequired);
99
- label.textContent = this.options.label;
100
- container.appendChild(label);
101
- if (this.options.showHelpIcon) {
102
- container.appendChild(this.createHelpIcon());
103
- }
104
- return container;
105
- };
106
- /**
107
- * Help icon 생성
108
- */
109
- FileInputView.prototype.createHelpIcon = function () {
110
- var iconContainer = document.createElement('span');
111
- iconContainer.className = _classNames.FILE_INPUT_CLASS_NAMES.helpIcon;
112
- var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
113
- svg.setAttribute('width', '16');
114
- svg.setAttribute('height', '16');
115
- svg.setAttribute('viewBox', '0 0 24 24');
116
- svg.setAttribute('fill', 'none');
117
- svg.setAttribute('stroke', 'currentColor');
118
- var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
119
- circle.setAttribute('cx', '12');
120
- circle.setAttribute('cy', '12');
121
- circle.setAttribute('r', '10');
122
- circle.setAttribute('stroke-width', '2');
123
- var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
124
- path.setAttribute('d', 'M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3');
125
- path.setAttribute('stroke-width', '2');
126
- path.setAttribute('stroke-linecap', 'round');
127
- path.setAttribute('stroke-linejoin', 'round');
128
- var line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
129
- line.setAttribute('x1', '12');
130
- line.setAttribute('y1', '17');
131
- line.setAttribute('x2', '12.01');
132
- line.setAttribute('y2', '17');
133
- line.setAttribute('stroke-width', '2');
134
- line.setAttribute('stroke-linecap', 'round');
135
- svg.appendChild(circle);
136
- svg.appendChild(path);
137
- svg.appendChild(line);
138
- iconContainer.appendChild(svg);
139
- return iconContainer;
140
- };
141
- FileInputView.prototype.createButton = function () {
142
- var button = document.createElement('button');
143
- button.type = 'button';
144
- button.className = "ncua-btn ncua-btn--".concat(this.options.size, " ncua-btn--secondary-gray");
145
- button.disabled = this.options.disabled;
146
- var iconSvg = this.createShareIcon();
147
- button.appendChild(iconSvg);
148
- var label = document.createElement('span');
149
- label.className = 'ncua-btn__label';
150
- label.textContent = this.options.buttonLabel;
151
- button.appendChild(label);
152
- return button;
153
- };
154
- FileInputView.prototype.createShareIcon = function () {
155
- var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
156
- svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
157
- svg.setAttribute('width', '14');
158
- svg.setAttribute('height', '14');
159
- svg.setAttribute('viewBox', '0 0 24 24');
160
- svg.setAttribute('fill', 'none');
161
- svg.setAttribute('stroke', 'none');
162
- svg.classList.add('ncua-btn__icon');
163
- var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
164
- path.setAttribute('stroke', 'currentColor');
165
- path.setAttribute('stroke-linecap', 'round');
166
- path.setAttribute('stroke-linejoin', 'round');
167
- path.setAttribute('stroke-width', '2');
168
- path.setAttribute('d', 'M21 12v4.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V12m13-5-4-4m0 0L8 7m4-4v12');
169
- svg.appendChild(path);
170
- return svg;
171
- };
172
- /**
173
- * Hint text 생성
174
- */
175
- FileInputView.prototype.createHintText = function () {
176
- var hintText = document.createElement('div');
177
- hintText.className = (0, _classNames.getHintTextClassName)(this.options.destructive);
178
- hintText.textContent = this.options.hintText;
179
- return hintText;
180
- };
181
- /**
182
- * Hint list 생성
183
- */
184
- FileInputView.prototype.createHintList = function () {
185
- var _a;
186
- var ul = document.createElement('ul');
187
- ul.className = _classNames.FILE_INPUT_CLASS_NAMES.hintList;
188
- (_a = this.options.hintItems) === null || _a === void 0 ? void 0 : _a.forEach(function (hint) {
189
- var li = document.createElement('li');
190
- li.className = _classNames.FILE_INPUT_CLASS_NAMES.hintItem;
191
- li.textContent = hint;
192
- ul.appendChild(li);
193
- });
194
- return ul;
195
- };
196
- /**
197
- * 파일 태그 렌더링 (삭제 표시된 초기 파일 포함)
198
- */
199
- FileInputView.prototype.renderFileTags = function (files, onRemove) {
200
- var _this = this;
201
- // 전체 파일 목록 (삭제 표시된 초기 파일 포함)을 가져와서 렌더링
202
- var allFiles = this.getAllFilesIncludingDeleted();
203
- if (allFiles.length === 0) {
204
- // 모든 파일이 제거된 경우
205
- this.tagInstances.forEach(function (tag) {
206
- return tag.destroy();
207
- });
208
- this.tagInstances = [];
209
- this.fileTagsContainer.innerHTML = '';
210
- this.fileTagsContainer.style.display = 'none';
211
- this.renderedFiles = [];
212
- return;
213
- }
214
- this.fileTagsContainer.style.display = 'flex';
215
- // 현재 렌더링된 파일과 새로운 전체 파일 목록 비교
216
- var renderedFileCount = this.renderedFiles.length;
217
- var _loop_1 = function (i) {
218
- var renderedFile = this_1.renderedFiles[i];
219
- var stillExists = allFiles.some(function (file) {
220
- return _this.isSameFile(file, renderedFile);
221
- });
222
- if (!stillExists) {
223
- // 파일이 완전히 제거됨
224
- if (this_1.tagInstances[i]) {
225
- this_1.tagInstances[i].destroy();
226
- }
227
- var tagContainer = this_1.fileTagsContainer.children[i];
228
- if (tagContainer) {
229
- // 이미지 URL 정리
230
- var img = tagContainer.querySelector('img');
231
- if (img && img.src.startsWith('blob:')) {
232
- URL.revokeObjectURL(img.src);
233
- }
234
- tagContainer.remove();
235
- }
236
- this_1.tagInstances.splice(i, 1);
237
- this_1.renderedFiles.splice(i, 1);
238
- }
239
- };
240
- var this_1 = this;
241
- // 제거된 파일들 처리 (뒤에서부터 제거하여 인덱스 변화 방지)
242
- for (var i = renderedFileCount - 1; i >= 0; i--) {
243
- _loop_1(i);
244
- }
245
- // 새로운 파일들과 상태 변경된 파일들 처리
246
- allFiles.forEach(function (file, index) {
247
- var isAlreadyRendered = _this.renderedFiles.some(function (renderedFile) {
248
- return _this.isSameFile(file, renderedFile);
249
- });
250
- var isDeletedInitial = _this.model.isDeletedInitialFile(file);
251
- if (!isAlreadyRendered) {
252
- // 새로운 파일을 올바른 위치에 삽입
253
- _this.insertFileTagAtIndex(file, index, onRemove);
254
- _this.renderedFiles.splice(index, 0, file);
255
- } else if (isDeletedInitial) {
256
- // 기존 파일이 삭제 표시됨 - 해당 컨테이너를 숨김 처리하고 checkbox 체크
257
- var existingIndex = _this.renderedFiles.findIndex(function (renderedFile) {
258
- return _this.isSameFile(file, renderedFile);
259
- });
260
- if (existingIndex !== -1) {
261
- var tagContainer = _this.fileTagsContainer.children[existingIndex];
262
- if (tagContainer) {
263
- tagContainer.style.display = 'none';
264
- // checkbox를 체크된 상태로 변경
265
- var checkbox = tagContainer.querySelector('input[type="checkbox"]');
266
- if (checkbox) {
267
- checkbox.checked = true;
268
- }
269
- // Tag 인스턴스 제거 (UI는 숨김)
270
- if (_this.tagInstances[existingIndex]) {
271
- _this.tagInstances[existingIndex].destroy();
272
- _this.tagInstances.splice(existingIndex, 1);
273
- }
274
- }
275
- }
276
- }
277
- });
278
- // 인덱스 업데이트 (onRemove 콜백의 인덱스가 정확하도록)
279
- this.updateFileIndices(onRemove);
280
- };
281
- /**
282
- * 삭제 표시된 초기 파일을 포함한 전체 파일 목록 반환
283
- */
284
- FileInputView.prototype.getAllFilesIncludingDeleted = function () {
285
- var _this = this;
286
- var newFiles = this.model.getOptions().value !== undefined ? this.model.getOptions().value : this.model.internalFiles;
287
- // 모든 초기 파일을 File 객체로 변환 (삭제 표시된 것도 포함)
288
- var allInitialFiles = this.model.initialFiles.map(function (uploadedFile) {
289
- var mimeType = _this.model.getMimeTypeFromFileName(uploadedFile.fileName);
290
- return new File([], uploadedFile.fileName, {
291
- type: mimeType
292
- });
293
- });
294
- return __spreadArray(__spreadArray([], allInitialFiles, true), newFiles, true);
295
- };
296
- /**
297
- * 두 파일이 같은 파일인지 확인
298
- */
299
- FileInputView.prototype.isSameFile = function (file1, file2) {
300
- return file1.name === file2.name && file1.size === file2.size && file1.lastModified === file2.lastModified;
301
- };
302
- /**
303
- * 특정 인덱스에 파일 태그 삽입
304
- */
305
- FileInputView.prototype.insertFileTagAtIndex = function (file, index, onRemove) {
306
- var tagContainer = this.createFileTagContainer(file, index, onRemove);
307
- // 올바른 위치에 삽입
308
- var existingChildren = this.fileTagsContainer.children;
309
- if (index >= existingChildren.length) {
310
- // 마지막에 추가
311
- this.fileTagsContainer.appendChild(tagContainer);
312
- } else {
313
- // 특정 위치에 삽입
314
- this.fileTagsContainer.insertBefore(tagContainer, existingChildren[index]);
315
- }
316
- };
317
- /**
318
- * 파일 태그 생성 (마지막에 추가)
319
- */
320
- FileInputView.prototype.createFileTag = function (file, index, onRemove) {
321
- var tagContainer = this.createFileTagContainer(file, index, onRemove);
322
- this.fileTagsContainer.appendChild(tagContainer);
323
- };
324
- /**
325
- * 파일 태그 컨테이너 생성
326
- */
327
- FileInputView.prototype.createFileTagContainer = function (file, index, onRemove) {
328
- var tagContainer = document.createElement('div');
329
- tagContainer.className = _classNames.FILE_INPUT_CLASS_NAMES.fileTagContainer;
330
- // 파일이 초기 파일인지 새로 추가된 파일인지 확인
331
- var isInitialFile = this.model.isInitialFile(file);
332
- var isNewlyAdded = this.model.isNewlyAddedFile(file);
333
- var isDeletedInitial = this.model.isDeletedInitialFile(file);
334
- // 삭제 표시된 초기 파일인 경우 숨김 처리하지만 checkbox는 유지
335
- if (isDeletedInitial) {
336
- tagContainer.style.display = 'none';
337
- // checkbox만 생성 (체크된 상태로)
338
- if (this.options.checkboxName) {
339
- var checkbox = document.createElement('input');
340
- checkbox.type = 'checkbox';
341
- checkbox.name = this.options.checkboxName;
342
- checkbox.value = file.name;
343
- checkbox.hidden = true;
344
- checkbox.checked = true; // 삭제 표시됨
345
- checkbox.setAttribute('data-file-index', String(index));
346
- tagContainer.appendChild(checkbox);
347
- }
348
- return tagContainer;
349
- }
350
- // Tag 인스턴스 생성 (삭제되지 않은 파일만)
351
- var tagSize = this.options.size === 'xs' ? 'sm' : 'md';
352
- var tag = new _Tag.Tag({
353
- text: file.name,
354
- size: tagSize,
355
- close: true,
356
- onButtonClick: function () {
357
- return onRemove(index);
358
- }
359
- });
360
- this.tagInstances.splice(index, 0, tag);
361
- tagContainer.appendChild(tag.getElement());
362
- // PHP form submission을 위한 hidden input 생성
363
- if (isInitialFile && this.options.checkboxName) {
364
- // 기존 파일: checkbox (삭제 표시용)
365
- var checkbox = document.createElement('input');
366
- checkbox.type = 'checkbox';
367
- checkbox.name = this.options.checkboxName;
368
- checkbox.value = file.name;
369
- checkbox.hidden = true;
370
- checkbox.checked = false; // 기본적으로 삭제 안함
371
- checkbox.setAttribute('data-file-index', String(index));
372
- tagContainer.appendChild(checkbox);
373
- } else if (isNewlyAdded && this.options.fileInputName) {
374
- // 새로 추가된 파일: file input (업로드용)
375
- var hiddenFileInput = document.createElement('input');
376
- hiddenFileInput.type = 'file';
377
- hiddenFileInput.name = this.options.fileInputName;
378
- hiddenFileInput.hidden = true;
379
- hiddenFileInput.classList.add('no-filestyle');
380
- hiddenFileInput.setAttribute('data-file-index', String(index));
381
- // File 객체를 DataTransfer를 통해 설정
382
- var dataTransfer = new DataTransfer();
383
- dataTransfer.items.add(file);
384
- hiddenFileInput.files = dataTransfer.files;
385
- tagContainer.appendChild(hiddenFileInput);
386
- }
387
- if (this.options.showImagePreview && file.type.startsWith('image/')) {
388
- var img = document.createElement('img');
389
- img.className = _classNames.FILE_INPUT_CLASS_NAMES.fileImage;
390
- img.src = URL.createObjectURL(file);
391
- img.alt = file.name;
392
- tagContainer.appendChild(img);
393
- }
394
- return tagContainer;
395
- };
396
- /**
397
- * 파일 인덱스 업데이트
398
- */
399
- FileInputView.prototype.updateFileIndices = function (onRemove) {
400
- var _a;
401
- var tagContainers = this.fileTagsContainer.children;
402
- var _loop_2 = function (i) {
403
- var tagContainer = tagContainers[i];
404
- // data-file-index 업데이트
405
- var inputs = tagContainer.querySelectorAll('input[data-file-index]');
406
- inputs.forEach(function (input) {
407
- input.setAttribute('data-file-index', String(i));
408
- });
409
- // Tag 인스턴스의 onButtonClick 업데이트
410
- if (this_2.tagInstances[i]) {
411
- // Tag 인스턴스의 콜백을 직접 업데이트할 수 없으므로
412
- // 버튼 이벤트 리스너를 다시 설정
413
- var closeButton = tagContainer.querySelector('.ncua-tag__close');
414
- if (closeButton) {
415
- // 기존 이벤트 리스너를 제거하고 새로운 것으로 교체
416
- var newCloseButton = closeButton.cloneNode(true);
417
- (_a = closeButton.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newCloseButton, closeButton);
418
- newCloseButton.addEventListener('click', function () {
419
- return onRemove(i);
420
- });
421
- }
422
- }
423
- };
424
- var this_2 = this;
425
- for (var i = 0; i < tagContainers.length; i++) {
426
- _loop_2(i);
427
- }
428
- };
429
- FileInputView.prototype.setButtonDisabled = function (disabled) {
430
- this.buttonElement.disabled = disabled;
431
- };
432
- FileInputView.prototype.getElement = function () {
433
- return this.element;
434
- };
435
- FileInputView.prototype.getFileInputElement = function () {
436
- return this.fileInputElement;
437
- };
438
- FileInputView.prototype.getButtonElement = function () {
439
- return this.buttonElement;
440
- };
441
- FileInputView.prototype.destroy = function () {
442
- this.tagInstances.forEach(function (tag) {
443
- return tag.destroy();
444
- });
445
- this.tagInstances = [];
446
- this.renderedFiles = [];
447
- var images = this.fileTagsContainer.querySelectorAll('img');
448
- images.forEach(function (img) {
449
- if (img.src.startsWith('blob:')) {
450
- URL.revokeObjectURL(img.src);
451
- }
452
- });
453
- };
454
- return FileInputView;
455
- }();
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getLabelClassName = exports.getHintTextClassName = exports.getFileInputSizeClassName = exports.getButtonSizeClassName = exports.FILE_INPUT_CLASS_NAMES = void 0;
7
- // FileInput 관련 CSS 클래스명 상수
8
- var FILE_INPUT_CLASS_NAMES = exports.FILE_INPUT_CLASS_NAMES = {
9
- fileInput: 'ncua-file-input',
10
- inputContainer: 'ncua-file-input__input-container',
11
- label: 'ncua-file-input__label',
12
- helpIcon: 'ncua-input__help-icon',
13
- hintText: 'ncua-input__hint-text',
14
- hintList: 'ncua-file-input__hint-list',
15
- hintItem: 'ncua-file-input__hint-item',
16
- fileTags: 'ncua-file-input__file-tags',
17
- fileTagContainer: 'ncua-file-input__file-tag-container',
18
- fileImage: 'ncua-file-input__file-image'
19
- };
20
- var getFileInputSizeClassName = function (size) {
21
- return "ncua-file-input--".concat(size);
22
- };
23
- exports.getFileInputSizeClassName = getFileInputSizeClassName;
24
- var getButtonSizeClassName = function (size) {
25
- return "ncua-button--".concat(size);
26
- };
27
- exports.getButtonSizeClassName = getButtonSizeClassName;
28
- var getLabelClassName = function (isRequired) {
29
- return isRequired ? 'ncua-label ncua-label--required' : 'ncua-label';
30
- };
31
- exports.getLabelClassName = getLabelClassName;
32
- var getHintTextClassName = function (destructive) {
33
- return destructive ? 'ncua-input__hint-text ncua-input__hint-text--destructive' : 'ncua-input__hint-text';
34
- };
35
- exports.getHintTextClassName = getHintTextClassName;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _classNames = require("./classNames");
7
- Object.keys(_classNames).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _classNames[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _classNames[key];
14
- }
15
- });
16
- });
17
- var _types = require("./types");
18
- Object.keys(_types).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _types[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _types[key];
25
- }
26
- });
27
- });
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FileInputErrorType = void 0;
7
- // FileInput 관련 타입 정의 (React FileInput.tsx와 동일)
8
- var FileInputErrorType;
9
- (function (FileInputErrorType) {
10
- FileInputErrorType["ALREADY_UPLOADED"] = "ALREADY_UPLOADED";
11
- FileInputErrorType["EXCEED_MAX_FILE_SIZE"] = "EXCEED_MAX_FILE_SIZE";
12
- FileInputErrorType["EXCEED_MAX_FILE_COUNT"] = "EXCEED_MAX_FILE_COUNT";
13
- })(FileInputErrorType || (exports.FileInputErrorType = FileInputErrorType = {}));
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- FileInput: true
8
- };
9
- Object.defineProperty(exports, "FileInput", {
10
- enumerable: true,
11
- get: function () {
12
- return _FileInput.FileInput;
13
- }
14
- });
15
- var _FileInput = require("./FileInput");
16
- var _classNames = require("./const/classNames");
17
- Object.keys(_classNames).forEach(function (key) {
18
- if (key === "default" || key === "__esModule") return;
19
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
20
- if (key in exports && exports[key] === _classNames[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _classNames[key];
25
- }
26
- });
27
- });
28
- var _types = require("./const/types");
29
- Object.keys(_types).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
32
- if (key in exports && exports[key] === _types[key]) return;
33
- Object.defineProperty(exports, key, {
34
- enumerable: true,
35
- get: function () {
36
- return _types[key];
37
- }
38
- });
39
- });
40
- // 전역 등록 (추후 index.ts와 개별동작 할 수 있게끔 대비)
41
- if (typeof window !== 'undefined') {
42
- window.ncua = window.ncua || {};
43
- window.ncua.FileInput = _FileInput.FileInput;
44
- }