@simplysm/solid 13.0.69 → 13.0.71
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 +168 -195
- package/dist/components/data/calendar/Calendar.d.ts.map +1 -1
- package/dist/components/data/calendar/Calendar.js +15 -2
- package/dist/components/data/calendar/Calendar.js.map +2 -2
- package/dist/components/data/kanban/KanbanContext.js +2 -2
- package/dist/components/data/kanban/KanbanContext.js.map +1 -1
- package/dist/components/data/list/List.d.ts +8 -8
- package/dist/components/data/list/ListContext.d.ts +1 -1
- package/dist/components/data/list/ListItem.d.ts +15 -15
- package/dist/components/data/sheet/DataSheet.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheet.js +6 -4
- package/dist/components/data/sheet/DataSheet.js.map +2 -2
- package/dist/components/data/sheet/DataSheetConfigDialog.js +8 -8
- package/dist/components/data/sheet/DataSheetConfigDialog.js.map +1 -1
- package/dist/components/data/sheet/types.d.ts +4 -4
- package/dist/components/data/sheet/types.d.ts.map +1 -1
- package/dist/components/disclosure/Collapse.d.ts +4 -4
- package/dist/components/disclosure/Dialog.d.ts +24 -24
- package/dist/components/disclosure/Dialog.d.ts.map +1 -1
- package/dist/components/disclosure/Dialog.js +7 -2
- package/dist/components/disclosure/Dialog.js.map +2 -2
- package/dist/components/disclosure/DialogContext.d.ts +25 -25
- package/dist/components/disclosure/DialogContext.d.ts.map +1 -1
- package/dist/components/disclosure/DialogContext.js +1 -1
- package/dist/components/disclosure/DialogContext.js.map +1 -1
- package/dist/components/disclosure/DialogInstanceContext.d.ts +7 -7
- package/dist/components/disclosure/DialogInstanceContext.d.ts.map +1 -1
- package/dist/components/disclosure/DialogProvider.d.ts +3 -3
- package/dist/components/disclosure/Dropdown.d.ts +26 -24
- package/dist/components/disclosure/Dropdown.d.ts.map +1 -1
- package/dist/components/disclosure/Dropdown.js +24 -8
- package/dist/components/disclosure/Dropdown.js.map +2 -2
- package/dist/components/disclosure/Tabs.js +1 -1
- package/dist/components/disclosure/Tabs.js.map +1 -1
- package/dist/components/disclosure/dialogZIndex.d.ts +9 -7
- package/dist/components/disclosure/dialogZIndex.d.ts.map +1 -1
- package/dist/components/disclosure/dialogZIndex.js +4 -0
- package/dist/components/disclosure/dialogZIndex.js.map +1 -1
- package/dist/components/features/crud-detail/CrudDetail.d.ts.map +1 -1
- package/dist/components/features/crud-detail/CrudDetail.js +34 -22
- package/dist/components/features/crud-detail/CrudDetail.js.map +2 -2
- package/dist/components/features/crud-sheet/CrudSheet.d.ts.map +1 -1
- package/dist/components/features/crud-sheet/CrudSheet.js +48 -33
- package/dist/components/features/crud-sheet/CrudSheet.js.map +2 -2
- package/dist/components/features/crudRegistry.d.ts +16 -0
- package/dist/components/features/crudRegistry.d.ts.map +1 -0
- package/dist/components/features/crudRegistry.js +37 -0
- package/dist/components/features/crudRegistry.js.map +6 -0
- package/dist/components/features/data-select-button/DataSelectButton.d.ts +14 -14
- package/dist/components/features/data-select-button/DataSelectButton.d.ts.map +1 -1
- package/dist/components/features/data-select-button/DataSelectButton.js +27 -9
- package/dist/components/features/data-select-button/DataSelectButton.js.map +2 -2
- package/dist/components/features/permission-table/PermissionTable.d.ts +3 -3
- package/dist/components/features/permission-table/PermissionTable.d.ts.map +1 -1
- package/dist/components/features/permission-table/PermissionTable.js +74 -85
- package/dist/components/features/permission-table/PermissionTable.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelect.d.ts +12 -12
- package/dist/components/features/shared-data/SharedDataSelect.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelect.js +10 -6
- package/dist/components/features/shared-data/SharedDataSelect.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelectButton.d.ts +10 -10
- package/dist/components/features/shared-data/SharedDataSelectButton.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectList.d.ts +23 -15
- package/dist/components/features/shared-data/SharedDataSelectList.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectList.js +191 -65
- package/dist/components/features/shared-data/SharedDataSelectList.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelectListContext.d.ts +15 -0
- package/dist/components/features/shared-data/SharedDataSelectListContext.d.ts.map +1 -0
- package/dist/components/features/shared-data/SharedDataSelectListContext.js +27 -0
- package/dist/components/features/shared-data/SharedDataSelectListContext.js.map +6 -0
- package/dist/components/feedback/Progress.d.ts +1 -1
- package/dist/components/feedback/Progress.d.ts.map +1 -1
- package/dist/components/feedback/busy/BusyContainer.d.ts +2 -2
- package/dist/components/feedback/busy/BusyContainer.d.ts.map +1 -1
- package/dist/components/feedback/busy/BusyContext.d.ts +11 -11
- package/dist/components/feedback/busy/BusyContext.d.ts.map +1 -1
- package/dist/components/feedback/busy/BusyContext.js +1 -1
- package/dist/components/feedback/busy/BusyContext.js.map +1 -1
- package/dist/components/feedback/busy/BusyProvider.d.ts +6 -6
- package/dist/components/feedback/busy/BusyProvider.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationBanner.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationBanner.js +7 -3
- package/dist/components/feedback/notification/NotificationBanner.js.map +2 -2
- package/dist/components/feedback/notification/NotificationBell.js +2 -2
- package/dist/components/feedback/notification/NotificationBell.js.map +1 -1
- package/dist/components/feedback/notification/NotificationContext.d.ts +22 -22
- package/dist/components/feedback/notification/NotificationContext.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationContext.js +1 -1
- package/dist/components/feedback/notification/NotificationContext.js.map +1 -1
- package/dist/components/feedback/notification/NotificationProvider.d.ts +5 -5
- package/dist/components/feedback/notification/NotificationProvider.js +1 -1
- package/dist/components/feedback/notification/NotificationProvider.js.map +1 -1
- package/dist/components/feedback/print/PrintContext.js +1 -1
- package/dist/components/feedback/print/PrintContext.js.map +1 -1
- package/dist/components/form-control/DropdownTrigger.styles.d.ts +1 -1
- package/dist/components/form-control/DropdownTrigger.styles.d.ts.map +1 -1
- package/dist/components/form-control/ThemeToggle.d.ts +7 -7
- package/dist/components/form-control/ThemeToggle.d.ts.map +1 -1
- package/dist/components/form-control/ThemeToggle.js +3 -3
- package/dist/components/form-control/checkbox/Checkbox.js +1 -1
- package/dist/components/form-control/checkbox/CheckboxGroup.js +1 -1
- package/dist/components/form-control/checkbox/Radio.js +1 -1
- package/dist/components/form-control/checkbox/RadioGroup.js +1 -1
- package/dist/components/form-control/color-picker/ColorPicker.d.ts +12 -12
- package/dist/components/form-control/color-picker/ColorPicker.d.ts.map +1 -1
- package/dist/components/form-control/color-picker/ColorPicker.js +2 -2
- package/dist/components/form-control/combobox/Combobox.d.ts +22 -22
- package/dist/components/form-control/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/form-control/combobox/Combobox.js +2 -2
- package/dist/components/form-control/combobox/ComboboxContext.d.ts +4 -4
- package/dist/components/form-control/combobox/ComboboxContext.d.ts.map +1 -1
- package/dist/components/form-control/combobox/ComboboxContext.js +1 -1
- package/dist/components/form-control/combobox/ComboboxContext.js.map +1 -1
- package/dist/components/form-control/combobox/ComboboxItem.d.ts +3 -3
- package/dist/components/form-control/combobox/ComboboxItem.d.ts.map +1 -1
- package/dist/components/form-control/date-range-picker/DateRangePicker.d.ts +14 -14
- package/dist/components/form-control/date-range-picker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/form-control/date-range-picker/DateRangePicker.js +20 -9
- package/dist/components/form-control/date-range-picker/DateRangePicker.js.map +2 -2
- package/dist/components/form-control/editor/EditorToolbar.d.ts.map +1 -1
- package/dist/components/form-control/editor/EditorToolbar.js +65 -20
- package/dist/components/form-control/editor/EditorToolbar.js.map +2 -2
- package/dist/components/form-control/editor/RichTextEditor.d.ts +6 -6
- package/dist/components/form-control/editor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/form-control/editor/RichTextEditor.js +1 -1
- package/dist/components/form-control/editor/editor.css +5 -5
- package/dist/components/form-control/field/DatePicker.d.ts +22 -22
- package/dist/components/form-control/field/DatePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DatePicker.js +4 -4
- package/dist/components/form-control/field/DatePicker.js.map +1 -1
- package/dist/components/form-control/field/DateTimePicker.d.ts +21 -21
- package/dist/components/form-control/field/DateTimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DateTimePicker.js +4 -4
- package/dist/components/form-control/field/DateTimePicker.js.map +1 -1
- package/dist/components/form-control/field/FieldPlaceholder.d.ts +1 -1
- package/dist/components/form-control/field/FieldPlaceholder.d.ts.map +1 -1
- package/dist/components/form-control/field/NumberInput.d.ts +23 -23
- package/dist/components/form-control/field/NumberInput.d.ts.map +1 -1
- package/dist/components/form-control/field/NumberInput.js +4 -4
- package/dist/components/form-control/field/NumberInput.js.map +1 -1
- package/dist/components/form-control/field/TextInput.d.ts +25 -25
- package/dist/components/form-control/field/TextInput.d.ts.map +1 -1
- package/dist/components/form-control/field/TextInput.js +5 -5
- package/dist/components/form-control/field/TextInput.js.map +1 -1
- package/dist/components/form-control/field/Textarea.d.ts +19 -19
- package/dist/components/form-control/field/Textarea.d.ts.map +1 -1
- package/dist/components/form-control/field/Textarea.js +4 -4
- package/dist/components/form-control/field/Textarea.js.map +1 -1
- package/dist/components/form-control/field/TimePicker.d.ts +20 -20
- package/dist/components/form-control/field/TimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/TimePicker.js +4 -4
- package/dist/components/form-control/field/TimePicker.js.map +1 -1
- package/dist/components/form-control/numpad/Numpad.d.ts +11 -11
- package/dist/components/form-control/numpad/Numpad.d.ts.map +1 -1
- package/dist/components/form-control/select/Select.d.ts +26 -26
- package/dist/components/form-control/select/Select.d.ts.map +1 -1
- package/dist/components/form-control/select/Select.js +34 -23
- package/dist/components/form-control/select/Select.js.map +2 -2
- package/dist/components/form-control/select/SelectContext.d.ts +7 -7
- package/dist/components/form-control/select/SelectContext.d.ts.map +1 -1
- package/dist/components/form-control/select/SelectContext.js +1 -1
- package/dist/components/form-control/select/SelectContext.js.map +1 -1
- package/dist/components/form-control/select/SelectItem.d.ts +4 -4
- package/dist/components/form-control/select/SelectItem.d.ts.map +1 -1
- package/dist/components/form-control/state-preset/StatePreset.js +8 -8
- package/dist/components/form-control/state-preset/StatePreset.js.map +1 -1
- package/dist/components/layout/FormTable.js +4 -4
- package/dist/components/layout/sidebar/Sidebar.d.ts +5 -5
- package/dist/components/layout/sidebar/SidebarContainer.d.ts +11 -11
- package/dist/components/layout/sidebar/SidebarContainer.d.ts.map +1 -1
- package/dist/components/layout/sidebar/SidebarContainer.js +6 -1
- package/dist/components/layout/sidebar/SidebarContainer.js.map +2 -2
- package/dist/components/layout/sidebar/SidebarContext.d.ts +7 -7
- package/dist/components/layout/sidebar/SidebarContext.js +1 -1
- package/dist/components/layout/sidebar/SidebarContext.js.map +1 -1
- package/dist/components/layout/sidebar/SidebarMenu.d.ts +11 -11
- package/dist/components/layout/sidebar/SidebarUser.d.ts +14 -14
- package/dist/components/layout/topbar/Topbar.d.ts +6 -6
- package/dist/components/layout/topbar/Topbar.d.ts.map +1 -1
- package/dist/components/layout/topbar/Topbar.js +11 -6
- package/dist/components/layout/topbar/Topbar.js.map +2 -2
- package/dist/components/layout/topbar/TopbarContainer.d.ts +6 -6
- package/dist/components/layout/topbar/TopbarContext.js +2 -2
- package/dist/components/layout/topbar/TopbarContext.js.map +1 -1
- package/dist/components/layout/topbar/TopbarMenu.d.ts +11 -11
- package/dist/components/layout/topbar/TopbarMenu.d.ts.map +1 -1
- package/dist/components/layout/topbar/TopbarMenu.js +5 -1
- package/dist/components/layout/topbar/TopbarMenu.js.map +2 -2
- package/dist/components/layout/topbar/TopbarUser.d.ts +9 -9
- package/dist/directives/ripple.d.ts +5 -5
- package/dist/helpers/createAppStructure.d.ts.map +1 -1
- package/dist/helpers/createAppStructure.js +7 -3
- package/dist/helpers/createAppStructure.js.map +1 -1
- package/dist/helpers/createHmrSafeContext.d.ts +3 -0
- package/dist/helpers/createHmrSafeContext.d.ts.map +1 -0
- package/dist/helpers/createHmrSafeContext.js +10 -0
- package/dist/helpers/createHmrSafeContext.js.map +6 -0
- package/dist/helpers/createSlotComponent.d.ts +3 -3
- package/dist/helpers/mergeStyles.d.ts +8 -8
- package/dist/hooks/createControllableSignal.d.ts +10 -10
- package/dist/hooks/createControllableStore.d.ts +6 -6
- package/dist/hooks/createIMEHandler.d.ts +7 -7
- package/dist/hooks/createMountTransition.d.ts +4 -4
- package/dist/hooks/createSelectionGroup.d.ts.map +1 -1
- package/dist/hooks/createSelectionGroup.js +4 -3
- package/dist/hooks/createSelectionGroup.js.map +2 -2
- package/dist/hooks/createSlotSignal.d.ts +2 -2
- package/dist/hooks/useLocalStorage.d.ts +11 -11
- package/dist/hooks/useLogger.d.ts +1 -1
- package/dist/hooks/useLogger.d.ts.map +1 -1
- package/dist/hooks/useLogger.js +1 -1
- package/dist/hooks/useLogger.js.map +1 -1
- package/dist/hooks/useRouterLink.d.ts +10 -10
- package/dist/hooks/useRouterLink.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/providers/ClipboardProvider.d.ts +5 -5
- package/dist/providers/ConfigContext.d.ts +6 -6
- package/dist/providers/ConfigContext.js +2 -2
- package/dist/providers/ConfigContext.js.map +1 -1
- package/dist/providers/ErrorLoggerProvider.d.ts +3 -3
- package/dist/providers/LoggerContext.d.ts +13 -13
- package/dist/providers/PwaUpdateProvider.d.ts +4 -4
- package/dist/providers/PwaUpdateProvider.js +2 -2
- package/dist/providers/PwaUpdateProvider.js.map +1 -1
- package/dist/providers/ServiceClientContext.d.ts +8 -8
- package/dist/providers/ServiceClientContext.d.ts.map +1 -1
- package/dist/providers/ServiceClientContext.js +1 -1
- package/dist/providers/ServiceClientContext.js.map +1 -1
- package/dist/providers/ServiceClientProvider.d.ts +6 -6
- package/dist/providers/ServiceClientProvider.js +7 -7
- package/dist/providers/ServiceClientProvider.js.map +1 -1
- package/dist/providers/SyncStorageContext.d.ts +14 -14
- package/dist/providers/SystemProvider.d.ts.map +1 -1
- package/dist/providers/SystemProvider.js +21 -16
- package/dist/providers/SystemProvider.js.map +2 -2
- package/dist/providers/ThemeContext.d.ts +20 -20
- package/dist/providers/ThemeContext.d.ts.map +1 -1
- package/dist/providers/ThemeContext.js +1 -1
- package/dist/providers/ThemeContext.js.map +1 -1
- package/dist/providers/i18n/I18nContext.d.ts +44 -0
- package/dist/providers/i18n/I18nContext.d.ts.map +1 -0
- package/dist/providers/i18n/I18nContext.js +73 -0
- package/dist/providers/i18n/I18nContext.js.map +6 -0
- package/dist/providers/i18n/I18nContext.types.d.ts +28 -0
- package/dist/providers/i18n/I18nContext.types.d.ts.map +1 -0
- package/dist/providers/i18n/I18nContext.types.js +1 -0
- package/dist/providers/i18n/I18nContext.types.js.map +6 -0
- package/dist/providers/i18n/i18nUtils.d.ts +18 -0
- package/dist/providers/i18n/i18nUtils.d.ts.map +1 -0
- package/dist/providers/i18n/i18nUtils.js +25 -0
- package/dist/providers/i18n/i18nUtils.js.map +6 -0
- package/dist/providers/i18n/locales/en.d.ts +163 -0
- package/dist/providers/i18n/locales/en.d.ts.map +1 -0
- package/dist/providers/i18n/locales/en.js +165 -0
- package/dist/providers/i18n/locales/en.js.map +6 -0
- package/dist/providers/i18n/locales/ko.d.ts +163 -0
- package/dist/providers/i18n/locales/ko.d.ts.map +1 -0
- package/dist/providers/i18n/locales/ko.js +165 -0
- package/dist/providers/i18n/locales/ko.js.map +6 -0
- package/dist/providers/shared-data/SharedDataChangeEvent.d.ts +4 -4
- package/dist/providers/shared-data/SharedDataContext.d.ts +28 -28
- package/dist/providers/shared-data/SharedDataContext.d.ts.map +1 -1
- package/dist/providers/shared-data/SharedDataContext.js +1 -1
- package/dist/providers/shared-data/SharedDataContext.js.map +1 -1
- package/dist/providers/shared-data/SharedDataProvider.d.ts +9 -9
- package/dist/providers/shared-data/SharedDataProvider.js +4 -4
- package/dist/providers/shared-data/SharedDataProvider.js.map +1 -1
- package/package.json +9 -8
- package/src/components/data/calendar/Calendar.tsx +10 -4
- package/src/components/data/kanban/Kanban.tsx +14 -14
- package/src/components/data/kanban/KanbanContext.ts +3 -3
- package/src/components/data/list/List.tsx +10 -10
- package/src/components/data/list/ListContext.ts +1 -1
- package/src/components/data/list/ListItem.styles.ts +8 -8
- package/src/components/data/list/ListItem.tsx +15 -15
- package/src/components/data/sheet/DataSheet.styles.ts +22 -22
- package/src/components/data/sheet/DataSheet.tsx +52 -48
- package/src/components/data/sheet/DataSheetColumn.tsx +1 -1
- package/src/components/data/sheet/DataSheetConfigDialog.tsx +9 -9
- package/src/components/data/sheet/sheetUtils.ts +7 -7
- package/src/components/data/sheet/types.ts +16 -16
- package/src/components/disclosure/Collapse.tsx +11 -11
- package/src/components/disclosure/Dialog.tsx +60 -57
- package/src/components/disclosure/DialogContext.ts +26 -26
- package/src/components/disclosure/DialogInstanceContext.ts +7 -7
- package/src/components/disclosure/DialogProvider.tsx +5 -5
- package/src/components/disclosure/Dropdown.tsx +89 -75
- package/src/components/disclosure/Tabs.tsx +1 -1
- package/src/components/disclosure/dialogZIndex.ts +16 -11
- package/src/components/display/Echarts.tsx +4 -4
- package/src/components/features/address/AddressSearch.tsx +2 -2
- package/src/components/features/crud-detail/CrudDetail.tsx +34 -21
- package/src/components/features/crud-detail/CrudDetailAfter.tsx +1 -1
- package/src/components/features/crud-detail/CrudDetailBefore.tsx +1 -1
- package/src/components/features/crud-detail/CrudDetailTools.tsx +1 -1
- package/src/components/features/crud-sheet/CrudSheet.tsx +52 -40
- package/src/components/features/crud-sheet/CrudSheetColumn.tsx +1 -1
- package/src/components/features/crud-sheet/CrudSheetFilter.tsx +1 -1
- package/src/components/features/crud-sheet/CrudSheetHeader.tsx +1 -1
- package/src/components/features/crud-sheet/CrudSheetTools.tsx +1 -1
- package/src/components/features/crudRegistry.ts +60 -0
- package/src/components/features/data-select-button/DataSelectButton.tsx +34 -32
- package/src/components/features/permission-table/PermissionTable.tsx +70 -64
- package/src/components/features/shared-data/SharedDataSelect.tsx +24 -22
- package/src/components/features/shared-data/SharedDataSelectButton.tsx +10 -10
- package/src/components/features/shared-data/SharedDataSelectList.tsx +231 -59
- package/src/components/features/shared-data/SharedDataSelectListContext.ts +39 -0
- package/src/components/feedback/Progress.tsx +1 -1
- package/src/components/feedback/busy/BusyContainer.tsx +6 -6
- package/src/components/feedback/busy/BusyContext.ts +12 -12
- package/src/components/feedback/busy/BusyProvider.tsx +6 -6
- package/src/components/feedback/notification/NotificationBanner.tsx +3 -1
- package/src/components/feedback/notification/NotificationBell.tsx +4 -4
- package/src/components/feedback/notification/NotificationContext.ts +28 -28
- package/src/components/feedback/notification/NotificationProvider.tsx +9 -9
- package/src/components/feedback/print/PrintContext.ts +1 -1
- package/src/components/form-control/Button.tsx +1 -1
- package/src/components/form-control/DropdownTrigger.styles.ts +1 -1
- package/src/components/form-control/Invalid.tsx +5 -5
- package/src/components/form-control/ThemeToggle.tsx +10 -10
- package/src/components/form-control/checkbox/Checkbox.styles.ts +8 -8
- package/src/components/form-control/checkbox/Checkbox.tsx +2 -2
- package/src/components/form-control/checkbox/CheckboxGroup.tsx +1 -1
- package/src/components/form-control/checkbox/Radio.tsx +2 -2
- package/src/components/form-control/checkbox/RadioGroup.tsx +1 -1
- package/src/components/form-control/color-picker/ColorPicker.tsx +17 -17
- package/src/components/form-control/combobox/Combobox.tsx +55 -55
- package/src/components/form-control/combobox/ComboboxContext.ts +5 -5
- package/src/components/form-control/combobox/ComboboxItem.tsx +3 -3
- package/src/components/form-control/date-range-picker/DateRangePicker.tsx +40 -26
- package/src/components/form-control/editor/EditorToolbar.tsx +52 -50
- package/src/components/form-control/editor/RichTextEditor.tsx +16 -16
- package/src/components/form-control/editor/editor.css +5 -5
- package/src/components/form-control/field/DatePicker.tsx +39 -39
- package/src/components/form-control/field/DateTimePicker.tsx +38 -38
- package/src/components/form-control/field/Field.styles.ts +11 -11
- package/src/components/form-control/field/FieldPlaceholder.tsx +1 -1
- package/src/components/form-control/field/NumberInput.tsx +63 -63
- package/src/components/form-control/field/TextInput.tsx +48 -48
- package/src/components/form-control/field/Textarea.tsx +32 -32
- package/src/components/form-control/field/TimePicker.tsx +37 -37
- package/src/components/form-control/numpad/Numpad.tsx +26 -26
- package/src/components/form-control/select/Select.tsx +82 -86
- package/src/components/form-control/select/SelectContext.ts +8 -8
- package/src/components/form-control/select/SelectItem.tsx +5 -5
- package/src/components/form-control/state-preset/StatePreset.tsx +13 -13
- package/src/components/layout/FormTable.tsx +4 -4
- package/src/components/layout/sidebar/Sidebar.tsx +8 -8
- package/src/components/layout/sidebar/SidebarContainer.tsx +19 -17
- package/src/components/layout/sidebar/SidebarContext.ts +8 -8
- package/src/components/layout/sidebar/SidebarMenu.tsx +19 -19
- package/src/components/layout/sidebar/SidebarUser.tsx +14 -14
- package/src/components/layout/topbar/Topbar.tsx +15 -13
- package/src/components/layout/topbar/TopbarContainer.tsx +6 -6
- package/src/components/layout/topbar/TopbarContext.ts +2 -2
- package/src/components/layout/topbar/TopbarMenu.tsx +18 -16
- package/src/components/layout/topbar/TopbarUser.tsx +9 -9
- package/src/directives/ripple.ts +8 -8
- package/src/helpers/createAppStructure.ts +15 -8
- package/src/helpers/createHmrSafeContext.ts +8 -0
- package/src/helpers/createSlotComponent.ts +4 -4
- package/src/helpers/mergeStyles.ts +11 -11
- package/src/hooks/createControllableSignal.ts +11 -11
- package/src/hooks/createControllableStore.ts +8 -8
- package/src/hooks/createIMEHandler.ts +7 -7
- package/src/hooks/createMountTransition.ts +4 -4
- package/src/hooks/createSelectionGroup.tsx +5 -3
- package/src/hooks/createSlotSignal.ts +2 -2
- package/src/hooks/useLocalStorage.ts +13 -13
- package/src/hooks/useLogger.ts +2 -2
- package/src/hooks/useRouterLink.ts +15 -15
- package/src/index.ts +4 -3
- package/src/providers/ClipboardProvider.tsx +19 -19
- package/src/providers/ConfigContext.tsx +8 -8
- package/src/providers/ErrorLoggerProvider.tsx +3 -3
- package/src/providers/LoggerContext.tsx +13 -13
- package/src/providers/PwaUpdateProvider.tsx +6 -6
- package/src/providers/ServiceClientContext.ts +9 -9
- package/src/providers/ServiceClientProvider.tsx +15 -15
- package/src/providers/SyncStorageContext.tsx +15 -15
- package/src/providers/SystemProvider.tsx +15 -12
- package/src/providers/ThemeContext.tsx +26 -26
- package/src/providers/i18n/I18nContext.tsx +129 -0
- package/src/providers/i18n/I18nContext.types.ts +30 -0
- package/src/providers/i18n/i18nUtils.ts +38 -0
- package/src/providers/i18n/locales/en.ts +161 -0
- package/src/providers/i18n/locales/ko.ts +161 -0
- package/src/providers/shared-data/SharedDataChangeEvent.ts +4 -4
- package/src/providers/shared-data/SharedDataContext.ts +29 -29
- package/src/providers/shared-data/SharedDataProvider.tsx +21 -21
- package/src/styles/patterns.styles.ts +6 -6
- package/src/styles/tokens.styles.ts +5 -5
- package/tailwind.config.ts +1 -1
- package/tailwind.css +4 -4
- package/tests/components/data/List.spec.tsx +689 -0
- package/tests/components/data/Pagination.spec.tsx +336 -0
- package/tests/components/data/Table.spec.tsx +55 -0
- package/tests/components/data/kanban/Kanban.selection.spec.tsx +213 -0
- package/tests/components/data/sheet/DataSheet.spec.tsx +645 -0
- package/tests/components/disclosure/Collapse.spec.tsx +173 -0
- package/tests/components/disclosure/Dialog.spec.tsx +438 -0
- package/tests/components/disclosure/DialogProvider.spec.tsx +142 -0
- package/tests/components/disclosure/Dropdown.spec.tsx +333 -0
- package/tests/components/disclosure/Tabs.spec.tsx +220 -0
- package/tests/components/disclosure/dialogZIndex.spec.ts +45 -0
- package/tests/components/display/Alert.spec.tsx +47 -0
- package/tests/components/display/Barcode.spec.tsx +61 -0
- package/tests/components/display/Card.spec.tsx +41 -0
- package/tests/components/display/Link.spec.tsx +62 -0
- package/tests/components/display/Tag.spec.tsx +47 -0
- package/tests/components/features/address/AddressSearch.spec.tsx +45 -0
- package/tests/components/features/crud-detail/CrudDetail.spec.tsx +537 -0
- package/tests/components/features/crud-sheet/CrudSheet.spec.tsx +491 -0
- package/tests/components/features/crudRegistry.spec.ts +119 -0
- package/tests/components/features/data-select-button/DataSelectButton.spec.tsx +482 -0
- package/tests/components/features/permission-table/PermissionTable.spec.tsx +288 -0
- package/tests/components/features/shared-data/SharedDataSelectList.spec.tsx +448 -0
- package/tests/components/feedback/busy/BusyContainer.spec.tsx +80 -0
- package/tests/components/feedback/notification/LiveRegion.spec.tsx +52 -0
- package/tests/components/feedback/notification/NotificationBanner.spec.tsx +187 -0
- package/tests/components/feedback/notification/NotificationBell.spec.tsx +226 -0
- package/tests/components/feedback/notification/NotificationContext.spec.tsx +362 -0
- package/tests/components/feedback/print/Print.spec.tsx +45 -0
- package/tests/components/form-control/Button.spec.tsx +119 -0
- package/tests/components/form-control/Invalid.spec.tsx +131 -0
- package/tests/components/form-control/checkbox/Checkbox.spec.tsx +137 -0
- package/tests/components/form-control/checkbox/CheckboxGroup.spec.tsx +108 -0
- package/tests/components/form-control/checkbox/Radio.spec.tsx +138 -0
- package/tests/components/form-control/checkbox/RadioGroup.spec.tsx +108 -0
- package/tests/components/form-control/color-picker/ColorPicker.spec.tsx +94 -0
- package/tests/components/form-control/combobox/Combobox.spec.tsx +253 -0
- package/tests/components/form-control/combobox/ComboboxItem.spec.tsx +88 -0
- package/tests/components/form-control/date-range-picker/DateRangePicker.spec.tsx +208 -0
- package/tests/components/form-control/field/DatePicker.spec.tsx +381 -0
- package/tests/components/form-control/field/DateTimePicker.spec.tsx +383 -0
- package/tests/components/form-control/field/NumberInput.spec.tsx +371 -0
- package/tests/components/form-control/field/TextInput.spec.tsx +341 -0
- package/tests/components/form-control/field/Textarea.spec.tsx +224 -0
- package/tests/components/form-control/field/TimePicker.spec.tsx +315 -0
- package/tests/components/form-control/numpad/Numpad.spec.tsx +248 -0
- package/tests/components/form-control/select/Select.spec.tsx +676 -0
- package/tests/components/form-control/select/SelectItem.spec.tsx +174 -0
- package/tests/components/layout/FormGroup.spec.tsx +104 -0
- package/tests/components/layout/FormTable.spec.tsx +43 -0
- package/tests/components/layout/sidebar/Sidebar.spec.tsx +192 -0
- package/tests/components/layout/sidebar/SidebarContainer.spec.tsx +261 -0
- package/tests/components/layout/sidebar/SidebarMenu.spec.tsx +219 -0
- package/tests/components/layout/sidebar/SidebarUser.spec.tsx +133 -0
- package/tests/components/layout/topbar/TopbarActions.spec.tsx +77 -0
- package/tests/components/layout/topbar/TopbarContainer.spec.tsx +38 -0
- package/tests/components/layout/topbar/createTopbarActions.spec.tsx +66 -0
- package/tests/directives/ripple.spec.tsx +130 -0
- package/tests/helpers/createAppStructure.spec.tsx +843 -0
- package/tests/helpers/mergeStyles.spec.ts +172 -0
- package/tests/hooks/createControllableSignal.spec.ts +194 -0
- package/tests/hooks/createIMEHandler.spec.ts +80 -0
- package/tests/hooks/createMountTransition.spec.ts +86 -0
- package/tests/hooks/useLocalStorage.spec.tsx +223 -0
- package/tests/hooks/useLogger.spec.tsx +116 -0
- package/tests/hooks/usePrint.spec.tsx +134 -0
- package/tests/hooks/useRouterLink.spec.tsx +183 -0
- package/tests/hooks/useSyncConfig.spec.tsx +304 -0
- package/tests/providers/ClipboardProvider.spec.tsx +20 -0
- package/tests/providers/ConfigContext.spec.tsx +42 -0
- package/tests/providers/ErrorLoggerProvider.spec.tsx +73 -0
- package/tests/providers/LoggerContext.spec.tsx +76 -0
- package/tests/providers/PwaUpdateProvider.spec.tsx +22 -0
- package/tests/providers/ServiceClientContext.spec.tsx +88 -0
- package/tests/providers/SyncStorageContext.spec.tsx +77 -0
- package/tests/providers/i18n/I18nContext.spec.tsx +110 -0
- package/tests/providers/shared-data/SharedDataProvider.spec.tsx +401 -0
- package/tests/vitest-env.d.ts +1 -0
- package/dist/components/form-control/select-list/SelectList.d.ts +0 -54
- package/dist/components/form-control/select-list/SelectList.d.ts.map +0 -1
- package/dist/components/form-control/select-list/SelectList.js +0 -280
- package/dist/components/form-control/select-list/SelectList.js.map +0 -6
- package/dist/components/form-control/select-list/SelectListContext.d.ts +0 -13
- package/dist/components/form-control/select-list/SelectListContext.d.ts.map +0 -1
- package/dist/components/form-control/select-list/SelectListContext.js +0 -14
- package/dist/components/form-control/select-list/SelectListContext.js.map +0 -6
- package/docs/data-components.md +0 -782
- package/docs/disclosure.md +0 -254
- package/docs/display.md +0 -153
- package/docs/feedback.md +0 -238
- package/docs/form-controls.md +0 -1068
- package/docs/helpers.md +0 -54
- package/docs/hooks.md +0 -588
- package/docs/layout.md +0 -384
- package/docs/providers.md +0 -211
- package/docs/styling.md +0 -184
- package/src/components/form-control/select-list/SelectList.tsx +0 -385
- package/src/components/form-control/select-list/SelectListContext.ts +0 -23
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { createRoot } from "solid-js";
|
|
3
|
+
import { render, waitFor } from "@solidjs/testing-library";
|
|
4
|
+
import { NotificationProvider } from "../../../../src/components/feedback/notification/NotificationProvider";
|
|
5
|
+
import { ConfigContext } from "../../../../src/providers/ConfigContext";
|
|
6
|
+
import {
|
|
7
|
+
useNotification,
|
|
8
|
+
type NotificationContextValue,
|
|
9
|
+
} from "../../../../src/components/feedback/notification/NotificationContext";
|
|
10
|
+
|
|
11
|
+
describe("NotificationContext", () => {
|
|
12
|
+
describe("useNotification", () => {
|
|
13
|
+
it("throws error when used without Provider", () => {
|
|
14
|
+
createRoot((dispose) => {
|
|
15
|
+
expect(() => useNotification()).toThrow(
|
|
16
|
+
"useNotification can only be used inside NotificationProvider",
|
|
17
|
+
);
|
|
18
|
+
dispose();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe("NotificationProvider", () => {
|
|
25
|
+
it("useNotification works normally inside Provider", () => {
|
|
26
|
+
let notification: NotificationContextValue;
|
|
27
|
+
|
|
28
|
+
render(() => (
|
|
29
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
30
|
+
<NotificationProvider>
|
|
31
|
+
{(() => {
|
|
32
|
+
notification = useNotification();
|
|
33
|
+
return null;
|
|
34
|
+
})()}
|
|
35
|
+
</NotificationProvider>
|
|
36
|
+
</ConfigContext.Provider>
|
|
37
|
+
));
|
|
38
|
+
|
|
39
|
+
expect(notification!.items()).toEqual([]);
|
|
40
|
+
expect(notification!.unreadCount()).toBe(0);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("adds notification when info is called", async () => {
|
|
44
|
+
let notification: NotificationContextValue;
|
|
45
|
+
|
|
46
|
+
render(() => (
|
|
47
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
48
|
+
<NotificationProvider>
|
|
49
|
+
{(() => {
|
|
50
|
+
notification = useNotification();
|
|
51
|
+
return null;
|
|
52
|
+
})()}
|
|
53
|
+
</NotificationProvider>
|
|
54
|
+
</ConfigContext.Provider>
|
|
55
|
+
));
|
|
56
|
+
|
|
57
|
+
notification!.info("Test Title", "Test Message");
|
|
58
|
+
|
|
59
|
+
await waitFor(() => {
|
|
60
|
+
expect(notification!.items().length).toBe(1);
|
|
61
|
+
expect(notification!.items()[0].theme).toBe("info");
|
|
62
|
+
expect(notification!.items()[0].title).toBe("Test Title");
|
|
63
|
+
expect(notification!.items()[0].message).toBe("Test Message");
|
|
64
|
+
expect(notification!.unreadCount()).toBe(1);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("correctly applies success/warning/danger themes", async () => {
|
|
69
|
+
let notification: NotificationContextValue;
|
|
70
|
+
|
|
71
|
+
render(() => (
|
|
72
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
73
|
+
<NotificationProvider>
|
|
74
|
+
{(() => {
|
|
75
|
+
notification = useNotification();
|
|
76
|
+
return null;
|
|
77
|
+
})()}
|
|
78
|
+
</NotificationProvider>
|
|
79
|
+
</ConfigContext.Provider>
|
|
80
|
+
));
|
|
81
|
+
|
|
82
|
+
notification!.success("Success", "Success message");
|
|
83
|
+
notification!.warning("Warning", "Warning message");
|
|
84
|
+
notification!.danger("Error", "Error message");
|
|
85
|
+
|
|
86
|
+
await waitFor(() => {
|
|
87
|
+
const items = notification!.items();
|
|
88
|
+
expect(items[0].theme).toBe("success");
|
|
89
|
+
expect(items[1].theme).toBe("warning");
|
|
90
|
+
expect(items[2].theme).toBe("danger");
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("marks notification as read when markAsRead is called", async () => {
|
|
95
|
+
let notification: NotificationContextValue;
|
|
96
|
+
|
|
97
|
+
render(() => (
|
|
98
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
99
|
+
<NotificationProvider>
|
|
100
|
+
{(() => {
|
|
101
|
+
notification = useNotification();
|
|
102
|
+
return null;
|
|
103
|
+
})()}
|
|
104
|
+
</NotificationProvider>
|
|
105
|
+
</ConfigContext.Provider>
|
|
106
|
+
));
|
|
107
|
+
|
|
108
|
+
notification!.info("Test", "Message");
|
|
109
|
+
|
|
110
|
+
await waitFor(() => {
|
|
111
|
+
expect(notification!.unreadCount()).toBe(1);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const id = notification!.items()[0].id;
|
|
115
|
+
notification!.markAsRead(id);
|
|
116
|
+
|
|
117
|
+
await waitFor(() => {
|
|
118
|
+
expect(notification!.unreadCount()).toBe(0);
|
|
119
|
+
expect(notification!.items()[0].read).toBe(true);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("removes all notifications when clear is called", async () => {
|
|
124
|
+
let notification: NotificationContextValue;
|
|
125
|
+
|
|
126
|
+
render(() => (
|
|
127
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
128
|
+
<NotificationProvider>
|
|
129
|
+
{(() => {
|
|
130
|
+
notification = useNotification();
|
|
131
|
+
return null;
|
|
132
|
+
})()}
|
|
133
|
+
</NotificationProvider>
|
|
134
|
+
</ConfigContext.Provider>
|
|
135
|
+
));
|
|
136
|
+
|
|
137
|
+
notification!.info("Notification 1");
|
|
138
|
+
notification!.info("Notification 2");
|
|
139
|
+
|
|
140
|
+
await waitFor(() => {
|
|
141
|
+
expect(notification!.items().length).toBe(2);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
notification!.clear();
|
|
145
|
+
|
|
146
|
+
await waitFor(() => {
|
|
147
|
+
expect(notification!.items().length).toBe(0);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it("maintains maximum 50 notifications", async () => {
|
|
152
|
+
let notification: NotificationContextValue;
|
|
153
|
+
|
|
154
|
+
render(() => (
|
|
155
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
156
|
+
<NotificationProvider>
|
|
157
|
+
{(() => {
|
|
158
|
+
notification = useNotification();
|
|
159
|
+
return null;
|
|
160
|
+
})()}
|
|
161
|
+
</NotificationProvider>
|
|
162
|
+
</ConfigContext.Provider>
|
|
163
|
+
));
|
|
164
|
+
|
|
165
|
+
// Add 51 notifications
|
|
166
|
+
for (let i = 0; i < 51; i++) {
|
|
167
|
+
notification!.info(`Notification ${i}`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
await waitFor(() => {
|
|
171
|
+
expect(notification!.items().length).toBe(50);
|
|
172
|
+
// First notification deleted, last notification retained
|
|
173
|
+
expect(notification!.items()[49].title).toBe("Notification 50");
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("latestUnread returns the most recent unread notification", async () => {
|
|
178
|
+
let notification: NotificationContextValue;
|
|
179
|
+
|
|
180
|
+
render(() => (
|
|
181
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
182
|
+
<NotificationProvider>
|
|
183
|
+
{(() => {
|
|
184
|
+
notification = useNotification();
|
|
185
|
+
return null;
|
|
186
|
+
})()}
|
|
187
|
+
</NotificationProvider>
|
|
188
|
+
</ConfigContext.Provider>
|
|
189
|
+
));
|
|
190
|
+
|
|
191
|
+
notification!.info("First");
|
|
192
|
+
notification!.info("Second");
|
|
193
|
+
|
|
194
|
+
await waitFor(() => {
|
|
195
|
+
expect(notification!.latestUnread()?.title).toBe("Second");
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("latestUnread becomes undefined and marked as read when dismissBanner is called", async () => {
|
|
200
|
+
let notification: NotificationContextValue;
|
|
201
|
+
|
|
202
|
+
render(() => (
|
|
203
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
204
|
+
<NotificationProvider>
|
|
205
|
+
{(() => {
|
|
206
|
+
notification = useNotification();
|
|
207
|
+
return null;
|
|
208
|
+
})()}
|
|
209
|
+
</NotificationProvider>
|
|
210
|
+
</ConfigContext.Provider>
|
|
211
|
+
));
|
|
212
|
+
|
|
213
|
+
notification!.info("Test");
|
|
214
|
+
|
|
215
|
+
await waitFor(() => {
|
|
216
|
+
expect(notification!.latestUnread()).toBeDefined();
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
notification!.dismissBanner();
|
|
220
|
+
|
|
221
|
+
await waitFor(() => {
|
|
222
|
+
expect(notification!.latestUnread()).toBeUndefined();
|
|
223
|
+
// Still exists in items but marked as read
|
|
224
|
+
expect(notification!.items().length).toBe(1);
|
|
225
|
+
expect(notification!.items()[0].read).toBe(true);
|
|
226
|
+
expect(notification!.unreadCount()).toBe(0);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it("returns id of created notification when info is called", async () => {
|
|
231
|
+
let notification: NotificationContextValue;
|
|
232
|
+
|
|
233
|
+
render(() => (
|
|
234
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
235
|
+
<NotificationProvider>
|
|
236
|
+
{(() => {
|
|
237
|
+
notification = useNotification();
|
|
238
|
+
return null;
|
|
239
|
+
})()}
|
|
240
|
+
</NotificationProvider>
|
|
241
|
+
</ConfigContext.Provider>
|
|
242
|
+
));
|
|
243
|
+
|
|
244
|
+
const id = notification!.info("Test Title");
|
|
245
|
+
|
|
246
|
+
await waitFor(() => {
|
|
247
|
+
expect(typeof id).toBe("string");
|
|
248
|
+
expect(notification!.items()[0].id).toBe(id);
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it("updates notification content when update is called", async () => {
|
|
253
|
+
let notification: NotificationContextValue;
|
|
254
|
+
|
|
255
|
+
render(() => (
|
|
256
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
257
|
+
<NotificationProvider>
|
|
258
|
+
{(() => {
|
|
259
|
+
notification = useNotification();
|
|
260
|
+
return null;
|
|
261
|
+
})()}
|
|
262
|
+
</NotificationProvider>
|
|
263
|
+
</ConfigContext.Provider>
|
|
264
|
+
));
|
|
265
|
+
|
|
266
|
+
const id = notification!.info("Original Title", "Original Message");
|
|
267
|
+
|
|
268
|
+
notification!.update(id, { title: "Updated Title", message: "Updated Message" });
|
|
269
|
+
|
|
270
|
+
await waitFor(() => {
|
|
271
|
+
const item = notification!.items()[0];
|
|
272
|
+
expect(item.title).toBe("Updated Title");
|
|
273
|
+
expect(item.message).toBe("Updated Message");
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it("removes notification when remove is called", async () => {
|
|
278
|
+
let notification: NotificationContextValue;
|
|
279
|
+
|
|
280
|
+
render(() => (
|
|
281
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
282
|
+
<NotificationProvider>
|
|
283
|
+
{(() => {
|
|
284
|
+
notification = useNotification();
|
|
285
|
+
return null;
|
|
286
|
+
})()}
|
|
287
|
+
</NotificationProvider>
|
|
288
|
+
</ConfigContext.Provider>
|
|
289
|
+
));
|
|
290
|
+
|
|
291
|
+
const id = notification!.info("Notification to delete");
|
|
292
|
+
notification!.info("Notification to keep");
|
|
293
|
+
|
|
294
|
+
await waitFor(() => {
|
|
295
|
+
expect(notification!.items().length).toBe(2);
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
notification!.remove(id);
|
|
299
|
+
|
|
300
|
+
await waitFor(() => {
|
|
301
|
+
expect(notification!.items().length).toBe(1);
|
|
302
|
+
expect(notification!.items()[0].title).toBe("Notification to keep");
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it("update with renotify: read notification changes back to unread", async () => {
|
|
307
|
+
let notification: NotificationContextValue;
|
|
308
|
+
|
|
309
|
+
render(() => (
|
|
310
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
311
|
+
<NotificationProvider>
|
|
312
|
+
{(() => {
|
|
313
|
+
notification = useNotification();
|
|
314
|
+
return null;
|
|
315
|
+
})()}
|
|
316
|
+
</NotificationProvider>
|
|
317
|
+
</ConfigContext.Provider>
|
|
318
|
+
));
|
|
319
|
+
|
|
320
|
+
const id = notification!.info("Notification");
|
|
321
|
+
notification!.markAsRead(id);
|
|
322
|
+
|
|
323
|
+
await waitFor(() => {
|
|
324
|
+
expect(notification!.unreadCount()).toBe(0);
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
notification!.update(id, { message: "Done!" }, { renotify: true });
|
|
328
|
+
|
|
329
|
+
await waitFor(() => {
|
|
330
|
+
expect(notification!.unreadCount()).toBe(1);
|
|
331
|
+
expect(notification!.items()[0].read).toBe(false);
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it("update with renotify: unread notification remains unread", async () => {
|
|
336
|
+
let notification: NotificationContextValue;
|
|
337
|
+
|
|
338
|
+
render(() => (
|
|
339
|
+
<ConfigContext.Provider value={{ clientName: "testApp" }}>
|
|
340
|
+
<NotificationProvider>
|
|
341
|
+
{(() => {
|
|
342
|
+
notification = useNotification();
|
|
343
|
+
return null;
|
|
344
|
+
})()}
|
|
345
|
+
</NotificationProvider>
|
|
346
|
+
</ConfigContext.Provider>
|
|
347
|
+
));
|
|
348
|
+
|
|
349
|
+
const id = notification!.info("Notification");
|
|
350
|
+
|
|
351
|
+
await waitFor(() => {
|
|
352
|
+
expect(notification!.unreadCount()).toBe(1);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
notification!.update(id, { message: "Updated" }, { renotify: true });
|
|
356
|
+
|
|
357
|
+
await waitFor(() => {
|
|
358
|
+
// Still 1 (not increased)
|
|
359
|
+
expect(notification!.unreadCount()).toBe(1);
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { render } from "@solidjs/testing-library";
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
import { Print } from "../../../../src/components/feedback/print/Print";
|
|
4
|
+
|
|
5
|
+
describe("Print", () => {
|
|
6
|
+
describe("basic rendering", () => {
|
|
7
|
+
it("renders children", () => {
|
|
8
|
+
const { getByText } = render(() => <Print>테스트 내용</Print>);
|
|
9
|
+
expect(getByText("테스트 내용")).toBeTruthy();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
describe("Print.Page", () => {
|
|
14
|
+
it("renders with data-print-page attribute", () => {
|
|
15
|
+
const { container } = render(() => (
|
|
16
|
+
<Print>
|
|
17
|
+
<Print.Page>페이지 1</Print.Page>
|
|
18
|
+
</Print>
|
|
19
|
+
));
|
|
20
|
+
const page = container.querySelector("[data-print-page]");
|
|
21
|
+
expect(page).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("each Print.Page has data-print-page attribute", () => {
|
|
25
|
+
const { container } = render(() => (
|
|
26
|
+
<Print>
|
|
27
|
+
<Print.Page>페이지 1</Print.Page>
|
|
28
|
+
<Print.Page>페이지 2</Print.Page>
|
|
29
|
+
<Print.Page>페이지 3</Print.Page>
|
|
30
|
+
</Print>
|
|
31
|
+
));
|
|
32
|
+
const pages = container.querySelectorAll("[data-print-page]");
|
|
33
|
+
expect(pages.length).toBe(3);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("renders Print.Page children", () => {
|
|
37
|
+
const { getByText } = render(() => (
|
|
38
|
+
<Print>
|
|
39
|
+
<Print.Page>페이지 내용</Print.Page>
|
|
40
|
+
</Print>
|
|
41
|
+
));
|
|
42
|
+
expect(getByText("페이지 내용")).toBeTruthy();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { render, fireEvent } from "@solidjs/testing-library";
|
|
2
|
+
import { describe, it, expect, vi } from "vitest";
|
|
3
|
+
import { Button } from "../../../src/components/form-control/Button";
|
|
4
|
+
|
|
5
|
+
describe("Button component", () => {
|
|
6
|
+
describe("basic rendering", () => {
|
|
7
|
+
it("renders children inside the button", () => {
|
|
8
|
+
const { getByRole } = render(() => <Button>Click Me</Button>);
|
|
9
|
+
const button = getByRole("button");
|
|
10
|
+
|
|
11
|
+
expect(button.textContent).toBe("Click Me");
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("defaults type to button", () => {
|
|
15
|
+
const { getByRole } = render(() => <Button>Click</Button>);
|
|
16
|
+
const button = getByRole("button");
|
|
17
|
+
|
|
18
|
+
expect(button.getAttribute("type")).toBe("button");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("overrides type with submit", () => {
|
|
22
|
+
const { getByRole } = render(() => <Button type="submit">Submit</Button>);
|
|
23
|
+
const button = getByRole("button");
|
|
24
|
+
|
|
25
|
+
expect(button.getAttribute("type")).toBe("submit");
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("theme prop", () => {
|
|
30
|
+
it("applies different styles per theme", () => {
|
|
31
|
+
const { getByRole: getDefault } = render(() => <Button>Click</Button>);
|
|
32
|
+
const { getByRole: getThemed } = render(() => <Button theme="danger">Click</Button>);
|
|
33
|
+
|
|
34
|
+
expect(getDefault("button").className).not.toBe(getThemed("button").className);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("variant prop", () => {
|
|
39
|
+
it("applies different styles per variant", () => {
|
|
40
|
+
const { getByRole: getOutline } = render(() => <Button>Click</Button>);
|
|
41
|
+
const { getByRole: getSolid } = render(() => <Button variant="solid">Click</Button>);
|
|
42
|
+
const { getByRole: getGhost } = render(() => <Button variant="ghost">Click</Button>);
|
|
43
|
+
|
|
44
|
+
const outlineClass = getOutline("button").className;
|
|
45
|
+
const solidClass = getSolid("button").className;
|
|
46
|
+
const ghostClass = getGhost("button").className;
|
|
47
|
+
|
|
48
|
+
expect(outlineClass).not.toBe(solidClass);
|
|
49
|
+
expect(solidClass).not.toBe(ghostClass);
|
|
50
|
+
expect(outlineClass).not.toBe(ghostClass);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe("size prop", () => {
|
|
55
|
+
it("applies different styles per size", () => {
|
|
56
|
+
const { getByRole: getDefault } = render(() => <Button>Click</Button>);
|
|
57
|
+
const { getByRole: getSm } = render(() => <Button size="sm">Click</Button>);
|
|
58
|
+
const { getByRole: getLg } = render(() => <Button size="lg">Click</Button>);
|
|
59
|
+
|
|
60
|
+
const defaultClass = getDefault("button").className;
|
|
61
|
+
const smClass = getSm("button").className;
|
|
62
|
+
const lgClass = getLg("button").className;
|
|
63
|
+
|
|
64
|
+
expect(defaultClass).not.toBe(smClass);
|
|
65
|
+
expect(defaultClass).not.toBe(lgClass);
|
|
66
|
+
expect(smClass).not.toBe(lgClass);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
describe("inset prop", () => {
|
|
71
|
+
it("applies different styles when inset", () => {
|
|
72
|
+
const { getByRole: getDefault } = render(() => <Button>Click</Button>);
|
|
73
|
+
const { getByRole: getInset } = render(() => <Button inset>Click</Button>);
|
|
74
|
+
|
|
75
|
+
expect(getDefault("button").className).not.toBe(getInset("button").className);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("disabled prop", () => {
|
|
80
|
+
it("applies different styles when disabled", () => {
|
|
81
|
+
const { getByRole: getDefault } = render(() => <Button>Click</Button>);
|
|
82
|
+
const { getByRole: getDisabled } = render(() => <Button disabled>Click</Button>);
|
|
83
|
+
|
|
84
|
+
expect(getDefault("button").className).not.toBe(getDisabled("button").className);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("sets HTML disabled attribute when disabled=true", () => {
|
|
88
|
+
const { getByRole } = render(() => <Button disabled>Click</Button>);
|
|
89
|
+
|
|
90
|
+
expect(getByRole("button").hasAttribute("disabled")).toBe(true);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("event handling", () => {
|
|
95
|
+
it("calls onClick handler on click", () => {
|
|
96
|
+
const handleClick = vi.fn();
|
|
97
|
+
const { getByRole } = render(() => <Button onClick={handleClick}>Click</Button>);
|
|
98
|
+
|
|
99
|
+
fireEvent.click(getByRole("button"));
|
|
100
|
+
|
|
101
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("blocks click when disabled", () => {
|
|
105
|
+
const { getByRole } = render(() => <Button disabled>Click</Button>);
|
|
106
|
+
|
|
107
|
+
expect(getByRole("button").hasAttribute("disabled")).toBe(true);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe("class merging", () => {
|
|
112
|
+
it("merges custom classes", () => {
|
|
113
|
+
// eslint-disable-next-line tailwindcss/no-custom-classname
|
|
114
|
+
const { getByRole } = render(() => <Button class="my-custom-class">Click</Button>);
|
|
115
|
+
|
|
116
|
+
expect(getByRole("button").classList.contains("my-custom-class")).toBe(true);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { render } from "@solidjs/testing-library";
|
|
2
|
+
import { describe, it, expect } from "vitest";
|
|
3
|
+
import { createSignal } from "solid-js";
|
|
4
|
+
import { Invalid } from "../../../src/components/form-control/Invalid";
|
|
5
|
+
|
|
6
|
+
describe("Invalid component", () => {
|
|
7
|
+
describe("Fragment rendering", () => {
|
|
8
|
+
it("renders children and hidden input without wrapper div", () => {
|
|
9
|
+
const { container } = render(() => (
|
|
10
|
+
<Invalid message="error">
|
|
11
|
+
<div data-testid="child">Content</div>
|
|
12
|
+
</Invalid>
|
|
13
|
+
));
|
|
14
|
+
const child = container.querySelector("[data-testid='child']");
|
|
15
|
+
const hiddenInput = container.querySelector("input[aria-hidden='true']");
|
|
16
|
+
expect(child).toBeTruthy();
|
|
17
|
+
expect(hiddenInput).toBeTruthy();
|
|
18
|
+
expect(child!.parentElement).toBe(container);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe("setCustomValidity", () => {
|
|
23
|
+
it("sets setCustomValidity when message is present", () => {
|
|
24
|
+
const { container } = render(() => (
|
|
25
|
+
<Invalid message="This is a required field">
|
|
26
|
+
<div>Content</div>
|
|
27
|
+
</Invalid>
|
|
28
|
+
));
|
|
29
|
+
const hiddenInput = container.querySelector("input[aria-hidden='true']") as HTMLInputElement;
|
|
30
|
+
expect(hiddenInput.validationMessage).toBe("This is a required field");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("is valid when no message is provided", () => {
|
|
34
|
+
const { container } = render(() => (
|
|
35
|
+
<Invalid>
|
|
36
|
+
<div>Content</div>
|
|
37
|
+
</Invalid>
|
|
38
|
+
));
|
|
39
|
+
const hiddenInput = container.querySelector("input[aria-hidden='true']") as HTMLInputElement;
|
|
40
|
+
expect(hiddenInput.validity.valid).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("updates setCustomValidity when message changes", () => {
|
|
44
|
+
const [msg, setMsg] = createSignal<string | undefined>("error");
|
|
45
|
+
const { container } = render(() => (
|
|
46
|
+
<Invalid message={msg()}>
|
|
47
|
+
<div>Content</div>
|
|
48
|
+
</Invalid>
|
|
49
|
+
));
|
|
50
|
+
const hiddenInput = container.querySelector("input[aria-hidden='true']") as HTMLInputElement;
|
|
51
|
+
expect(hiddenInput.validationMessage).toBe("error");
|
|
52
|
+
|
|
53
|
+
setMsg(undefined);
|
|
54
|
+
expect(hiddenInput.validity.valid).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe("variant='border'", () => {
|
|
59
|
+
it("adds border-danger-500 class to target when message is present", () => {
|
|
60
|
+
const { container } = render(() => (
|
|
61
|
+
<Invalid variant="border" message="error">
|
|
62
|
+
<div data-testid="target" class="border">
|
|
63
|
+
Content
|
|
64
|
+
</div>
|
|
65
|
+
</Invalid>
|
|
66
|
+
));
|
|
67
|
+
const target = container.querySelector("[data-testid='target']") as HTMLElement;
|
|
68
|
+
expect(target.classList.contains("border-danger-500")).toBe(true);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("does not have border-danger-500 class when no message", () => {
|
|
72
|
+
const { container } = render(() => (
|
|
73
|
+
<Invalid variant="border">
|
|
74
|
+
<div data-testid="target" class="border">
|
|
75
|
+
Content
|
|
76
|
+
</div>
|
|
77
|
+
</Invalid>
|
|
78
|
+
));
|
|
79
|
+
const target = container.querySelector("[data-testid='target']") as HTMLElement;
|
|
80
|
+
expect(target.classList.contains("border-danger-500")).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe("variant='dot' (default)", () => {
|
|
85
|
+
it("inserts dot element inside target when message is present", () => {
|
|
86
|
+
const { container } = render(() => (
|
|
87
|
+
<Invalid message="error">
|
|
88
|
+
<div data-testid="target">Content</div>
|
|
89
|
+
</Invalid>
|
|
90
|
+
));
|
|
91
|
+
const target = container.querySelector("[data-testid='target']") as HTMLElement;
|
|
92
|
+
const dot = target.querySelector("[data-invalid-dot]");
|
|
93
|
+
expect(dot).toBeTruthy();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("has no dot element when no message", () => {
|
|
97
|
+
const { container } = render(() => (
|
|
98
|
+
<Invalid>
|
|
99
|
+
<div data-testid="target">Content</div>
|
|
100
|
+
</Invalid>
|
|
101
|
+
));
|
|
102
|
+
const target = container.querySelector("[data-testid='target']") as HTMLElement;
|
|
103
|
+
const dot = target.querySelector("[data-invalid-dot]");
|
|
104
|
+
expect(dot).toBeFalsy();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe("touchMode", () => {
|
|
109
|
+
it("has no visual indication initially in touchMode", () => {
|
|
110
|
+
const { container } = render(() => (
|
|
111
|
+
<Invalid variant="border" message="error" touchMode>
|
|
112
|
+
<div data-testid="target" class="border">
|
|
113
|
+
Content
|
|
114
|
+
</div>
|
|
115
|
+
</Invalid>
|
|
116
|
+
));
|
|
117
|
+
const target = container.querySelector("[data-testid='target']") as HTMLElement;
|
|
118
|
+
expect(target.classList.contains("border-danger-500")).toBe(false);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("setCustomValidity is always set in touchMode", () => {
|
|
122
|
+
const { container } = render(() => (
|
|
123
|
+
<Invalid variant="border" message="error" touchMode>
|
|
124
|
+
<div>Content</div>
|
|
125
|
+
</Invalid>
|
|
126
|
+
));
|
|
127
|
+
const hiddenInput = container.querySelector("input[aria-hidden='true']") as HTMLInputElement;
|
|
128
|
+
expect(hiddenInput.validationMessage).toBe("error");
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|