@streamline-pulse/formkrafter-wc 0.3.0 → 0.4.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 (158) hide show
  1. package/README.md +10 -8
  2. package/dist/components/fk-brick-actions.js +1 -1
  3. package/dist/components/fk-brick-list.js +1 -1
  4. package/dist/components/fk-brick-mold-item.js +1 -1
  5. package/dist/components/fk-brick-render.js +1 -1
  6. package/dist/components/fk-code-editor.js +1 -1
  7. package/dist/components/fk-data-grid.js +1 -1
  8. package/dist/components/fk-drop-area.js +1 -1
  9. package/dist/components/fk-empty-form.js +1 -1
  10. package/dist/components/fk-file-input.js +1 -1
  11. package/dist/components/fk-form-builder.js +1 -1
  12. package/dist/components/fk-form-render.js +1 -1
  13. package/dist/components/fk-property-panel.js +1 -1
  14. package/dist/components/fk-rules-editor.js +1 -1
  15. package/dist/components/fk-select-input.js +1 -1
  16. package/dist/components/fk-signature-input.js +1 -1
  17. package/dist/components/fk-stepper.js +1 -1
  18. package/dist/components/fk-tabs.js +1 -1
  19. package/dist/components/index.js +1 -1
  20. package/dist/components/{p-CKMHMpID.js → p-28GBFlUX.js} +4 -4
  21. package/dist/components/{p-D6n74M9d.js → p-BGxmFcpL.js} +1 -1
  22. package/dist/components/{p-DYchD23x.js → p-BInUBjyw.js} +1 -1
  23. package/dist/{formkrafter-wc/p-C-wnqV3i.js → components/p-BietHxaT.js} +1 -1
  24. package/dist/components/{p-fDJP6whN.js → p-BnzSarwW.js} +1 -1
  25. package/dist/components/p-BpkKcCCr.js +1 -0
  26. package/dist/components/p-C0Y8qh8R.js +1 -0
  27. package/dist/components/p-C5OWoRhO.js +1 -0
  28. package/dist/components/{p-wuC5rVU7.js → p-CKs1CWVz.js} +1 -1
  29. package/dist/components/{p-v7LxwCAc.js → p-CZHykCYD.js} +1 -1
  30. package/dist/components/{p-4COASNrZ.js → p-CehxuHtl.js} +1 -1
  31. package/dist/components/p-CqVSd56Z.js +1 -0
  32. package/dist/components/p-CyZA17qf.js +1 -0
  33. package/dist/components/{p-BGkZP87K.js → p-D4HhZxQ-.js} +1 -1
  34. package/dist/components/p-DC6Wxbnz.js +1 -0
  35. package/dist/components/p-DRNycSdI.js +1 -0
  36. package/dist/components/{p--vL6GR31.js → p-Dh5Z49YD.js} +1 -1
  37. package/dist/components/p-DiOstAi9.js +1 -0
  38. package/dist/components/p-DlqnIm46.js +1 -0
  39. package/dist/components/{p-CIfjRTky.js → p-DshUS8Zm.js} +1 -1
  40. package/dist/components/{p-DMCkrZqi.js → p-RzeBwfwG.js} +1 -1
  41. package/dist/components/{p-BWdm2a6q.js → p-ajy8ZcBX.js} +1 -1
  42. package/dist/components/p-kYG3E0GQ.js +1 -0
  43. package/dist/components/p-tTJg_I4V.js +1 -0
  44. package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
  45. package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
  46. package/dist/formkrafter-wc/index.esm.js +1 -1
  47. package/dist/formkrafter-wc/p-3579150a.entry.js +1 -0
  48. package/dist/formkrafter-wc/p-8b0ff66e.entry.js +1 -0
  49. package/dist/formkrafter-wc/p-BHZMDq2e.js +1 -0
  50. package/dist/{components/p-C-wnqV3i.js → formkrafter-wc/p-BietHxaT.js} +1 -1
  51. package/dist/formkrafter-wc/p-C0Y8qh8R.js +1 -0
  52. package/dist/formkrafter-wc/{p-4COASNrZ.js → p-CehxuHtl.js} +1 -1
  53. package/dist/formkrafter-wc/p-DlqnIm46.js +1 -0
  54. package/dist/formkrafter-wc/{p-DMCkrZqi.js → p-RzeBwfwG.js} +1 -1
  55. package/dist/formkrafter-wc/p-WWmY5Z05.js +1 -0
  56. package/dist/formkrafter-wc/p-hcT25XX4.js +12 -0
  57. package/dist/types/components/fk-code-editor/fk-code-editor.d.ts +1 -0
  58. package/dist/types/components/fk-data-grid/fk-data-grid.d.ts +1 -0
  59. package/dist/types/components/fk-drop-area/fk-drop-area.d.ts +1 -0
  60. package/dist/types/components/fk-form-render/fk-form-render.d.ts +7 -1
  61. package/dist/types/components.d.ts +17 -0
  62. package/dist/types/index.d.ts +1 -1
  63. package/dist/types/registry/default-bricks.d.ts +36 -0
  64. package/dist/types/utils/mask.d.ts +1 -0
  65. package/package.json +10 -15
  66. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
  67. package/dist/cjs/fk-brick-actions_18.cjs.entry.js +0 -4224
  68. package/dist/cjs/formkrafter-wc.cjs.js +0 -25
  69. package/dist/cjs/index-Bhy1RJMV.js +0 -3042
  70. package/dist/cjs/index-CImTe9BG.js +0 -2126
  71. package/dist/cjs/index-CdaT3-qx.js +0 -5444
  72. package/dist/cjs/index-CkPPRg03.js +0 -17548
  73. package/dist/cjs/index-DHgK3reD.js +0 -12233
  74. package/dist/cjs/index-Ds0sDbXV.js +0 -4019
  75. package/dist/cjs/index-c9BL7y3N.js +0 -1922
  76. package/dist/cjs/index.cjs.js +0 -48
  77. package/dist/cjs/loader.cjs.js +0 -13
  78. package/dist/collection/collection-manifest.json +0 -30
  79. package/dist/collection/components/fk-brick-actions/fk-brick-actions.css +0 -78
  80. package/dist/collection/components/fk-brick-actions/fk-brick-actions.js +0 -215
  81. package/dist/collection/components/fk-brick-list/fk-brick-list.css +0 -71
  82. package/dist/collection/components/fk-brick-list/fk-brick-list.js +0 -55
  83. package/dist/collection/components/fk-brick-mold-item/fk-brick-mold-item.css +0 -33
  84. package/dist/collection/components/fk-brick-mold-item/fk-brick-mold-item.js +0 -73
  85. package/dist/collection/components/fk-brick-not-found/fk-brick-not-found.css +0 -8
  86. package/dist/collection/components/fk-brick-not-found/fk-brick-not-found.js +0 -18
  87. package/dist/collection/components/fk-brick-render/fk-brick-render.js +0 -447
  88. package/dist/collection/components/fk-code-editor/fk-code-editor.css +0 -26
  89. package/dist/collection/components/fk-code-editor/fk-code-editor.js +0 -145
  90. package/dist/collection/components/fk-data-grid/fk-data-grid.css +0 -75
  91. package/dist/collection/components/fk-data-grid/fk-data-grid.js +0 -300
  92. package/dist/collection/components/fk-drop-area/fk-drop-area.css +0 -18
  93. package/dist/collection/components/fk-drop-area/fk-drop-area.js +0 -98
  94. package/dist/collection/components/fk-empty-form/fk-empty-form.css +0 -22
  95. package/dist/collection/components/fk-empty-form/fk-empty-form.js +0 -19
  96. package/dist/collection/components/fk-file-input/fk-file-input.css +0 -95
  97. package/dist/collection/components/fk-file-input/fk-file-input.js +0 -239
  98. package/dist/collection/components/fk-form-builder/fk-form-builder.css +0 -112
  99. package/dist/collection/components/fk-form-builder/fk-form-builder.js +0 -431
  100. package/dist/collection/components/fk-form-render/fk-form-render.css +0 -7
  101. package/dist/collection/components/fk-form-render/fk-form-render.js +0 -352
  102. package/dist/collection/components/fk-property-panel/fk-property-panel.css +0 -153
  103. package/dist/collection/components/fk-property-panel/fk-property-panel.js +0 -388
  104. package/dist/collection/components/fk-rules-editor/fk-rules-editor.css +0 -166
  105. package/dist/collection/components/fk-rules-editor/fk-rules-editor.js +0 -250
  106. package/dist/collection/components/fk-select-input/fk-select-input.css +0 -153
  107. package/dist/collection/components/fk-select-input/fk-select-input.js +0 -454
  108. package/dist/collection/components/fk-signature-input/fk-signature-input.css +0 -42
  109. package/dist/collection/components/fk-signature-input/fk-signature-input.js +0 -158
  110. package/dist/collection/components/fk-stepper/fk-stepper.css +0 -99
  111. package/dist/collection/components/fk-stepper/fk-stepper.js +0 -285
  112. package/dist/collection/components/fk-tabs/fk-tabs.css +0 -38
  113. package/dist/collection/components/fk-tabs/fk-tabs.js +0 -249
  114. package/dist/collection/i18n/i18n.js +0 -265
  115. package/dist/collection/index.js +0 -5
  116. package/dist/collection/registry/create-brick.js +0 -34
  117. package/dist/collection/registry/default-bricks.js +0 -564
  118. package/dist/collection/registry/registry.js +0 -44
  119. package/dist/collection/utils/brick-data.js +0 -16
  120. package/dist/collection/utils/drop.js +0 -14
  121. package/dist/collection/utils/events.js +0 -1
  122. package/dist/collection/utils/options.js +0 -21
  123. package/dist/collection/utils/remote.js +0 -27
  124. package/dist/collection/utils/rule-condition.js +0 -72
  125. package/dist/collection/utils/style.js +0 -11
  126. package/dist/components/p-BOmBVgfJ.js +0 -1
  127. package/dist/components/p-B_-x-GlA.js +0 -1
  128. package/dist/components/p-Br1s4Ujx.js +0 -1
  129. package/dist/components/p-CUF31e-P.js +0 -1
  130. package/dist/components/p-CWQX0sXS.js +0 -1
  131. package/dist/components/p-DFe3zZCI.js +0 -1
  132. package/dist/components/p-DOInQkG6.js +0 -1
  133. package/dist/components/p-PAr7WoWG.js +0 -1
  134. package/dist/components/p-YyGnQmX-.js +0 -1
  135. package/dist/components/p-swxZqinH.js +0 -1
  136. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  137. package/dist/esm/fk-brick-actions_18.entry.js +0 -4205
  138. package/dist/esm/formkrafter-wc.js +0 -21
  139. package/dist/esm/index-BAcz7b5u.js +0 -5416
  140. package/dist/esm/index-BkRMoLXK.js +0 -3029
  141. package/dist/esm/index-CGMDfZ5m.js +0 -1808
  142. package/dist/esm/index-D7Cta1UB.js +0 -17488
  143. package/dist/esm/index-DtcM1yw5.js +0 -3991
  144. package/dist/esm/index-DuVf3NlP.js +0 -12222
  145. package/dist/esm/index-qLZlXROB.js +0 -2117
  146. package/dist/esm/index.js +0 -2
  147. package/dist/esm/loader.js +0 -11
  148. package/dist/formkrafter-wc/p-6d29555b.entry.js +0 -1
  149. package/dist/formkrafter-wc/p-DOInQkG6.js +0 -1
  150. package/dist/formkrafter-wc/p-Ddu6BquK.js +0 -12
  151. package/dist/index.cjs.js +0 -1
  152. package/dist/index.js +0 -1
  153. package/dist/stencil.config.js +0 -34
  154. package/loader/cdn.js +0 -1
  155. package/loader/index.cjs.js +0 -1
  156. package/loader/index.d.ts +0 -24
  157. package/loader/index.es2017.js +0 -1
  158. package/loader/index.js +0 -2
