@uxf/cms 13.0.3 → 14.1.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.
- package/README.md +1 -1
- package/api/index.d.ts +2 -0
- package/api/index.js +2 -2
- package/api/swr.js +71 -6
- package/content-builder/content-builder-header.js +42 -3
- package/content-builder/content-builder.js +140 -18
- package/content-builder/content-builder.stories.js +24 -5
- package/content-builder/forms/content-builder-basic-form.js +212 -25
- package/content-builder/forms/content-builder-seo-form.js +92 -8
- package/forms/change-password-form/change-password-form.js +152 -15
- package/forms/components/wysiwyg-input/wysiwyg-input.js +188 -50
- package/forms/components/wysiwyg-input/wysiwyg-input.stories.js +127 -22
- package/forms/forgotten-password-form/forgotten-password-form.js +119 -15
- package/forms/invite-user-form/invite-user-form.js +171 -13
- package/forms/login-form/login-form.js +122 -13
- package/forms/renew-password-form/renew-password-form.js +148 -16
- package/lib/api/create-axios-instance.d.ts +3 -1
- package/lib/api/create-axios-request.d.ts +3 -1
- package/lib/api/create-axios-request.js +9 -2
- package/lib/api/create-axios-request.test.d.ts +1 -0
- package/lib/api/create-axios-request.test.js +32 -0
- package/lib/layout/layout.js +126 -28
- package/lib/layout/sidebar.js +69 -38
- package/lib/menu/ui/menu-item.js +5 -2
- package/lib/menu/ui/sub-menu/sub-menu-mobile.js +62 -14
- package/lib/menu/ui/sub-menu/sub-menu.js +66 -14
- package/lib/menu/ui/sub-menu/use-sub-menu.js +137 -34
- package/lib/menu/ui/user-menu.js +178 -14
- package/package.json +21 -21
- package/pages/content-builder/components/form-content.js +189 -38
- package/pages/content-builder/components/form-root-fields.js +3 -3
- package/pages/content-builder/components/form.js +142 -27
- package/pages/content-builder/components/header.js +44 -5
- package/pages/content-builder/content/feature-section.js +67 -15
- package/pages/content-builder/content/gallery.js +38 -6
- package/pages/content-builder/content/hero-section.js +39 -6
- package/pages/content-builder/content/people.js +64 -13
- package/pages/content-builder/content/wysiwyg.js +60 -6
- package/pages/content-builder/content-builder-page.js +120 -48
- package/pages/content-builder/content-field.js +216 -35
- package/pages/content-builder/content-header-behaviour.spec.d.ts +1 -0
- package/pages/content-builder/content-header-behaviour.spec.js +22 -0
- package/pages/content-builder/content-header.js +100 -53
- package/pages/content-builder/context/details-visibility-context.js +96 -18
- package/pages/forgotten-password-page/forgotten-password-page.js +29 -46
- package/pages/grid-page/grid-page.js +292 -76
- package/pages/grid-page/history-pathname.d.ts +6 -0
- package/pages/grid-page/history-pathname.js +11 -0
- package/pages/grid-page/history-pathname.test.d.ts +1 -0
- package/pages/grid-page/history-pathname.test.js +11 -0
- package/pages/grid-page/use-hidden-columns.js +29 -8
- package/pages/invite-user-page/invite-user-page.js +39 -16
- package/pages/login-page/login-page.js +44 -50
- package/pages/renew-password-page/renew-password-page.js +35 -43
- package/pages/translations.d.ts +3 -0
- package/pages/translations.js +3 -0
- package/security/restricted-page.js +88 -10
- package/security/use-logged-user.js +33 -8
- package/translations/cs.json +2 -1
- package/translations/translations.d.ts +3 -0
- package/ui/avatar/avatar.js +3 -2
- package/ui/copy-to-clipboard/copy-to-clipboard.js +57 -44
- package/ui/copy-to-clipboard-button/copy-to-clipboard-button.js +47 -46
- package/utils/remove-confirm-handler.js +80 -11
- package/utils/use-viewport-height.js +26 -20
- package/utils/use-viewport-height.test.d.ts +1 -0
- package/utils/use-viewport-height.test.js +37 -0
- package/utils/use-visual-viewport-height.d.ts +2 -0
- package/utils/use-visual-viewport-height.js +26 -0
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ContentBuilderBasicForm = ContentBuilderBasicForm;
|
|
7
|
+
const compiler_runtime_1 = require("react/compiler-runtime");
|
|
7
8
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
8
9
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
9
10
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
@@ -19,32 +20,218 @@ const text_input_1 = require("@uxf/form/text-input");
|
|
|
19
20
|
const textarea_1 = require("@uxf/form/textarea");
|
|
20
21
|
const react_1 = __importDefault(require("react"));
|
|
21
22
|
const api_1 = require("../../api");
|
|
22
|
-
const visibilityLevelOptions = [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const visibilityLevelOptions = [{
|
|
24
|
+
id: "PRIVATE",
|
|
25
|
+
label: "Privátní"
|
|
26
|
+
}, {
|
|
27
|
+
id: "PUBLIC_WITHOUT_SITEMAP",
|
|
28
|
+
label: "Veřejný bez sitemapy"
|
|
29
|
+
}, {
|
|
30
|
+
id: "PUBLIC",
|
|
31
|
+
label: "Veřejný"
|
|
32
|
+
}];
|
|
27
33
|
// eslint-disable-next-line complexity
|
|
28
34
|
function ContentBuilderBasicForm(props) {
|
|
29
|
-
var _a, _b,
|
|
30
|
-
const
|
|
35
|
+
var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
|
|
36
|
+
const $ = (0, compiler_runtime_1.c)(66);
|
|
37
|
+
let t0;
|
|
38
|
+
if ($[0] !== props.formApi) {
|
|
39
|
+
t0 = props.formApi.watch("seo.name");
|
|
40
|
+
$[0] = props.formApi;
|
|
41
|
+
$[1] = t0;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
t0 = $[1];
|
|
45
|
+
}
|
|
46
|
+
const seoName = t0;
|
|
31
47
|
const t = (0, translations_1.useUxfTranslation)();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
let t1;
|
|
49
|
+
if ($[2] !== props.formApi || $[3] !== seoName) {
|
|
50
|
+
t1 = event => {
|
|
51
|
+
if ((0, is_nil_1.isNil)(seoName) || (0, is_empty_1.isEmpty)(seoName)) {
|
|
52
|
+
props.formApi.setValue("seo.name", (0, slugify_1.slugify)(event.target.value));
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
$[2] = props.formApi;
|
|
56
|
+
$[3] = seoName;
|
|
57
|
+
$[4] = t1;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
t1 = $[4];
|
|
61
|
+
}
|
|
62
|
+
const onBlurName = t1;
|
|
63
|
+
const t2 = props.className;
|
|
64
|
+
let t3;
|
|
65
|
+
if ($[5] !== props.fields || $[6] !== props.formApi.control) {
|
|
66
|
+
t3 = ((_b = (_a = props.fields) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.options) && react_1.default.createElement(select_1.Select, { control: props.formApi.control, isReadOnly: props.fields.type.isReadOnly, isRequired: true, label: "Typ", name: "type", options: props.fields.type.options });
|
|
67
|
+
$[5] = props.fields;
|
|
68
|
+
$[6] = props.formApi.control;
|
|
69
|
+
$[7] = t3;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
t3 = $[7];
|
|
73
|
+
}
|
|
74
|
+
const t4 = props.formApi.control;
|
|
75
|
+
let t5;
|
|
76
|
+
if ($[8] !== t) {
|
|
77
|
+
t5 = t("uxf-cms-content-builder:basic-form.title");
|
|
78
|
+
$[8] = t;
|
|
79
|
+
$[9] = t5;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
t5 = $[9];
|
|
83
|
+
}
|
|
84
|
+
let t6;
|
|
85
|
+
if ($[10] !== onBlurName || $[11] !== props.formApi.control || $[12] !== t5) {
|
|
86
|
+
t6 = react_1.default.createElement(text_input_1.TextInput, { control: t4, isRequired: true, label: t5, name: "name", onBlur: onBlurName, type: "text" });
|
|
87
|
+
$[10] = onBlurName;
|
|
88
|
+
$[11] = props.formApi.control;
|
|
89
|
+
$[12] = t5;
|
|
90
|
+
$[13] = t6;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
t6 = $[13];
|
|
94
|
+
}
|
|
95
|
+
let t7;
|
|
96
|
+
if ($[14] !== ((_e = (_d = props.fields) === null || _d === void 0 ? void 0 : _d.publishedAt) === null || _e === void 0 ? void 0 : _e.isHidden) || $[15] !== props.formApi.control || $[16] !== t) {
|
|
97
|
+
t7 = !((_g = (_f = props.fields) === null || _f === void 0 ? void 0 : _f.publishedAt) === null || _g === void 0 ? void 0 : _g.isHidden) && react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: props.formApi.control, isRequired: true, label: t("uxf-cms-content-builder:basic-form.published-at"), name: "publishedAt" });
|
|
98
|
+
$[14] = (_j = (_h = props.fields) === null || _h === void 0 ? void 0 : _h.publishedAt) === null || _j === void 0 ? void 0 : _j.isHidden;
|
|
99
|
+
$[15] = props.formApi.control;
|
|
100
|
+
$[16] = t;
|
|
101
|
+
$[17] = t7;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
t7 = $[17];
|
|
105
|
+
}
|
|
106
|
+
let t8;
|
|
107
|
+
if ($[18] !== ((_l = (_k = props.fields) === null || _k === void 0 ? void 0 : _k.perex) === null || _l === void 0 ? void 0 : _l.isHidden) || $[19] !== props.formApi.control || $[20] !== t) {
|
|
108
|
+
t8 = !((_o = (_m = props.fields) === null || _m === void 0 ? void 0 : _m.perex) === null || _o === void 0 ? void 0 : _o.isHidden) && react_1.default.createElement(textarea_1.Textarea, { control: props.formApi.control, label: t("uxf-cms-content-builder:basic-form.perex"), name: "perex", rows: 3 });
|
|
109
|
+
$[18] = (_q = (_p = props.fields) === null || _p === void 0 ? void 0 : _p.perex) === null || _q === void 0 ? void 0 : _q.isHidden;
|
|
110
|
+
$[19] = props.formApi.control;
|
|
111
|
+
$[20] = t;
|
|
112
|
+
$[21] = t8;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
t8 = $[21];
|
|
116
|
+
}
|
|
117
|
+
let t9;
|
|
118
|
+
if ($[22] !== ((_s = (_r = props.fields) === null || _r === void 0 ? void 0 : _r.authorText) === null || _s === void 0 ? void 0 : _s.isHidden) || $[23] !== props.formApi.control || $[24] !== t) {
|
|
119
|
+
t9 = ((_u = (_t = props.fields) === null || _t === void 0 ? void 0 : _t.authorText) === null || _u === void 0 ? void 0 : _u.isHidden) === false && react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, label: t("uxf-cms-content-builder:basic-form.author"), name: "authorText" });
|
|
120
|
+
$[22] = (_w = (_v = props.fields) === null || _v === void 0 ? void 0 : _v.authorText) === null || _w === void 0 ? void 0 : _w.isHidden;
|
|
121
|
+
$[23] = props.formApi.control;
|
|
122
|
+
$[24] = t;
|
|
123
|
+
$[25] = t9;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
t9 = $[25];
|
|
127
|
+
}
|
|
128
|
+
let t10;
|
|
129
|
+
if ($[26] !== props.fields || $[27] !== props.formApi.control || $[28] !== t) {
|
|
130
|
+
t10 = !((_y = (_x = props.fields) === null || _x === void 0 ? void 0 : _x.author) === null || _y === void 0 ? void 0 : _y.isHidden) && ((_0 = (_z = props.fields) === null || _z === void 0 ? void 0 : _z.author) === null || _0 === void 0 ? void 0 : _0.autocomplete) && react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: t("uxf-cms-content-builder:basic-form.author"), loadOptions: props.fields.author.autocomplete, name: "author" });
|
|
131
|
+
$[26] = props.fields;
|
|
132
|
+
$[27] = props.formApi.control;
|
|
133
|
+
$[28] = t;
|
|
134
|
+
$[29] = t10;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
t10 = $[29];
|
|
138
|
+
}
|
|
139
|
+
let t11;
|
|
140
|
+
if ($[30] !== props.fields || $[31] !== props.formApi.control) {
|
|
141
|
+
t11 = !((_2 = (_1 = props.fields) === null || _1 === void 0 ? void 0 : _1.category) === null || _2 === void 0 ? void 0 : _2.isHidden) && ((_4 = (_3 = props.fields) === null || _3 === void 0 ? void 0 : _3.category) === null || _4 === void 0 ? void 0 : _4.autocomplete) && react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Kategorie", loadOptions: props.fields.category.autocomplete, name: "category" });
|
|
142
|
+
$[30] = props.fields;
|
|
143
|
+
$[31] = props.formApi.control;
|
|
144
|
+
$[32] = t11;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
t11 = $[32];
|
|
148
|
+
}
|
|
149
|
+
let t12;
|
|
150
|
+
if ($[33] !== props.fields || $[34] !== props.formApi.control) {
|
|
151
|
+
t12 = !((_6 = (_5 = props.fields) === null || _5 === void 0 ? void 0 : _5.tags) === null || _6 === void 0 ? void 0 : _6.isHidden) && ((_8 = (_7 = props.fields) === null || _7 === void 0 ? void 0 : _7.tags) === null || _8 === void 0 ? void 0 : _8.autocomplete) && react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.formApi.control, label: "Tagy", loadOptions: props.fields.tags.autocomplete, name: "tags" });
|
|
152
|
+
$[33] = props.fields;
|
|
153
|
+
$[34] = props.formApi.control;
|
|
154
|
+
$[35] = t12;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
t12 = $[35];
|
|
158
|
+
}
|
|
159
|
+
let t13;
|
|
160
|
+
if ($[36] !== ((_10 = (_9 = props.fields) === null || _9 === void 0 ? void 0 : _9.image) === null || _10 === void 0 ? void 0 : _10.isHidden) || $[37] !== props.formApi.control || $[38] !== props.uploadNamespace || $[39] !== t) {
|
|
161
|
+
t13 = !((_12 = (_11 = props.fields) === null || _11 === void 0 ? void 0 : _11.image) === null || _12 === void 0 ? void 0 : _12.isHidden) && react_1.default.createElement(file_input_1.FileInput, { control: props.formApi.control, id: "image", label: t("uxf-cms-content-builder:basic-form.main-image"), name: "image", onUploadFile: file => (0, api_1.uploadFile)(file, props.uploadNamespace) });
|
|
162
|
+
$[36] = (_14 = (_13 = props.fields) === null || _13 === void 0 ? void 0 : _13.image) === null || _14 === void 0 ? void 0 : _14.isHidden;
|
|
163
|
+
$[37] = props.formApi.control;
|
|
164
|
+
$[38] = props.uploadNamespace;
|
|
165
|
+
$[39] = t;
|
|
166
|
+
$[40] = t13;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
t13 = $[40];
|
|
170
|
+
}
|
|
171
|
+
let t14;
|
|
172
|
+
if ($[41] !== ((_16 = (_15 = props.fields) === null || _15 === void 0 ? void 0 : _15.isActive) === null || _16 === void 0 ? void 0 : _16.isHidden) || $[42] !== props.formApi.control || $[43] !== t) {
|
|
173
|
+
t14 = !((_18 = (_17 = props.fields) === null || _17 === void 0 ? void 0 : _17.isActive) === null || _18 === void 0 ? void 0 : _18.isHidden) && react_1.default.createElement(checkbox_input_1.CheckboxInput, { control: props.formApi.control, label: t("uxf-cms-content-builder:basic-form.active"), name: "isActive" });
|
|
174
|
+
$[41] = (_20 = (_19 = props.fields) === null || _19 === void 0 ? void 0 : _19.isActive) === null || _20 === void 0 ? void 0 : _20.isHidden;
|
|
175
|
+
$[42] = props.formApi.control;
|
|
176
|
+
$[43] = t;
|
|
177
|
+
$[44] = t14;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
t14 = $[44];
|
|
181
|
+
}
|
|
182
|
+
let t15;
|
|
183
|
+
if ($[45] !== ((_22 = (_21 = props.fields) === null || _21 === void 0 ? void 0 : _21.visibilityLevel) === null || _22 === void 0 ? void 0 : _22.isHidden) || $[46] !== props.formApi.control) {
|
|
184
|
+
t15 = !((_24 = (_23 = props.fields) === null || _23 === void 0 ? void 0 : _23.visibilityLevel) === null || _24 === void 0 ? void 0 : _24.isHidden) && react_1.default.createElement(select_1.Select, { control: props.formApi.control, isRequired: true, label: "Viditelnost", name: "visibilityLevel", options: visibilityLevelOptions });
|
|
185
|
+
$[45] = (_26 = (_25 = props.fields) === null || _25 === void 0 ? void 0 : _25.visibilityLevel) === null || _26 === void 0 ? void 0 : _26.isHidden;
|
|
186
|
+
$[46] = props.formApi.control;
|
|
187
|
+
$[47] = t15;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
t15 = $[47];
|
|
191
|
+
}
|
|
192
|
+
let t16;
|
|
193
|
+
if ($[48] !== props.fields || $[49] !== props.formApi.control || $[50] !== t) {
|
|
194
|
+
t16 = (0, is_not_nil_1.isNotNil)((_28 = (_27 = props.fields) === null || _27 === void 0 ? void 0 : _27.parent) === null || _28 === void 0 ? void 0 : _28.autocomplete) && react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: t("uxf-cms-content-builder:basic-form.parent-article"), loadOptions: props.fields.parent.autocomplete, name: "parent" });
|
|
195
|
+
$[48] = props.fields;
|
|
196
|
+
$[49] = props.formApi.control;
|
|
197
|
+
$[50] = t;
|
|
198
|
+
$[51] = t16;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
t16 = $[51];
|
|
202
|
+
}
|
|
203
|
+
let t17;
|
|
204
|
+
if ($[52] !== props.className || $[53] !== t10 || $[54] !== t11 || $[55] !== t12 || $[56] !== t13 || $[57] !== t14 || $[58] !== t15 || $[59] !== t16 || $[60] !== t3 || $[61] !== t6 || $[62] !== t7 || $[63] !== t8 || $[64] !== t9) {
|
|
205
|
+
t17 = react_1.default.createElement("div", { className: t2 },
|
|
206
|
+
t3,
|
|
207
|
+
t6,
|
|
208
|
+
t7,
|
|
209
|
+
t8,
|
|
210
|
+
t9,
|
|
211
|
+
t10,
|
|
212
|
+
t11,
|
|
213
|
+
t12,
|
|
214
|
+
t13,
|
|
215
|
+
t14,
|
|
216
|
+
t15,
|
|
217
|
+
t16);
|
|
218
|
+
$[52] = props.className;
|
|
219
|
+
$[53] = t10;
|
|
220
|
+
$[54] = t11;
|
|
221
|
+
$[55] = t12;
|
|
222
|
+
$[56] = t13;
|
|
223
|
+
$[57] = t14;
|
|
224
|
+
$[58] = t15;
|
|
225
|
+
$[59] = t16;
|
|
226
|
+
$[60] = t3;
|
|
227
|
+
$[61] = t6;
|
|
228
|
+
$[62] = t7;
|
|
229
|
+
$[63] = t8;
|
|
230
|
+
$[64] = t9;
|
|
231
|
+
$[65] = t17;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
t17 = $[65];
|
|
235
|
+
}
|
|
236
|
+
return t17;
|
|
50
237
|
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ContentBuilderSeoForm = ContentBuilderSeoForm;
|
|
7
|
+
const compiler_runtime_1 = require("react/compiler-runtime");
|
|
7
8
|
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const file_input_1 = require("@uxf/form/file-input");
|
|
9
10
|
const text_input_1 = require("@uxf/form/text-input");
|
|
@@ -11,13 +12,96 @@ const react_1 = __importDefault(require("react"));
|
|
|
11
12
|
const api_1 = require("../../api");
|
|
12
13
|
// eslint-disable-next-line complexity
|
|
13
14
|
function ContentBuilderSeoForm(props) {
|
|
14
|
-
var _a, _b,
|
|
15
|
+
var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30;
|
|
16
|
+
const $ = (0, compiler_runtime_1.c)(33);
|
|
15
17
|
const t = (0, translations_1.useUxfTranslation)();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
!((
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
let t0;
|
|
19
|
+
if ($[0] !== ((_d = (_b = (_a = props.fields) === null || _a === void 0 ? void 0 : _a.seo) === null || _b === void 0 ? void 0 : _b.name) === null || _d === void 0 ? void 0 : _d.isHidden) || $[1] !== props.formApi || $[2] !== t) {
|
|
20
|
+
t0 = !((_g = (_f = (_e = props.fields) === null || _e === void 0 ? void 0 : _e.seo) === null || _f === void 0 ? void 0 : _f.name) === null || _g === void 0 ? void 0 : _g.isHidden) && react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, helperText: t("uxf-cms-content-builder:seo-form.slug-helper"), isRequired: true, label: t("uxf-cms-content-builder:seo-form.slug"), name: "seo.name", type: "text" });
|
|
21
|
+
$[0] = (_k = (_j = (_h = props.fields) === null || _h === void 0 ? void 0 : _h.seo) === null || _j === void 0 ? void 0 : _j.name) === null || _k === void 0 ? void 0 : _k.isHidden;
|
|
22
|
+
$[1] = props.formApi;
|
|
23
|
+
$[2] = t;
|
|
24
|
+
$[3] = t0;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
t0 = $[3];
|
|
28
|
+
}
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[4] !== ((_o = (_m = (_l = props.fields) === null || _l === void 0 ? void 0 : _l.seo) === null || _m === void 0 ? void 0 : _m.title) === null || _o === void 0 ? void 0 : _o.isHidden) || $[5] !== props.formApi || $[6] !== t) {
|
|
31
|
+
t1 = !((_r = (_q = (_p = props.fields) === null || _p === void 0 ? void 0 : _p.seo) === null || _q === void 0 ? void 0 : _q.title) === null || _r === void 0 ? void 0 : _r.isHidden) && react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, label: t("uxf-cms-content-builder:seo-form.title"), name: "seo.title", type: "text" });
|
|
32
|
+
$[4] = (_u = (_t = (_s = props.fields) === null || _s === void 0 ? void 0 : _s.seo) === null || _t === void 0 ? void 0 : _t.title) === null || _u === void 0 ? void 0 : _u.isHidden;
|
|
33
|
+
$[5] = props.formApi;
|
|
34
|
+
$[6] = t;
|
|
35
|
+
$[7] = t1;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
t1 = $[7];
|
|
39
|
+
}
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[8] !== ((_x = (_w = (_v = props.fields) === null || _v === void 0 ? void 0 : _v.seo) === null || _w === void 0 ? void 0 : _w.description) === null || _x === void 0 ? void 0 : _x.isHidden) || $[9] !== props.formApi || $[10] !== t) {
|
|
42
|
+
t2 = !((_0 = (_z = (_y = props.fields) === null || _y === void 0 ? void 0 : _y.seo) === null || _z === void 0 ? void 0 : _z.description) === null || _0 === void 0 ? void 0 : _0.isHidden) && react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, label: t("uxf-cms-content-builder:seo-form.description"), name: "seo.description", type: "text" });
|
|
43
|
+
$[8] = (_3 = (_2 = (_1 = props.fields) === null || _1 === void 0 ? void 0 : _1.seo) === null || _2 === void 0 ? void 0 : _2.description) === null || _3 === void 0 ? void 0 : _3.isHidden;
|
|
44
|
+
$[9] = props.formApi;
|
|
45
|
+
$[10] = t;
|
|
46
|
+
$[11] = t2;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
t2 = $[11];
|
|
50
|
+
}
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[12] !== ((_6 = (_5 = (_4 = props.fields) === null || _4 === void 0 ? void 0 : _4.seo) === null || _5 === void 0 ? void 0 : _5.ogTitle) === null || _6 === void 0 ? void 0 : _6.isHidden) || $[13] !== props.formApi || $[14] !== t) {
|
|
53
|
+
t3 = !((_9 = (_8 = (_7 = props.fields) === null || _7 === void 0 ? void 0 : _7.seo) === null || _8 === void 0 ? void 0 : _8.ogTitle) === null || _9 === void 0 ? void 0 : _9.isHidden) && react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, helperText: t("uxf-cms-content-builder:seo-form.og-title-helper"), label: "OG nadpis", name: "seo.ogTitle", type: "text" });
|
|
54
|
+
$[12] = (_12 = (_11 = (_10 = props.fields) === null || _10 === void 0 ? void 0 : _10.seo) === null || _11 === void 0 ? void 0 : _11.ogTitle) === null || _12 === void 0 ? void 0 : _12.isHidden;
|
|
55
|
+
$[13] = props.formApi;
|
|
56
|
+
$[14] = t;
|
|
57
|
+
$[15] = t3;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
t3 = $[15];
|
|
61
|
+
}
|
|
62
|
+
let t4;
|
|
63
|
+
if ($[16] !== ((_15 = (_14 = (_13 = props.fields) === null || _13 === void 0 ? void 0 : _13.seo) === null || _14 === void 0 ? void 0 : _14.ogDescription) === null || _15 === void 0 ? void 0 : _15.isHidden) || $[17] !== props.formApi || $[18] !== t) {
|
|
64
|
+
t4 = !((_18 = (_17 = (_16 = props.fields) === null || _16 === void 0 ? void 0 : _16.seo) === null || _17 === void 0 ? void 0 : _17.ogDescription) === null || _18 === void 0 ? void 0 : _18.isHidden) && react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, helperText: t("uxf-cms-content-builder:seo-form.og-description-helper"), label: "OG popis", name: "seo.ogDescription", type: "text" });
|
|
65
|
+
$[16] = (_21 = (_20 = (_19 = props.fields) === null || _19 === void 0 ? void 0 : _19.seo) === null || _20 === void 0 ? void 0 : _20.ogDescription) === null || _21 === void 0 ? void 0 : _21.isHidden;
|
|
66
|
+
$[17] = props.formApi;
|
|
67
|
+
$[18] = t;
|
|
68
|
+
$[19] = t4;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
t4 = $[19];
|
|
72
|
+
}
|
|
73
|
+
let t5;
|
|
74
|
+
if ($[20] !== ((_24 = (_23 = (_22 = props.fields) === null || _22 === void 0 ? void 0 : _22.seo) === null || _23 === void 0 ? void 0 : _23.ogImage) === null || _24 === void 0 ? void 0 : _24.isHidden) || $[21] !== props.formApi || $[22] !== props.uploadNamespace || $[23] !== t) {
|
|
75
|
+
t5 = !((_27 = (_26 = (_25 = props.fields) === null || _25 === void 0 ? void 0 : _25.seo) === null || _26 === void 0 ? void 0 : _26.ogImage) === null || _27 === void 0 ? void 0 : _27.isHidden) && react_1.default.createElement(file_input_1.FileInput, { control: props.formApi.control, helperText: t("uxf-cms-content-builder:seo-form.og-image-helper"), id: "seo.ogImage", label: t("uxf-cms-content-builder:seo-form.og-image"), name: "seo.ogImage", onUploadFile: file => (0, api_1.uploadFile)(file, props.uploadNamespace) });
|
|
76
|
+
$[20] = (_30 = (_29 = (_28 = props.fields) === null || _28 === void 0 ? void 0 : _28.seo) === null || _29 === void 0 ? void 0 : _29.ogImage) === null || _30 === void 0 ? void 0 : _30.isHidden;
|
|
77
|
+
$[21] = props.formApi;
|
|
78
|
+
$[22] = props.uploadNamespace;
|
|
79
|
+
$[23] = t;
|
|
80
|
+
$[24] = t5;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
t5 = $[24];
|
|
84
|
+
}
|
|
85
|
+
let t6;
|
|
86
|
+
if ($[25] !== props.className || $[26] !== t0 || $[27] !== t1 || $[28] !== t2 || $[29] !== t3 || $[30] !== t4 || $[31] !== t5) {
|
|
87
|
+
t6 = react_1.default.createElement("div", { className: props.className },
|
|
88
|
+
t0,
|
|
89
|
+
t1,
|
|
90
|
+
t2,
|
|
91
|
+
t3,
|
|
92
|
+
t4,
|
|
93
|
+
t5);
|
|
94
|
+
$[25] = props.className;
|
|
95
|
+
$[26] = t0;
|
|
96
|
+
$[27] = t1;
|
|
97
|
+
$[28] = t2;
|
|
98
|
+
$[29] = t3;
|
|
99
|
+
$[30] = t4;
|
|
100
|
+
$[31] = t5;
|
|
101
|
+
$[32] = t6;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
t6 = $[32];
|
|
105
|
+
}
|
|
106
|
+
return t6;
|
|
23
107
|
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ChangePasswordForm = void 0;
|
|
7
|
+
const compiler_runtime_1 = require("react/compiler-runtime");
|
|
7
8
|
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const form_1 = require("@uxf/form/form");
|
|
9
10
|
const text_input_1 = require("@uxf/form/text-input");
|
|
@@ -11,21 +12,157 @@ const button_1 = require("@uxf/ui/button");
|
|
|
11
12
|
const react_1 = __importDefault(require("react"));
|
|
12
13
|
const react_hook_form_1 = require("react-hook-form");
|
|
13
14
|
const widget_1 = require("../../ui/widget");
|
|
14
|
-
const ChangePasswordForm =
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const ChangePasswordForm = props => {
|
|
16
|
+
const $ = (0, compiler_runtime_1.c)(39);
|
|
17
|
+
let defaultValues;
|
|
18
|
+
let formProps;
|
|
19
|
+
if ($[0] !== props) {
|
|
20
|
+
({
|
|
21
|
+
defaultValues,
|
|
22
|
+
...formProps
|
|
23
|
+
} = props);
|
|
24
|
+
$[0] = props;
|
|
25
|
+
$[1] = defaultValues;
|
|
26
|
+
$[2] = formProps;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
defaultValues = $[1];
|
|
30
|
+
formProps = $[2];
|
|
31
|
+
}
|
|
17
32
|
const t = (0, translations_1.useUxfTranslation)();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
let t0;
|
|
34
|
+
if ($[3] !== defaultValues) {
|
|
35
|
+
t0 = {
|
|
36
|
+
defaultValues
|
|
37
|
+
};
|
|
38
|
+
$[3] = defaultValues;
|
|
39
|
+
$[4] = t0;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
t0 = $[4];
|
|
43
|
+
}
|
|
44
|
+
const formApi = (0, react_hook_form_1.useForm)(t0);
|
|
45
|
+
const t1 = formApi.formState.isSubmitting;
|
|
46
|
+
let t2;
|
|
47
|
+
if ($[5] !== t) {
|
|
48
|
+
t2 = t("uxf-cms-change-password-form:save");
|
|
49
|
+
$[5] = t;
|
|
50
|
+
$[6] = t2;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
t2 = $[6];
|
|
54
|
+
}
|
|
55
|
+
let t3;
|
|
56
|
+
if ($[7] !== formApi.formState.isSubmitting || $[8] !== t2) {
|
|
57
|
+
t3 = react_1.default.createElement("div", { className: "text-right" },
|
|
58
|
+
react_1.default.createElement(button_1.Button, { isDisabled: t1, type: "submit" }, t2));
|
|
59
|
+
$[7] = formApi.formState.isSubmitting;
|
|
60
|
+
$[8] = t2;
|
|
61
|
+
$[9] = t3;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
t3 = $[9];
|
|
65
|
+
}
|
|
66
|
+
const t4 = formApi.control;
|
|
67
|
+
let t5;
|
|
68
|
+
if ($[10] !== t) {
|
|
69
|
+
t5 = t("uxf-cms-change-password-form:original-password");
|
|
70
|
+
$[10] = t;
|
|
71
|
+
$[11] = t5;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
t5 = $[11];
|
|
75
|
+
}
|
|
76
|
+
let t6;
|
|
77
|
+
if ($[12] !== formApi.control || $[13] !== t5) {
|
|
78
|
+
t6 = react_1.default.createElement(text_input_1.TextInput, { control: t4, isRequired: true, label: t5, name: "originalPassword", type: "password" });
|
|
79
|
+
$[12] = formApi.control;
|
|
80
|
+
$[13] = t5;
|
|
81
|
+
$[14] = t6;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
t6 = $[14];
|
|
85
|
+
}
|
|
86
|
+
const t7 = formApi.control;
|
|
87
|
+
let t8;
|
|
88
|
+
if ($[15] !== t) {
|
|
89
|
+
t8 = t("uxf-cms-change-password-form:new-password");
|
|
90
|
+
$[15] = t;
|
|
91
|
+
$[16] = t8;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
t8 = $[16];
|
|
95
|
+
}
|
|
96
|
+
let t9;
|
|
97
|
+
if ($[17] !== formApi.control || $[18] !== props.passwordRules || $[19] !== t8) {
|
|
98
|
+
t9 = react_1.default.createElement(text_input_1.TextInput, { control: t7, isRequired: true, label: t8, name: "newPassword", rules: props.passwordRules, type: "password" });
|
|
99
|
+
$[17] = formApi.control;
|
|
100
|
+
$[18] = props.passwordRules;
|
|
101
|
+
$[19] = t8;
|
|
102
|
+
$[20] = t9;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
t9 = $[20];
|
|
106
|
+
}
|
|
107
|
+
const t10 = formApi.control;
|
|
108
|
+
let t11;
|
|
109
|
+
if ($[21] !== t) {
|
|
110
|
+
t11 = t("uxf-cms-change-password-form:new-password-again");
|
|
111
|
+
$[21] = t;
|
|
112
|
+
$[22] = t11;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
t11 = $[22];
|
|
116
|
+
}
|
|
117
|
+
let t12;
|
|
118
|
+
if ($[23] !== formApi || $[24] !== t) {
|
|
119
|
+
t12 = {
|
|
120
|
+
validate: v => v === formApi.getValues("newPassword") || t("uxf-cms-change-password-form:passwords-must-match")
|
|
121
|
+
};
|
|
122
|
+
$[23] = formApi;
|
|
123
|
+
$[24] = t;
|
|
124
|
+
$[25] = t12;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
t12 = $[25];
|
|
128
|
+
}
|
|
129
|
+
let t13;
|
|
130
|
+
if ($[26] !== formApi.control || $[27] !== t11 || $[28] !== t12) {
|
|
131
|
+
t13 = react_1.default.createElement(text_input_1.TextInput, { control: t10, isRequired: true, label: t11, name: "newPasswordAgain", rules: t12, type: "password" });
|
|
132
|
+
$[26] = formApi.control;
|
|
133
|
+
$[27] = t11;
|
|
134
|
+
$[28] = t12;
|
|
135
|
+
$[29] = t13;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
t13 = $[29];
|
|
139
|
+
}
|
|
140
|
+
let t14;
|
|
141
|
+
if ($[30] !== t13 || $[31] !== t3 || $[32] !== t6 || $[33] !== t9) {
|
|
142
|
+
t14 = react_1.default.createElement(widget_1.Widget, { className: "[&>*]:p-4", footer: t3, withDividers: true },
|
|
143
|
+
t6,
|
|
144
|
+
t9,
|
|
145
|
+
t13);
|
|
146
|
+
$[30] = t13;
|
|
147
|
+
$[31] = t3;
|
|
148
|
+
$[32] = t6;
|
|
149
|
+
$[33] = t9;
|
|
150
|
+
$[34] = t14;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
t14 = $[34];
|
|
154
|
+
}
|
|
155
|
+
let t15;
|
|
156
|
+
if ($[35] !== formApi || $[36] !== formProps || $[37] !== t14) {
|
|
157
|
+
t15 = react_1.default.createElement(form_1.Form, { formApi: formApi, id: "change-password-form", ...formProps }, t14);
|
|
158
|
+
$[35] = formApi;
|
|
159
|
+
$[36] = formProps;
|
|
160
|
+
$[37] = t14;
|
|
161
|
+
$[38] = t15;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
t15 = $[38];
|
|
165
|
+
}
|
|
166
|
+
return t15;
|
|
30
167
|
};
|
|
31
168
|
exports.ChangePasswordForm = ChangePasswordForm;
|