bromcom-ui 2.8.0-rc.1 → 2.8.0-rc.2

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 (194) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/{p-89a9e8e3.entry.js → p-00269ca7.entry.js} +1 -1
  4. package/dist/bromcom-ui/{p-0ae31364.entry.js → p-0041bd28.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-98c9ac37.entry.js → p-007bec47.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-3a093f9e.entry.js → p-036f3880.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-8fa7cdf0.entry.js → p-0626d065.entry.js} +1 -1
  8. package/dist/bromcom-ui/p-13082089.entry.js +5 -0
  9. package/dist/bromcom-ui/{p-2a57c8c7.entry.js → p-13337304.entry.js} +1 -1
  10. package/dist/bromcom-ui/p-19cba40f.js +5 -0
  11. package/dist/bromcom-ui/{p-3d8802d9.entry.js → p-1e328bbb.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-3ccc9177.entry.js → p-30070e50.entry.js} +1 -1
  13. package/dist/bromcom-ui/p-3407de8c.entry.js +5 -0
  14. package/dist/bromcom-ui/{p-ffb57c2c.entry.js → p-35e357fb.entry.js} +1 -1
  15. package/dist/bromcom-ui/{p-2eaf7068.entry.js → p-400f7245.entry.js} +1 -1
  16. package/dist/bromcom-ui/{p-970a4dd6.entry.js → p-445a227f.entry.js} +1 -1
  17. package/dist/bromcom-ui/{p-79a1c167.js → p-4bbba8b4.js} +1 -1
  18. package/dist/bromcom-ui/{p-58815bb1.entry.js → p-57185ca0.entry.js} +1 -1
  19. package/dist/bromcom-ui/{p-4185987d.entry.js → p-5948de7f.entry.js} +1 -1
  20. package/dist/bromcom-ui/{p-afa908e9.entry.js → p-5a26b9b8.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-07b62dab.entry.js → p-5bad0d7b.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-80fdd63f.entry.js → p-6530b216.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-178fb088.entry.js → p-67659c20.entry.js} +1 -1
  24. package/dist/bromcom-ui/{p-65fbabc8.entry.js → p-6bd60d81.entry.js} +1 -1
  25. package/dist/bromcom-ui/{p-b175a1e1.entry.js → p-6bfece08.entry.js} +1 -1
  26. package/dist/bromcom-ui/{p-bd2d9941.entry.js → p-6c288e79.entry.js} +1 -1
  27. package/dist/bromcom-ui/{p-ceace9c7.entry.js → p-6c7b218c.entry.js} +1 -1
  28. package/dist/bromcom-ui/{p-34a59d30.js → p-7124553b.js} +1 -1
  29. package/dist/bromcom-ui/{p-410c74f6.js → p-7b153da4.js} +1 -1
  30. package/dist/bromcom-ui/{p-b5531d54.entry.js → p-82031406.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-1faaac85.entry.js → p-843c229b.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-e30c5251.entry.js → p-8c9d67ad.entry.js} +1 -1
  33. package/dist/bromcom-ui/{p-6baf6ea4.entry.js → p-8ced5b81.entry.js} +1 -1
  34. package/dist/bromcom-ui/{p-d39369ff.entry.js → p-935fdf64.entry.js} +1 -1
  35. package/dist/bromcom-ui/{p-a5abe2d6.entry.js → p-9490e993.entry.js} +1 -1
  36. package/dist/bromcom-ui/{p-56a5396d.js → p-a366b934.js} +1 -1
  37. package/dist/bromcom-ui/{p-3e45d00d.entry.js → p-a3a346fc.entry.js} +1 -1
  38. package/dist/bromcom-ui/{p-c718f29a.js → p-a82bcbd4.js} +1 -1
  39. package/dist/bromcom-ui/{p-ef6e4107.entry.js → p-aa59b8d1.entry.js} +1 -1
  40. package/dist/bromcom-ui/{p-a452bb5e.entry.js → p-b0d84958.entry.js} +1 -1
  41. package/dist/bromcom-ui/{p-94da7678.entry.js → p-b3003060.entry.js} +1 -1
  42. package/dist/bromcom-ui/{p-e3d32c37.entry.js → p-c012565a.entry.js} +1 -1
  43. package/dist/bromcom-ui/p-c092fafd.entry.js +11 -0
  44. package/dist/bromcom-ui/{p-7eb09daf.entry.js → p-cf24655f.entry.js} +1 -1
  45. package/dist/bromcom-ui/{p-524ab0fc.entry.js → p-d9bd56ef.entry.js} +1 -1
  46. package/dist/bromcom-ui/{p-c3238361.entry.js → p-dc3d9f76.entry.js} +1 -1
  47. package/dist/bromcom-ui/{p-ba8d8c03.entry.js → p-e38344ed.entry.js} +1 -1
  48. package/dist/bromcom-ui/{p-889553d3.entry.js → p-e842eb54.entry.js} +1 -1
  49. package/dist/bromcom-ui/{p-e9295fec.entry.js → p-ed04ae18.entry.js} +1 -1
  50. package/dist/bromcom-ui/{p-17bafd84.entry.js → p-efd4bae1.entry.js} +1 -1
  51. package/dist/bromcom-ui/{p-8cc29a92.entry.js → p-f0877724.entry.js} +1 -1
  52. package/dist/bromcom-ui/{p-5cd30376.entry.js → p-f4c08ca4.entry.js} +1 -1
  53. package/dist/bromcom-ui/{p-701cf04e.entry.js → p-f4d15784.entry.js} +1 -1
  54. package/dist/bromcom-ui/{p-7eb8c46e.js → p-f4d6590d.js} +1 -1
  55. package/dist/bromcom-ui/{p-d236a84f.entry.js → p-ff78d3f1.entry.js} +1 -1
  56. package/dist/cjs/bcm-accordion.cjs.entry.js +1 -1
  57. package/dist/cjs/bcm-alert.cjs.entry.js +1 -1
  58. package/dist/cjs/bcm-attendance.cjs.entry.js +1 -1
  59. package/dist/cjs/bcm-avatar_2.cjs.entry.js +3 -3
  60. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
  61. package/dist/cjs/bcm-button-group.cjs.entry.js +1 -1
  62. package/dist/cjs/{bcm-colorful_2.cjs.entry.js → bcm-button_10.cjs.entry.js} +1533 -19
  63. package/dist/cjs/bcm-card.cjs.entry.js +1 -1
  64. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +17 -17
  65. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +1 -1
  66. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +1 -1
  67. package/dist/cjs/bcm-chip.cjs.entry.js +1 -1
  68. package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
  69. package/dist/cjs/bcm-color-input.cjs.entry.js +3 -3
  70. package/dist/cjs/bcm-date-picker.cjs.entry.js +1 -1
  71. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +1 -1
  72. package/dist/cjs/bcm-default.cjs.entry.js +1 -1
  73. package/dist/cjs/bcm-drawer.cjs.entry.js +3 -3
  74. package/dist/cjs/bcm-dropdown.cjs.entry.js +2 -2
  75. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +1 -1
  76. package/dist/cjs/bcm-form-2.cjs.entry.js +1 -1
  77. package/dist/cjs/bcm-input-custom.cjs.entry.js +1 -1
  78. package/dist/cjs/bcm-item.cjs.entry.js +1 -1
  79. package/dist/cjs/bcm-items.cjs.entry.js +1 -1
  80. package/dist/cjs/bcm-list.cjs.entry.js +5 -5
  81. package/dist/cjs/bcm-menu.cjs.entry.js +4 -4
  82. package/dist/cjs/bcm-modal.cjs.entry.js +1 -1
  83. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +1 -1
  84. package/dist/cjs/bcm-popconfirm.cjs.entry.js +1 -1
  85. package/dist/cjs/bcm-popover.cjs.entry.js +3 -3
  86. package/dist/cjs/bcm-progress.cjs.entry.js +1 -1
  87. package/dist/cjs/bcm-range.cjs.entry.js +1 -1
  88. package/dist/cjs/bcm-search.cjs.entry.js +2 -2
  89. package/dist/cjs/bcm-skeleton.cjs.entry.js +1 -1
  90. package/dist/cjs/bcm-step.cjs.entry.js +2 -2
  91. package/dist/cjs/bcm-stepper.cjs.entry.js +4 -4
  92. package/dist/cjs/bcm-switch.cjs.entry.js +1 -1
  93. package/dist/cjs/bcm-tab-group.cjs.entry.js +3 -3
  94. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +3 -3
  95. package/dist/cjs/bcm-tab-item.cjs.entry.js +3 -3
  96. package/dist/cjs/bcm-tag.cjs.entry.js +2 -2
  97. package/dist/cjs/bcm-textarea.cjs.entry.js +2 -2
  98. package/dist/cjs/bcm-time-picker.cjs.entry.js +1 -1
  99. package/dist/cjs/bcm-toast.cjs.entry.js +115 -0
  100. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  101. package/dist/cjs/{generate-b2779357.js → generate-e2397ffa.js} +1 -1
  102. package/dist/cjs/{input-template-ef0dff49.js → input-template-2bdd0688.js} +1 -1
  103. package/dist/cjs/{json-parse-decarator-6daa901d.js → json-parse-decarator-fe468734.js} +1 -1
  104. package/dist/cjs/loader.cjs.js +1 -1
  105. package/dist/cjs/{number-helper-c0a3073d.js → number-helper-aac9b592.js} +1 -1
  106. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +2 -2
  107. package/dist/cjs/old-bcm-popover.cjs.entry.js +1 -1
  108. package/dist/cjs/{stepper-states-7458308e.js → stepper-states-5aa9bb64.js} +1 -1
  109. package/dist/cjs/{tooltip-helper-d4c09d59.js → tooltip-helper-18b3deae.js} +3 -3
  110. package/dist/cjs/{validators-9db90679.js → validators-5c4ee18b.js} +1 -1
  111. package/dist/collection/components/molecules/radio/radio-group.js +27 -6
  112. package/dist/components/bcm-radio-group.js +21 -4
  113. package/dist/components/generate.js +1 -1
  114. package/dist/esm/bcm-accordion.entry.js +1 -1
  115. package/dist/esm/bcm-alert.entry.js +1 -1
  116. package/dist/esm/bcm-attendance.entry.js +1 -1
  117. package/dist/esm/bcm-avatar_2.entry.js +3 -3
  118. package/dist/esm/bcm-breadcrumb.entry.js +1 -1
  119. package/dist/esm/bcm-button-group.entry.js +1 -1
  120. package/dist/esm/{bcm-colorful_2.entry.js → bcm-button_10.entry.js} +1521 -15
  121. package/dist/esm/bcm-card.entry.js +1 -1
  122. package/dist/esm/bcm-checkbox-group.entry.js +7 -7
  123. package/dist/esm/bcm-checkbox-lite_9.entry.js +1 -1
  124. package/dist/esm/bcm-checkbox_2.entry.js +1 -1
  125. package/dist/esm/bcm-chip.entry.js +1 -1
  126. package/dist/esm/bcm-collapse.entry.js +1 -1
  127. package/dist/esm/bcm-color-input.entry.js +3 -3
  128. package/dist/esm/bcm-date-picker.entry.js +1 -1
  129. package/dist/esm/bcm-datetime-picker.entry.js +1 -1
  130. package/dist/esm/bcm-default.entry.js +1 -1
  131. package/dist/esm/bcm-drawer.entry.js +3 -3
  132. package/dist/esm/bcm-dropdown.entry.js +2 -2
  133. package/dist/esm/bcm-expansion-panel.entry.js +1 -1
  134. package/dist/esm/bcm-form-2.entry.js +1 -1
  135. package/dist/esm/bcm-input-custom.entry.js +1 -1
  136. package/dist/esm/bcm-item.entry.js +1 -1
  137. package/dist/esm/bcm-items.entry.js +1 -1
  138. package/dist/esm/bcm-list.entry.js +5 -5
  139. package/dist/esm/bcm-menu.entry.js +4 -4
  140. package/dist/esm/bcm-modal.entry.js +1 -1
  141. package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
  142. package/dist/esm/bcm-popconfirm.entry.js +1 -1
  143. package/dist/esm/bcm-popover.entry.js +3 -3
  144. package/dist/esm/bcm-progress.entry.js +1 -1
  145. package/dist/esm/bcm-range.entry.js +1 -1
  146. package/dist/esm/bcm-search.entry.js +2 -2
  147. package/dist/esm/bcm-skeleton.entry.js +1 -1
  148. package/dist/esm/bcm-step.entry.js +2 -2
  149. package/dist/esm/bcm-stepper.entry.js +4 -4
  150. package/dist/esm/bcm-switch.entry.js +1 -1
  151. package/dist/esm/bcm-tab-group.entry.js +3 -3
  152. package/dist/esm/bcm-tab-item-header.entry.js +3 -3
  153. package/dist/esm/bcm-tab-item.entry.js +3 -3
  154. package/dist/esm/bcm-tag.entry.js +2 -2
  155. package/dist/esm/bcm-textarea.entry.js +2 -2
  156. package/dist/esm/bcm-time-picker.entry.js +1 -1
  157. package/dist/esm/bcm-toast.entry.js +111 -0
  158. package/dist/esm/bromcom-ui.js +1 -1
  159. package/dist/esm/{generate-fbf3c64b.js → generate-82c3ee1f.js} +1 -1
  160. package/dist/esm/{input-template-f5b003c0.js → input-template-9a5da65a.js} +1 -1
  161. package/dist/esm/{json-parse-decarator-f023562b.js → json-parse-decarator-aba7d121.js} +1 -1
  162. package/dist/esm/loader.js +1 -1
  163. package/dist/esm/{number-helper-b69dc985.js → number-helper-d4126c02.js} +1 -1
  164. package/dist/esm/old-bcm-popover-box.entry.js +2 -2
  165. package/dist/esm/old-bcm-popover.entry.js +1 -1
  166. package/dist/esm/{stepper-states-7087f0cb.js → stepper-states-3b8d6edd.js} +1 -1
  167. package/dist/esm/{tooltip-helper-31ca799b.js → tooltip-helper-e7eb577d.js} +3 -3
  168. package/dist/esm/{validators-d3c37e80.js → validators-2a89d009.js} +1 -1
  169. package/dist/types/components/molecules/radio/radio-group.d.ts +3 -0
  170. package/package.json +1 -1
  171. package/dist/bromcom-ui/p-168d2632.entry.js +0 -5
  172. package/dist/bromcom-ui/p-1a0900cc.entry.js +0 -10
  173. package/dist/bromcom-ui/p-4a123037.entry.js +0 -5
  174. package/dist/bromcom-ui/p-51deaab5.entry.js +0 -5
  175. package/dist/bromcom-ui/p-6ea775e8.entry.js +0 -5
  176. package/dist/bromcom-ui/p-70c794df.js +0 -5
  177. package/dist/bromcom-ui/p-967df53d.entry.js +0 -5
  178. package/dist/bromcom-ui/p-e2e7d808.entry.js +0 -5
  179. package/dist/bromcom-ui/p-e422fc70.entry.js +0 -5
  180. package/dist/bromcom-ui/p-f881a6b8.entry.js +0 -5
  181. package/dist/cjs/bcm-button_2.cjs.entry.js +0 -482
  182. package/dist/cjs/bcm-form.cjs.entry.js +0 -487
  183. package/dist/cjs/bcm-icon.cjs.entry.js +0 -41
  184. package/dist/cjs/bcm-input.cjs.entry.js +0 -369
  185. package/dist/cjs/bcm-label_2.cjs.entry.js +0 -149
  186. package/dist/cjs/bcm-radio-group.cjs.entry.js +0 -143
  187. package/dist/cjs/bcm-radio.cjs.entry.js +0 -64
  188. package/dist/esm/bcm-button_2.entry.js +0 -477
  189. package/dist/esm/bcm-form.entry.js +0 -483
  190. package/dist/esm/bcm-icon.entry.js +0 -37
  191. package/dist/esm/bcm-input.entry.js +0 -365
  192. package/dist/esm/bcm-label_2.entry.js +0 -144
  193. package/dist/esm/bcm-radio-group.entry.js +0 -139
  194. package/dist/esm/bcm-radio.entry.js +0 -60