@@ -1,388 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { isLocalizedObject } from "@streamline-pulse/formkrafter-core";
3
- import { fkT, fkTOr } from "../../i18n/i18n";
4
- export class FkPropertyPanel {
5
- constructor() {
6
- this.fields = [];
7
- this.locales = [];
8
- this.activeTab = 'config';
9
- this.newStyleKey = '';
10
- }
11
- onBrickChange() {
12
- if (!this.availableTabs().some((tab) => tab.id === this.activeTab)) {
13
- this.activeTab = 'config';
14
- }
15
- }
16
- availableTabs() {
17
- const tabs = [
18
- { id: 'config', label: fkT('panel.tab.config') },
19
- ];
20
- if (this.brick.type === 'input') {
21
- tabs.push({ id: 'validation', label: fkT('panel.tab.validation') });
22
- }
23
- tabs.push({ id: 'styles', label: fkT('panel.tab.styles') }, { id: 'rules', label: fkT('panel.tab.rules') });
24
- return tabs;
25
- }
26
- localized(current, value) {
27
- var _a;
28
- if (this.locales.length <= 1)
29
- return value || undefined;
30
- const map = isLocalizedObject(current)
31
- ? Object.assign({}, current) : {};
32
- if (typeof current === 'string' && current && !isLocalizedObject(current)) {
33
- map[this.locales[0]] = current;
34
- }
35
- map[(_a = this.editLocale) !== null && _a !== void 0 ? _a : this.locales[0]] = value;
36
- return map;
37
- }
38
- readLocalized(current) {
39
- var _a, _b, _c;
40
- if (isLocalizedObject(current)) {
41
- return (_b = current[(_a = this.editLocale) !== null && _a !== void 0 ? _a : this.locales[0]]) !== null && _b !== void 0 ? _b : '';
42
- }
43
- return (_c = current) !== null && _c !== void 0 ? _c : '';
44
- }
45
- writeTextConfig(key, value) {
46
- var _a;
47
- this.emitConfigs({ [key]: this.localized((_a = this.brick.configs) === null || _a === void 0 ? void 0 : _a[key], value) });
48
- }
49
- emitConfigs(patch) {
50
- var _a;
51
- const uid = (_a = this.brick.configs) === null || _a === void 0 ? void 0 : _a.uid;
52
- if (!uid)
53
- return;
54
- this.brickConfigsChange.emit({ configs: patch, uid });
55
- }
56
- emitValidations(validations) {
57
- var _a;
58
- const uid = (_a = this.brick.configs) === null || _a === void 0 ? void 0 : _a.uid;
59
- if (!uid)
60
- return;
61
- this.brickValidationsChange.emit({ validations, uid });
62
- }
63
- emitStyles(patch) {
64
- var _a;
65
- const uid = (_a = this.brick.configs) === null || _a === void 0 ? void 0 : _a.uid;
66
- if (!uid)
67
- return;
68
- this.brickStylesChange.emit({ styles: patch, uid });
69
- }
70
- validationOf(validator) {
71
- var _a;
72
- return (_a = this.brick.validations) === null || _a === void 0 ? void 0 : _a.find((validation) => validation.validator === validator);
73
- }
74
- setValidation(validator, active, patch = {}) {
75
- var _a;
76
- const current = this.validationOf(validator);
77
- const others = ((_a = this.brick.validations) !== null && _a !== void 0 ? _a : []).filter((validation) => validation.validator !== validator);
78
- this.emitValidations(active ? [...others, Object.assign(Object.assign(Object.assign({}, current), { validator }), patch)] : others);
79
- }
80
- addStyle(value) {
81
- const key = this.newStyleKey.trim();
82
- if (!key)
83
- return;
84
- this.emitStyles({ [key]: value });
85
- this.newStyleKey = '';
86
- }
87
- textField(label, value, onCommit) {
88
- var _a;
89
- return (h("label", { class: "fk-props__field" }, h("span", { class: "fk-props__label" }, label), h("input", { class: "fk-props__input", type: "text", value: (_a = value) !== null && _a !== void 0 ? _a : '', onChange: (event) => onCommit(event.target.value) })));
90
- }
91
- optionsFields() {
92
- var _a, _b, _c;
93
- const configs = this.brick.configs;
94
- if (!configs || !('options' in configs || 'optionsSource' in configs)) {
95
- return [];
96
- }
97
- const supportsSources = 'optionsSource' in configs;
98
- const source = supportsSources
99
- ? ((_a = configs.optionsSource) !== null && _a !== void 0 ? _a : 'static')
100
- : 'static';
101
- const nodes = supportsSources
102
- ? [
103
- h("label", { class: "fk-props__field" }, h("span", { class: "fk-props__label" }, fkT('panel.optionsSource')), h("select", { class: "fk-props__input", onChange: (event) => this.emitConfigs({
104
- optionsSource: event.target.value,
105
- }) }, ['static', 'dataMap', 'remote', 'js'].map((candidate) => (h("option", { value: candidate, selected: candidate === source }, candidate))))),
106
- ]
107
- : [];
108
- if (source === 'static') {
109
- nodes.push(h("label", { class: "fk-props__field" }, h("span", { class: "fk-props__label" }, fkT('panel.options')), h("textarea", { class: "fk-props__input fk-props__input--textarea", onChange: (event) => this.writeTextConfig('options', event.target.value) }, this.readLocalized(configs.options))));
110
- }
111
- if (source === 'dataMap') {
112
- nodes.push(this.textField(fkT('panel.dataKey'), configs.optionsPath, (value) => this.emitConfigs({ optionsPath: value })));
113
- }
114
- if (source === 'remote') {
115
- nodes.push(this.textField(fkT('panel.url'), configs.optionsUrl, (value) => this.emitConfigs({ optionsUrl: value })), h("label", { class: "fk-props__field" }, h("span", { class: "fk-props__label" }, fkT('panel.headers')), h("textarea", { class: "fk-props__input fk-props__input--textarea", placeholder: 'Authorization: Bearer {token}', onChange: (event) => this.emitConfigs({
116
- optionsHeaders: event.target.value || undefined,
117
- }) }, (_b = configs.optionsHeaders) !== null && _b !== void 0 ? _b : '')), this.textField(fkT('panel.searchParam'), configs.searchParam, (value) => this.emitConfigs({ searchParam: value || undefined })));
118
- }
119
- if (source === 'js') {
120
- nodes.push(h("label", { class: "fk-props__field" }, h("span", { class: "fk-props__label" }, "Code"), h("fk-code-editor", { value: (_c = configs.optionsCode) !== null && _c !== void 0 ? _c : '', placeholder: "return dataMap.country === 'BJ' ? ['Cotonou'] : ['Paris'];", onCodeChange: (event) => this.emitConfigs({ optionsCode: event.detail }) })));
121
- }
122
- if (source === 'remote' || source === 'js') {
123
- nodes.push(this.textField(fkT('panel.labelKey'), configs.labelKey, (value) => this.emitConfigs({ labelKey: value })), this.textField(fkT('panel.valueKey'), configs.valueKey, (value) => this.emitConfigs({ valueKey: value })));
124
- }
125
- return nodes;
126
- }
127
- renderConfigTab() {
128
- const configs = this.brick.configs;
129
- const isInput = this.brick.type === 'input';
130
- return (h("section", { class: "fk-props__section" }, this.textField(fkT('panel.key'), configs === null || configs === void 0 ? void 0 : configs.key, (value) => this.emitConfigs({ key: value })), this.textField(fkT('panel.label'), this.readLocalized(configs === null || configs === void 0 ? void 0 : configs.label), (value) => this.writeTextConfig('label', value)), isInput
131
- ? [
132
- this.textField(fkT('panel.placeholder'), this.readLocalized(configs === null || configs === void 0 ? void 0 : configs.placeholder), (value) => this.writeTextConfig('placeholder', value)),
133
- this.textField(fkT('panel.prefix'), configs === null || configs === void 0 ? void 0 : configs.prefix, (value) => this.emitConfigs({ prefix: value || undefined })),
134
- this.textField(fkT('panel.suffix'), configs === null || configs === void 0 ? void 0 : configs.suffix, (value) => this.emitConfigs({ suffix: value || undefined })),
135
- ]
136
- : null, configs && 'accept' in configs
137
- ? this.textField(fkTOr('panel.accept', 'Accepted file types'), configs.accept, (value) => this.emitConfigs({ accept: value }))
138
- : null, configs && 'uploadUrl' in configs
139
- ? this.textField(fkTOr('panel.uploadUrl', 'Upload URL'), configs.uploadUrl, (value) => this.emitConfigs({ uploadUrl: value }))
140
- : null, this.optionsFields(), Object.entries(configs !== null && configs !== void 0 ? configs : {})
141
- .filter(([, value]) => typeof value === 'boolean')
142
- .map(([key, value]) => (h("label", { class: "fk-props__field fk-props__field--inline", key: key }, h("input", { type: "checkbox", checked: value === true, onChange: (event) => this.emitConfigs({
143
- [key]: event.target.checked,
144
- }) }), h("span", { class: "fk-props__label" }, fkTOr(`panel.cfg.${key}`, key))))), configs && 'content' in configs ? (h("label", { class: "fk-props__field" }, h("span", { class: "fk-props__label" }, fkT('panel.content')), h("textarea", { class: "fk-props__input fk-props__input--textarea", onChange: (event) => this.writeTextConfig('content', event.target.value) }, this.readLocalized(configs.content)))) : null));
145
- }
146
- validationRow(validator, label, valueType) {
147
- const rule = this.validationOf(validator);
148
- return (h("div", { class: "fk-props__vrule" }, h("label", { class: "fk-props__field fk-props__field--inline" }, h("input", { type: "checkbox", checked: !!rule, onChange: (event) => this.setValidation(validator, event.target.checked) }), h("span", { class: "fk-props__label" }, label)), rule && valueType ? (h("input", { class: "fk-props__input", type: valueType, placeholder: valueType === 'number' ? 'value' : 'regex', value: rule.value == null ? '' : String(rule.value), onChange: (event) => {
149
- const raw = event.target.value;
150
- this.setValidation(validator, true, {
151
- value: valueType === 'number'
152
- ? raw === ''
153
- ? undefined
154
- : Number(raw)
155
- : raw || undefined,
156
- });
157
- } })) : null, rule
158
- ? this.textField(fkT('panel.errorMessage'), this.readLocalized(rule.message), (value) => this.setValidation(validator, true, {
159
- message: this.localized(rule.message, value),
160
- }))
161
- : null));
162
- }
163
- renderValidationTab() {
164
- var _a;
165
- const dataType = this.brick.dataType;
166
- const custom = this.validationOf('custom');
167
- return (h("section", { class: "fk-props__section" }, this.validationRow('required', fkT('panel.required')), dataType === 'string'
168
- ? [
169
- this.validationRow('minLength', fkT('panel.minLength'), 'number'),
170
- this.validationRow('maxLength', fkT('panel.maxLength'), 'number'),
171
- this.validationRow('pattern', fkT('panel.pattern'), 'text'),
172
- this.validationRow('email', fkT('panel.emailFormat')),
173
- this.validationRow('url', fkT('panel.urlFormat')),
174
- ]
175
- : null, dataType === 'number'
176
- ? [
177
- this.validationRow('min', fkT('panel.min'), 'number'),
178
- this.validationRow('max', fkT('panel.max'), 'number'),
179
- ]
180
- : null, dataType === 'array'
181
- ? [
182
- this.validationRow('minItems', fkT('panel.minItems'), 'number'),
183
- this.validationRow('maxItems', fkT('panel.maxItems'), 'number'),
184
- ]
185
- : null, h("div", { class: "fk-props__vrule" }, h("label", { class: "fk-props__field fk-props__field--inline" }, h("input", { type: "checkbox", checked: !!custom, onChange: (event) => {
186
- var _a;
187
- return this.setValidation('custom', event.target.checked, { customValidator: (_a = custom === null || custom === void 0 ? void 0 : custom.customValidator) !== null && _a !== void 0 ? _a : 'return true;' });
188
- } }), h("span", { class: "fk-props__label" }, fkT('panel.custom'))), custom ? (h("fk-code-editor", { value: (_a = custom.customValidator) !== null && _a !== void 0 ? _a : '', placeholder: 'return value?.startsWith("BJ-") ? true : "Must start with BJ-";', onCodeChange: (event) => this.setValidation('custom', true, {
189
- customValidator: event.detail,
190
- }) })) : null, custom
191
- ? this.textField(fkT('panel.fallbackMessage'), this.readLocalized(custom.message), (value) => this.setValidation('custom', true, {
192
- message: this.localized(custom.message, value),
193
- }))
194
- : null)));
195
- }
196
- renderStylesTab() {
197
- var _a;
198
- return (h("section", { class: "fk-props__section" }, Object.entries((_a = this.brick.styles) !== null && _a !== void 0 ? _a : {}).map(([key, value]) => (h("div", { class: "fk-props__style-row", key: key }, h("span", { class: "fk-props__style-key" }, key), h("input", { class: "fk-props__input fk-props__input--grow", type: "text", value: String(value !== null && value !== void 0 ? value : ''), onChange: (event) => this.emitStyles({
199
- [key]: event.target.value,
200
- }) }), h("button", { type: "button", class: "fk-props__remove", title: "Remove style", onClick: () => this.emitStyles({ [key]: undefined }) }, "\u2715")))), h("div", { class: "fk-props__style-row" }, h("input", { class: "fk-props__input", type: "text", placeholder: fkT('panel.styleProperty'), value: this.newStyleKey, onInput: (event) => (this.newStyleKey = event.target.value) }), h("input", { class: "fk-props__input fk-props__input--grow", type: "text", placeholder: fkT('panel.styleValue'), onChange: (event) => {
201
- const target = event.target;
202
- this.addStyle(target.value);
203
- target.value = '';
204
- } }))));
205
- }
206
- render() {
207
- return (h("div", { key: '095fc127131cc509f0fb27ae2853042d3ca97e8f', class: "fk-props" }, h("header", { key: '5e5c3eb0cc844dbc023336c93e7b347bc87f5501', class: "fk-props__header" }, h("span", { key: 'f01a54c31c5885741c3671bbcd2bb46ec9deff32', class: "fk-props__type" }, this.brick.type), h("h4", { key: 'a558c48e018a228084eeac289b98e76495d7e630', class: "fk-props__title" }, fkTOr(`brick.${this.brick.id}.name`, this.brick.name))), h("div", { key: 'c11ee0bf0f17754abc00b561fef398bf9cdd9416', class: "fk-props__tabs" }, this.availableTabs().map((tab) => (h("button", { key: tab.id, type: "button", class: {
208
- 'fk-props__tab': true,
209
- 'fk-props__tab--active': this.activeTab === tab.id,
210
- }, onClick: () => (this.activeTab = tab.id) }, tab.label)))), this.activeTab === 'config' ? this.renderConfigTab() : null, this.activeTab === 'validation' ? this.renderValidationTab() : null, this.activeTab === 'styles' ? this.renderStylesTab() : null, this.activeTab === 'rules' ? (h("section", { class: "fk-props__section" }, h("fk-rules-editor", { brick: this.brick, fields: this.fields }))) : null));
211
- }
212
- static get is() { return "fk-property-panel"; }
213
- static get encapsulation() { return "scoped"; }
214
- static get originalStyleUrls() {
215
- return {
216
- "$": ["fk-property-panel.css"]
217
- };
218
- }
219
- static get styleUrls() {
220
- return {
221
- "$": ["fk-property-panel.css"]
222
- };
223
- }
224
- static get properties() {
225
- return {
226
- "brick": {
227
- "type": "unknown",
228
- "mutable": false,
229
- "complexType": {
230
- "original": "BrickSpec",
231
- "resolved": "BrickSpec",
232
- "references": {
233
- "BrickSpec": {
234
- "location": "import",
235
- "path": "@streamline-pulse/formkrafter-core",
236
- "id": "../core/dist/index.d.ts::BrickSpec",
237
- "referenceLocation": "BrickSpec"
238
- }
239
- }
240
- },
241
- "required": true,
242
- "optional": false,
243
- "docs": {
244
- "tags": [],
245
- "text": ""
246
- },
247
- "getter": false,
248
- "setter": false
249
- },
250
- "fields": {
251
- "type": "unknown",
252
- "mutable": false,
253
- "complexType": {
254
- "original": "string[]",
255
- "resolved": "string[]",
256
- "references": {}
257
- },
258
- "required": false,
259
- "optional": false,
260
- "docs": {
261
- "tags": [],
262
- "text": ""
263
- },
264
- "getter": false,
265
- "setter": false,
266
- "defaultValue": "[]"
267
- },
268
- "locales": {
269
- "type": "unknown",
270
- "mutable": false,
271
- "complexType": {
272
- "original": "string[]",
273
- "resolved": "string[]",
274
- "references": {}
275
- },
276
- "required": false,
277
- "optional": false,
278
- "docs": {
279
- "tags": [],
280
- "text": ""
281
- },
282
- "getter": false,
283
- "setter": false,
284
- "defaultValue": "[]"
285
- },
286
- "editLocale": {
287
- "type": "string",
288
- "mutable": false,
289
- "complexType": {
290
- "original": "string",
291
- "resolved": "string",
292
- "references": {}
293
- },
294
- "required": false,
295
- "optional": true,
296
- "docs": {
297
- "tags": [],
298
- "text": ""
299
- },
300
- "getter": false,
301
- "setter": false,
302
- "reflect": false,
303
- "attribute": "edit-locale"
304
- }
305
- };
306
- }
307
- static get states() {
308
- return {
309
- "activeTab": {},
310
- "newStyleKey": {}
311
- };
312
- }
313
- static get events() {
314
- return [{
315
- "method": "brickConfigsChange",
316
- "name": "brickConfigsChange",
317
- "bubbles": true,
318
- "cancelable": true,
319
- "composed": true,
320
- "docs": {
321
- "tags": [],
322
- "text": ""
323
- },
324
- "complexType": {
325
- "original": "BrickConfigsChangeDetail",
326
- "resolved": "BrickConfigsChangeDetail",
327
- "references": {
328
- "BrickConfigsChangeDetail": {
329
- "location": "import",
330
- "path": "../../utils/events",
331
- "id": "src/utils/events.ts::BrickConfigsChangeDetail",
332
- "referenceLocation": "BrickConfigsChangeDetail"
333
- }
334
- }
335
- }
336
- }, {
337
- "method": "brickValidationsChange",
338
- "name": "brickValidationsChange",
339
- "bubbles": true,
340
- "cancelable": true,
341
- "composed": true,
342
- "docs": {
343
- "tags": [],
344
- "text": ""
345
- },
346
- "complexType": {
347
- "original": "BrickValidationsChangeDetail",
348
- "resolved": "BrickValidationsChangeDetail",
349
- "references": {
350
- "BrickValidationsChangeDetail": {
351
- "location": "import",
352
- "path": "../../utils/events",
353
- "id": "src/utils/events.ts::BrickValidationsChangeDetail",
354
- "referenceLocation": "BrickValidationsChangeDetail"
355
- }
356
- }
357
- }
358
- }, {
359
- "method": "brickStylesChange",
360
- "name": "brickStylesChange",
361
- "bubbles": true,
362
- "cancelable": true,
363
- "composed": true,
364
- "docs": {
365
- "tags": [],
366
- "text": ""
367
- },
368
- "complexType": {
369
- "original": "BrickStylesChangeDetail",
370
- "resolved": "BrickStylesChangeDetail",
371
- "references": {
372
- "BrickStylesChangeDetail": {
373
- "location": "import",
374
- "path": "../../utils/events",
375
- "id": "src/utils/events.ts::BrickStylesChangeDetail",
376
- "referenceLocation": "BrickStylesChangeDetail"
377
- }
378
- }
379
- }
380
- }];
381
- }
382
- static get watchers() {
383
- return [{
384
- "propName": "brick",
385
- "methodName": "onBrickChange"
386
- }];
387
- }
388
- }
@@ -1,166 +0,0 @@
1
- :host {
2
- display: block;
3
- }
4
-
5
- .fk-rules {
6
- display: flex;
7
- flex-direction: column;
8
- gap: var(--fk-spacing);
9
- }
10
-
11
- .fk-rule {
12
- display: flex;
13
- flex-direction: column;
14
- gap: calc(var(--fk-spacing) / 1.5);
15
- padding: var(--fk-spacing);
16
- border: 1px solid var(--fk-color-border);
17
- border-radius: calc(var(--fk-radius) / 1.5);
18
- background: color-mix(in srgb, var(--fk-color-surface) 60%, transparent);
19
- }
20
-
21
- .fk-rule__header {
22
- display: flex;
23
- align-items: center;
24
- gap: 6px;
25
- }
26
-
27
- .fk-rule__name {
28
- flex: 1;
29
- min-width: 0;
30
- font: inherit;
31
- font-size: 0.8rem;
32
- font-weight: 600;
33
- padding: 4px 6px;
34
- border: 1px solid transparent;
35
- border-radius: calc(var(--fk-radius) / 2);
36
- background: transparent;
37
- color: var(--fk-color-text);
38
- }
39
-
40
- .fk-rule__name:hover,
41
- .fk-rule__name:focus {
42
- border-color: var(--fk-color-border);
43
- background: var(--fk-color-surface);
44
- outline: none;
45
- }
46
-
47
- .fk-rule__modes {
48
- display: flex;
49
- gap: 4px;
50
- }
51
-
52
- .fk-rule__mode {
53
- font: inherit;
54
- font-size: 0.65rem;
55
- font-weight: 600;
56
- text-transform: uppercase;
57
- letter-spacing: 0.05em;
58
- padding: 3px 8px;
59
- border: 1px solid var(--fk-color-border);
60
- border-radius: 999px;
61
- background: transparent;
62
- color: var(--fk-color-muted);
63
- cursor: pointer;
64
- }
65
-
66
- .fk-rule__mode--active {
67
- border-color: var(--fk-color-primary);
68
- background: color-mix(in srgb, var(--fk-color-primary) 12%, transparent);
69
- color: var(--fk-color-primary);
70
- }
71
-
72
- .fk-rule__condition,
73
- .fk-rule__effect {
74
- display: flex;
75
- flex-wrap: wrap;
76
- align-items: center;
77
- gap: 4px;
78
- }
79
-
80
- .fk-rule__keyword {
81
- font-size: 0.65rem;
82
- font-weight: 700;
83
- text-transform: uppercase;
84
- letter-spacing: 0.08em;
85
- color: var(--fk-color-muted);
86
- }
87
-
88
- .fk-rule__control {
89
- font: inherit;
90
- font-size: 0.78rem;
91
- padding: 4px 6px;
92
- max-width: 100%;
93
- min-width: 0;
94
- border: 1px solid var(--fk-color-border);
95
- border-radius: calc(var(--fk-radius) / 2);
96
- background: var(--fk-color-surface);
97
- color: var(--fk-color-text);
98
- }
99
-
100
- .fk-rule__control:focus {
101
- outline: none;
102
- border-color: var(--fk-color-primary);
103
- }
104
-
105
- .fk-rule__advanced {
106
- display: flex;
107
- flex-direction: column;
108
- gap: 4px;
109
- }
110
-
111
- .fk-rule__code {
112
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
113
- font-size: 0.75rem;
114
- min-height: 72px;
115
- padding: 6px 8px;
116
- border: 1px solid var(--fk-color-border);
117
- border-radius: calc(var(--fk-radius) / 2);
118
- background: var(--fk-color-surface);
119
- color: var(--fk-color-text);
120
- resize: vertical;
121
- }
122
-
123
- .fk-rule__error {
124
- margin: 0;
125
- font-size: 0.72rem;
126
- color: var(--fk-color-danger);
127
- }
128
-
129
- .fk-rule__effects {
130
- display: flex;
131
- flex-direction: column;
132
- gap: 6px;
133
- }
134
-
135
- .fk-rule__remove {
136
- border: none;
137
- background: transparent;
138
- color: var(--fk-color-muted);
139
- font-size: 0.75rem;
140
- cursor: pointer;
141
- padding: 2px 4px;
142
- border-radius: calc(var(--fk-radius) / 2);
143
- }
144
-
145
- .fk-rule__remove:hover {
146
- color: var(--fk-color-danger);
147
- background: color-mix(in srgb, var(--fk-color-danger) 10%, transparent);
148
- }
149
-
150
- .fk-rule__add {
151
- align-self: flex-start;
152
- font: inherit;
153
- font-size: 0.75rem;
154
- font-weight: 600;
155
- padding: 4px 10px;
156
- border: 1px dashed var(--fk-color-border);
157
- border-radius: calc(var(--fk-radius) / 2);
158
- background: transparent;
159
- color: var(--fk-color-muted);
160
- cursor: pointer;
161
- }
162
-
163
- .fk-rule__add:hover {
164
- border-color: var(--fk-color-primary);
165
- color: var(--fk-color-primary);
166
- }