bromcom-ui 2.9.0-rc.18 → 2.9.0-rc.19

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 (223) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/{p-13380aab.js → p-04e7d8ac.js} +1 -1
  3. package/dist/bromcom-ui/{p-b4b9c195.entry.js → p-05fef42b.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-1264d0a2.entry.js → p-06672174.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-95c6e625.entry.js → p-06c3ed21.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-901911e3.entry.js → p-09737f79.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-882a7f23.entry.js → p-0ac10364.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-0b3dc9d6.entry.js → p-0b81c02f.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-0c774416.entry.js +7 -0
  10. package/dist/bromcom-ui/{p-85ad9f3f.entry.js → p-0fb41a53.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-4e79863b.entry.js → p-14cafd64.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-0248dda1.entry.js → p-150450da.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-b81b471f.entry.js → p-1625ce05.entry.js} +1 -1
  14. package/dist/bromcom-ui/{p-cb8f146d.entry.js → p-1ae58853.entry.js} +1 -1
  15. package/dist/bromcom-ui/{p-f7c0dacd.entry.js → p-1ba23d50.entry.js} +1 -1
  16. package/dist/bromcom-ui/{p-73d21d07.entry.js → p-203446af.entry.js} +1 -1
  17. package/dist/bromcom-ui/{p-f9be0aa3.js → p-2156f8f5.js} +1 -1
  18. package/dist/bromcom-ui/{p-0f59535f.js → p-2208aada.js} +1 -1
  19. package/dist/bromcom-ui/{p-970b4b64.entry.js → p-2505c9d9.entry.js} +1 -1
  20. package/dist/bromcom-ui/{p-b4ab469f.entry.js → p-26290ed5.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-1da685cc.entry.js → p-29a6e6c0.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-3db2e540.entry.js → p-29ca858f.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-ad278432.entry.js → p-2dbf5ba5.entry.js} +1 -1
  24. package/dist/bromcom-ui/{p-bd02fdcc.entry.js → p-302fe8de.entry.js} +1 -1
  25. package/dist/bromcom-ui/{p-dda4e3d6.entry.js → p-30dbc7bd.entry.js} +1 -1
  26. package/dist/bromcom-ui/{p-df33161f.js → p-3363ca16.js} +1 -1
  27. package/dist/bromcom-ui/{p-c357d5b9.entry.js → p-3a29e450.entry.js} +1 -1
  28. package/dist/bromcom-ui/{p-ce7aa349.js → p-3fa51f1b.js} +1 -1
  29. package/dist/bromcom-ui/{p-9efd429a.js → p-41dc7f2d.js} +1 -1
  30. package/dist/bromcom-ui/{p-46207bba.entry.js → p-430c0a24.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-9c7c62bf.entry.js → p-47ce3a16.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-2d859945.entry.js → p-4a511d29.entry.js} +1 -1
  33. package/dist/bromcom-ui/{p-98cb2ad8.entry.js → p-4a83d3fc.entry.js} +1 -1
  34. package/dist/bromcom-ui/{p-00adb162.entry.js → p-4be8e402.entry.js} +1 -1
  35. package/dist/bromcom-ui/{p-e2cfb773.entry.js → p-56e27911.entry.js} +1 -1
  36. package/dist/bromcom-ui/p-5c03d929.entry.js +5 -0
  37. package/dist/bromcom-ui/{p-07c3eb8e.js → p-61db1f1f.js} +1 -1
  38. package/dist/bromcom-ui/{p-ac5f4e84.entry.js → p-66da9512.entry.js} +1 -1
  39. package/dist/bromcom-ui/{p-5ae0a59b.js → p-7e44e6b5.js} +1 -1
  40. package/dist/bromcom-ui/{p-660a8daa.entry.js → p-80ee3d97.entry.js} +1 -1
  41. package/dist/bromcom-ui/{p-5f87e129.js → p-85ca2b62.js} +1 -1
  42. package/dist/bromcom-ui/{p-6f32652d.entry.js → p-87dda5e5.entry.js} +1 -1
  43. package/dist/bromcom-ui/{p-ac234c84.entry.js → p-8a9e9aeb.entry.js} +1 -1
  44. package/dist/bromcom-ui/{p-a6edcc85.entry.js → p-8b08527e.entry.js} +1 -1
  45. package/dist/bromcom-ui/{p-3c7a0345.js → p-8c018ae0.js} +1 -1
  46. package/dist/bromcom-ui/{p-a341fa6d.entry.js → p-90c5221d.entry.js} +1 -1
  47. package/dist/bromcom-ui/{p-10fd8284.js → p-917bd915.js} +1 -1
  48. package/dist/bromcom-ui/{p-c9c7067e.entry.js → p-99824717.entry.js} +1 -1
  49. package/dist/bromcom-ui/{p-5a0e52d2.entry.js → p-9e25eb82.entry.js} +1 -1
  50. package/dist/bromcom-ui/{p-347b7912.entry.js → p-9ed18ccb.entry.js} +1 -1
  51. package/dist/bromcom-ui/{p-347606cb.entry.js → p-a2b00328.entry.js} +1 -1
  52. package/dist/bromcom-ui/{p-eeaf54a5.entry.js → p-a3e268da.entry.js} +1 -1
  53. package/dist/bromcom-ui/{p-2d0719af.entry.js → p-a7763f93.entry.js} +1 -1
  54. package/dist/bromcom-ui/{p-6a2c6341.entry.js → p-a8254f18.entry.js} +1 -1
  55. package/dist/bromcom-ui/{p-99384b21.entry.js → p-ad822bff.entry.js} +1 -1
  56. package/dist/bromcom-ui/{p-e2933884.entry.js → p-bb3239ef.entry.js} +1 -1
  57. package/dist/bromcom-ui/{p-381c0161.entry.js → p-bc46e80c.entry.js} +1 -1
  58. package/dist/bromcom-ui/{p-3d730230.entry.js → p-c1a992e7.entry.js} +1 -1
  59. package/dist/bromcom-ui/{p-c917c1fb.entry.js → p-c78ab3ca.entry.js} +1 -1
  60. package/dist/bromcom-ui/p-ce938f1e.entry.js +5 -0
  61. package/dist/bromcom-ui/{p-766522ff.entry.js → p-cf9d4122.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-042fa5c0.entry.js → p-d64879be.entry.js} +1 -1
  63. package/dist/bromcom-ui/{p-eae72194.entry.js → p-d85727a3.entry.js} +1 -1
  64. package/dist/bromcom-ui/{p-bb2f87d8.entry.js → p-e45a2a64.entry.js} +1 -1
  65. package/dist/bromcom-ui/{p-8f9077af.entry.js → p-e688b044.entry.js} +1 -1
  66. package/dist/bromcom-ui/{p-edf43cd5.entry.js → p-e6e00bc4.entry.js} +1 -1
  67. package/dist/bromcom-ui/{p-fae5ab21.entry.js → p-f2b3b5a8.entry.js} +1 -1
  68. package/dist/bromcom-ui/{p-12010629.js → p-fc361b51.js} +1 -1
  69. package/dist/bromcom-ui/{p-106a65bf.entry.js → p-fe86c9e1.entry.js} +1 -1
  70. package/dist/cjs/bcm-accordion.cjs.entry.js +2 -2
  71. package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
  72. package/dist/cjs/bcm-attendance.cjs.entry.js +2 -2
  73. package/dist/cjs/bcm-avatar_2.cjs.entry.js +4 -4
  74. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
  75. package/dist/cjs/bcm-button-group.cjs.entry.js +2 -2
  76. package/dist/cjs/{bcm-button_14.cjs.entry.js → bcm-button_15.cjs.entry.js} +3586 -2960
  77. package/dist/cjs/bcm-card.cjs.entry.js +2 -2
  78. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +2 -2
  79. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +2 -2
  80. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +2 -2
  81. package/dist/cjs/bcm-chip-group.cjs.entry.js +4 -4
  82. package/dist/cjs/bcm-chip.cjs.entry.js +2 -2
  83. package/dist/cjs/bcm-collapse.cjs.entry.js +2 -2
  84. package/dist/cjs/bcm-color-input.cjs.entry.js +4 -4
  85. package/dist/cjs/bcm-default.cjs.entry.js +2 -2
  86. package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
  87. package/dist/cjs/bcm-dropdown.cjs.entry.js +3 -3
  88. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
  89. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
  90. package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -4
  91. package/dist/cjs/bcm-item.cjs.entry.js +2 -2
  92. package/dist/cjs/bcm-items.cjs.entry.js +2 -2
  93. package/dist/cjs/bcm-list_3.cjs.entry.js +9 -6
  94. package/dist/cjs/bcm-menu.cjs.entry.js +5 -5
  95. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
  96. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
  97. package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
  98. package/dist/cjs/bcm-modal.cjs.entry.js +2 -2
  99. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +2 -2
  100. package/dist/cjs/bcm-popconfirm.cjs.entry.js +2 -2
  101. package/dist/cjs/bcm-popover.cjs.entry.js +4 -4
  102. package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
  103. package/dist/cjs/bcm-radio-group.cjs.entry.js +4 -4
  104. package/dist/cjs/bcm-radio.cjs.entry.js +4 -4
  105. package/dist/cjs/bcm-range.cjs.entry.js +2 -2
  106. package/dist/cjs/bcm-skeleton.cjs.entry.js +2 -2
  107. package/dist/cjs/bcm-step.cjs.entry.js +3 -3
  108. package/dist/cjs/bcm-stepper.cjs.entry.js +5 -5
  109. package/dist/cjs/bcm-switch.cjs.entry.js +2 -2
  110. package/dist/cjs/bcm-tab-group.cjs.entry.js +4 -4
  111. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +4 -4
  112. package/dist/cjs/bcm-tab-item.cjs.entry.js +4 -4
  113. package/dist/cjs/bcm-table.cjs.entry.js +4 -4
  114. package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
  115. package/dist/cjs/bcm-textarea.cjs.entry.js +3 -3
  116. package/dist/cjs/bcm-toast.cjs.entry.js +2 -2
  117. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  118. package/dist/cjs/{generate-90889006.js → generate-a614441c.js} +1 -1
  119. package/dist/cjs/{global-83d1dfc5.js → global-dbb478c2.js} +1 -1
  120. package/dist/cjs/{input-template-58031bb0.js → input-template-2f000bbb.js} +1 -1
  121. package/dist/cjs/{json-parse-decarator-c5086a06.js → json-parse-decarator-2831cc43.js} +1 -1
  122. package/dist/cjs/loader.cjs.js +3 -3
  123. package/dist/cjs/{number-helper-7cf76b12.js → number-helper-f401b29a.js} +1 -1
  124. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
  125. package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
  126. package/dist/cjs/{package-cbf038fe.js → package-5175214b.js} +1 -1
  127. package/dist/cjs/{stepper-states-7f2a5e9d.js → stepper-states-fa6f45d2.js} +1 -1
  128. package/dist/cjs/{tooltip-helper-2dd2937e.js → tooltip-helper-a9d5aaef.js} +3 -3
  129. package/dist/cjs/{validators-b86a27db.js → validators-45097bb8.js} +1 -1
  130. package/dist/collection/components/molecules/input/input.js +0 -2
  131. package/dist/collection/components/molecules/linked/linked.js +3 -27
  132. package/dist/collection/components/organism/list/list.js +3 -18
  133. package/dist/collection/components/third-parts/rc-picker/date.js +202 -56
  134. package/dist/collection/components/third-parts/rc-picker/rc-picker.css +101 -4
  135. package/dist/collection/components/third-parts/rc-picker/rc-picker.js +274 -159
  136. package/dist/components/bcm-date.js +44 -15
  137. package/dist/components/generate.js +1 -1
  138. package/dist/components/input.js +0 -2
  139. package/dist/components/linked.js +4 -10
  140. package/dist/components/list.js +4 -1
  141. package/dist/components/rc-picker.js +3031 -2887
  142. package/dist/esm/bcm-accordion.entry.js +2 -2
  143. package/dist/esm/bcm-alert.entry.js +2 -2
  144. package/dist/esm/bcm-attendance.entry.js +2 -2
  145. package/dist/esm/bcm-avatar_2.entry.js +7 -7
  146. package/dist/esm/bcm-breadcrumb.entry.js +2 -2
  147. package/dist/esm/bcm-button-group.entry.js +2 -2
  148. package/dist/esm/{bcm-button_14.entry.js → bcm-button_15.entry.js} +3589 -2964
  149. package/dist/esm/bcm-card.entry.js +4 -4
  150. package/dist/esm/bcm-checkbox-group.entry.js +3 -3
  151. package/dist/esm/bcm-checkbox-lite_9.entry.js +3 -3
  152. package/dist/esm/bcm-checkbox_2.entry.js +4 -4
  153. package/dist/esm/bcm-chip-group.entry.js +7 -7
  154. package/dist/esm/bcm-chip.entry.js +4 -4
  155. package/dist/esm/bcm-collapse-group.entry.js +1 -1
  156. package/dist/esm/bcm-collapse.entry.js +2 -2
  157. package/dist/esm/bcm-color-input.entry.js +7 -7
  158. package/dist/esm/bcm-colorpicker.entry.js +2 -2
  159. package/dist/esm/bcm-default.entry.js +2 -2
  160. package/dist/esm/bcm-drawer.entry.js +7 -7
  161. package/dist/esm/bcm-dropdown.entry.js +3 -3
  162. package/dist/esm/bcm-expansion-panel.entry.js +4 -4
  163. package/dist/esm/bcm-input-custom.entry.js +2 -2
  164. package/dist/esm/bcm-input-dropdown.entry.js +7 -7
  165. package/dist/esm/bcm-item.entry.js +4 -4
  166. package/dist/esm/bcm-items.entry.js +2 -2
  167. package/dist/esm/bcm-list_3.entry.js +12 -9
  168. package/dist/esm/bcm-menu.entry.js +8 -8
  169. package/dist/esm/bcm-modal-2-footer.entry.js +7 -7
  170. package/dist/esm/bcm-modal-2-header.entry.js +7 -7
  171. package/dist/esm/bcm-modal-2.entry.js +7 -7
  172. package/dist/esm/bcm-modal.entry.js +2 -2
  173. package/dist/esm/bcm-old-tag_2.entry.js +1 -1
  174. package/dist/esm/bcm-popconfirm-box.entry.js +4 -4
  175. package/dist/esm/bcm-popconfirm.entry.js +2 -2
  176. package/dist/esm/bcm-popover.entry.js +7 -7
  177. package/dist/esm/bcm-progress.entry.js +4 -4
  178. package/dist/esm/bcm-radio-group.entry.js +7 -7
  179. package/dist/esm/bcm-radio.entry.js +7 -7
  180. package/dist/esm/bcm-range.entry.js +3 -3
  181. package/dist/esm/bcm-select.entry.js +1 -1
  182. package/dist/esm/bcm-skeleton.entry.js +2 -2
  183. package/dist/esm/bcm-step.entry.js +3 -3
  184. package/dist/esm/bcm-stepper.entry.js +8 -8
  185. package/dist/esm/bcm-switch.entry.js +3 -3
  186. package/dist/esm/bcm-tab-group.entry.js +7 -7
  187. package/dist/esm/bcm-tab-item-header.entry.js +7 -7
  188. package/dist/esm/bcm-tab-item.entry.js +7 -7
  189. package/dist/esm/bcm-table.entry.js +7 -7
  190. package/dist/esm/bcm-tabs-content.entry.js +1 -1
  191. package/dist/esm/bcm-tabs.entry.js +1 -1
  192. package/dist/esm/bcm-tag.entry.js +4 -4
  193. package/dist/esm/bcm-text.entry.js +2 -2
  194. package/dist/esm/bcm-textarea.entry.js +4 -4
  195. package/dist/esm/bcm-toast.entry.js +3 -3
  196. package/dist/esm/bromcom-ui.js +3 -3
  197. package/dist/esm/{color-helper-71b610e7.js → color-helper-845ba523.js} +1 -1
  198. package/dist/esm/{element-dragger-7ea06c76.js → element-dragger-89bb52fd.js} +1 -1
  199. package/dist/esm/{generate-429ed196.js → generate-f5397d67.js} +1 -1
  200. package/dist/esm/{global-4d7d3a13.js → global-fca83dc9.js} +1 -1
  201. package/dist/esm/{input-template-ab2e6439.js → input-template-50de36a8.js} +1 -1
  202. package/dist/esm/{json-parse-decarator-a55054fc.js → json-parse-decarator-db88bf63.js} +1 -1
  203. package/dist/esm/loader.js +3 -3
  204. package/dist/esm/{number-helper-4dc8b504.js → number-helper-aac382ed.js} +1 -1
  205. package/dist/esm/old-bcm-popover-box.entry.js +5 -5
  206. package/dist/esm/old-bcm-popover.entry.js +2 -2
  207. package/dist/esm/{package-ad16f749.js → package-3edf06a4.js} +1 -1
  208. package/dist/esm/{stepper-states-f96a4ba5.js → stepper-states-d7ac1d20.js} +1 -1
  209. package/dist/esm/{tooltip-helper-c4cb45ab.js → tooltip-helper-d7a40058.js} +6 -6
  210. package/dist/esm/{utils-b3338faf.js → utils-57652744.js} +1 -1
  211. package/dist/esm/{validators-4cbe3998.js → validators-7cb12260.js} +1 -1
  212. package/dist/types/components/molecules/linked/linked.d.ts +1 -3
  213. package/dist/types/components/organism/list/list.d.ts +1 -0
  214. package/dist/types/components/third-parts/rc-picker/date.d.ts +121 -6
  215. package/dist/types/components/third-parts/rc-picker/rc-picker.d.ts +35 -16
  216. package/dist/types/components.d.ts +52 -25
  217. package/package.json +7 -7
  218. package/dist/bromcom-ui/p-00f70814.entry.js +0 -5
  219. package/dist/bromcom-ui/p-8373bb17.entry.js +0 -5
  220. package/dist/bromcom-ui/p-be63b3e6.entry.js +0 -13
  221. package/dist/bromcom-ui/p-f82738d7.entry.js +0 -5
  222. package/dist/cjs/bcm-form.cjs.entry.js +0 -489
  223. package/dist/esm/bcm-form.entry.js +0 -485
@@ -1,485 +0,0 @@
1
- /*!
2
- * Built with Stencil
3
- * Copyright (c) Bromcom.
4
- */
5
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-0615c2b8.js';
6
- import { c as classnames } from './index-00c8a8f7.js';
7
- import { I as IsLoad } from './is-load-decorator-8277e3b8.js';
8
- import { S as StringHelper } from './string-helper-b0e05041.js';
9
- import { d as delay, a as getChildElements } from './utils-b3338faf.js';
10
- import './_commonjsHelpers-7002e5de.js';
11
- import './bcm-d45dc47d.js';
12
-
13
- // /**
14
- // *
15
- // * @param type
16
- // */
17
- // export const required = (value:any) => {
18
- // if ( value || value != null ) {
19
- // return true
20
- // } else {
21
- // return true
22
- // }
23
- // }
24
- class rules {
25
- constructor() { }
26
- response(status, message) {
27
- return Object.assign(Object.assign({ valid: status }, (message && { message })), (!status && { type: 'error' }));
28
- }
29
- required(value, componentValidation) {
30
- let validation = this.response(true);
31
- if (value == '' || value == "" || value == undefined || value == null || value === false) {
32
- validation = this.response(false, 'This field is required.');
33
- }
34
- if (componentValidation) {
35
- if (!componentValidation.valid) {
36
- validation = this.response(false, componentValidation.errorText);
37
- }
38
- if (value instanceof Object) {
39
- if (value.isValid) {
40
- if (value.isValid == false)
41
- validation = this.response(false, 'This field is required.');
42
- }
43
- }
44
- }
45
- return validation;
46
- }
47
- selfValidation(input) {
48
- let validation = this.response(true);
49
- if (input.captionError != null || input.captionType == 'error') {
50
- validation = this.response(false, input.captionError);
51
- }
52
- return validation;
53
- }
54
- }
55
- const validate = new rules;
56
-
57
- const formCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block;margin-bottom:8px}:host(.hidden){display:none}";
58
-
59
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
- r = Reflect.decorate(decorators, target, key, desc);
63
- else
64
- for (var i = decorators.length - 1; i >= 0; i--)
65
- if (d = decorators[i])
66
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
- return c > 3 && r && Object.defineProperty(target, key, r), r;
68
- };
69
- const BcmForm = class {
70
- constructor(hostRef) {
71
- registerInstance(this, hostRef);
72
- this.bcmForm = createEvent(this, "bcm-form", 7);
73
- this.formData = {};
74
- this.inputs = [];
75
- this.duplicateInput = [];
76
- this.isValid = true;
77
- this.returnCaption = [];
78
- this.Bromcom = {
79
- errors: {
80
- targetFormNotExist: 'target form is not exist --> ',
81
- },
82
- inputComponents: {
83
- CHIP_GROUP: 'chip-group',
84
- // Birbirinin aynısı
85
- INPUT: 'input',
86
- TEXTAREA: 'textarea',
87
- //çok benzer
88
- SWITCH: 'switch',
89
- CHECKBOX: 'checkbox',
90
- RADIO_GROUP: 'radio-group',
91
- CHECKBOX_GROUP: 'checkbox-group',
92
- RANGE: 'range',
93
- // sadece value fırlatıyor
94
- FORM: 'form',
95
- FORM_GROUP: 'form-group',
96
- // *En vakit alacak => içinde select, autocomplete, listbox, treeview özellikleri var
97
- LIST: 'list',
98
- //
99
- COLORPICKER: 'colorpicker',
100
- DATE: 'date',
101
- // picker aslında tek komponent hepsi datetimepicker
102
- DATE_PICKER: 'date-picker',
103
- TIME_PICKER: 'time-picker',
104
- DATETIME_PICKER: 'datetime-picker',
105
- // silinecek komponentler
106
- SELECT: 'select',
107
- LISTBOX: 'listbox'
108
- },
109
- helpers: {
110
- randomId: function () {
111
- return Math.random().toString(16).slice(2, -1);
112
- },
113
- },
114
- };
115
- this._id = (Math.random() * 4).toString(16).replace('.', '');
116
- this.hidden = false;
117
- this.validation = false;
118
- this.name = "";
119
- this.value = undefined;
120
- this.autocomplete = false;
121
- }
122
- handleSubmit() {
123
- // if (lowercase(e.target.nodeName) === 'bcm-button') {
124
- // if (e.target.type === 'submit') {
125
- // this.submitFunction()
126
- // }
127
- // }
128
- }
129
- async submitFunction() {
130
- this.formData = {};
131
- this.inputs = [];
132
- this.selector = this.el;
133
- await this.getInputs();
134
- await delay(10);
135
- const usrFrmData = await this.userFormData();
136
- var formData = { isValid: true, formData: usrFrmData };
137
- if (this.name) {
138
- formData = Object.assign(Object.assign({}, formData), { formName: this.name });
139
- }
140
- if (this.isValid) {
141
- this.bcmForm.emit(formData);
142
- return formData;
143
- }
144
- else {
145
- this.returnCaption = { isValid: false, 'message': 'Please fill in all inputs', 'errorDetails': this.returnCaption, formData: usrFrmData };
146
- if (this.name) {
147
- this.returnCaption = Object.assign(Object.assign({}, this.returnCaption), { formName: this.name });
148
- }
149
- this.bcmForm.emit(this.returnCaption);
150
- return this.returnCaption;
151
- }
152
- }
153
- async submit() {
154
- return Promise.resolve(this.submitFunction());
155
- }
156
- async set(data) {
157
- var _a;
158
- const validate = this.validation;
159
- this.validation = false;
160
- // debugger
161
- this.selector = this.el;
162
- await this.getInputs();
163
- if (data && ((_a = this.inputs) === null || _a === void 0 ? void 0 : _a.length) > 0) {
164
- for (const key of Object.keys(data)) {
165
- const item = this.inputs.find(item => item.name === key);
166
- if (item) {
167
- try {
168
- await item.set(data[key]);
169
- }
170
- catch (error) {
171
- console.log(item.nodeName, "set", error);
172
- }
173
- }
174
- }
175
- }
176
- this.validation = validate;
177
- }
178
- async get() {
179
- var _a;
180
- let formData = {};
181
- this.selector = this.el;
182
- const inputsCache = this.inputs;
183
- await this.getInputs();
184
- ((_a = this.inputs) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.inputs.forEach(async (item) => {
185
- try {
186
- const value = await item.get();
187
- formData = Object.assign(Object.assign({}, formData), { [item.name]: value });
188
- }
189
- catch (error) {
190
- console.log(`${item.nodeName} get error`);
191
- }
192
- });
193
- this.inputs = inputsCache;
194
- await delay(10);
195
- return Promise.resolve(formData);
196
- }
197
- async setClear() {
198
- this.formData = {};
199
- this.inputs = [];
200
- this.selector = this.el;
201
- let clear = [];
202
- await this.getInputs();
203
- this.inputs.forEach(async (item) => {
204
- try {
205
- clear.push(await item.setClear());
206
- }
207
- catch (error) {
208
- console.log(error);
209
- }
210
- });
211
- await Promise.all(clear).then(() => {
212
- this.formData = {};
213
- this.inputs = [];
214
- this.duplicateInput = [];
215
- this.isValid = true;
216
- this.returnCaption = [];
217
- });
218
- await delay(10);
219
- return Promise.resolve(true);
220
- }
221
- async resetCaption() {
222
- await delay(10);
223
- this.formData = {};
224
- this.inputs = [];
225
- this.selector = this.el;
226
- await this.getInputs();
227
- for (const item of this.inputs) {
228
- try {
229
- await item.resetCaption();
230
- }
231
- catch (error) {
232
- console.log(item.nodeName, "rc p");
233
- }
234
- }
235
- await delay(10);
236
- return Promise.resolve();
237
- }
238
- async config(_config) {
239
- if (_config['validation']) {
240
- typeof _config['validation'] == 'boolean'
241
- ? this.validation = _config['validation']
242
- : this.validation = false;
243
- }
244
- return true;
245
- }
246
- async getInputs() {
247
- var form = this.selector;
248
- if (!form) {
249
- console.warn(this.Bromcom.errors.targetFormNotExist + this.selector);
250
- return;
251
- }
252
- const inputs = Array.from(form.querySelectorAll('bcm-' + Object.values(this.Bromcom.inputComponents).join(',bcm-')));
253
- this.duplicateInput = [];
254
- // s-hn: Stencil private flag that contains host web component
255
- // https://github.com/ionic-team/stencil/blob/45388e95edb46ef357eb9ae37cd32bbb5bc1ed23/src/runtime/vdom/vdom-render.ts#L116
256
- const rootInputs = inputs.filter((input) => { var _a; return !input['s-hn'] || ((_a = input['s-hn']) === null || _a === void 0 ? void 0 : _a.nodeName) !== 'BcmForm'; });
257
- // debugger;
258
- for (const item of rootInputs) {
259
- if (StringHelper.lowercase(item.nodeName) == "bcm-checkbox-group") {
260
- let checkboxs = item.querySelectorAll("bcm-checkbox");
261
- if (checkboxs) {
262
- for (const checkbox of checkboxs) {
263
- this.duplicateInput.push(checkbox.name);
264
- }
265
- }
266
- }
267
- if (StringHelper.lowercase(item.nodeName) == "bcm-form") {
268
- const groupInputs = Array.from(item.querySelectorAll('bcm-' + Object.values(this.Bromcom.inputComponents).join(',bcm-')));
269
- let itemObject = {};
270
- for (const element of groupInputs) {
271
- var name = element.name;
272
- var value = element.value;
273
- itemObject = Object.assign(Object.assign({}, itemObject), { [name]: value });
274
- this.duplicateInput.push(element.name);
275
- }
276
- item.value = itemObject;
277
- let checkboxs = item.querySelectorAll("bcm-checkbox");
278
- if (checkboxs) {
279
- for (const checkbox of checkboxs) {
280
- this.duplicateInput.push(checkbox.name);
281
- }
282
- }
283
- }
284
- }
285
- await delay(10);
286
- this.inputs = rootInputs;
287
- }
288
- getItemValue(item) {
289
- const tagName = item.tagName.toLowerCase().replace('bcm-', '');
290
- switch (tagName) {
291
- /* case 'date-picker':
292
- case 'datetime-picker':
293
- return item.value.timestamp
294
- case 'time-picker':
295
- return item.value.time */
296
- default:
297
- return item.value;
298
- }
299
- }
300
- isWrapperComponent(item) {
301
- return ['bcm-datetime-picker', 'bcm-date-picker', 'bcm-time-picker'].includes(item.toLowerCase());
302
- }
303
- isGroupComponent(item) {
304
- return ['bcm-checkbox-group'].includes(item.toLowerCase());
305
- }
306
- isListComponent(item) {
307
- return ['bcm-list'].includes(item.toLowerCase());
308
- }
309
- async userFormData() {
310
- this.formData = {};
311
- this.isValid = true;
312
- this.returnCaption = [];
313
- for (const item of this.inputs) {
314
- // const isListComponent = this.isListComponent(item.tagName);
315
- const isGroupComponent = this.isGroupComponent(item.tagName);
316
- const isWrapperComponent = this.isWrapperComponent(item.tagName);
317
- const wrapperComponent = isWrapperComponent && item;
318
- const input = isWrapperComponent
319
- ? await item.getInput() && item
320
- : item;
321
- // input.caption = ''
322
- // input.captionType = ''
323
- if (this.validation) {
324
- let valid = null;
325
- // if (isListComponent) {
326
- // valid = !(input.value && input.value.length > 0) && validate.required(input.value)
327
- // } else
328
- if (isWrapperComponent) {
329
- const isPickerValid = await wrapperComponent.isValid();
330
- valid = validate.required(input.value, isPickerValid);
331
- if (valid) {
332
- if (input.value instanceof Object) {
333
- if (input.value["isValid"] == false) {
334
- valid = validate.required("", isPickerValid);
335
- }
336
- }
337
- else {
338
- valid = validate.required(input.value, isPickerValid);
339
- }
340
- }
341
- }
342
- else if (isGroupComponent) {
343
- const childsCheckbox = getChildElements(input, 'bcm-checkbox:not(#bcm-indeterminate-element)');
344
- if (childsCheckbox && childsCheckbox.length > 0) {
345
- for (const element of childsCheckbox) {
346
- if (element && element.required === true) {
347
- valid = validate.required(element.checked);
348
- if (!valid['valid']) {
349
- element.noCaption = false;
350
- element.captionError = valid['message'];
351
- element.captionType = valid['type'];
352
- }
353
- else {
354
- element.noCaption = input.noCaption;
355
- element.captionError = null;
356
- element.captionType = "default";
357
- }
358
- }
359
- }
360
- }
361
- }
362
- else {
363
- valid = validate.required(input.value);
364
- }
365
- if (input.required) {
366
- if (!valid['valid']) {
367
- input.captionError = valid['message'];
368
- input.captionType = valid['type'];
369
- }
370
- else {
371
- input.captionError = null;
372
- input.captionType = "default";
373
- }
374
- await delay(10);
375
- const selfValidation = validate.selfValidation(input);
376
- if (valid['valid']) {
377
- if (!selfValidation['valid']) {
378
- input.captionError = selfValidation['message'];
379
- input.captionType = selfValidation['type'];
380
- }
381
- }
382
- }
383
- let name = input.name;
384
- let value = input.captionError;
385
- !input.hidden && input.captionType == 'error' && (this.returnCaption = [...Array.from(this.returnCaption), { [name]: value }],
386
- this.isValid = false);
387
- }
388
- if (input.name && !this.duplicateInput.includes(input.name)) {
389
- var itemValue = this.getItemValue(input);
390
- if (!itemValue || itemValue == undefined || itemValue == null) {
391
- itemValue = null;
392
- }
393
- this.formData[input.name] = itemValue;
394
- }
395
- }
396
- return this.formData;
397
- }
398
- async handleChange(e) {
399
- const isWrapperComponent = this.isWrapperComponent(e.target.tagName);
400
- const isGroupComponent = this.isGroupComponent(e.target.tagName);
401
- let target;
402
- if (isWrapperComponent) {
403
- target = e.target.getInput && await e.target.getInput() || e.target;
404
- }
405
- else if (isGroupComponent) {
406
- let req = false;
407
- const childsCheckbox = getChildElements(e.target, 'bcm-checkbox:not(#bcm-indeterminate-element)');
408
- childsCheckbox.length > 0 && (childsCheckbox.forEach((element) => {
409
- if (element && element.required === true) {
410
- req = true;
411
- }
412
- }));
413
- target = Object.assign(Object.assign({}, e.target), { required: req });
414
- }
415
- else {
416
- target = e.target;
417
- }
418
- const value = e.target.value;
419
- const wrapperComponent = isWrapperComponent && e.target;
420
- var isPickerValid;
421
- if (isWrapperComponent) {
422
- isPickerValid = await wrapperComponent.isValid();
423
- }
424
- const tick = setTimeout(() => {
425
- if (target.required) {
426
- let valid = null;
427
- if (isWrapperComponent) {
428
- valid = validate.required(value, isPickerValid);
429
- if (valid) {
430
- if (value instanceof Object) {
431
- if (value["isValid"] == false) {
432
- valid = validate.required("", isPickerValid);
433
- }
434
- }
435
- else {
436
- valid = validate.required(value, isPickerValid);
437
- }
438
- }
439
- }
440
- else if (isGroupComponent) {
441
- const childsCheckbox = getChildElements(e.target, 'bcm-checkbox:not(#bcm-indeterminate-element)');
442
- childsCheckbox.length > 0 && (childsCheckbox.forEach((element) => {
443
- if (element && element.required === true) {
444
- valid = validate.required(element.checked);
445
- if (!valid['valid']) {
446
- element.noCaption = false;
447
- element.captionError = valid['message'];
448
- element.captionType = valid['type'];
449
- }
450
- else {
451
- element.noCaption = e.target.noCaption;
452
- element.captionError = null;
453
- element.captionType = "default";
454
- }
455
- }
456
- }));
457
- }
458
- else {
459
- valid = validate.required(value);
460
- }
461
- if (valid['valid']) {
462
- target.captionError = null;
463
- target.captionType = null;
464
- }
465
- else {
466
- target.captionError = valid['message'];
467
- target.captionType = valid['type'];
468
- }
469
- }
470
- clearTimeout(tick);
471
- });
472
- this.value = await this.userFormData();
473
- }
474
- render() {
475
- const hostClasses = classnames(this.hidden ? 'hidden' : null);
476
- return (h(Host, { class: hostClasses }, h("form", { class: "bcm-form", autocomplete: this.autocomplete ? "on" : "off" }, h("slot", null))));
477
- }
478
- get el() { return getElement(this); }
479
- };
480
- __decorate([
481
- IsLoad()
482
- ], BcmForm.prototype, "el", void 0);
483
- BcmForm.style = formCss;
484
-
485
- export { BcmForm as bcm_form };