@@ -1,483 +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-6e2d80d7.js';
6
- import { c as classnames } from './index-ba2edd32.js';
7
- import { I as IsLoad } from './is-load-decorator-66e19e04.js';
8
- import { S as StringHelper } from './string-helper-0fb7ff20.js';
9
- import { d as delay, g as getChildElements } from './utils-57652744.js';
10
- import './_commonjsHelpers-3016b722.js';
11
- import './bcm-9f50af9c.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
- // Birbirinin aynısı
84
- INPUT: 'input',
85
- TEXTAREA: 'textarea',
86
- //çok benzer
87
- SWITCH: 'switch',
88
- CHECKBOX: 'checkbox',
89
- RADIO_GROUP: 'radio-group',
90
- CHECKBOX_GROUP: 'checkbox-group',
91
- RANGE: 'range',
92
- // sadece value fırlatıyor
93
- FORM: 'form',
94
- FORM_GROUP: 'form-group',
95
- // *En vakit alacak => içinde select, autocomplete, listbox, treeview özellikleri var
96
- LIST: 'list',
97
- //
98
- COLORPICKER: 'colorpicker',
99
- // picker aslında tek komponent hepsi datetimepicker
100
- DATE_PICKER: 'date-picker',
101
- TIME_PICKER: 'time-picker',
102
- DATETIME_PICKER: 'datetime-picker',
103
- // silinecek komponentler
104
- SELECT: 'select',
105
- LISTBOX: 'listbox'
106
- },
107
- helpers: {
108
- randomId: function () {
109
- return Math.random().toString(16).slice(2, -1);
110
- },
111
- },
112
- };
113
- this._id = (Math.random() * 4).toString(16).replace('.', '');
114
- this.hidden = false;
115
- this.validation = false;
116
- this.name = "";
117
- this.value = undefined;
118
- this.autocomplete = false;
119
- }
120
- handleSubmit() {
121
- // if (lowercase(e.target.nodeName) === 'bcm-button') {
122
- // if (e.target.type === 'submit') {
123
- // this.submitFunction()
124
- // }
125
- // }
126
- }
127
- async submitFunction() {
128
- this.formData = {};
129
- this.inputs = [];
130
- this.selector = this.el;
131
- await this.getInputs();
132
- await delay(10);
133
- const usrFrmData = await this.userFormData();
134
- var formData = { isValid: true, formData: usrFrmData };
135
- if (this.name) {
136
- formData = Object.assign(Object.assign({}, formData), { formName: this.name });
137
- }
138
- if (this.isValid) {
139
- this.bcmForm.emit(formData);
140
- return formData;
141
- }
142
- else {
143
- this.returnCaption = { isValid: false, 'message': 'Please fill in all inputs', 'errorDetails': this.returnCaption, formData: usrFrmData };
144
- if (this.name) {
145
- this.returnCaption = Object.assign(Object.assign({}, this.returnCaption), { formName: this.name });
146
- }
147
- this.bcmForm.emit(this.returnCaption);
148
- return this.returnCaption;
149
- }
150
- }
151
- async submit() {
152
- return Promise.resolve(this.submitFunction());
153
- }
154
- async set(data) {
155
- var _a;
156
- const validate = this.validation;
157
- this.validation = false;
158
- // debugger
159
- this.selector = this.el;
160
- await this.getInputs();
161
- if (data && ((_a = this.inputs) === null || _a === void 0 ? void 0 : _a.length) > 0) {
162
- for (const key of Object.keys(data)) {
163
- const item = this.inputs.find(item => item.name === key);
164
- if (item) {
165
- try {
166
- await item.set(data[key]);
167
- }
168
- catch (error) {
169
- console.log(item.nodeName, "set", error);
170
- }
171
- }
172
- }
173
- }
174
- this.validation = validate;
175
- }
176
- async get() {
177
- var _a;
178
- let formData = {};
179
- this.selector = this.el;
180
- const inputsCache = this.inputs;
181
- await this.getInputs();
182
- ((_a = this.inputs) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.inputs.forEach(async (item) => {
183
- try {
184
- const value = await item.get();
185
- formData = Object.assign(Object.assign({}, formData), { [item.name]: value });
186
- }
187
- catch (error) {
188
- console.log(`${item.nodeName} get error`);
189
- }
190
- });
191
- this.inputs = inputsCache;
192
- await delay(10);
193
- return Promise.resolve(formData);
194
- }
195
- async setClear() {
196
- this.formData = {};
197
- this.inputs = [];
198
- this.selector = this.el;
199
- let clear = [];
200
- await this.getInputs();
201
- this.inputs.forEach(async (item) => {
202
- try {
203
- clear.push(await item.setClear());
204
- }
205
- catch (error) {
206
- console.log(error);
207
- }
208
- });
209
- await Promise.all(clear).then(() => {
210
- this.formData = {};
211
- this.inputs = [];
212
- this.duplicateInput = [];
213
- this.isValid = true;
214
- this.returnCaption = [];
215
- });
216
- await delay(10);
217
- return Promise.resolve(true);
218
- }
219
- async resetCaption() {
220
- await delay(10);
221
- this.formData = {};
222
- this.inputs = [];
223
- this.selector = this.el;
224
- await this.getInputs();
225
- for (const item of this.inputs) {
226
- try {
227
- await item.resetCaption();
228
- }
229
- catch (error) {
230
- console.log(item.nodeName, "rc p");
231
- }
232
- }
233
- await delay(10);
234
- return Promise.resolve();
235
- }
236
- async config(_config) {
237
- if (_config['validation']) {
238
- typeof _config['validation'] == 'boolean'
239
- ? this.validation = _config['validation']
240
- : this.validation = false;
241
- }
242
- return true;
243
- }
244
- async getInputs() {
245
- var form = this.selector;
246
- if (!form) {
247
- console.warn(this.Bromcom.errors.targetFormNotExist + this.selector);
248
- return;
249
- }
250
- const inputs = Array.from(form.querySelectorAll('bcm-' + Object.values(this.Bromcom.inputComponents).join(',bcm-')));
251
- this.duplicateInput = [];
252
- // s-hn: Stencil private flag that contains host web component
253
- // https://github.com/ionic-team/stencil/blob/45388e95edb46ef357eb9ae37cd32bbb5bc1ed23/src/runtime/vdom/vdom-render.ts#L116
254
- const rootInputs = inputs.filter((input) => { var _a; return !input['s-hn'] || ((_a = input['s-hn']) === null || _a === void 0 ? void 0 : _a.nodeName) !== 'BcmForm'; });
255
- // debugger;
256
- for (const item of rootInputs) {
257
- if (StringHelper.lowercase(item.nodeName) == "bcm-checkbox-group") {
258
- let checkboxs = item.querySelectorAll("bcm-checkbox");
259
- if (checkboxs) {
260
- for (const checkbox of checkboxs) {
261
- this.duplicateInput.push(checkbox.name);
262
- }
263
- }
264
- }
265
- if (StringHelper.lowercase(item.nodeName) == "bcm-form") {
266
- const groupInputs = Array.from(item.querySelectorAll('bcm-' + Object.values(this.Bromcom.inputComponents).join(',bcm-')));
267
- let itemObject = {};
268
- for (const element of groupInputs) {
269
- var name = element.name;
270
- var value = element.value;
271
- itemObject = Object.assign(Object.assign({}, itemObject), { [name]: value });
272
- this.duplicateInput.push(element.name);
273
- }
274
- item.value = itemObject;
275
- let checkboxs = item.querySelectorAll("bcm-checkbox");
276
- if (checkboxs) {
277
- for (const checkbox of checkboxs) {
278
- this.duplicateInput.push(checkbox.name);
279
- }
280
- }
281
- }
282
- }
283
- await delay(10);
284
- this.inputs = rootInputs;
285
- }
286
- getItemValue(item) {
287
- const tagName = item.tagName.toLowerCase().replace('bcm-', '');
288
- switch (tagName) {
289
- /* case 'date-picker':
290
- case 'datetime-picker':
291
- return item.value.timestamp
292
- case 'time-picker':
293
- return item.value.time */
294
- default:
295
- return item.value;
296
- }
297
- }
298
- isWrapperComponent(item) {
299
- return ['bcm-datetime-picker', 'bcm-date-picker', 'bcm-time-picker'].includes(item.toLowerCase());
300
- }
301
- isGroupComponent(item) {
302
- return ['bcm-checkbox-group'].includes(item.toLowerCase());
303
- }
304
- isListComponent(item) {
305
- return ['bcm-list'].includes(item.toLowerCase());
306
- }
307
- async userFormData() {
308
- this.formData = {};
309
- this.isValid = true;
310
- this.returnCaption = [];
311
- for (const item of this.inputs) {
312
- // const isListComponent = this.isListComponent(item.tagName);
313
- const isGroupComponent = this.isGroupComponent(item.tagName);
314
- const isWrapperComponent = this.isWrapperComponent(item.tagName);
315
- const wrapperComponent = isWrapperComponent && item;
316
- const input = isWrapperComponent
317
- ? await item.getInput() && item
318
- : item;
319
- // input.caption = ''
320
- // input.captionType = ''
321
- if (this.validation) {
322
- let valid = null;
323
- // if (isListComponent) {
324
- // valid = !(input.value && input.value.length > 0) && validate.required(input.value)
325
- // } else
326
- if (isWrapperComponent) {
327
- const isPickerValid = await wrapperComponent.isValid();
328
- valid = validate.required(input.value, isPickerValid);
329
- if (valid) {
330
- if (input.value instanceof Object) {
331
- if (input.value["isValid"] == false) {
332
- valid = validate.required("", isPickerValid);
333
- }
334
- }
335
- else {
336
- valid = validate.required(input.value, isPickerValid);
337
- }
338
- }
339
- }
340
- else if (isGroupComponent) {
341
- const childsCheckbox = getChildElements(input, 'bcm-checkbox:not(#bcm-indeterminate-element)');
342
- if (childsCheckbox && childsCheckbox.length > 0) {
343
- for (const element of childsCheckbox) {
344
- if (element && element.required === true) {
345
- valid = validate.required(element.checked);
346
- if (!valid['valid']) {
347
- element.noCaption = false;
348
- element.captionError = valid['message'];
349
- element.captionType = valid['type'];
350
- }
351
- else {
352
- element.noCaption = input.noCaption;
353
- element.captionError = null;
354
- element.captionType = "default";
355
- }
356
- }
357
- }
358
- }
359
- }
360
- else {
361
- valid = validate.required(input.value);
362
- }
363
- if (input.required) {
364
- if (!valid['valid']) {
365
- input.captionError = valid['message'];
366
- input.captionType = valid['type'];
367
- }
368
- else {
369
- input.captionError = null;
370
- input.captionType = "default";
371
- }
372
- await delay(10);
373
- const selfValidation = validate.selfValidation(input);
374
- if (valid['valid']) {
375
- if (!selfValidation['valid']) {
376
- input.captionError = selfValidation['message'];
377
- input.captionType = selfValidation['type'];
378
- }
379
- }
380
- }
381
- let name = input.name;
382
- let value = input.captionError;
383
- !input.hidden && input.captionType == 'error' && (this.returnCaption = [...Array.from(this.returnCaption), { [name]: value }],
384
- this.isValid = false);
385
- }
386
- if (input.name && !this.duplicateInput.includes(input.name)) {
387
- var itemValue = this.getItemValue(input);
388
- if (!itemValue || itemValue == undefined || itemValue == null) {
389
- itemValue = null;
390
- }
391
- this.formData[input.name] = itemValue;
392
- }
393
- }
394
- return this.formData;
395
- }
396
- async handleChange(e) {
397
- const isWrapperComponent = this.isWrapperComponent(e.target.tagName);
398
- const isGroupComponent = this.isGroupComponent(e.target.tagName);
399
- let target;
400
- if (isWrapperComponent) {
401
- target = e.target.getInput && await e.target.getInput() || e.target;
402
- }
403
- else if (isGroupComponent) {
404
- let req = false;
405
- const childsCheckbox = getChildElements(e.target, 'bcm-checkbox:not(#bcm-indeterminate-element)');
406
- childsCheckbox.length > 0 && (childsCheckbox.forEach((element) => {
407
- if (element && element.required === true) {
408
- req = true;
409
- }
410
- }));
411
- target = Object.assign(Object.assign({}, e.target), { required: req });
412
- }
413
- else {
414
- target = e.target;
415
- }
416
- const value = e.target.value;
417
- const wrapperComponent = isWrapperComponent && e.target;
418
- var isPickerValid;
419
- if (isWrapperComponent) {
420
- isPickerValid = await wrapperComponent.isValid();
421
- }
422
- const tick = setTimeout(() => {
423
- if (target.required) {
424
- let valid = null;
425
- if (isWrapperComponent) {
426
- valid = validate.required(value, isPickerValid);
427
- if (valid) {
428
- if (value instanceof Object) {
429
- if (value["isValid"] == false) {
430
- valid = validate.required("", isPickerValid);
431
- }
432
- }
433
- else {
434
- valid = validate.required(value, isPickerValid);
435
- }
436
- }
437
- }
438
- else if (isGroupComponent) {
439
- const childsCheckbox = getChildElements(e.target, 'bcm-checkbox:not(#bcm-indeterminate-element)');
440
- childsCheckbox.length > 0 && (childsCheckbox.forEach((element) => {
441
- if (element && element.required === true) {
442
- valid = validate.required(element.checked);
443
- if (!valid['valid']) {
444
- element.noCaption = false;
445
- element.captionError = valid['message'];
446
- element.captionType = valid['type'];
447
- }
448
- else {
449
- element.noCaption = e.target.noCaption;
450
- element.captionError = null;
451
- element.captionType = "default";
452
- }
453
- }
454
- }));
455
- }
456
- else {
457
- valid = validate.required(value);
458
- }
459
- if (valid['valid']) {
460
- target.captionError = null;
461
- target.captionType = null;
462
- }
463
- else {
464
- target.captionError = valid['message'];
465
- target.captionType = valid['type'];
466
- }
467
- }
468
- clearTimeout(tick);
469
- });
470
- this.value = await this.userFormData();
471
- }
472
- render() {
473
- const hostClasses = classnames(this.hidden ? 'hidden' : null);
474
- return (h(Host, { class: hostClasses }, h("form", { class: "bcm-form", autocomplete: this.autocomplete ? "on" : "off" }, h("slot", null))));
475
- }
476
- get el() { return getElement(this); }
477
- };
478
- __decorate([
479
- IsLoad()
480
- ], BcmForm.prototype, "el", void 0);
481
- BcmForm.style = formCss;
482
-
483
- export { BcmForm as bcm_form };
@@ -1,37 +0,0 @@
1
- /*!
2
- * Built with Stencil
3
- * Copyright (c) Bromcom.
4
- */
5
- import { r as registerInstance, h, H as Host, g as getElement } from './index-6e2d80d7.js';
6
- import { I as IsLoad } from './is-load-decorator-66e19e04.js';
7
-
8
- const iconCss = "@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}.bcm-icon.hidden{display:none}";
9
-
10
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
11
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
13
- r = Reflect.decorate(decorators, target, key, desc);
14
- else
15
- for (var i = decorators.length - 1; i >= 0; i--)
16
- if (d = decorators[i])
17
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- };
20
- const BcmIcon = class {
21
- constructor(hostRef) {
22
- registerInstance(this, hostRef);
23
- this.hidden = false;
24
- this.icon = undefined;
25
- }
26
- render() {
27
- const { icon, hidden } = this;
28
- return (h(Host, { class: `bcm-icon fa ${hidden ? 'hidden' : ''}` }, h("i", { class: `${icon}` })));
29
- }
30
- get el() { return getElement(this); }
31
- };
32
- __decorate([
33
- IsLoad()
34
- ], BcmIcon.prototype, "el", void 0);
35
- BcmIcon.style = iconCss;
36
-
37
- export { BcmIcon as bcm_icon };