adminizer 4.2.0 → 4.3.0-build.101
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/assets/add-1E1UsMVZ.js +1 -0
- package/assets/add-form-CGa9QbwE.js +1 -0
- package/assets/add-group-7yAK6uFY.js +1 -0
- package/assets/add-group-form-BNmpvW8K.js +1 -0
- package/assets/add-user-NoYkTfZi.js +1 -0
- package/assets/add-user-form-DrclnTOd.js +1 -0
- package/assets/{app-CVnUv8s_.css → app-D8oqdt8J.css} +1 -1
- package/assets/app-layout-i2zN9Rn-.js +1 -0
- package/assets/app-shell-CHEYhVco.js +1 -0
- package/assets/app-sidebar-DeF8WNmW.js +1 -0
- package/assets/app-sidebar-header-DdM1EOrb.js +1 -0
- package/assets/app.js +1699 -1657
- package/assets/breadcrumbs-C439DWrC.js +1 -0
- package/assets/catalog-B9hdop59.js +6 -0
- package/assets/dashboard-Bi5KeZu2.js +3 -0
- package/assets/date-picker-DbJ8nHp5.js +1 -0
- package/assets/del-modal-_b3CSNHb.js +1 -0
- package/assets/dynamic-controls-BOYmRX_z.js +1 -0
- package/assets/field-renderer-4obZ_jUo.js +407 -0
- package/assets/{field-renderer-CsBa_tMB.css → field-renderer-CRNLShJD.css} +1 -1
- package/assets/form-Bte5kzjB.js +1 -0
- package/assets/form-oUlsuu7h.js +1 -0
- package/assets/geo-json-CadjdhwW.js +4 -0
- package/assets/handsontable-PVakPtJV.js +281 -0
- package/assets/home-CsUXA-O6.js +2 -0
- package/assets/icon-DM49pZW3.js +1 -0
- package/assets/init-user-DNrB8Xt5.js +1 -0
- package/assets/input-error--IOnWghB.js +1 -0
- package/assets/jsoneditor-D95dIAP2.js +3878 -0
- package/assets/list-CdfSnSN1.js +1 -0
- package/assets/list-table-Byzv346I.js +22 -0
- package/assets/login-6Xb8bcPq.js +1 -0
- package/assets/manifest.json +331 -221
- package/assets/material-icon-BedgD2NE.js +1 -0
- package/assets/media-manager-UQT6RhI8.js +14 -0
- package/assets/module-B4-7WkY5.js +1 -0
- package/assets/monaco-ICtx6xoc.js +11 -0
- package/assets/nav-footer-BwkQkwow.js +1 -0
- package/assets/nav-main-9Eb_A0rf.js +1 -0
- package/assets/nav-user-CRAfyE-x.js +1 -0
- package/assets/notification-ma2x7vka.js +27 -0
- package/assets/pagination-render-xsEktzA8.js +1 -0
- package/assets/register-BIyjCy8M.js +1 -0
- package/assets/tabs-BK_5wdPA.js +1 -0
- package/assets/theme-switcher-CKiJbMkh.js +1 -0
- package/assets/toast-editor-BZM5RHph.js +845 -0
- package/assets/user-info-CcYdmjMZ.js +1 -0
- package/assets/user-menu-content-DbUk8ZeY.js +1 -0
- package/assets/vanilla-picker-l5rcX3cq.js +8 -0
- package/assets/vendor-wzZzN_Jv.js +17 -0
- package/assets/welcome-cWh1qnl_.js +1 -0
- package/controllers/add.js +1 -1
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +4 -4
- package/controllers/ckeditorUpload.d.ts +1 -1
- package/controllers/ckeditorUpload.js +50 -26
- package/controllers/edit.js +2 -2
- package/controllers/form.js +29 -13
- package/controllers/list.js +2 -2
- package/controllers/login.js +2 -2
- package/controllers/media-manager/mediaManagerAdapter.js +13 -2
- package/controllers/media-manager/mediaManagerApi.js +4 -3
- package/controllers/navigation/edit.js +1 -1
- package/controllers/notifications/NotificationController.d.ts +11 -0
- package/controllers/notifications/NotificationController.js +219 -0
- package/controllers/remove.js +2 -1
- package/controllers/view.js +1 -1
- package/files/favicon.png +0 -0
- package/helpers/configHelper.d.ts +1 -1
- package/helpers/controllerHelper.js +1 -1
- package/helpers/diffHelpers.d.ts +2 -0
- package/helpers/diffHelpers.js +69 -0
- package/helpers/fieldsHelper.d.ts +1 -1
- package/helpers/fieldsHelper.js +1 -1
- package/helpers/formHelper.js +3 -1
- package/helpers/inertiaAddHelper.d.ts +1 -1
- package/helpers/inertiaAutHelper.js +19 -0
- package/helpers/inertiaFromHelper.js +12 -0
- package/helpers/translationHelper.d.ts +1 -1
- package/helpers/translationHelper.js +1 -1
- package/index.d.ts +16 -14
- package/index.js +16 -14
- package/interfaces/adminpanelConfig.d.ts +18 -0
- package/interfaces/global.d.ts +3 -3
- package/interfaces/types.d.ts +44 -2
- package/lib/Adminizer.d.ts +16 -8
- package/lib/Adminizer.js +95 -12
- package/lib/{v4/DataAccessor.d.ts → DataAccessor.d.ts} +5 -5
- package/lib/{v4/DataAccessor.js → DataAccessor.js} +3 -3
- package/lib/{v4/I18n.js → I18n.js} +2 -2
- package/lib/{v4/PolicyManager.d.ts → PolicyManager.d.ts} +1 -1
- package/lib/{v4/PolicyManager.js → PolicyManager.js} +2 -2
- package/lib/{v4/catalog → catalog}/AbstractCatalog.d.ts +1 -1
- package/lib/{v4/catalog → catalog}/Navigation.d.ts +2 -2
- package/lib/{v4/catalog → catalog}/Navigation.js +1 -1
- package/lib/{v4/controls → controls}/AbstractControls.d.ts +1 -1
- package/lib/{v4/controls → controls}/codeEditor/MonacoEditor.d.ts +1 -1
- package/lib/{v4/controls → controls}/geojsoneditor/GeoEditor.d.ts +1 -1
- package/lib/{v4/controls → controls}/jsoneditor/JsonEditor.d.ts +1 -1
- package/lib/{v4/controls → controls}/markdown/ToastUiEditor.d.ts +1 -1
- package/lib/{v4/controls → controls}/table/Handsontable.d.ts +1 -1
- package/lib/{v4/controls → controls}/wysiwyg/CKeditor.d.ts +1 -1
- package/lib/{v4/controls → controls}/wysiwyg/CKeditor.js +1 -1
- package/lib/{v4/datatable → datatable}/NodeTable.d.ts +1 -1
- package/lib/media-manager/AbstractMediaManager.d.ts +3 -3
- package/lib/media-manager/AbstractMediaManager.js +2 -2
- package/lib/media-manager/DefaultMediaManager.d.ts +1 -1
- package/lib/media-manager/DefaultMediaManager.js +6 -8
- package/lib/media-manager/Items.d.ts +2 -1
- package/lib/media-manager/Items.js +7 -0
- package/lib/media-manager/helpers/MediaManagerHelper.d.ts +10 -0
- package/lib/media-manager/helpers/MediaManagerHelper.js +27 -10
- package/lib/{v4/model → model}/AbstractModel.d.ts +12 -0
- package/lib/model/AbstractModel.js +178 -0
- package/lib/{v4/model → model}/ModelHandler.js +1 -1
- package/lib/{v4/model → model}/adapter/sequelize.d.ts +3 -4
- package/lib/{v4/model → model}/adapter/sequelize.js +41 -14
- package/lib/notifications/AbstractNotificationService.d.ts +163 -0
- package/lib/notifications/AbstractNotificationService.js +353 -0
- package/lib/notifications/GeneralNotificationService.d.ts +8 -0
- package/lib/notifications/GeneralNotificationService.js +61 -0
- package/lib/notifications/NotificationHandler.d.ts +27 -0
- package/lib/notifications/NotificationHandler.js +41 -0
- package/lib/notifications/SystemNotificationService.d.ts +19 -0
- package/lib/notifications/SystemNotificationService.js +173 -0
- package/lib/{v4/widgets → widgets}/abstractCustom.d.ts +1 -1
- package/lib/{v4/widgets → widgets}/abstractLink.d.ts +1 -1
- package/lib/{v4/widgets → widgets}/abstractWidgetBase.d.ts +1 -1
- package/lib/{v4/widgets → widgets}/widgetHandler.d.ts +2 -2
- package/migrations/index.d.ts +3 -0
- package/migrations/index.js +4 -0
- package/migrations/umzug/0001.d.ts +7 -0
- package/migrations/umzug/0001.js +121 -0
- package/migrations/umzugExports.d.ts +2 -0
- package/migrations/umzugExports.js +9 -0
- package/models/MediaManagerAP.d.ts +9 -3
- package/models/MediaManagerAP.js +11 -5
- package/models/MediaManagerAssociationsAP.d.ts +9 -3
- package/models/MediaManagerAssociationsAP.js +11 -5
- package/models/MediaManagerMetaAP.d.ts +9 -3
- package/models/MediaManagerMetaAP.js +11 -5
- package/models/NotificationAP.d.ts +44 -0
- package/models/NotificationAP.js +30 -0
- package/models/UserAP.d.ts +1 -1
- package/models/UserNotificationAP.d.ts +26 -0
- package/models/UserNotificationAP.js +18 -0
- package/package.json +17 -8
- package/system/Router.js +21 -7
- package/system/bindAssets.js +1 -0
- package/system/bindControls.js +6 -6
- package/system/bindInertia.js +9 -3
- package/system/bindMediaManager.js +2 -1
- package/system/bindNavigation.js +3 -4
- package/system/bindNotifications.d.ts +2 -0
- package/system/bindNotifications.js +14 -0
- package/system/bindReqFunctions.js +8 -25
- package/system/defaults.js +6 -0
- package/translations/ar.json +5 -4
- package/translations/cn.json +5 -4
- package/translations/de.json +72 -71
- package/translations/en.json +5 -4
- package/translations/es.json +5 -4
- package/translations/fr.json +5 -4
- package/translations/hi.json +5 -4
- package/translations/jp.json +5 -4
- package/translations/ko.json +5 -4
- package/translations/pt.json +5 -4
- package/translations/ru.json +2 -1
- package/translations/ua.json +5 -4
- package/translations/uz.json +73 -72
- package/translations/vi.json +5 -4
- package/ui/components/VanillaJSONEditor.d.ts +2 -0
- package/ui/components/VanillaJSONEditor.js +101 -0
- package/ui/components/handsontable.d.ts +10 -0
- package/ui/components/handsontable.js +51 -0
- package/ui/components/monaco-editor.d.ts +11 -0
- package/ui/components/monaco-editor.js +57 -0
- package/ui/components/ui/table.d.ts +1 -1
- package/ui/components/ui/table.js +2 -2
- package/ui/hooks/form-state.d.ts +4 -0
- package/ui/hooks/form-state.js +45 -0
- package/ui/hooks/use-appearance.d.ts +7 -0
- package/ui/hooks/use-appearance.js +76 -0
- package/ui/hooks/use-window-size.d.ts +5 -0
- package/ui/hooks/use-window-size.js +21 -0
- package/assets/VanillaJSONEditor-x8tDbio1.js +0 -3833
- package/assets/add-DOaZgoTz.js +0 -1
- package/assets/add-form-BjackXJe.js +0 -1
- package/assets/add-group-Br44s2D6.js +0 -1
- package/assets/add-group-form-YI6KS37x.js +0 -1
- package/assets/add-user-DWcH0s9-.js +0 -1
- package/assets/add-user-form-bv5BNX5A.js +0 -1
- package/assets/app-layout-DecN527i.js +0 -1
- package/assets/app-shell-DHzMWA1L.js +0 -1
- package/assets/app-sidebar-4JFP8UdU.js +0 -1
- package/assets/app-sidebar-header-CIKLfLsF.js +0 -1
- package/assets/breadcrumbs-Bo2z-LNC.js +0 -1
- package/assets/catalog-DVyrGTNR.js +0 -6
- package/assets/dashboard-Dy3pk9t7.js +0 -3
- package/assets/date-picker-B2z-aeuv.js +0 -1
- package/assets/debounce-D6eaSoDg.js +0 -1
- package/assets/del-modal-l3LxJWCN.js +0 -1
- package/assets/dynamic-controls-CSVVCONh.js +0 -1
- package/assets/field-renderer-BHo944Cn.js +0 -407
- package/assets/form-BXfnz6h5.js +0 -1
- package/assets/form-hP8sjbND.js +0 -1
- package/assets/form-state-702tb_BV.js +0 -1
- package/assets/geo-json-CVaNUZbb.js +0 -4
- package/assets/handsontable-CZQ5Ietj.js +0 -347
- package/assets/home-BD4MWmm9.js +0 -2
- package/assets/icon-C_X2cQ6W.js +0 -1
- package/assets/index-C148XJoK.js +0 -1
- package/assets/index-Vcq4gwWv.js +0 -1
- package/assets/init-user-DgCD4ZN1.js +0 -1
- package/assets/input-error-Bab-HPbn.js +0 -1
- package/assets/list-C-27EH39.js +0 -1
- package/assets/list-table-_OiQmr2A.js +0 -22
- package/assets/login-jzvVXgAV.js +0 -1
- package/assets/material-icon-DsiW0iQG.js +0 -1
- package/assets/media-manager-CSB_XRcE.js +0 -14
- package/assets/module-Ceq6vuwa.js +0 -1
- package/assets/monaco-editor-XX8Hz76f.js +0 -11
- package/assets/multi-select-BbKSrMw2.js +0 -1
- package/assets/nav-footer-B8gMV6Wp.js +0 -1
- package/assets/nav-main-BUp9qA8R.js +0 -1
- package/assets/nav-user-DeF3SDRj.js +0 -1
- package/assets/pagination-render-B9U_hVbB.js +0 -1
- package/assets/register-C6acWsLe.js +0 -1
- package/assets/theme-switcher-D8T9NgWG.js +0 -1
- package/assets/toast-editor-C0550yms.js +0 -845
- package/assets/use-appearance-CXP5cHaQ.js +0 -1
- package/assets/use-window-size-DLSEoR6e.js +0 -1
- package/assets/user-info-CAgkqARx.js +0 -1
- package/assets/user-menu-content-BxL0QMC9.js +0 -1
- package/assets/vanilla-picker-B6E6ObS_.js +0 -8
- package/assets/welcome-Dk7GoS5R.js +0 -1
- package/lib/v4/model/AbstractModel.js +0 -67
- package/lib/v4/model/adapter/typeorm.d.ts +0 -23
- package/lib/v4/model/adapter/typeorm.js +0 -68
- package/migrations/20230303171134-adminpanel-init.js +0 -122
- package/migrations/20231223215835-add-widgets.js +0 -32
- package/migrations/20240804191001-added-navigationap.js +0 -53
- package/migrations/20241121184236-v4-init.js +0 -134
- /package/lib/{v4/I18n.d.ts → I18n.d.ts} +0 -0
- /package/lib/{v4/POWCaptcha.d.ts → POWCaptcha.d.ts} +0 -0
- /package/lib/{v4/POWCaptcha.js → POWCaptcha.js} +0 -0
- /package/lib/{v4/catalog → catalog}/AbstractCatalog.js +0 -0
- /package/lib/{v4/catalog → catalog}/CatalogHandler.d.ts +0 -0
- /package/lib/{v4/catalog → catalog}/CatalogHandler.js +0 -0
- /package/lib/{v4/controls → controls}/AbstractControls.js +0 -0
- /package/lib/{v4/controls → controls}/ControlsHandler.d.ts +0 -0
- /package/lib/{v4/controls → controls}/ControlsHandler.js +0 -0
- /package/lib/{v4/controls → controls}/codeEditor/MonacoEditor.js +0 -0
- /package/lib/{v4/controls → controls}/geojsoneditor/GeoEditor.js +0 -0
- /package/lib/{v4/controls → controls}/jsoneditor/JsonEditor.js +0 -0
- /package/lib/{v4/controls → controls}/markdown/ToastUiEditor.js +0 -0
- /package/lib/{v4/controls → controls}/table/Handsontable.js +0 -0
- /package/lib/{v4/datatable → datatable}/NodeTable.js +0 -0
- /package/lib/{v4/helper → helper}/jwt.d.ts +0 -0
- /package/lib/{v4/helper → helper}/jwt.js +0 -0
- /package/lib/{v4/inertia → inertia}/flash.d.ts +0 -0
- /package/lib/{v4/inertia → inertia}/flash.js +0 -0
- /package/lib/{v4/inertia → inertia}/inertiaAdapter.d.ts +0 -0
- /package/lib/{v4/inertia → inertia}/inertiaAdapter.js +0 -0
- /package/lib/{v4/model → model}/ModelHandler.d.ts +0 -0
- /package/lib/{v4/model → model}/adapter/waterline.d.ts +0 -0
- /package/lib/{v4/model → model}/adapter/waterline.js +0 -0
- /package/lib/{v4/widgets → widgets}/abstractAction.d.ts +0 -0
- /package/lib/{v4/widgets → widgets}/abstractAction.js +0 -0
- /package/lib/{v4/widgets → widgets}/abstractCustom.js +0 -0
- /package/lib/{v4/widgets → widgets}/abstractInfo.d.ts +0 -0
- /package/lib/{v4/widgets → widgets}/abstractInfo.js +0 -0
- /package/lib/{v4/widgets → widgets}/abstractLink.js +0 -0
- /package/lib/{v4/widgets → widgets}/abstractSwitch.d.ts +0 -0
- /package/lib/{v4/widgets → widgets}/abstractSwitch.js +0 -0
- /package/lib/{v4/widgets → widgets}/abstractWidgetBase.js +0 -0
- /package/lib/{v4/widgets → widgets}/widgetHandler.js +0 -0
package/translations/jp.json
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"Actions": "アクション",
|
|
4
4
|
"All": "全て",
|
|
5
5
|
"Are you sure?": "本気ですか?",
|
|
6
|
-
"Back": "戻る",
|
|
7
|
-
"Back to Login": "ログインに戻ります",
|
|
8
|
-
"
|
|
6
|
+
"Back": "戻る",
|
|
7
|
+
"Back to Login": "ログインに戻ります",
|
|
8
|
+
"Additional login page": "追加のログインページ",
|
|
9
|
+
"Clean": "クリーン",
|
|
9
10
|
"Confirm Password": "パスワードを認証する",
|
|
10
11
|
"Confirm Password*": "パスワードを認証する*",
|
|
11
12
|
"Create": "作成する",
|
|
@@ -69,4 +70,4 @@
|
|
|
69
70
|
"You don't have any widgets selected yet. You can add them by clicking on the plus sign at the top right.": "まだ選択されているウィジェットはありません。右上のプラスサインをクリックして追加できます。",
|
|
70
71
|
"create": "作成する",
|
|
71
72
|
"create new": "新しいものを作成します"
|
|
72
|
-
}
|
|
73
|
+
}
|
package/translations/ko.json
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"Actions": "행위",
|
|
4
4
|
"All": "모두",
|
|
5
5
|
"Are you sure?": "확실합니까?",
|
|
6
|
-
"Back": "뒤쪽에",
|
|
7
|
-
"Back to Login": "로그인으로 돌아갑니다",
|
|
8
|
-
"
|
|
6
|
+
"Back": "뒤쪽에",
|
|
7
|
+
"Back to Login": "로그인으로 돌아갑니다",
|
|
8
|
+
"Additional login page": "추가 로그인 페이지",
|
|
9
|
+
"Clean": "깨끗한",
|
|
9
10
|
"Confirm Password": "비밀번호를 확인하십시오",
|
|
10
11
|
"Confirm Password*": "비밀번호 확인*",
|
|
11
12
|
"Create": "만들다",
|
|
@@ -69,4 +70,4 @@
|
|
|
69
70
|
"You don't have any widgets selected yet. You can add them by clicking on the plus sign at the top right.": "아직 위젯이 선택되지 않았습니다. 오른쪽 상단의 플러스 부호를 클릭하여 추가 할 수 있습니다.",
|
|
70
71
|
"create": "만들다",
|
|
71
72
|
"create new": "새로운 창조"
|
|
72
|
-
}
|
|
73
|
+
}
|
package/translations/pt.json
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"Actions": "Ações",
|
|
4
4
|
"All": "Todos",
|
|
5
5
|
"Are you sure?": "Tem certeza?",
|
|
6
|
-
"Back": "Voltar",
|
|
7
|
-
"Back to Login": "De volta ao login",
|
|
8
|
-
"
|
|
6
|
+
"Back": "Voltar",
|
|
7
|
+
"Back to Login": "De volta ao login",
|
|
8
|
+
"Additional login page": "Página adicional de login",
|
|
9
|
+
"Clean": "Limpar",
|
|
9
10
|
"Confirm Password": "Confirme sua senha",
|
|
10
11
|
"Confirm Password*": "Confirme sua senha*",
|
|
11
12
|
"Create": "Criar",
|
|
@@ -69,4 +70,4 @@
|
|
|
69
70
|
"You don't have any widgets selected yet. You can add them by clicking on the plus sign at the top right.": "Você ainda não tem widgets selecionados. Você pode adicioná -los clicando no sinal de mais no canto superior direito.",
|
|
70
71
|
"create": "criar",
|
|
71
72
|
"create new": "Crie novo"
|
|
72
|
-
}
|
|
73
|
+
}
|
package/translations/ru.json
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"Are you sure?": "Вы уверены?",
|
|
6
6
|
"Back": " Назад",
|
|
7
7
|
"Back to Login": "Назад ко входу",
|
|
8
|
+
"Additional login page": "Дополнительная страница входа",
|
|
8
9
|
"Clean": "Очистить",
|
|
9
10
|
"Confirm Password": "Подтвердите пароль",
|
|
10
11
|
"Confirm Password*": "Подтвердите пароль*",
|
|
@@ -118,4 +119,4 @@
|
|
|
118
119
|
"W x H (orig.)": "W x H (orig.)",
|
|
119
120
|
"Sizes/Ver": "Sizes/Ver",
|
|
120
121
|
"Locales": "Locales"
|
|
121
|
-
}
|
|
122
|
+
}
|
package/translations/ua.json
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"Actions": "Дії",
|
|
4
4
|
"All": "Все",
|
|
5
5
|
"Are you sure?": "Ви впевнені?",
|
|
6
|
-
"Back": "Спинка",
|
|
7
|
-
"Back to Login": "Назад до входу",
|
|
8
|
-
"
|
|
6
|
+
"Back": "Спинка",
|
|
7
|
+
"Back to Login": "Назад до входу",
|
|
8
|
+
"Additional login page": "Додаткова сторінка входу",
|
|
9
|
+
"Clean": "Чистий",
|
|
9
10
|
"Confirm Password": "Підтвердити пароль",
|
|
10
11
|
"Confirm Password*": "Підтвердити пароль*",
|
|
11
12
|
"Create": "Створити",
|
|
@@ -69,4 +70,4 @@
|
|
|
69
70
|
"You don't have any widgets selected yet. You can add them by clicking on the plus sign at the top right.": "У вас ще не вибрано жодних віджетів. Ви можете додати їх, натиснувши на знак плюс у верхній частині праворуч.",
|
|
70
71
|
"create": "створити",
|
|
71
72
|
"create new": "створити нове"
|
|
72
|
-
}
|
|
73
|
+
}
|
package/translations/uz.json
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Action completed": "Harakat tugadi",
|
|
3
|
-
"Actions": "Harakatlar",
|
|
4
|
-
"All": "Hamma",
|
|
5
|
-
"Are you sure?": "Ishonasizmi?",
|
|
6
|
-
"Back": "Orqaga qaytish",
|
|
7
|
-
"Back to Login": "Kirish uchun qaytish",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"Confirm Password
|
|
11
|
-
"
|
|
12
|
-
"Create
|
|
13
|
-
"Create
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"Full
|
|
22
|
-
"
|
|
23
|
-
"Group
|
|
24
|
-
"Group
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"Is
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"No
|
|
36
|
-
"No
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"Record was removed
|
|
49
|
-
"Record was
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"Select
|
|
57
|
-
"Select
|
|
58
|
-
"Select
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"User
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"create
|
|
72
|
-
|
|
1
|
+
{
|
|
2
|
+
"Action completed": "Harakat tugadi",
|
|
3
|
+
"Actions": "Harakatlar",
|
|
4
|
+
"All": "Hamma",
|
|
5
|
+
"Are you sure?": "Ishonasizmi?",
|
|
6
|
+
"Back": "Orqaga qaytish",
|
|
7
|
+
"Back to Login": "Kirish uchun qaytish",
|
|
8
|
+
"Additional login page": "Qo'shimcha kirish sahifasi",
|
|
9
|
+
"Clean": "Tozalamoq",
|
|
10
|
+
"Confirm Password": "Parolni tasdiqlang",
|
|
11
|
+
"Confirm Password*": "Parolni tasdiqlang*",
|
|
12
|
+
"Create": "Yaratmoq",
|
|
13
|
+
"Create a new administrator": "Yangi ma'mur yarating",
|
|
14
|
+
"Create an Account": "Hisob ochish",
|
|
15
|
+
"Custom": "Odat",
|
|
16
|
+
"Delete": "O'chirmoq",
|
|
17
|
+
"E-mail": "Elektron pochta",
|
|
18
|
+
"Edit": "Tahrirlamoq",
|
|
19
|
+
"Email": "Elektron pochta",
|
|
20
|
+
"Fast links": "Tez havolalar",
|
|
21
|
+
"Full Name": "To'liq ism",
|
|
22
|
+
"Full name": "To'liq ism",
|
|
23
|
+
"Group description": "Guruh tavsifi",
|
|
24
|
+
"Group name": "Guruh nomi",
|
|
25
|
+
"Group settings": "Guruh sozlamalari",
|
|
26
|
+
"Info": "Ma'lumot",
|
|
27
|
+
"Is Administrator": "Bu ma'mur",
|
|
28
|
+
"Is confirmed": "Tasdiqlangan",
|
|
29
|
+
"Link": "Bog'lamoq",
|
|
30
|
+
"Locale": "Mahalliy",
|
|
31
|
+
"Log in": "Tizimga kirish",
|
|
32
|
+
"Login": "Tizimga kirish",
|
|
33
|
+
"Members": "A'zolari",
|
|
34
|
+
"New record was created": "Yangi rekord yaratildi",
|
|
35
|
+
"No": "Yo'q",
|
|
36
|
+
"No records found !": "Yozuvlar topilmadi!",
|
|
37
|
+
"No widgets found": "Vidjetlar topilmadi",
|
|
38
|
+
"Not found": "Topilmadi",
|
|
39
|
+
"OR": "Yoki",
|
|
40
|
+
"Open in a new window": "Yangi oynada oching",
|
|
41
|
+
"Password": "Parol",
|
|
42
|
+
"Passwords do not match!": "Parollar mos kelmaydi!",
|
|
43
|
+
"Performing an action...": "Harakatni bajarish ...",
|
|
44
|
+
"Please fill out the fields below": "Iltimos, quyidagi maydonlarni to'ldiring",
|
|
45
|
+
"Pretend to be a user": "Foydalanuvchi deb da'vo qiling",
|
|
46
|
+
"Profile expires": "Profil muddati tugaydi",
|
|
47
|
+
"Quick actions": "Tez harakatlar",
|
|
48
|
+
"Record was not removed": "Yozuv olib tashlanmadi",
|
|
49
|
+
"Record was removed successfully !": "Yozuv muvaffaqiyatli olib tashlandi!",
|
|
50
|
+
"Record was updated": "Yozuv yangilandi",
|
|
51
|
+
"Register": "Ro'yxatga olmoq",
|
|
52
|
+
"Repeat password": "Parolni qayta kiriting",
|
|
53
|
+
"Reset": "Qayta o'rnatmoq",
|
|
54
|
+
"Save": "Tejash",
|
|
55
|
+
"Search": "Qidirish",
|
|
56
|
+
"Select": "Tanlamoq",
|
|
57
|
+
"Select Ids": "IDS-ni tanlang",
|
|
58
|
+
"Select Item type": "Element turi-ni tanlang",
|
|
59
|
+
"Select Items": "Elementlarni tanlang",
|
|
60
|
+
"Switcher": "O'zgartirmoq",
|
|
61
|
+
"Timezone": "Vaqtincha",
|
|
62
|
+
"Title": "Sarlavha",
|
|
63
|
+
"Toggle to change the grid. To save the grid, turn it off.": "Panjarani o'zgartirish uchun almashtiring. Gridni saqlash uchun uni o'chiring.",
|
|
64
|
+
"User groups": "Foydalanuvchi guruhlari",
|
|
65
|
+
"User settings": "Foydalanuvchi parametrlari",
|
|
66
|
+
"Values in \"password\" and \"repeatPassword\" fields should be the same": "\"Parol\" va \"Raqamli\" maydonidagi qiymatlar bir xil bo'lishi kerak",
|
|
67
|
+
"View": "Qarash",
|
|
68
|
+
"Welcome": "Xush kelibsiz",
|
|
69
|
+
"Yes": "Ha",
|
|
70
|
+
"You don't have any widgets selected yet. You can add them by clicking on the plus sign at the top right.": "Sizda hali tanlangan hech qanday vidjet yo'q. Siz ularni yuqori o'ng tomonda plyus belgisini bosish orqali qo'shishingiz mumkin.",
|
|
71
|
+
"create": "yaratmoq",
|
|
72
|
+
"create new": "Yangi yarating"
|
|
73
|
+
}
|
package/translations/vi.json
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"Actions": "Hành động",
|
|
4
4
|
"All": "Tất cả",
|
|
5
5
|
"Are you sure?": "Bạn có chắc không?",
|
|
6
|
-
"Back": "Mặt sau",
|
|
7
|
-
"Back to Login": "Quay lại để đăng nhập",
|
|
8
|
-
"
|
|
6
|
+
"Back": "Mặt sau",
|
|
7
|
+
"Back to Login": "Quay lại để đăng nhập",
|
|
8
|
+
"Additional login page": "Trang đăng nhập bổ sung",
|
|
9
|
+
"Clean": "Lau dọn",
|
|
9
10
|
"Confirm Password": "Xác nhận mật khẩu",
|
|
10
11
|
"Confirm Password*": "Xác nhận mật khẩu*",
|
|
11
12
|
"Create": "Tạo nên",
|
|
@@ -69,4 +70,4 @@
|
|
|
69
70
|
"You don't have any widgets selected yet. You can add them by clicking on the plus sign at the top right.": "Bạn chưa có bất kỳ vật dụng nào được chọn. Bạn có thể thêm chúng bằng cách nhấp vào dấu cộng ở phía trên bên phải.",
|
|
70
71
|
"create": "tạo nên",
|
|
71
72
|
"create new": "Tạo mới"
|
|
72
|
-
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createJSONEditor, createAjvValidator } from 'vanilla-jsoneditor';
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useAppearance } from "@/hooks/use-appearance";
|
|
5
|
+
import { setFieldError } from "@/hooks/form-state";
|
|
6
|
+
export default function VanillaJSONEditor(props) {
|
|
7
|
+
const refContainer = useRef(null);
|
|
8
|
+
const refEditor = useRef(null);
|
|
9
|
+
const refPrevProps = useRef(props);
|
|
10
|
+
const { appearance } = useAppearance();
|
|
11
|
+
const [theme, setTheme] = useState('');
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (appearance === 'dark') {
|
|
14
|
+
setTheme('jse-theme-dark');
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
setTheme('');
|
|
18
|
+
}
|
|
19
|
+
}, [appearance]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const validator = props.schema ? createAjvValidator({ schema: props.schema }) : undefined;
|
|
22
|
+
const content = props.content ? { json: props.content } : props.json ? { json: props.json } : undefined;
|
|
23
|
+
refEditor.current = createJSONEditor({
|
|
24
|
+
target: refContainer.current,
|
|
25
|
+
props: {
|
|
26
|
+
...props,
|
|
27
|
+
validator,
|
|
28
|
+
content,
|
|
29
|
+
onChange: (content, previousContent, status) => {
|
|
30
|
+
if (validator) {
|
|
31
|
+
const isEmpty = content.json === undefined;
|
|
32
|
+
const validationError = isEmpty
|
|
33
|
+
? ['error']
|
|
34
|
+
: status.contentErrors?.validationErrors;
|
|
35
|
+
setFieldError(props.name, !!validationError?.length, 'Error validation JSON schema');
|
|
36
|
+
}
|
|
37
|
+
if (props.onChange) {
|
|
38
|
+
props.onChange(content, previousContent, status);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
// Trigger onChange manually
|
|
44
|
+
if (refEditor.current) {
|
|
45
|
+
// Get the current content
|
|
46
|
+
const currentContent = refEditor.current.get();
|
|
47
|
+
// Validate the content
|
|
48
|
+
const validationResult = refEditor.current.validate();
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
const hasErrors = !!validationResult?.validationErrors?.length;
|
|
51
|
+
if (props.onChange) {
|
|
52
|
+
props.onChange(currentContent,
|
|
53
|
+
//@ts-ignore
|
|
54
|
+
undefined, {
|
|
55
|
+
contentErrors: validationResult,
|
|
56
|
+
patchResult: undefined,
|
|
57
|
+
isUndo: false,
|
|
58
|
+
isRedo: false,
|
|
59
|
+
isValid: !hasErrors
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// Set the error state
|
|
63
|
+
setFieldError(props.name, hasErrors, 'Error validation JSON schema');
|
|
64
|
+
}
|
|
65
|
+
return () => {
|
|
66
|
+
// destroy editor
|
|
67
|
+
if (refEditor.current) {
|
|
68
|
+
refEditor.current.destroy();
|
|
69
|
+
refEditor.current = null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
// update props
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (refEditor.current) {
|
|
76
|
+
// only pass the props that actually changed
|
|
77
|
+
// since the last time to prevent syncing issues
|
|
78
|
+
const changedProps = filterUnchangedProps(props, refPrevProps.current);
|
|
79
|
+
refEditor.current.updateProps(changedProps);
|
|
80
|
+
refPrevProps.current = props;
|
|
81
|
+
}
|
|
82
|
+
}, [props]);
|
|
83
|
+
return _jsx("div", { className: `vanilla-jsoneditor-react ${theme} ${props.disabled ? 'pointer-events-none opacity-50 cursor-not-allowed' : ''}`, ref: refContainer });
|
|
84
|
+
}
|
|
85
|
+
function filterUnchangedProps(props, prevProps) {
|
|
86
|
+
const changedProps = {};
|
|
87
|
+
for (const [key, value] of Object.entries(props)) {
|
|
88
|
+
if (key === 'content') {
|
|
89
|
+
const currentJson = value?.json;
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
const prevJson = prevProps[key]?.json;
|
|
92
|
+
if (JSON.stringify(currentJson) !== JSON.stringify(prevJson)) {
|
|
93
|
+
changedProps[key] = value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else if (value !== prevProps[key]) {
|
|
97
|
+
changedProps[key] = value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return changedProps;
|
|
101
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GridSettings } from "handsontable/settings";
|
|
2
|
+
import { RowObject } from "handsontable/common";
|
|
3
|
+
interface TableProps {
|
|
4
|
+
config: GridSettings;
|
|
5
|
+
data?: any[][] | RowObject[] | undefined;
|
|
6
|
+
onChange: (data: any) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const HandsonTable: ({ config, data, onChange, disabled }: TableProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default HandsonTable;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HotTable, HotColumn } from '@handsontable/react';
|
|
3
|
+
import { registerAllModules } from 'handsontable/registry';
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { useAppearance } from "@/hooks/use-appearance";
|
|
6
|
+
import { registerLanguageDictionary, deDE, enUS, esMX, frFR, itIT, jaJP, koKR, nlNL, plPL, ptBR, ruRU, zhCN } from 'handsontable/i18n';
|
|
7
|
+
registerAllModules();
|
|
8
|
+
const languageDictionaries = {
|
|
9
|
+
'de': deDE,
|
|
10
|
+
'en': enUS,
|
|
11
|
+
'es': esMX,
|
|
12
|
+
'fr': frFR,
|
|
13
|
+
'it': itIT,
|
|
14
|
+
'ja': jaJP,
|
|
15
|
+
'ko': koKR,
|
|
16
|
+
'nl': nlNL,
|
|
17
|
+
'pl': plPL,
|
|
18
|
+
'pt': ptBR,
|
|
19
|
+
'ru': ruRU,
|
|
20
|
+
'zh': zhCN,
|
|
21
|
+
};
|
|
22
|
+
const docLang = document.documentElement.lang;
|
|
23
|
+
const lang = languageDictionaries[docLang] ?? languageDictionaries['en'];
|
|
24
|
+
registerLanguageDictionary(lang);
|
|
25
|
+
const HandsonTable = ({ config, data = [], onChange, disabled }) => {
|
|
26
|
+
const { appearance } = useAppearance();
|
|
27
|
+
const [theme, setTheme] = useState('ht-theme-main');
|
|
28
|
+
const handleChange = useCallback((_changes, source) => {
|
|
29
|
+
if (source === 'loadData') {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const hotData = hotTableRef.current?.hotInstance?.getSourceData();
|
|
33
|
+
onChange(hotData);
|
|
34
|
+
}, []);
|
|
35
|
+
const hotTableRef = useRef(null);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (hotTableRef.current) {
|
|
38
|
+
hotTableRef.current.hotInstance.loadData(data);
|
|
39
|
+
}
|
|
40
|
+
}, [data]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (appearance === 'dark') {
|
|
43
|
+
setTheme('ht-theme-main-dark');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
setTheme('ht-theme-main');
|
|
47
|
+
}
|
|
48
|
+
}, [appearance]);
|
|
49
|
+
return (_jsx(HotTable, { className: disabled ? 'pointer-events-none opacity-50' : '', themeName: theme, language: lang.languageCode, ref: hotTableRef, ...config, afterChange: handleChange, children: config.columns.map((item) => (_jsx(HotColumn, { data: item.data, ...item }, item.data))) }));
|
|
50
|
+
};
|
|
51
|
+
export default HandsonTable;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
interface MonacoEditorProps {
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
value: string;
|
|
5
|
+
options: {
|
|
6
|
+
language: string;
|
|
7
|
+
};
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const MonacoEditor: FC<MonacoEditorProps>;
|
|
11
|
+
export default MonacoEditor;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Editor from '@monaco-editor/react';
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { useAppearance } from "@/hooks/use-appearance";
|
|
5
|
+
import useWindowSize from "@/hooks/use-window-size";
|
|
6
|
+
const MonacoEditor = ({ onChange, value, options, disabled }) => {
|
|
7
|
+
const { appearance } = useAppearance();
|
|
8
|
+
const [theme, setTheme] = useState('light');
|
|
9
|
+
const editorRef = useRef(null);
|
|
10
|
+
const editorWrapperRef = useRef(null);
|
|
11
|
+
const { width } = useWindowSize();
|
|
12
|
+
// Device type detection
|
|
13
|
+
const isMobile = width < 768;
|
|
14
|
+
const isTablet = width >= 768 && width < 1024;
|
|
15
|
+
const handleEditorChange = (value) => {
|
|
16
|
+
onChange(value);
|
|
17
|
+
};
|
|
18
|
+
const handleEditorDidMount = (editor) => {
|
|
19
|
+
editorRef.current = editor;
|
|
20
|
+
updateEditorOptions();
|
|
21
|
+
};
|
|
22
|
+
const updateEditorOptions = () => {
|
|
23
|
+
if (!editorRef.current)
|
|
24
|
+
return;
|
|
25
|
+
const options = {
|
|
26
|
+
minimap: { enabled: !isMobile },
|
|
27
|
+
fontSize: isMobile ? 12 : isTablet ? 13 : 14,
|
|
28
|
+
lineNumbers: isMobile ? 'off' : 'on',
|
|
29
|
+
lineDecorationsWidth: isMobile ? 5 : 10,
|
|
30
|
+
scrollBeyondLastLine: !isMobile,
|
|
31
|
+
wordWrap: isMobile ? 'on' : 'bounded',
|
|
32
|
+
renderWhitespace: isMobile ? 'none' : 'selection',
|
|
33
|
+
padding: { top: isMobile ? 8 : 16, bottom: isMobile ? 8 : 16 }
|
|
34
|
+
};
|
|
35
|
+
editorRef.current.updateOptions(options);
|
|
36
|
+
editorWrapperRef.current?.classList.add('overflow-hidden');
|
|
37
|
+
// Small delay to ensure that the editor has been fully rendered
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
editorRef.current?.layout();
|
|
40
|
+
editorWrapperRef.current?.classList.remove('overflow-hidden');
|
|
41
|
+
}, 100);
|
|
42
|
+
};
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setTheme(appearance === 'dark' ? 'vs-dark' : 'light');
|
|
45
|
+
}, [appearance]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
updateEditorOptions();
|
|
48
|
+
}, [width]);
|
|
49
|
+
// Вычисляем высоту редактора
|
|
50
|
+
const editorHeight = isMobile ? '300px' : isTablet ? '400px' : '500px';
|
|
51
|
+
return (_jsx("div", { className: `border rounded-lg ${isMobile ? 'p-1' : 'p-2'}`, ref: editorWrapperRef, children: _jsx(Editor, { height: editorHeight, language: options.language, value: value, theme: theme, options: {
|
|
52
|
+
automaticLayout: true,
|
|
53
|
+
...(isMobile && { wordWrap: 'on' }),
|
|
54
|
+
minimap: { enabled: !isMobile }
|
|
55
|
+
}, onChange: handleEditorChange, onMount: handleEditorDidMount, className: `transition-all duration-200 ease-in-out ${disabled ? 'pointer-events-none opacity-50 cursor-not-allowed' : ''}` }) }));
|
|
56
|
+
};
|
|
57
|
+
export default MonacoEditor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare function Table({ className, wrapperHeight, ...props }: React.ComponentProps<"table"> & {
|
|
2
|
+
declare function Table({ className, wrapperHeight, ref, ...props }: React.ComponentProps<"table"> & {
|
|
3
3
|
wrapperHeight?: string;
|
|
4
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@/lib/utils";
|
|
3
|
-
function Table({ className, wrapperHeight, ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "table-container", className: cn('relative w-full overflow-x-auto', wrapperHeight), children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
3
|
+
function Table({ className, wrapperHeight, ref, ...props }) {
|
|
4
|
+
return (_jsx("div", { "data-slot": "table-container", ref: ref, className: cn('relative w-full overflow-x-auto', wrapperHeight), children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
5
5
|
}
|
|
6
6
|
function TableHeader({ className, ...props }) {
|
|
7
7
|
return (_jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b", className), ...props }));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const setFieldError: (fieldName: string, hasError: boolean, message?: string) => void;
|
|
2
|
+
export declare const getFieldError: (fieldName: string) => string | undefined;
|
|
3
|
+
export declare const hasFormErrors: () => boolean;
|
|
4
|
+
export declare const resetFormErrors: () => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const formState = {
|
|
2
|
+
errors: {},
|
|
3
|
+
};
|
|
4
|
+
const formStateProxy = new Proxy(formState, {
|
|
5
|
+
set(target, property, value) {
|
|
6
|
+
if (property === 'errors') {
|
|
7
|
+
if (Object.keys(value).length === 0) {
|
|
8
|
+
// Reset all errors
|
|
9
|
+
target.errors = {};
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
// Update specific errors
|
|
13
|
+
target.errors = { ...target.errors, ...value };
|
|
14
|
+
}
|
|
15
|
+
// console.debug('Form errors updated:', target.errors);
|
|
16
|
+
// window.dispatchEvent(new CustomEvent('formStateChanged'));
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
export const setFieldError = (fieldName, hasError, message) => {
|
|
22
|
+
if (!hasError) {
|
|
23
|
+
// If clearing error, remove it from the errors object
|
|
24
|
+
const { [fieldName]: _, ...rest } = formStateProxy.errors;
|
|
25
|
+
formStateProxy.errors = rest;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
formStateProxy.errors = {
|
|
29
|
+
...formStateProxy.errors,
|
|
30
|
+
[fieldName]: {
|
|
31
|
+
hasError: true,
|
|
32
|
+
message
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export const getFieldError = (fieldName) => {
|
|
38
|
+
return formStateProxy.errors[fieldName]?.message;
|
|
39
|
+
};
|
|
40
|
+
export const hasFormErrors = () => {
|
|
41
|
+
return Object.values(formStateProxy.errors).some(error => error.hasError);
|
|
42
|
+
};
|
|
43
|
+
export const resetFormErrors = () => {
|
|
44
|
+
formStateProxy.errors = {};
|
|
45
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type Appearance = 'light' | 'dark' | 'system';
|
|
2
|
+
export declare function initializeTheme(): void;
|
|
3
|
+
export declare function useAppearance(): {
|
|
4
|
+
readonly appearance: Appearance;
|
|
5
|
+
readonly updateAppearance: (mode: Appearance) => void;
|
|
6
|
+
readonly isThemeChanging: boolean;
|
|
7
|
+
};
|