@portnet/ui 3.1.6 → 4.0.1
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/dist/components/buttons/PuiButton.js +96 -103
- package/dist/components/common/StyledMuiButton.js +3 -5
- package/dist/components/common/StyledMuiTextField.js +103 -59
- package/dist/components/inputs/PuiDateField.js +176 -52
- package/dist/components/inputs/PuiDateTimeField.js +204 -195
- package/dist/components/inputs/PuiSelect.js +124 -82
- package/dist/components/others/DateTimePickerField.js +210 -0
- package/dist/components/others/PuiSection.js +88 -31
- package/dist/components/referentiel/components/PuiSpecificReferentielField.js +6 -24
- package/dist/components/table/PuiTable.js +124 -50
- package/dist/components/table/PuiTableAction.js +12 -2
- package/dist/components/typography/PuiMainTitle.js +124 -35
- package/dist/components/ui/pages/general/PuiSearchPage.js +56 -34
- package/dist/config/apperance.js +13 -95
- package/dist/index.js +0 -42
- package/package.json +20 -25
- package/dist/components/providers/PuiAntdProvider.js +0 -70
- package/dist/components/providers/PuiThemeProvider.js +0 -230
- package/dist/components/stepper/PuiStepContent.js +0 -66
- package/dist/components/stepper/PuiStepper.js +0 -184
- package/dist/components/stepper/PuiStepperActions.js +0 -105
- package/dist/components/table/PuiModernTable.js +0 -541
- package/dist/components-antd-optional/PuiAntdForm.js +0 -328
- package/dist/components-antd-optional/PuiAntdStepper.js +0 -317
- package/dist/components-antd-optional/PuiAntdTable.js +0 -352
- package/dist/config/antdTheme.js +0 -227
- package/dist/hooks/useCustomAxios.js +0 -36
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.weak-map.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
5
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
exports.default = void 0;
|
|
10
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
11
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
12
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
13
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
-
var _antd = require("antd");
|
|
17
|
-
var _icons = require("@ant-design/icons");
|
|
18
|
-
var _material = require("@mui/material");
|
|
19
|
-
var _styles = require("@mui/material/styles");
|
|
20
|
-
var _apperance = require("../../config/apperance");
|
|
21
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _excluded = ["data", "columns", "actions", "loading", "title", "pagination", "currentPage", "totalPages", "pageSize", "total", "onPageChange", "onPageSizeChange", "rowKey", "size", "showHeader", "bordered", "expandable", "rowSelection", "scroll", "emptyText"];
|
|
23
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
25
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
28
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
29
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
31
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
32
|
-
const {
|
|
33
|
-
Title
|
|
34
|
-
} = _antd.Typography;
|
|
35
|
-
|
|
36
|
-
// Container principal avec style moderne
|
|
37
|
-
const TableContainer = (0, _styles.styled)(_material.Box)(() => ({
|
|
38
|
-
padding: '24px',
|
|
39
|
-
backgroundColor: _apperance.palette.background.default,
|
|
40
|
-
borderRadius: '12px',
|
|
41
|
-
minHeight: '400px',
|
|
42
|
-
// Styles pour la table Ant Design
|
|
43
|
-
'& .ant-table': {
|
|
44
|
-
backgroundColor: _apperance.palette.background.paper,
|
|
45
|
-
borderRadius: '8px',
|
|
46
|
-
overflow: 'hidden',
|
|
47
|
-
boxShadow: _apperance.palette.shadow.card
|
|
48
|
-
},
|
|
49
|
-
'& .ant-table-thead > tr > th': {
|
|
50
|
-
backgroundColor: _apperance.palette.gray[50],
|
|
51
|
-
color: _apperance.palette.gray[700],
|
|
52
|
-
fontWeight: 600,
|
|
53
|
-
borderBottom: "2px solid ".concat(_apperance.palette.border.light),
|
|
54
|
-
padding: '16px'
|
|
55
|
-
},
|
|
56
|
-
'& .ant-table-tbody > tr > td': {
|
|
57
|
-
padding: '16px',
|
|
58
|
-
borderBottom: "1px solid ".concat(_apperance.palette.border.light),
|
|
59
|
-
color: _apperance.palette.gray[700]
|
|
60
|
-
},
|
|
61
|
-
'& .ant-table-tbody > tr:hover > td': {
|
|
62
|
-
backgroundColor: "".concat(_apperance.palette.primary, "08")
|
|
63
|
-
},
|
|
64
|
-
'& .ant-pagination': {
|
|
65
|
-
marginTop: '24px',
|
|
66
|
-
textAlign: 'center',
|
|
67
|
-
'& .ant-pagination-item': {
|
|
68
|
-
borderRadius: '6px',
|
|
69
|
-
border: "1px solid ".concat(_apperance.palette.border.light),
|
|
70
|
-
'&:hover': {
|
|
71
|
-
borderColor: _apperance.palette.primary,
|
|
72
|
-
color: _apperance.palette.primary
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
'& .ant-pagination-item-active': {
|
|
76
|
-
backgroundColor: _apperance.palette.primary,
|
|
77
|
-
borderColor: _apperance.palette.primary,
|
|
78
|
-
'& a': {
|
|
79
|
-
color: _apperance.palette.white
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}));
|
|
84
|
-
|
|
85
|
-
// Configuration des icônes et couleurs d'actions selon les maquettes
|
|
86
|
-
const actionConfig = {
|
|
87
|
-
validate: {
|
|
88
|
-
icon: _icons.CheckCircleOutlined,
|
|
89
|
-
color: _apperance.palette.actions.validate,
|
|
90
|
-
label: 'Validé'
|
|
91
|
-
},
|
|
92
|
-
expire: {
|
|
93
|
-
icon: _icons.CloseCircleOutlined,
|
|
94
|
-
color: _apperance.palette.actions.expire,
|
|
95
|
-
label: 'Expiré'
|
|
96
|
-
},
|
|
97
|
-
renew: {
|
|
98
|
-
icon: _icons.SyncOutlined,
|
|
99
|
-
color: _apperance.palette.actions.renew,
|
|
100
|
-
label: 'Renouveler'
|
|
101
|
-
},
|
|
102
|
-
download: {
|
|
103
|
-
icon: _icons.DownloadOutlined,
|
|
104
|
-
color: _apperance.palette.actions.download,
|
|
105
|
-
label: 'Télécharger'
|
|
106
|
-
},
|
|
107
|
-
processing: {
|
|
108
|
-
icon: _icons.ClockCircleOutlined,
|
|
109
|
-
color: _apperance.palette.actions.processing,
|
|
110
|
-
label: 'En cours'
|
|
111
|
-
},
|
|
112
|
-
souscrit: {
|
|
113
|
-
icon: _icons.CheckCircleOutlined,
|
|
114
|
-
color: _apperance.palette.actions.souscrit,
|
|
115
|
-
label: 'Souscrit'
|
|
116
|
-
},
|
|
117
|
-
edit: {
|
|
118
|
-
icon: _icons.EditOutlined,
|
|
119
|
-
color: _apperance.palette.info,
|
|
120
|
-
label: 'Modifier'
|
|
121
|
-
},
|
|
122
|
-
view: {
|
|
123
|
-
icon: _icons.EyeOutlined,
|
|
124
|
-
color: _apperance.palette.gray[600],
|
|
125
|
-
label: 'Voir'
|
|
126
|
-
},
|
|
127
|
-
delete: {
|
|
128
|
-
icon: _icons.DeleteOutlined,
|
|
129
|
-
color: _apperance.palette.error,
|
|
130
|
-
label: 'Supprimer'
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Composant de tableau moderne utilisant Ant Design avec le thème des maquettes
|
|
136
|
-
*/
|
|
137
|
-
const PuiAntdTable = _ref => {
|
|
138
|
-
let {
|
|
139
|
-
data = [],
|
|
140
|
-
columns = [],
|
|
141
|
-
actions = [],
|
|
142
|
-
loading = false,
|
|
143
|
-
title,
|
|
144
|
-
pagination = true,
|
|
145
|
-
currentPage = 1,
|
|
146
|
-
totalPages = 1,
|
|
147
|
-
pageSize = 10,
|
|
148
|
-
total,
|
|
149
|
-
onPageChange,
|
|
150
|
-
onPageSizeChange,
|
|
151
|
-
rowKey = 'id',
|
|
152
|
-
size = 'middle',
|
|
153
|
-
showHeader = true,
|
|
154
|
-
bordered = false,
|
|
155
|
-
expandable,
|
|
156
|
-
rowSelection,
|
|
157
|
-
scroll,
|
|
158
|
-
emptyText = 'Aucune donnée disponible'
|
|
159
|
-
} = _ref,
|
|
160
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
161
|
-
const [selectedRowKeys, setSelectedRowKeys] = (0, _react.useState)([]);
|
|
162
|
-
|
|
163
|
-
// Transformation des colonnes pour Ant Design
|
|
164
|
-
const antdColumns = [...columns.map(col => ({
|
|
165
|
-
title: col.label || col.title,
|
|
166
|
-
dataIndex: col.key || col.dataIndex,
|
|
167
|
-
key: col.key || col.dataIndex,
|
|
168
|
-
width: col.width,
|
|
169
|
-
fixed: col.fixed,
|
|
170
|
-
align: col.align || 'left',
|
|
171
|
-
sorter: col.sortable ? (a, b) => {
|
|
172
|
-
const aVal = a[col.key] || '';
|
|
173
|
-
const bVal = b[col.key] || '';
|
|
174
|
-
return aVal.toString().localeCompare(bVal.toString());
|
|
175
|
-
} : false,
|
|
176
|
-
render: col.render || ((text, record) => {
|
|
177
|
-
if (col.type === 'currency') {
|
|
178
|
-
return new Intl.NumberFormat('fr-FR', {
|
|
179
|
-
style: 'currency',
|
|
180
|
-
currency: 'EUR'
|
|
181
|
-
}).format(text || 0);
|
|
182
|
-
}
|
|
183
|
-
if (col.type === 'date') {
|
|
184
|
-
return text ? new Date(text).toLocaleDateString('fr-FR') : '-';
|
|
185
|
-
}
|
|
186
|
-
if (col.type === 'tag') {
|
|
187
|
-
const config = col.tagConfig || {};
|
|
188
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tag, {
|
|
189
|
-
color: config.color || 'default',
|
|
190
|
-
style: {
|
|
191
|
-
borderRadius: '6px'
|
|
192
|
-
},
|
|
193
|
-
children: text
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
return text || '-';
|
|
197
|
-
})
|
|
198
|
-
})),
|
|
199
|
-
// Colonne d'actions si des actions sont définies
|
|
200
|
-
...(actions.length > 0 ? [{
|
|
201
|
-
title: 'Actions',
|
|
202
|
-
key: 'actions',
|
|
203
|
-
fixed: 'right',
|
|
204
|
-
width: Math.min(actions.length * 60 + 40, 300),
|
|
205
|
-
render: (_, record) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
206
|
-
size: "small",
|
|
207
|
-
children: actions.map((action, index) => {
|
|
208
|
-
const config = actionConfig[action.type] || action;
|
|
209
|
-
const IconComponent = config.icon || action.icon;
|
|
210
|
-
const isDisabled = action.disabled ? action.disabled(record) : false;
|
|
211
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
212
|
-
type: action.type === 'validate' || action.type === 'renew' ? 'primary' : 'default',
|
|
213
|
-
icon: IconComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {}) : null,
|
|
214
|
-
size: "small",
|
|
215
|
-
disabled: isDisabled,
|
|
216
|
-
onClick: () => action.onClick && action.onClick(record),
|
|
217
|
-
style: {
|
|
218
|
-
backgroundColor: !isDisabled ? config.color : undefined,
|
|
219
|
-
borderColor: !isDisabled ? config.color : undefined,
|
|
220
|
-
color: !isDisabled && config.color ? _apperance.palette.white : undefined,
|
|
221
|
-
borderRadius: '6px',
|
|
222
|
-
fontWeight: 500
|
|
223
|
-
},
|
|
224
|
-
title: action.tooltip || config.label || action.label,
|
|
225
|
-
children: action.showLabel !== false && (action.label || config.label)
|
|
226
|
-
}, index);
|
|
227
|
-
})
|
|
228
|
-
})
|
|
229
|
-
}] : [])];
|
|
230
|
-
|
|
231
|
-
// Configuration de la sélection de lignes
|
|
232
|
-
const selectionConfig = rowSelection ? _objectSpread({
|
|
233
|
-
selectedRowKeys,
|
|
234
|
-
onChange: (keys, rows) => {
|
|
235
|
-
setSelectedRowKeys(keys);
|
|
236
|
-
rowSelection.onChange && rowSelection.onChange(keys, rows);
|
|
237
|
-
},
|
|
238
|
-
onSelectAll: rowSelection.onSelectAll,
|
|
239
|
-
onSelect: rowSelection.onSelect,
|
|
240
|
-
type: rowSelection.type || 'checkbox'
|
|
241
|
-
}, rowSelection) : undefined;
|
|
242
|
-
|
|
243
|
-
// Configuration de la pagination
|
|
244
|
-
const paginationConfig = pagination ? {
|
|
245
|
-
current: currentPage,
|
|
246
|
-
pageSize: pageSize,
|
|
247
|
-
total: total || (data.length > 0 ? totalPages * pageSize : 0),
|
|
248
|
-
showSizeChanger: true,
|
|
249
|
-
showQuickJumper: true,
|
|
250
|
-
showTotal: (total, range) => "".concat(range[0], "-").concat(range[1], " sur ").concat(total, " \xE9l\xE9ments"),
|
|
251
|
-
onChange: (page, size) => {
|
|
252
|
-
onPageChange && onPageChange(page);
|
|
253
|
-
if (size !== pageSize) {
|
|
254
|
-
onPageSizeChange && onPageSizeChange(size);
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
onShowSizeChange: (current, size) => {
|
|
258
|
-
onPageSizeChange && onPageSizeChange(size);
|
|
259
|
-
},
|
|
260
|
-
pageSizeOptions: ['10', '20', '50', '100'],
|
|
261
|
-
size: 'default'
|
|
262
|
-
} : false;
|
|
263
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TableContainer, {
|
|
264
|
-
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
265
|
-
sx: {
|
|
266
|
-
mb: 3
|
|
267
|
-
},
|
|
268
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Title, {
|
|
269
|
-
level: 3,
|
|
270
|
-
style: {
|
|
271
|
-
margin: 0,
|
|
272
|
-
color: _apperance.palette.gray[800],
|
|
273
|
-
fontWeight: 600
|
|
274
|
-
},
|
|
275
|
-
children: title
|
|
276
|
-
})
|
|
277
|
-
}), loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
278
|
-
sx: {
|
|
279
|
-
display: 'flex',
|
|
280
|
-
justifyContent: 'center',
|
|
281
|
-
alignItems: 'center',
|
|
282
|
-
minHeight: '300px'
|
|
283
|
-
},
|
|
284
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Spin, {
|
|
285
|
-
size: "large",
|
|
286
|
-
tip: "Chargement des donn\xE9es..."
|
|
287
|
-
})
|
|
288
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Table, _objectSpread({
|
|
289
|
-
dataSource: data,
|
|
290
|
-
columns: antdColumns,
|
|
291
|
-
rowKey: rowKey,
|
|
292
|
-
pagination: paginationConfig,
|
|
293
|
-
loading: loading,
|
|
294
|
-
size: size,
|
|
295
|
-
showHeader: showHeader,
|
|
296
|
-
bordered: bordered,
|
|
297
|
-
expandable: expandable,
|
|
298
|
-
rowSelection: selectionConfig,
|
|
299
|
-
scroll: scroll,
|
|
300
|
-
locale: {
|
|
301
|
-
emptyText: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Empty, {
|
|
302
|
-
description: emptyText,
|
|
303
|
-
style: {
|
|
304
|
-
padding: '40px 20px'
|
|
305
|
-
}
|
|
306
|
-
})
|
|
307
|
-
}
|
|
308
|
-
}, props))]
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
PuiAntdTable.propTypes = {
|
|
312
|
-
data: _propTypes.default.array,
|
|
313
|
-
columns: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
314
|
-
key: _propTypes.default.string.isRequired,
|
|
315
|
-
label: _propTypes.default.string,
|
|
316
|
-
title: _propTypes.default.string,
|
|
317
|
-
width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
318
|
-
fixed: _propTypes.default.oneOf(['left', 'right']),
|
|
319
|
-
align: _propTypes.default.oneOf(['left', 'center', 'right']),
|
|
320
|
-
sortable: _propTypes.default.bool,
|
|
321
|
-
type: _propTypes.default.oneOf(['text', 'currency', 'date', 'tag']),
|
|
322
|
-
tagConfig: _propTypes.default.object,
|
|
323
|
-
render: _propTypes.default.func
|
|
324
|
-
})),
|
|
325
|
-
actions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
326
|
-
type: _propTypes.default.string,
|
|
327
|
-
label: _propTypes.default.string,
|
|
328
|
-
icon: _propTypes.default.elementType,
|
|
329
|
-
onClick: _propTypes.default.func,
|
|
330
|
-
disabled: _propTypes.default.func,
|
|
331
|
-
tooltip: _propTypes.default.string,
|
|
332
|
-
showLabel: _propTypes.default.bool
|
|
333
|
-
})),
|
|
334
|
-
loading: _propTypes.default.bool,
|
|
335
|
-
title: _propTypes.default.string,
|
|
336
|
-
pagination: _propTypes.default.bool,
|
|
337
|
-
currentPage: _propTypes.default.number,
|
|
338
|
-
totalPages: _propTypes.default.number,
|
|
339
|
-
pageSize: _propTypes.default.number,
|
|
340
|
-
total: _propTypes.default.number,
|
|
341
|
-
onPageChange: _propTypes.default.func,
|
|
342
|
-
onPageSizeChange: _propTypes.default.func,
|
|
343
|
-
rowKey: _propTypes.default.string,
|
|
344
|
-
size: _propTypes.default.oneOf(['small', 'middle', 'large']),
|
|
345
|
-
showHeader: _propTypes.default.bool,
|
|
346
|
-
bordered: _propTypes.default.bool,
|
|
347
|
-
expandable: _propTypes.default.object,
|
|
348
|
-
rowSelection: _propTypes.default.object,
|
|
349
|
-
scroll: _propTypes.default.object,
|
|
350
|
-
emptyText: _propTypes.default.string
|
|
351
|
-
};
|
|
352
|
-
var _default = exports.default = PuiAntdTable;
|
package/dist/config/antdTheme.js
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.antdTheme = void 0;
|
|
7
|
-
var _apperance = require("./apperance");
|
|
8
|
-
// Configuration Ant Design avec la nouvelle palette de couleurs des maquettes
|
|
9
|
-
const antdTheme = exports.antdTheme = {
|
|
10
|
-
token: {
|
|
11
|
-
// Couleurs principales
|
|
12
|
-
colorPrimary: _apperance.palette.primary,
|
|
13
|
-
colorSuccess: _apperance.palette.success,
|
|
14
|
-
colorWarning: _apperance.palette.warning,
|
|
15
|
-
colorError: _apperance.palette.error,
|
|
16
|
-
colorInfo: _apperance.palette.info,
|
|
17
|
-
// Couleurs de fond
|
|
18
|
-
colorBgBase: _apperance.palette.white,
|
|
19
|
-
colorBgContainer: _apperance.palette.background.paper,
|
|
20
|
-
colorBgElevated: _apperance.palette.background.card,
|
|
21
|
-
colorBgLayout: _apperance.palette.background.default,
|
|
22
|
-
colorBgSpotlight: _apperance.palette.background.sidebar,
|
|
23
|
-
// Couleurs de texte
|
|
24
|
-
colorText: _apperance.palette.dark,
|
|
25
|
-
colorTextSecondary: _apperance.palette.gray[600],
|
|
26
|
-
colorTextTertiary: _apperance.palette.gray[500],
|
|
27
|
-
colorTextQuaternary: _apperance.palette.gray[400],
|
|
28
|
-
// Bordures
|
|
29
|
-
colorBorder: _apperance.palette.border.light,
|
|
30
|
-
colorBorderSecondary: _apperance.palette.border.main,
|
|
31
|
-
// Radius moderne comme dans les maquettes
|
|
32
|
-
borderRadius: 8,
|
|
33
|
-
borderRadiusLG: 12,
|
|
34
|
-
borderRadiusSM: 6,
|
|
35
|
-
borderRadiusXS: 4,
|
|
36
|
-
// Shadows modernes
|
|
37
|
-
boxShadow: _apperance.palette.shadow.light,
|
|
38
|
-
boxShadowSecondary: _apperance.palette.shadow.medium,
|
|
39
|
-
boxShadowTertiary: _apperance.palette.shadow.strong,
|
|
40
|
-
// Espacement
|
|
41
|
-
padding: 16,
|
|
42
|
-
paddingLG: 24,
|
|
43
|
-
paddingSM: 12,
|
|
44
|
-
paddingXS: 8,
|
|
45
|
-
paddingXXS: 4,
|
|
46
|
-
margin: 16,
|
|
47
|
-
marginLG: 24,
|
|
48
|
-
marginSM: 12,
|
|
49
|
-
marginXS: 8,
|
|
50
|
-
marginXXS: 4,
|
|
51
|
-
// Tailles
|
|
52
|
-
controlHeight: 40,
|
|
53
|
-
controlHeightLG: 48,
|
|
54
|
-
controlHeightSM: 32,
|
|
55
|
-
controlHeightXS: 24,
|
|
56
|
-
// Typographie moderne
|
|
57
|
-
fontSize: 14,
|
|
58
|
-
fontSizeLG: 16,
|
|
59
|
-
fontSizeSM: 12,
|
|
60
|
-
fontSizeXL: 20,
|
|
61
|
-
fontSizeHeading1: 32,
|
|
62
|
-
fontSizeHeading2: 24,
|
|
63
|
-
fontSizeHeading3: 20,
|
|
64
|
-
fontSizeHeading4: 16,
|
|
65
|
-
fontSizeHeading5: 14,
|
|
66
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
67
|
-
fontFamilyCode: 'SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace',
|
|
68
|
-
// Line heights
|
|
69
|
-
lineHeight: 1.5,
|
|
70
|
-
lineHeightLG: 1.6,
|
|
71
|
-
lineHeightSM: 1.4,
|
|
72
|
-
lineHeightHeading1: 1.2,
|
|
73
|
-
lineHeightHeading2: 1.3,
|
|
74
|
-
lineHeightHeading3: 1.4,
|
|
75
|
-
lineHeightHeading4: 1.5,
|
|
76
|
-
lineHeightHeading5: 1.5,
|
|
77
|
-
// Motion
|
|
78
|
-
motionDurationFast: '0.1s',
|
|
79
|
-
motionDurationMid: '0.2s',
|
|
80
|
-
motionDurationSlow: '0.3s',
|
|
81
|
-
motionEaseInOut: 'cubic-bezier(0.645, 0.045, 0.355, 1)',
|
|
82
|
-
motionEaseOut: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
|
|
83
|
-
motionEaseIn: 'cubic-bezier(0.55, 0.055, 0.675, 0.19)',
|
|
84
|
-
// Z-index
|
|
85
|
-
zIndexBase: 0,
|
|
86
|
-
zIndexPopupBase: 1000,
|
|
87
|
-
// Screen sizes
|
|
88
|
-
screenXS: 480,
|
|
89
|
-
screenSM: 576,
|
|
90
|
-
screenMD: 768,
|
|
91
|
-
screenLG: 992,
|
|
92
|
-
screenXL: 1200,
|
|
93
|
-
screenXXL: 1600
|
|
94
|
-
},
|
|
95
|
-
components: {
|
|
96
|
-
// Button personnalisé selon les maquettes
|
|
97
|
-
Button: {
|
|
98
|
-
borderRadius: 8,
|
|
99
|
-
controlHeight: 40,
|
|
100
|
-
controlHeightLG: 48,
|
|
101
|
-
controlHeightSM: 32,
|
|
102
|
-
fontWeight: 500,
|
|
103
|
-
defaultShadow: _apperance.palette.shadow.light,
|
|
104
|
-
primaryShadow: "0 2px 4px ".concat(_apperance.palette.primary, "40")
|
|
105
|
-
},
|
|
106
|
-
// Input personnalisé
|
|
107
|
-
Input: {
|
|
108
|
-
borderRadius: 8,
|
|
109
|
-
controlHeight: 40,
|
|
110
|
-
controlHeightLG: 48,
|
|
111
|
-
controlHeightSM: 32,
|
|
112
|
-
activeBorderColor: _apperance.palette.primary,
|
|
113
|
-
hoverBorderColor: _apperance.palette.gray[400]
|
|
114
|
-
},
|
|
115
|
-
// Select personnalisé
|
|
116
|
-
Select: {
|
|
117
|
-
borderRadius: 8,
|
|
118
|
-
controlHeight: 40,
|
|
119
|
-
controlHeightLG: 48,
|
|
120
|
-
controlHeightSM: 32,
|
|
121
|
-
optionSelectedBg: "".concat(_apperance.palette.primary, "10"),
|
|
122
|
-
optionActiveBg: "".concat(_apperance.palette.primary, "08")
|
|
123
|
-
},
|
|
124
|
-
// Card moderne selon les maquettes
|
|
125
|
-
Card: {
|
|
126
|
-
borderRadius: 12,
|
|
127
|
-
boxShadow: _apperance.palette.shadow.card,
|
|
128
|
-
headerBg: _apperance.palette.background.paper,
|
|
129
|
-
bodyPadding: 24,
|
|
130
|
-
headPadding: '16px 24px'
|
|
131
|
-
},
|
|
132
|
-
// Table style moderne
|
|
133
|
-
Table: {
|
|
134
|
-
borderRadius: 8,
|
|
135
|
-
headerBg: _apperance.palette.gray[50],
|
|
136
|
-
headerColor: _apperance.palette.gray[700],
|
|
137
|
-
rowHoverBg: "".concat(_apperance.palette.primary, "08"),
|
|
138
|
-
borderColor: _apperance.palette.border.light,
|
|
139
|
-
headerSplitColor: _apperance.palette.border.light
|
|
140
|
-
},
|
|
141
|
-
// Menu style moderne
|
|
142
|
-
Menu: {
|
|
143
|
-
borderRadius: 8,
|
|
144
|
-
itemBg: 'transparent',
|
|
145
|
-
itemSelectedBg: "".concat(_apperance.palette.primary, "10"),
|
|
146
|
-
itemHoverBg: "".concat(_apperance.palette.primary, "08"),
|
|
147
|
-
itemActiveBg: "".concat(_apperance.palette.primary, "15"),
|
|
148
|
-
itemSelectedColor: _apperance.palette.primary,
|
|
149
|
-
itemColor: _apperance.palette.gray[700]
|
|
150
|
-
},
|
|
151
|
-
// Modal moderne
|
|
152
|
-
Modal: {
|
|
153
|
-
borderRadius: 12,
|
|
154
|
-
headerBg: _apperance.palette.background.paper,
|
|
155
|
-
contentBg: _apperance.palette.background.paper,
|
|
156
|
-
titleColor: _apperance.palette.dark
|
|
157
|
-
},
|
|
158
|
-
// Drawer moderne
|
|
159
|
-
Drawer: {
|
|
160
|
-
colorBgElevated: _apperance.palette.background.paper,
|
|
161
|
-
colorBgMask: 'rgba(0, 0, 0, 0.45)'
|
|
162
|
-
},
|
|
163
|
-
// Steps (Stepper) selon les maquettes de parcours
|
|
164
|
-
Steps: {
|
|
165
|
-
borderRadius: 8,
|
|
166
|
-
dotSize: 32,
|
|
167
|
-
iconSize: 16,
|
|
168
|
-
titleLineHeight: 1.5,
|
|
169
|
-
descriptionLineHeight: 1.4,
|
|
170
|
-
customDotSize: 40,
|
|
171
|
-
finishIconBorderColor: _apperance.palette.success,
|
|
172
|
-
finishIconColor: _apperance.palette.success,
|
|
173
|
-
processIconBorderColor: _apperance.palette.primary,
|
|
174
|
-
processIconColor: _apperance.palette.primary,
|
|
175
|
-
waitIconBorderColor: _apperance.palette.gray[300],
|
|
176
|
-
waitIconColor: _apperance.palette.gray[400]
|
|
177
|
-
},
|
|
178
|
-
// Notification moderne
|
|
179
|
-
Notification: {
|
|
180
|
-
borderRadius: 8,
|
|
181
|
-
paddingMD: 16,
|
|
182
|
-
paddingContentHorizontal: 16
|
|
183
|
-
},
|
|
184
|
-
// Message moderne
|
|
185
|
-
Message: {
|
|
186
|
-
borderRadius: 8,
|
|
187
|
-
contentPadding: '10px 16px'
|
|
188
|
-
},
|
|
189
|
-
// Progress moderne
|
|
190
|
-
Progress: {
|
|
191
|
-
borderRadius: 6,
|
|
192
|
-
defaultColor: _apperance.palette.gray[200],
|
|
193
|
-
remainingColor: _apperance.palette.gray[100]
|
|
194
|
-
},
|
|
195
|
-
// Tag moderne
|
|
196
|
-
Tag: {
|
|
197
|
-
borderRadius: 6,
|
|
198
|
-
defaultBg: _apperance.palette.gray[100],
|
|
199
|
-
defaultColor: _apperance.palette.gray[700]
|
|
200
|
-
},
|
|
201
|
-
// Breadcrumb moderne
|
|
202
|
-
Breadcrumb: {
|
|
203
|
-
itemColor: _apperance.palette.gray[600],
|
|
204
|
-
lastItemColor: _apperance.palette.dark,
|
|
205
|
-
linkColor: _apperance.palette.primary,
|
|
206
|
-
linkHoverColor: _apperance.palette.blue.dark,
|
|
207
|
-
separatorColor: _apperance.palette.gray[400]
|
|
208
|
-
},
|
|
209
|
-
// Pagination moderne
|
|
210
|
-
Pagination: {
|
|
211
|
-
borderRadius: 6,
|
|
212
|
-
itemSize: 32,
|
|
213
|
-
itemSizeSM: 24,
|
|
214
|
-
itemActiveBg: _apperance.palette.primary,
|
|
215
|
-
itemLinkBg: _apperance.palette.background.paper,
|
|
216
|
-
itemInputBg: _apperance.palette.background.paper
|
|
217
|
-
},
|
|
218
|
-
// Typography moderne
|
|
219
|
-
Typography: {
|
|
220
|
-
titleMarginBottom: '0.5em',
|
|
221
|
-
titleMarginTop: '1.2em'
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
// Algorithmes de couleurs personnalisés
|
|
225
|
-
algorithm: []
|
|
226
|
-
};
|
|
227
|
-
var _default = exports.default = antdTheme;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
require("core-js/modules/es.promise.js");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _axios = _interopRequireDefault(require("axios"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
const useCustomAxios = (token, secret, customUrl) => {
|
|
12
|
-
const axiosInstance = (0, _react.useMemo)(() => {
|
|
13
|
-
const instance = _axios.default.create({
|
|
14
|
-
baseURL: customUrl || "",
|
|
15
|
-
headers: {
|
|
16
|
-
"Content-Type": "application/json"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// Intercepteur pour ajouter l'authentification
|
|
21
|
-
instance.interceptors.request.use(config => {
|
|
22
|
-
if (token) {
|
|
23
|
-
config.headers.Authorization = secret ? token : "Bearer ".concat(token);
|
|
24
|
-
}
|
|
25
|
-
if (secret) {
|
|
26
|
-
config.headers["X-Secret"] = secret;
|
|
27
|
-
}
|
|
28
|
-
return config;
|
|
29
|
-
}, error => {
|
|
30
|
-
return Promise.reject(error);
|
|
31
|
-
});
|
|
32
|
-
return instance;
|
|
33
|
-
}, [token, secret, customUrl]);
|
|
34
|
-
return axiosInstance;
|
|
35
|
-
};
|
|
36
|
-
var _default = exports.default = useCustomAxios;
|