amotify 0.2.240 → 0.2.242

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.
@@ -1 +1 @@
1
- var r={Img:"_Img_1egfu_1",ShowExpand_true:"_ShowExpand_true_1egfu_11"};var a={};var t={Size_S:"_Size_S_10jdu_1",Size_R:"_Size_R_10jdu_6",Size_L:"_Size_L_10jdu_11",Size_2L:"_Size_2L_10jdu_16",Size_3L:"_Size_3L_10jdu_21",Icon:"_Icon_10jdu_27",Title:"_Title_10jdu_31",ComunIcon:"_ComunIcon_10jdu_38",ComunTitle:"_ComunTitle_10jdu_42",MingooIcon:"_MingooIcon_10jdu_46",P:"_P_10jdu_46",P_0:"_P_0_10jdu_50",P_1:"_P_1_10jdu_53",P_2:"_P_2_10jdu_56",P_3:"_P_3_10jdu_59",P_4:"_P_4_10jdu_62",P_5:"_P_5_10jdu_65",P_6:"_P_6_10jdu_68",P_7:"_P_7_10jdu_71",P_8:"_P_8_10jdu_74",P_9:"_P_9_10jdu_77",P_10:"_P_10_10jdu_81",P_11:"_P_11_10jdu_85",P_12:"_P_12_10jdu_89"};var _={Placeholder:"_Placeholder_rl2bi_14",Body:"_Body_rl2bi_14",PlaceholderEffect:"_PlaceholderEffect_rl2bi_1",Color_white:"_Color_white_rl2bi_25"};var l={Wrap:"_Wrap_13krz_1",Open_true:"_Open_true_13krz_1",Open_false:"_Open_false_13krz_4"};var e={Wrapper:"_Wrapper_1s842_1",Cell:"_Cell_1s842_9",FadeIn:"_FadeIn_1s842_13",FadeOut:"_FadeOut_1s842_17"};var c={Wrap:"_Wrap_1hu5n_2",Content:"_Content_1hu5n_6",BB:"_BB_1hu5n_17",TapSensor:"_TapSensor_1hu5n_20",isMainSheet_false:"_isMainSheet_false_1hu5n_24",isMainSheet_true:"_isMainSheet_true_1hu5n_27",Open:"_Open_1hu5n_33",Hide:"_Hide_1hu5n_39",Tcate_normal:"_Tcate_normal_1hu5n_45",BaseBody:"_BaseBody_1hu5n_49",Tcate_drawer:"_Tcate_drawer_1hu5n_64",Tpos_left:"_Tpos_left_1hu5n_64",Tpos_right:"_Tpos_right_1hu5n_79",Tpos_bottom:"_Tpos_bottom_1hu5n_94",DragBar:"_DragBar_1hu5n_101",Tcate_custom:"_Tcate_custom_1hu5n_109",CustomSheet:"_CustomSheet_1hu5n_117",GPT:"_GPT_1hu5n_120",Col_1:"_Col_1_1hu5n_120",Row_1:"_Row_1_1hu5n_120",Row_4:"_Row_4_1hu5n_120",Col_4:"_Col_4_1hu5n_120",Row_2:"_Row_2_1hu5n_123",Row_5:"_Row_5_1hu5n_123",Col_2:"_Col_2_1hu5n_126",Col_5:"_Col_5_1hu5n_126",GPT_3:"_GPT_3_1hu5n_132",GPT_18:"_GPT_18_1hu5n_132",GPT_8:"_GPT_8_1hu5n_135",GPT_23:"_GPT_23_1hu5n_135",GPT_11:"_GPT_11_1hu5n_138",GPT_14:"_GPT_14_1hu5n_138",GPT_12:"_GPT_12_1hu5n_141",GPT_15:"_GPT_15_1hu5n_141",Col_3:"_Col_3_1hu5n_151",TapContent:"_TapContent_1hu5n_167"};var i={Wrapper:"_Wrapper_jip2p_1",CornerLoader:"_CornerLoader_jip2p_17",Wrap:"_Wrap_jip2p_1",isActive:"_isActive_jip2p_28",ldAnm:"_ldAnm_jip2p_1",Ld1:"_Ld1_jip2p_34",Ld2:"_Ld2_jip2p_37",Ld3:"_Ld3_jip2p_40",Ld4:"_Ld4_jip2p_43",MiniLoader:"_MiniLoader_jip2p_61",Active_false:"_Active_false_jip2p_64",Hide:"_Hide_jip2p_67",Active:"_Active_jip2p_64",Core:"_Core_jip2p_77",spin:"_spin_jip2p_1",SVG1:"_SVG1_jip2p_85",loader:"_loader_jip2p_1",loading:"_loading_jip2p_1",SVG2:"_SVG2_jip2p_92"};var n={RootViewController:"_RootViewController_czfgs_2",Content:"_Content_czfgs_7",TopNav:"_TopNav_czfgs_11",FooterNav:"_FooterNav_czfgs_14",Body:"_Body_czfgs_17",SideNav:"_SideNav_czfgs_17",SwipeView:"_SwipeView_czfgs_24",Rail:"_Rail_czfgs_24",ShowOther_true:"_ShowOther_true_czfgs_24",Child:"_Child_czfgs_24",Display:"_Display_czfgs_32",LoopAdjusting:"_LoopAdjusting_czfgs_36"};var s={Wrap:"_Wrap_1rtvv_1",RowClickable_true:"_RowClickable_true_1rtvv_4",Row:"_Row_1rtvv_4",BodyRow:"_BodyRow_1rtvv_4",DataNotFound:"_DataNotFound_1rtvv_4",Cell:"_Cell_1rtvv_7",Table:"_Table_1rtvv_13",TableType_drag:"_TableType_drag_1rtvv_24",DraggerOrigin:"_DraggerOrigin_1rtvv_28",DragableButton:"_DragableButton_1rtvv_34",TableType_data:"_TableType_data_1rtvv_43",Console:"_Console_1rtvv_43",TableBase:"_TableBase_1rtvv_50",HeadRow:"_HeadRow_1rtvv_60",FilterRegion:"_FilterRegion_1rtvv_66",Filtering_true:"_Filtering_true_1rtvv_69"};var d={RippleElement:"_RippleElement_17vcx_1",Color_cloud:"_Color_cloud_17vcx_7",RippleWrap:"_RippleWrap_17vcx_7",Wave:"_Wave_17vcx_7",Color_theme:"_Color_theme_17vcx_10",PuddingEffect:"_PuddingEffect_17vcx_39",pdAnm:"_pdAnm_17vcx_1"};var h={Wrap:"_Wrap_8x4zl_1",Use_profile:"_Use_profile_8x4zl_4",Use_head:"_Use_head_8x4zl_7",Canvas:"_Canvas_8x4zl_11",Preview:"_Preview_8x4zl_17",ToneBall:"_ToneBall_8x4zl_21",ToneBall_1:"_ToneBall_1_8x4zl_25",ToneBall_2:"_ToneBall_2_8x4zl_28",ToneBall_3:"_ToneBall_3_8x4zl_31",ToneBall_4:"_ToneBall_4_8x4zl_34",ToneBall_5:"_ToneBall_5_8x4zl_37",ToneBall_6:"_ToneBall_6_8x4zl_40",ToneBall_7:"_ToneBall_7_8x4zl_43",ToneBall_8:"_ToneBall_8_8x4zl_46",ToneBall_9:"_ToneBall_9_8x4zl_49",ToneBall_10:"_ToneBall_10_8x4zl_52"};var m={Wrap:"_Wrap_11ave_1",isLocked_true:"_isLocked_true_11ave_16",Tone_sub_Color_theme:"_Tone_sub_Color_theme_11ave_21",Tone_clear_Color_theme:"_Tone_clear_Color_theme_11ave_21",Tone_sub_Color_posi:"_Tone_sub_Color_posi_11ave_24",Tone_clear_Color_posi:"_Tone_clear_Color_posi_11ave_24",Tone_sub_Color_nega:"_Tone_sub_Color_nega_11ave_27",Tone_clear_Color_nega:"_Tone_clear_Color_nega_11ave_27",Tone_sub_Color_warn:"_Tone_sub_Color_warn_11ave_30",Tone_clear_Color_warn:"_Tone_clear_Color_warn_11ave_30",Tone_sub_Color_white:"_Tone_sub_Color_white_11ave_33",Tone_clear_Color_white:"_Tone_clear_Color_white_11ave_33",Tone_sub_Color_cloud:"_Tone_sub_Color_cloud_11ave_36",Tone_clear_Color_cloud:"_Tone_clear_Color_cloud_11ave_36",Tone_sub_Color_layer:"_Tone_sub_Color_layer_11ave_39",Tone_clear_Color_layer:"_Tone_clear_Color_layer_11ave_39",isNeutral_true:"_isNeutral_true_11ave_43",Tone_clear:"_Tone_clear_11ave_21",Tone_borderToFill:"_Tone_borderToFill_11ave_46",Tone_fillToBorder:"_Tone_fillToBorder_11ave_49",Tone_fillToBorder_Color_white:"_Tone_fillToBorder_Color_white_11ave_52",Tone_fillToBorder_Color_cloud:"_Tone_fillToBorder_Color_cloud_11ave_52",Tone_link:"_Tone_link_11ave_55",Tone_normal_Color_plain:"_Tone_normal_Color_plain_11ave_62",Tone_normal_Color_theme:"_Tone_normal_Color_theme_11ave_66",Tone_normal_Color_posi:"_Tone_normal_Color_posi_11ave_70",Tone_normal_Color_nega:"_Tone_normal_Color_nega_11ave_74",Tone_normal_Color_warn:"_Tone_normal_Color_warn_11ave_78",Tone_border:"_Tone_border_11ave_46",Tone_prime:"_Tone_prime_11ave_85",Tone_borderToFill_Color_white:"_Tone_borderToFill_Color_white_11ave_120",Tone_borderToFill_Color_cloud:"_Tone_borderToFill_Color_cloud_11ave_120"};var b={Wrapper:"_Wrapper_51igx_1",Input:"_Input_51igx_40",DigitCharacterCell:"_DigitCharacterCell_51igx_71",Combined:"_Combined_51igx_71",ShowCell:"_ShowCell_51igx_1"};var g={SelectorWrapper:"_SelectorWrapper_vfpyx_1"};var p={Input:"_Input_1g1ty_1",List:"_List_1g1ty_1",AddButton:"_AddButton_1g1ty_1",FileName:"_FileName_1g1ty_5",Draggable:"_Draggable_1g1ty_18",AddIcon:"_AddIcon_1g1ty_21",IconAnimation:"_IconAnimation_1g1ty_1"};var f={CellBase:"_CellBase_xuhga_1",HideInput_true:"_HideInput_true_xuhga_1",Input:"_Input_xuhga_1",Label:"_Label_xuhga_5"};var v={Core:"_Core_1psny_1",SelectedCell:"_SelectedCell_1psny_5",Selector:"_Selector_1psny_9"};var u={Input:"_Input_1lndc_1",Label:"_Label_1lndc_7"};var w={Label:"_Label_qfhyi_1",Wrap:"_Wrap_qfhyi_18",Rail:"_Rail_qfhyi_18",Bar:"_Bar_qfhyi_18",BarColor:"_BarColor_qfhyi_21",Labels:"_Labels_qfhyi_24",ShowLegendsAlways_true:"_ShowLegendsAlways_true_qfhyi_27",Ball:"_Ball_qfhyi_38"};var k={Header:"_Header_1rlyc_1",Body:"_Body_1rlyc_8",Footer:"_Footer_1rlyc_13",ClockBase:"_ClockBase_1rlyc_20",DesignSide:"_DesignSide_1rlyc_20",ClockUiBase:"_ClockUiBase_1rlyc_20",ClockUi:"_ClockUi_1rlyc_20",Needle:"_Needle_1rlyc_24",hour:"_hour_1rlyc_31",minute:"_minute_1rlyc_36",DateBase:"_DateBase_1rlyc_42",LeftButton:"_LeftButton_1rlyc_42",RightButton:"_RightButton_1rlyc_45",MonthBase:"_MonthBase_1rlyc_49",Cell:"_Cell_1rlyc_55",isThisMonth:"_isThisMonth_1rlyc_55",miniYearInput:"_miniYearInput_1rlyc_61",CalendarDay:"_CalendarDay_1rlyc_66",isToday_true:"_isToday_true_1rlyc_66"};var y={Origin:"_Origin_vvhgd_1",Shallow:"_Shallow_vvhgd_5"};var x={Label:"_Label_1kvwn_1",Tone_plain:"_Tone_plain_1kvwn_6",Checked:"_Checked_1kvwn_6",Tone_cloud:"_Tone_cloud_1kvwn_9",Tone_cloudmono:"_Tone_cloudmono_1kvwn_12",Tone_cloudtheme:"_Tone_cloudtheme_1kvwn_15",Tone_bordervivid:"_Tone_bordervivid_1kvwn_21",Tone_bottomline:"_Tone_bottomline_1kvwn_27"};var Rr=o=>r[o],Pr=o=>a[o],Ir=o=>t[o],Ar=o=>_[o],Gr=o=>l[o],Mr=o=>e[o],Yr=o=>c[o],Fr=o=>i[o],Or=o=>n[o],Dr=o=>s[o],qr=o=>d[o],Ur=o=>h[o],Vr=o=>m[o],Er=o=>b[o],Kr=o=>g[o],Xr=o=>p[o],Jr=o=>f[o],Qr=o=>v[o],Zr=o=>u[o],$r=o=>w[o],oa=o=>k[o],ra=o=>y[o],aa=o=>x[o];export{Gr as AccordionClasses,Vr as ButtonClasses,Ur as CropperClasses,qr as EffectClasses,Pr as GridClasses,Rr as ImgClasses,ra as InputAutoHeightClasses,Qr as InputAutocompleteClasses,Kr as InputChipsClasses,Er as InputClasses,Xr as InputFilerClasses,Jr as InputListClasses,aa as InputSegmentedClasses,$r as InputSliderClasses,Zr as InputSwitchClasses,oa as InputTimeClasses,Or as LayoutClasses,Fr as LoaderClasses,Ir as LogoClasses,Ar as PlaceholderClasses,Yr as SheetClasses,Mr as SnackbarClasses,Dr as TableClasses};
1
+ var r={Img:"_Img_1egfu_1",ShowExpand_true:"_ShowExpand_true_1egfu_11"};var a={};var t={Size_S:"_Size_S_10jdu_1",Size_R:"_Size_R_10jdu_6",Size_L:"_Size_L_10jdu_11",Size_2L:"_Size_2L_10jdu_16",Size_3L:"_Size_3L_10jdu_21",Icon:"_Icon_10jdu_27",Title:"_Title_10jdu_31",ComunIcon:"_ComunIcon_10jdu_38",ComunTitle:"_ComunTitle_10jdu_42",MingooIcon:"_MingooIcon_10jdu_46",P:"_P_10jdu_46",P_0:"_P_0_10jdu_50",P_1:"_P_1_10jdu_53",P_2:"_P_2_10jdu_56",P_3:"_P_3_10jdu_59",P_4:"_P_4_10jdu_62",P_5:"_P_5_10jdu_65",P_6:"_P_6_10jdu_68",P_7:"_P_7_10jdu_71",P_8:"_P_8_10jdu_74",P_9:"_P_9_10jdu_77",P_10:"_P_10_10jdu_81",P_11:"_P_11_10jdu_85",P_12:"_P_12_10jdu_89"};var _={Placeholder:"_Placeholder_rl2bi_14",Body:"_Body_rl2bi_14",PlaceholderEffect:"_PlaceholderEffect_rl2bi_1",Color_white:"_Color_white_rl2bi_25"};var l={Wrap:"_Wrap_13krz_1",Open_true:"_Open_true_13krz_1",Open_false:"_Open_false_13krz_4"};var e={Wrapper:"_Wrapper_1s842_1",Cell:"_Cell_1s842_9",FadeIn:"_FadeIn_1s842_13",FadeOut:"_FadeOut_1s842_17"};var c={Wrap:"_Wrap_1w12m_2",Content:"_Content_1w12m_5",BB:"_BB_1w12m_16",TapSensor:"_TapSensor_1w12m_19",isMainSheet_false:"_isMainSheet_false_1w12m_23",isMainSheet_true:"_isMainSheet_true_1w12m_26",Open:"_Open_1w12m_32",Hide:"_Hide_1w12m_38",Tcate_normal:"_Tcate_normal_1w12m_44",BaseBody:"_BaseBody_1w12m_48",Tcate_drawer:"_Tcate_drawer_1w12m_63",Tpos_left:"_Tpos_left_1w12m_63",Tpos_right:"_Tpos_right_1w12m_78",Tpos_bottom:"_Tpos_bottom_1w12m_93",DragBar:"_DragBar_1w12m_100",Tcate_custom:"_Tcate_custom_1w12m_108",CustomSheet:"_CustomSheet_1w12m_116",GPT:"_GPT_1w12m_119",Col_1:"_Col_1_1w12m_119",Row_1:"_Row_1_1w12m_119",Row_4:"_Row_4_1w12m_119",Col_4:"_Col_4_1w12m_119",Row_2:"_Row_2_1w12m_122",Row_5:"_Row_5_1w12m_122",Col_2:"_Col_2_1w12m_125",Col_5:"_Col_5_1w12m_125",GPT_3:"_GPT_3_1w12m_131",GPT_18:"_GPT_18_1w12m_131",GPT_8:"_GPT_8_1w12m_134",GPT_23:"_GPT_23_1w12m_134",GPT_11:"_GPT_11_1w12m_137",GPT_14:"_GPT_14_1w12m_137",GPT_12:"_GPT_12_1w12m_140",GPT_15:"_GPT_15_1w12m_140",Col_3:"_Col_3_1w12m_150",TapContent:"_TapContent_1w12m_166"};var i={Wrapper:"_Wrapper_jip2p_1",CornerLoader:"_CornerLoader_jip2p_17",Wrap:"_Wrap_jip2p_1",isActive:"_isActive_jip2p_28",ldAnm:"_ldAnm_jip2p_1",Ld1:"_Ld1_jip2p_34",Ld2:"_Ld2_jip2p_37",Ld3:"_Ld3_jip2p_40",Ld4:"_Ld4_jip2p_43",MiniLoader:"_MiniLoader_jip2p_61",Active_false:"_Active_false_jip2p_64",Hide:"_Hide_jip2p_67",Active:"_Active_jip2p_64",Core:"_Core_jip2p_77",spin:"_spin_jip2p_1",SVG1:"_SVG1_jip2p_85",loader:"_loader_jip2p_1",loading:"_loading_jip2p_1",SVG2:"_SVG2_jip2p_92"};var n={RootViewController:"_RootViewController_1uslg_2",Content:"_Content_1uslg_5",TopNav:"_TopNav_1uslg_14",FooterNav:"_FooterNav_1uslg_17",Body:"_Body_1uslg_20",SideNav:"_SideNav_1uslg_20",SwipeView:"_SwipeView_1uslg_27",Rail:"_Rail_1uslg_27",ShowOther_true:"_ShowOther_true_1uslg_27",Child:"_Child_1uslg_27",Display:"_Display_1uslg_35",LoopAdjusting:"_LoopAdjusting_1uslg_39"};var s={Wrap:"_Wrap_1rtvv_1",RowClickable_true:"_RowClickable_true_1rtvv_4",Row:"_Row_1rtvv_4",BodyRow:"_BodyRow_1rtvv_4",DataNotFound:"_DataNotFound_1rtvv_4",Cell:"_Cell_1rtvv_7",Table:"_Table_1rtvv_13",TableType_drag:"_TableType_drag_1rtvv_24",DraggerOrigin:"_DraggerOrigin_1rtvv_28",DragableButton:"_DragableButton_1rtvv_34",TableType_data:"_TableType_data_1rtvv_43",Console:"_Console_1rtvv_43",TableBase:"_TableBase_1rtvv_50",HeadRow:"_HeadRow_1rtvv_60",FilterRegion:"_FilterRegion_1rtvv_66",Filtering_true:"_Filtering_true_1rtvv_69"};var m={RippleElement:"_RippleElement_17vcx_1",Color_cloud:"_Color_cloud_17vcx_7",RippleWrap:"_RippleWrap_17vcx_7",Wave:"_Wave_17vcx_7",Color_theme:"_Color_theme_17vcx_10",PuddingEffect:"_PuddingEffect_17vcx_39",pdAnm:"_pdAnm_17vcx_1"};var d={Wrap:"_Wrap_8x4zl_1",Use_profile:"_Use_profile_8x4zl_4",Use_head:"_Use_head_8x4zl_7",Canvas:"_Canvas_8x4zl_11",Preview:"_Preview_8x4zl_17",ToneBall:"_ToneBall_8x4zl_21",ToneBall_1:"_ToneBall_1_8x4zl_25",ToneBall_2:"_ToneBall_2_8x4zl_28",ToneBall_3:"_ToneBall_3_8x4zl_31",ToneBall_4:"_ToneBall_4_8x4zl_34",ToneBall_5:"_ToneBall_5_8x4zl_37",ToneBall_6:"_ToneBall_6_8x4zl_40",ToneBall_7:"_ToneBall_7_8x4zl_43",ToneBall_8:"_ToneBall_8_8x4zl_46",ToneBall_9:"_ToneBall_9_8x4zl_49",ToneBall_10:"_ToneBall_10_8x4zl_52"};var b={Wrap:"_Wrap_11ave_1",isLocked_true:"_isLocked_true_11ave_16",Tone_sub_Color_theme:"_Tone_sub_Color_theme_11ave_21",Tone_clear_Color_theme:"_Tone_clear_Color_theme_11ave_21",Tone_sub_Color_posi:"_Tone_sub_Color_posi_11ave_24",Tone_clear_Color_posi:"_Tone_clear_Color_posi_11ave_24",Tone_sub_Color_nega:"_Tone_sub_Color_nega_11ave_27",Tone_clear_Color_nega:"_Tone_clear_Color_nega_11ave_27",Tone_sub_Color_warn:"_Tone_sub_Color_warn_11ave_30",Tone_clear_Color_warn:"_Tone_clear_Color_warn_11ave_30",Tone_sub_Color_white:"_Tone_sub_Color_white_11ave_33",Tone_clear_Color_white:"_Tone_clear_Color_white_11ave_33",Tone_sub_Color_cloud:"_Tone_sub_Color_cloud_11ave_36",Tone_clear_Color_cloud:"_Tone_clear_Color_cloud_11ave_36",Tone_sub_Color_layer:"_Tone_sub_Color_layer_11ave_39",Tone_clear_Color_layer:"_Tone_clear_Color_layer_11ave_39",isNeutral_true:"_isNeutral_true_11ave_43",Tone_clear:"_Tone_clear_11ave_21",Tone_borderToFill:"_Tone_borderToFill_11ave_46",Tone_fillToBorder:"_Tone_fillToBorder_11ave_49",Tone_fillToBorder_Color_white:"_Tone_fillToBorder_Color_white_11ave_52",Tone_fillToBorder_Color_cloud:"_Tone_fillToBorder_Color_cloud_11ave_52",Tone_link:"_Tone_link_11ave_55",Tone_normal_Color_plain:"_Tone_normal_Color_plain_11ave_62",Tone_normal_Color_theme:"_Tone_normal_Color_theme_11ave_66",Tone_normal_Color_posi:"_Tone_normal_Color_posi_11ave_70",Tone_normal_Color_nega:"_Tone_normal_Color_nega_11ave_74",Tone_normal_Color_warn:"_Tone_normal_Color_warn_11ave_78",Tone_border:"_Tone_border_11ave_46",Tone_prime:"_Tone_prime_11ave_85",Tone_borderToFill_Color_white:"_Tone_borderToFill_Color_white_11ave_120",Tone_borderToFill_Color_cloud:"_Tone_borderToFill_Color_cloud_11ave_120"};var h={Wrapper:"_Wrapper_51igx_1",Input:"_Input_51igx_40",DigitCharacterCell:"_DigitCharacterCell_51igx_71",Combined:"_Combined_51igx_71",ShowCell:"_ShowCell_51igx_1"};var g={SelectorWrapper:"_SelectorWrapper_vfpyx_1"};var p={Input:"_Input_1g1ty_1",List:"_List_1g1ty_1",AddButton:"_AddButton_1g1ty_1",FileName:"_FileName_1g1ty_5",Draggable:"_Draggable_1g1ty_18",AddIcon:"_AddIcon_1g1ty_21",IconAnimation:"_IconAnimation_1g1ty_1"};var f={CellBase:"_CellBase_xuhga_1",HideInput_true:"_HideInput_true_xuhga_1",Input:"_Input_xuhga_1",Label:"_Label_xuhga_5"};var v={Core:"_Core_1psny_1",SelectedCell:"_SelectedCell_1psny_5",Selector:"_Selector_1psny_9"};var u={Input:"_Input_1lndc_1",Label:"_Label_1lndc_7"};var w={Label:"_Label_qfhyi_1",Wrap:"_Wrap_qfhyi_18",Rail:"_Rail_qfhyi_18",Bar:"_Bar_qfhyi_18",BarColor:"_BarColor_qfhyi_21",Labels:"_Labels_qfhyi_24",ShowLegendsAlways_true:"_ShowLegendsAlways_true_qfhyi_27",Ball:"_Ball_qfhyi_38"};var k={Header:"_Header_1rlyc_1",Body:"_Body_1rlyc_8",Footer:"_Footer_1rlyc_13",ClockBase:"_ClockBase_1rlyc_20",DesignSide:"_DesignSide_1rlyc_20",ClockUiBase:"_ClockUiBase_1rlyc_20",ClockUi:"_ClockUi_1rlyc_20",Needle:"_Needle_1rlyc_24",hour:"_hour_1rlyc_31",minute:"_minute_1rlyc_36",DateBase:"_DateBase_1rlyc_42",LeftButton:"_LeftButton_1rlyc_42",RightButton:"_RightButton_1rlyc_45",MonthBase:"_MonthBase_1rlyc_49",Cell:"_Cell_1rlyc_55",isThisMonth:"_isThisMonth_1rlyc_55",miniYearInput:"_miniYearInput_1rlyc_61",CalendarDay:"_CalendarDay_1rlyc_66",isToday_true:"_isToday_true_1rlyc_66"};var y={Origin:"_Origin_vvhgd_1",Shallow:"_Shallow_vvhgd_5"};var x={Label:"_Label_1kvwn_1",Tone_plain:"_Tone_plain_1kvwn_6",Checked:"_Checked_1kvwn_6",Tone_cloud:"_Tone_cloud_1kvwn_9",Tone_cloudmono:"_Tone_cloudmono_1kvwn_12",Tone_cloudtheme:"_Tone_cloudtheme_1kvwn_15",Tone_bordervivid:"_Tone_bordervivid_1kvwn_21",Tone_bottomline:"_Tone_bottomline_1kvwn_27"};var Rr=o=>r[o],Pr=o=>a[o],Ir=o=>t[o],Ar=o=>_[o],Gr=o=>l[o],Mr=o=>e[o],Yr=o=>c[o],Fr=o=>i[o],Or=o=>n[o],Dr=o=>s[o],qr=o=>m[o],Ur=o=>d[o],Vr=o=>b[o],Er=o=>h[o],Kr=o=>g[o],Xr=o=>p[o],Jr=o=>f[o],Qr=o=>v[o],Zr=o=>u[o],$r=o=>w[o],oa=o=>k[o],ra=o=>y[o],aa=o=>x[o];export{Gr as AccordionClasses,Vr as ButtonClasses,Ur as CropperClasses,qr as EffectClasses,Pr as GridClasses,Rr as ImgClasses,ra as InputAutoHeightClasses,Qr as InputAutocompleteClasses,Kr as InputChipsClasses,Er as InputClasses,Xr as InputFilerClasses,Jr as InputListClasses,aa as InputSegmentedClasses,$r as InputSliderClasses,Zr as InputSwitchClasses,oa as InputTimeClasses,Or as LayoutClasses,Fr as LoaderClasses,Ir as LogoClasses,Ar as PlaceholderClasses,Yr as SheetClasses,Mr as SnackbarClasses,Dr as TableClasses};
@@ -86,8 +86,6 @@ declare namespace Autocomplete {
86
86
  set_keyword: React.Dispatch<React.SetStateAction<string>>;
87
87
  val_status: InputTypes.Status.Plain<Value[]>;
88
88
  set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
89
- val_validate: InputTypes.Validation.Result;
90
- set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
91
89
  };
92
90
  type Component = {
93
91
  <T = Value>(p: Input<Value<T>>): React.JSX.Element;
@@ -1 +1 @@
1
- import{b as f,c as h,d as ee,e as te}from"../../chunk-C5N2D3ZX.js";import{Fragment as X,jsx as l,jsxs as V}from"react/jsx-runtime";import{useState as b,useEffect as F,useRef as ue}from"react";import c,{UUID as D}from"jmini";import{ExtractStyles as ce}from"../../@utils";import{Box as E,Span as pe,FAI as H,Column as oe}from"../../atoms";import{Literal as q,Row as P}from"../../mols";import{Button as ae}from"../Button";import{Loader as de}from"../Loader";import{Sheet as Se}from"../Sheet";import{OptionalInputWrapper as fe,BoxWrapper as me,CoreEffects as M,DefaultBoxishStyles as ve}from"./core";import{InputAutocompleteClasses as W}from"../../@styles/componentClasses";import{InputLabel as ye}from"./Label";import{RightIcon as le}from".";function _e(e){let{value:t,states:r}=e,{required:p,options:o,min:a,max:n}=r;a=a||0,n=n||65535;let d=[],s=t.filter(u=>u!==null).length;return p&&(s||d.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),s<a&&d.push({type:"invalid",label:a+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),s>n&&d.push({type:"invalid",label:n+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!d.filter(({type:u})=>u=="invalid").length,notice:d}}const z={InitOptions:e=>{let t=[];return e.forEach(r=>{if(!r)return;let{type:p,label:o,value:a,searchValue:n}=r,d=n||c.is.string(o)&&o||""||c.is.string(a)&&a||c.Stringify(a||"")||"";c.is.nullish(o)&&(o=String(a)),t.push(h(f({id:D()},r),{searchValue:d,type:p||"selector",label:o,value:a}))}),t},FilterSelectableOptions:(e,t,r)=>{let p=e;return r||(p=e.filter(o=>(o==null?void 0:o.type)!="label")),c.scope(()=>{if(!t)return;let o=t.toLower().replace(/ /g,"");p=p.filter(a=>(a.searchValue||"").toLower().replace(/ /g,"").includes(o))}),p}},L={Shallow:e=>{let{rootStates:t,val_status:r}=e,p=ce(t);return l(E,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:l(q.Description,h(f({className:t.className},p),{position:"absolute",width:1,freeCSS:h(f({},p.freeCSS),{color:"orange"}),"data-id":"shallow_"+r.componentId,children:l(E,{"data-input-value-shallow":r.componentId,children:"A"})}))})},Button:e=>{let{rootStates:t,val_keyword:r,set_keyword:p,val_optionFocused:o,set_optionFocused:a,val_preventOpenSelector:n,set_preventOpenSelector:d,val_openSelector:s,set_openSelector:u,val_status:i,set_status:S,val_activeInput:m,set_activeInput:y,val_validate:C,set_validate:O}=e,Y=t,{tone:g,required:A,form:I,className:w,multiSelect:R,enableFormSubmit:K,checkValidationAtFirst:N,onValidate:$,onValidateDelay:Q,onUpdateValue:U,onUpdateValidValue:J,onUserAction:j,value:G="",options:T,leftIndicator:B,rightIndicator:k,leftIcon:he,rightIcon:ge,componentId:Ie,status_id:be,wrapStyles:Ce,emptySelect:De,SearchInput:Oe,SearchInputPlaceholder:we,SelectedComponent:Re,SelectorComponent:Te,SelectorStyles:ke,SelectorPosition:xe,DynamicOptionsOnSearch:Ve,DynamicOptionsOnSearchDelay:Ae}=Y,v=ee(Y,["tone","required","form","className","multiSelect","enableFormSubmit","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentId","status_id","wrapStyles","emptySelect","SearchInput","SearchInputPlaceholder","SelectedComponent","SelectorComponent","SelectorStyles","SelectorPosition","DynamicOptionsOnSearch","DynamicOptionsOnSearchDelay"]);return F(()=>{var x;if(t.disabled||!s||c.is.exist(o))return;let _=z.FilterSelectableOptions(e.val_options,r,!1);a(((x=_[0])==null?void 0:x.id)||"")},[r]),F(()=>{if(i.eventType!="init"&&i.eventType!="override"){if(t.max==i.dataValue.length){u(!1),d(!0),p("");return}c("#SearchInput_"+t.componentId).focus()}},[i.dataValue]),F(()=>{let _="autocomplete-click-"+t.componentId;if(!s){c(document).removeEvent([_]);return}c('[data-input-origin="'+t.componentId+'"]')&&(c("#SearchInput_"+t.componentId).focus(),c(document).addEvent({eventID:_,eventType:"mousedown",callback:ie=>{let Z=c(ie.target),re=!!c(Z).parent("."+W("Core")).length,se=!!c(Z).parent("."+W("Selector")).length;re||se||(u(!1),y(!1))},options:{passive:!1}}))},[s]),V(X,{children:[l(E,h(f({tabIndex:0},v),{"data-disabled":t.disabled,"data-show-validation":M.isShowValidation(C,i,!!N),"data-component-id":i.componentId,"data-input-origin":i.componentId,"data-focus":!!s||!!m,className:[w,W("Core")].join(" "),onFocus:_=>{if(v!=null&&v.onFocus&&(v==null||v.onFocus(_)),!t.disabled){if(n)return d(!1);u(!0),y(!0),_.preventDefault()}},onCompositionStart:_=>{v!=null&&v.onCompositionStart&&(v==null||v.onCompositionStart(_))},onCompositionEnd:_=>{v!=null&&v.onCompositionEnd&&(v==null||v.onCompositionEnd(_))},onClick:_=>{v!=null&&v.onClick&&(v==null||v.onClick(_)),!t.disabled&&(u(!0),y(!0))},onKeyDown:_=>{let{key:x}=_;K&&M.SubmitForm(_,I),!s&&(x==" "||x=="ArrowDown"||x=="ArrowUp"||x=="Enter")&&(u(!0),y(!0))},children:V(P.Left,{gap:0,children:[l(pe,{width:0,overflow:"hidden",opacity:"trans",children:"A"}),V(P.Left,{flexWrap:!0,flexSizing:0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[l(L.Selected,f({},e)),l(L.SearchInput,f({},e))]})]})})),s&&l(L.Selector,f({},e))]})},SearchInput:e=>{let{rootStates:t,val_status:r,set_status:p}=e;return t.disabled||!e.val_openSelector&&!e.val_activeInput?null:l(E,{htmlTag:"input",id:"SearchInput_"+t.componentId,placeholder:t.SearchInputPlaceholder||"\u691C\u7D22...",opacity:e.val_openSelector?"max":"middle",transition:"middle",flexSizing:0,fontSize:"inherit",border:"unset",backgroundColor:"trans",value:e.val_keyword,freeCSS:{outline:"none"},onFocus:o=>{p(a=>h(f({},a),{eventID:D(),isFocusing:!0}))},onBlur:o=>{e.set_activeInput(!1),p(a=>h(f({},a),{eventID:D(),isFocusing:!1}))},onCompositionStart:o=>{p(a=>h(f({},a),{eventID:D(),isComposing:!0}))},onCompositionEnd:o=>{p(a=>h(f({},a),{eventID:D(),isComposing:!1}))},onKeyDown:o=>{let{key:a,metaKey:n,ctrlKey:d}=o,s=n||d;a=="Tab"?(e.set_openSelector(!1),e.set_activeInput(!1),e.set_preventOpenSelector(!1)):a==" "?c.scope(()=>{e.val_openSelector||e.val_keyword||(o.preventDefault(),e.set_openSelector(!0))}):a=="Backspace"?c.scope(()=>{if(e.val_keyword)return;let u=[...e.val_status.dataValue];u.pop(),e.set_status(i=>h(f({},i),{dataValue:u,eventType:"update",eventID:D(),isInspected:!1}))}):a=="Enter"&&c.scope(()=>{if(r.isComposing||(o==null?void 0:o.keyCode)===229)return;if(!e.val_openSelector)return e.set_openSelector(!0);if(!e.val_optionFocused)return;let u=e.val_options.find(S=>(S==null?void 0:S.id)==e.val_optionFocused);if(!u)return;let{value:i}=u;e.set_status(S=>{let m=[...S.dataValue];return c.scope(()=>{if(i===null)return m=[];S.dataValue.includes(i)?m=m.filter(C=>C!==i):t.multiSelect?m.push(i):m=[i]}),h(f({},S),{dataValue:m,eventType:"update",eventID:D(),isInspected:!1})}),e.set_optionsModified(!0),e.set_keyword("")}),c.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(a))return;if(o.preventDefault(),!e.val_openSelector)return e.set_openSelector(!0);let u=a=="ArrowDown"?1:-1,i=z.FilterSelectableOptions(e.val_options),S=i.length-1,m=null;c.scope(()=>{var C,O,g,A,I,w;let y=i.findIndex(R=>(R==null?void 0:R.id)==e.val_optionFocused);if(y==-1&&(y=0),u==1){if(m=(C=i[0])==null?void 0:C.id,s){m=(O=i[S])==null?void 0:O.id;return}if(y==-1||y==S)return;m=(g=i[y+1])==null?void 0:g.id}else{if(m=(A=i[S])==null?void 0:A.id,s){m=(I=i[0])==null?void 0:I.id;return}if(y==-1||y==0)return;m=(w=i[y-1])==null?void 0:w.id}}),e.set_optionFocused(m)}),t.enableFormSubmit&&M.SubmitForm(o,e.rootStates.form)},onChange:o=>{let n=o.target.value;e.set_openSelector(!0),e.set_keyword(n)}},"searchInput")},Selector:e=>{var d;let[t,r]=b("idle"),[p,o]=b("idle");F(()=>{if(!e.rootStates.DynamicOptionsOnSearch||!e.val_openSelector)return;if(e.val_optionsModified)return e.set_optionsModified(!1);if(e.val_status.isComposing)return;if(t=="idle")return r("ok");o("fetch");let s="autocomplete-search-"+e.rootStates.componentId;e.set_optionFocused(""),c.interval.once(()=>te(void 0,null,function*(){var S;let u=yield e.rootStates.DynamicOptionsOnSearch(e.val_keyword);o("idle");let i=z.InitOptions(u||[]);e.set_options(i),e.set_optionFocused(((S=i[0])==null?void 0:S.id)||"")}),e.rootStates.DynamicOptionsOnSearchDelay||500,s)},[e.val_keyword,e.val_status.isComposing]),F(()=>{let s=c(`[data-selector-id="${e.val_status.componentId}"]`)[0];if(!s)return;let u=c(`[data-autocomplete-input-value="${e.val_optionFocused}"]`)[0];u&&(s.scrollTop=u.offsetTop-24)},[e.val_optionFocused]);let a=z.FilterSelectableOptions(e.val_options,e.rootStates.DynamicOptionsOnSearch?"":e.val_keyword,!0),n={};switch(e.rootStates.SelectorPosition){case 1:n.bottom="100%",n.left=0,n.paddingBottom="1/3";break;case 2:n.bottom="100%",n.right=0,n.paddingBottom="1/3";break;case 3:n.top="100%",n.left=0,n.paddingTop="1/3";break;case 4:n.top="100%",n.right=0,n.paddingTop="1/3";break;default:break}return l(E,h(f({position:"absolute"},n),{freeCSS:f({minWidth:"75%",zIndex:1e3},n.freeCSS),children:l(Se.Body,h(f({className:W("Selector"),borderRadius:"2.tone.secondary",ssCardBox:!0,boxShadow:"1.normal",overflow:"auto","data-selector-id":e.val_status.componentId},e.rootStates.SelectorStyles),{freeCSS:f({maxHeight:12*24},(d=e.rootStates.SelectorStyles)==null?void 0:d.freeCSS),children:V(oe,{gap:"1/12",padding:[1,0],children:[p=="fetch"&&l(P.Center,{padding:"1/2",children:l(de.Theme.R,{showInitial:!0})}),p!="fetch"&&V(X,{children:[!a.length&&l(q.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"}),a.map((s,u)=>{if(!s)return null;let{type:i,value:S}=s,m=e.val_optionFocused==s.id,y=e.val_status.dataValue.includes(S),C=e.rootStates.SelectorComponent;return l(oe,{"data-autocomplete-input-value":s.id,children:l(C,{option:s,isFocused:m,isSelected:y,addCallback:()=>{e.set_status(O=>{let g=[...O.dataValue];return c.scope(()=>{if(S===null)return g=[];O.dataValue.includes(S)?g=g.filter(I=>I!==S):e.rootStates.multiSelect?g.push(S):g=[S]}),h(f({},O),{dataValue:g,eventType:"update",eventID:D(),isInspected:!1})})}})},s.id)})]})]})}))}))},Selected:e=>{let{rootStates:t,val_status:r,set_status:p,val_optionsDict:o}=e,a=[];return r.dataValue.forEach(n=>{let d=o[c.Stringify(n)];if(!d)return;let s=t.SelectedComponent,u=d.label;(d==null?void 0:d.value)===null&&(u=""),a.push(l(E,{className:W("SelectedCell"),children:l(s,{value:d==null?void 0:d.value,label:u,removeCallback:i=>{if(i.stopPropagation(),i.preventDefault(),t.disabled)return;let S=[...r.dataValue];S=S.filter(m=>m!==n),p(m=>h(f({},m),{dataValue:S,eventType:"update",eventID:D(),isInspected:!1}))}})},c.Stringify(d==null?void 0:d.value)||D()))}),l(X,{children:a})},Core:e=>{var J,j,G;let{value:t}=e,[r,p]=b(!1),[o,a]=b(!1),[n,d]=b(!1),[s,u]=b(!1),[i,S]=b(""),[m,y]=b(e.options),[C,O]=b(((J=e.options.find(T=>{var B;return(T==null?void 0:T.value)===((B=e.value)==null?void 0:B[0])}))==null?void 0:J.id)||((j=e.options[0])==null?void 0:j.id)||""),[g,A]=b({}),[I,w]=b(M.DefaultStatus(e.componentId,t)),[R,K]=b({ok:!1,notice:[]}),N=ue(!1);F(()=>{o||(N.current?y(e.options):N.current=!0)},[c.Stringify((G=e.options)==null?void 0:G.map(T=>T.value))]),F(()=>{if(!m.length)return;let T=[...m],B=f({},g);T.forEach(k=>{(k==null?void 0:k.type)!="label"&&(B[c.Stringify(k==null?void 0:k.value)]=k)}),A(B)},[m]);let $={rootStates:e,val_options:m,set_options:y,val_optionFocused:C,set_optionFocused:O,val_optionsDict:g,set_optionsDict:A,val_optionsModified:o,set_optionsModified:a,val_preventOpenSelector:r,set_preventOpenSelector:p,val_openSelector:n,set_openSelector:d,val_activeInput:s,set_activeInput:u,val_keyword:i,set_keyword:S,val_status:I,set_status:w,val_validate:R,set_validate:K},Q=!!e.multiSelect;M.CommonEffects({type:Q?"autocomplete.multi":"autocomplete.single",states:e,val_status:I,set_status:w,val_validate:R,set_validate:K,SystemValidation:_e});let U=I.dataValue.length&&I.dataValue[0]!==null;return U=U||n||s,V(me,{val_status:I,set_status:w,val_validate:R,states:e,children:[l(ye,{componentId:e.componentId,fontSize:e.fontSize,required:e.required,label:e.label,isActive:U}),l(L.Shallow,f({},$)),l(L.Button,f({},$))]})}},ne=e=>{let t=f({},e);return t=h(f({value:[],min:0,max:65535,multiSelect:!0,SearchInput:!0,emptySelect:!0,SelectorComponent:({option:r,isSelected:p,isFocused:o,addCallback:a})=>r?(r==null?void 0:r.type)=="label"?l(X,{children:r.label}):l(ae.Sub.S,{color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1.5],isActive:o,isActiveStyles:{backgroundColor:"cloud"},onClick:a,children:V(P.Left,{gap:"1/2",children:[p&&l(H.Check,{fontColor:"theme"}),l(q.Supplement,{transition:"short",children:r.label})]})}):null,SelectedComponent:({value:r,label:p,removeCallback:o})=>V(P.Left,{ssCardBox:"cloud",borderRadius:"2.tone.secondary",fontSize:"1.mini",padding:"1/2",gap:0,children:[l(E,{padding:[0,"1/4"],children:p}),l(ae.Clear,{flexSizing:"none",color:"nega",fontColor:"4.thin",tabIndex:-1,isRounded:!0,padding:"1/4",onClick:o,freeCSS:{lineHeight:1,aspectRatio:"1/1"},children:l(H.X,{})})]}),SelectorPosition:3},t),{freeCSS:f({cursor:"pointer"},t.freeCSS)}),t.multiSelect||(t.min=0,t.max=1),t.options=t.options||[],t.emptySelect&&(t.options=[{value:null,label:l(q.Supplement,{fontColor:"4.thin",children:"\u9078\u629E\u3092\u89E3\u9664"})},...t.options]),t.value=c.flatArray(t.value),t.options=z.InitOptions(t.options),c.is.nullish(t.rightIcon)&&(t.rightIcon=l(le,{children:l(H.Search,{})}),t.disabled&&(t.rightIcon=l(le,{fontColor:"5.translucent",children:l(H.Ban,{})}))),t.rightIcon&&(t=f({paddingRight:3},t)),t.leftIcon&&(t=f({paddingLeft:3},t)),l(fe,{componentId:t.componentId,children:L.Core,states:ve(t)})};export{ne as Autocomplete,ne as default};
1
+ import{b as f,c as g,d as Y,e as Z}from"../../chunk-C5N2D3ZX.js";import{Fragment as H,jsx as l,jsxs as A}from"react/jsx-runtime";import{useState as b,useEffect as F,useRef as re}from"react";import c,{UUID as C}from"jmini";import{ExtractStyles as se}from"../../@utils";import{Box as E,Span as ue,FAI as N,Column as ee}from"../../atoms";import{Literal as U,Row as P}from"../../mols";import{Button as te}from"../Button";import{Loader as ce}from"../Loader";import{Sheet as pe}from"../Sheet";import{OptionalInputWrapper as de,BoxWrapper as Se,CoreEffects as M,DefaultBoxishStyles as fe}from"./core";import{InputAutocompleteClasses as W}from"../../@styles/componentClasses";import{InputLabel as me}from"./Label";import{RightIcon as oe}from".";function ve(e){let{value:t,states:r}=e,{required:p,options:o,min:a,max:n}=r;a=a||0,n=n||65535;let d=[],s=t.filter(u=>u!==null).length;return p&&(s||d.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),s<a&&d.push({type:"invalid",label:a+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),s>n&&d.push({type:"invalid",label:n+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!d.filter(({type:u})=>u=="invalid").length,notice:d}}const z={InitOptions:e=>{let t=[];return e.forEach(r=>{if(!r)return;let{type:p,label:o,value:a,searchValue:n}=r,d=n||c.is.string(o)&&o||""||c.is.string(a)&&a||c.Stringify(a||"")||"";c.is.nullish(o)&&(o=String(a)),t.push(g(f({id:C()},r),{searchValue:d,type:p||"selector",label:o,value:a}))}),t},FilterSelectableOptions:(e,t,r)=>{let p=e;return r||(p=e.filter(o=>(o==null?void 0:o.type)!="label")),c.scope(()=>{if(!t)return;let o=t.toLower().replace(/ /g,"");p=p.filter(a=>(a.searchValue||"").toLower().replace(/ /g,"").includes(o))}),p}},L={Shallow:e=>{let{rootStates:t,val_status:r}=e,p=se(t);return l(E,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:l(U.Description,g(f({className:t.className},p),{position:"absolute",width:1,freeCSS:g(f({},p.freeCSS),{color:"orange"}),"data-id":"shallow_"+r.componentId,children:l(E,{"data-input-value-shallow":r.componentId,children:"A"})}))})},Button:e=>{let{rootStates:t,val_keyword:r,set_keyword:p,val_optionFocused:o,set_optionFocused:a,val_preventOpenSelector:n,set_preventOpenSelector:d,val_openSelector:s,set_openSelector:u,val_status:i,set_status:S,val_activeInput:m,set_activeInput:y}=e,G=t,{tone:D,required:O,form:h,className:w,multiSelect:I,enableFormSubmit:x,checkValidationAtFirst:k,onValidate:q,onValidateDelay:j,onUpdateValue:K,onUpdateValidValue:X,onUserAction:$,value:J="",options:R,leftIndicator:B,rightIndicator:T,leftIcon:ye,rightIcon:_e,componentId:ge,status_id:he,wrapStyles:Ie,emptySelect:be,SearchInput:Ce,SearchInputPlaceholder:De,SelectedComponent:Oe,SelectorComponent:we,SelectorStyles:xe,SelectorPosition:ke,DynamicOptionsOnSearch:Re,DynamicOptionsOnSearchDelay:Te}=G,v=Y(G,["tone","required","form","className","multiSelect","enableFormSubmit","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentId","status_id","wrapStyles","emptySelect","SearchInput","SearchInputPlaceholder","SelectedComponent","SelectorComponent","SelectorStyles","SelectorPosition","DynamicOptionsOnSearch","DynamicOptionsOnSearchDelay"]);return F(()=>{var V;if(t.disabled||!s||c.is.exist(o))return;let _=z.FilterSelectableOptions(e.val_options,r,!1);a(((V=_[0])==null?void 0:V.id)||"")},[r]),F(()=>{if(i.eventType!="init"&&i.eventType!="override"){if(t.max==i.dataValue.length){u(!1),d(!0),p("");return}c("#SearchInput_"+t.componentId).focus()}},[i.dataValue]),F(()=>{let _="autocomplete-click-"+t.componentId;if(!s){c(document).removeEvent([_]);return}c('[data-input-origin="'+t.componentId+'"]')&&(c("#SearchInput_"+t.componentId).focus(),c(document).addEvent({eventID:_,eventType:"mousedown",callback:le=>{let Q=c(le.target),ne=!!c(Q).parent("."+W("Core")).length,ie=!!c(Q).parent("."+W("Selector")).length;ne||ie||(u(!1),y(!1))},options:{passive:!1}}))},[s]),A(H,{children:[l(E,g(f({tabIndex:0},v),{"data-disabled":t.disabled,"data-show-validation":M.isShowValidation(i,!!k),"data-component-id":i.componentId,"data-input-origin":i.componentId,"data-focus":!!s||!!m,className:[w,W("Core")].join(" "),onFocus:_=>{if(v!=null&&v.onFocus&&(v==null||v.onFocus(_)),!t.disabled){if(n)return d(!1);u(!0),y(!0),_.preventDefault()}},onCompositionStart:_=>{v!=null&&v.onCompositionStart&&(v==null||v.onCompositionStart(_))},onCompositionEnd:_=>{v!=null&&v.onCompositionEnd&&(v==null||v.onCompositionEnd(_))},onClick:_=>{v!=null&&v.onClick&&(v==null||v.onClick(_)),!t.disabled&&(u(!0),y(!0))},onKeyDown:_=>{let{key:V}=_;x&&M.SubmitForm(_,h),!s&&(V==" "||V=="ArrowDown"||V=="ArrowUp"||V=="Enter")&&(u(!0),y(!0))},children:A(P.Left,{gap:0,children:[l(ue,{width:0,overflow:"hidden",opacity:"trans",children:"A"}),A(P.Left,{flexWrap:!0,flexSizing:0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[l(L.Selected,f({},e)),l(L.SearchInput,f({},e))]})]})})),s&&l(L.Selector,f({},e))]})},SearchInput:e=>{let{rootStates:t,val_status:r,set_status:p}=e;return t.disabled||!e.val_openSelector&&!e.val_activeInput?null:l(E,{htmlTag:"input",id:"SearchInput_"+t.componentId,placeholder:t.SearchInputPlaceholder||"\u691C\u7D22...",opacity:e.val_openSelector?"max":"middle",transition:"middle",flexSizing:0,fontSize:"inherit",border:"unset",backgroundColor:"trans",value:e.val_keyword,freeCSS:{outline:"none"},onFocus:o=>{p(a=>g(f({},a),{eventID:C(12),isFocusing:!0}))},onBlur:o=>{e.set_activeInput(!1),p(a=>g(f({},a),{eventID:C(12),isFocusing:!1}))},onCompositionStart:o=>{p(a=>g(f({},a),{eventID:C(12),isComposing:!0}))},onCompositionEnd:o=>{p(a=>g(f({},a),{eventID:C(12),isComposing:!1}))},onKeyDown:o=>{let{key:a,metaKey:n,ctrlKey:d}=o,s=n||d;a=="Tab"?(e.set_openSelector(!1),e.set_activeInput(!1),e.set_preventOpenSelector(!1)):a==" "?c.scope(()=>{e.val_openSelector||e.val_keyword||(o.preventDefault(),e.set_openSelector(!0))}):a=="Backspace"?c.scope(()=>{if(e.val_keyword)return;let u=[...e.val_status.dataValue];u.pop(),e.set_status(i=>g(f({},i),{dataValue:u,eventType:"update",eventID:C(12),isInspected:!1}))}):a=="Enter"&&c.scope(()=>{if(r.isComposing||(o==null?void 0:o.keyCode)===229)return;if(!e.val_openSelector)return e.set_openSelector(!0);if(!e.val_optionFocused)return;let u=e.val_options.find(S=>(S==null?void 0:S.id)==e.val_optionFocused);if(!u)return;let{value:i}=u;e.set_status(S=>{let m=[...S.dataValue];return c.scope(()=>{if(i===null)return m=[];S.dataValue.includes(i)?m=m.filter(D=>D!==i):t.multiSelect?m.push(i):m=[i]}),g(f({},S),{dataValue:m,eventType:"update",eventID:C(12),isInspected:!1})}),e.set_optionsModified(!0),e.set_keyword("")}),c.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(a))return;if(o.preventDefault(),!e.val_openSelector)return e.set_openSelector(!0);let u=a=="ArrowDown"?1:-1,i=z.FilterSelectableOptions(e.val_options),S=i.length-1,m=null;c.scope(()=>{var D,O,h,w,I,x;let y=i.findIndex(k=>(k==null?void 0:k.id)==e.val_optionFocused);if(y==-1&&(y=0),u==1){if(m=(D=i[0])==null?void 0:D.id,s){m=(O=i[S])==null?void 0:O.id;return}if(y==-1||y==S)return;m=(h=i[y+1])==null?void 0:h.id}else{if(m=(w=i[S])==null?void 0:w.id,s){m=(I=i[0])==null?void 0:I.id;return}if(y==-1||y==0)return;m=(x=i[y-1])==null?void 0:x.id}}),e.set_optionFocused(m)}),t.enableFormSubmit&&M.SubmitForm(o,e.rootStates.form)},onChange:o=>{let n=o.target.value;e.set_openSelector(!0),e.set_keyword(n)}},"searchInput")},Selector:e=>{var d;let[t,r]=b("idle"),[p,o]=b("idle");F(()=>{if(!e.rootStates.DynamicOptionsOnSearch||!e.val_openSelector)return;if(e.val_optionsModified)return e.set_optionsModified(!1);if(e.val_status.isComposing)return;if(t=="idle")return r("ok");o("fetch");let s="autocomplete-search-"+e.rootStates.componentId;e.set_optionFocused(""),c.interval.once(()=>Z(void 0,null,function*(){var S;let u=yield e.rootStates.DynamicOptionsOnSearch(e.val_keyword);o("idle");let i=z.InitOptions(u||[]);e.set_options(i),e.set_optionFocused(((S=i[0])==null?void 0:S.id)||"")}),e.rootStates.DynamicOptionsOnSearchDelay||500,s)},[e.val_keyword,e.val_status.isComposing]),F(()=>{let s=c(`[data-selector-id="${e.val_status.componentId}"]`)[0];if(!s)return;let u=c(`[data-autocomplete-input-value="${e.val_optionFocused}"]`)[0];u&&(s.scrollTop=u.offsetTop-24)},[e.val_optionFocused]);let a=z.FilterSelectableOptions(e.val_options,e.rootStates.DynamicOptionsOnSearch?"":e.val_keyword,!0),n={};switch(e.rootStates.SelectorPosition){case 1:n.bottom="100%",n.left=0,n.paddingBottom="1/3";break;case 2:n.bottom="100%",n.right=0,n.paddingBottom="1/3";break;case 3:n.top="100%",n.left=0,n.paddingTop="1/3";break;case 4:n.top="100%",n.right=0,n.paddingTop="1/3";break;default:break}return l(E,g(f({position:"absolute"},n),{freeCSS:f({minWidth:"75%",zIndex:1e3},n.freeCSS),children:l(pe.Body,g(f({className:W("Selector"),borderRadius:"2.tone.secondary",ssCardBox:!0,boxShadow:"1.normal",overflow:"auto","data-selector-id":e.val_status.componentId},e.rootStates.SelectorStyles),{freeCSS:f({maxHeight:12*24},(d=e.rootStates.SelectorStyles)==null?void 0:d.freeCSS),children:A(ee,{gap:"1/12",padding:[1,0],children:[p=="fetch"&&l(P.Center,{padding:"1/2",children:l(ce.Theme.R,{showInitial:!0})}),p!="fetch"&&A(H,{children:[!a.length&&l(U.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"}),a.map((s,u)=>{if(!s)return null;let{type:i,value:S}=s,m=e.val_optionFocused==s.id,y=e.val_status.dataValue.includes(S),D=e.rootStates.SelectorComponent;return l(ee,{"data-autocomplete-input-value":s.id,children:l(D,{option:s,isFocused:m,isSelected:y,addCallback:()=>{e.set_status(O=>{let h=[...O.dataValue];return c.scope(()=>{if(S===null)return h=[];O.dataValue.includes(S)?h=h.filter(I=>I!==S):e.rootStates.multiSelect?h.push(S):h=[S]}),g(f({},O),{dataValue:h,eventType:"update",eventID:C(12),isInspected:!1})})}})},s.id)})]})]})}))}))},Selected:e=>{let{rootStates:t,val_status:r,set_status:p,val_optionsDict:o}=e,a=[];return r.dataValue.forEach(n=>{let d=o[c.Stringify(n)];if(!d)return;let s=t.SelectedComponent,u=d.label;(d==null?void 0:d.value)===null&&(u=""),a.push(l(E,{className:W("SelectedCell"),children:l(s,{value:d==null?void 0:d.value,label:u,removeCallback:i=>{if(i.stopPropagation(),i.preventDefault(),t.disabled)return;let S=[...r.dataValue];S=S.filter(m=>m!==n),p(m=>g(f({},m),{dataValue:S,eventType:"update",eventID:C(12),isInspected:!1}))}})},c.Stringify(d==null?void 0:d.value)||C()))}),l(H,{children:a})},Core:e=>{var X,$,J;let{value:t}=e,[r,p]=b(!1),[o,a]=b(!1),[n,d]=b(!1),[s,u]=b(!1),[i,S]=b(""),[m,y]=b(e.options),[D,O]=b(((X=e.options.find(R=>{var B;return(R==null?void 0:R.value)===((B=e.value)==null?void 0:B[0])}))==null?void 0:X.id)||(($=e.options[0])==null?void 0:$.id)||""),[h,w]=b({}),[I,x]=b(M.DefaultStatus(e.componentId,t)),k=re(!1);F(()=>{o||(k.current?y(e.options):k.current=!0)},[c.Stringify((J=e.options)==null?void 0:J.map(R=>R.value))]),F(()=>{if(!m.length)return;let R=[...m],B=f({},h);R.forEach(T=>{(T==null?void 0:T.type)!="label"&&(B[c.Stringify(T==null?void 0:T.value)]=T)}),w(B)},[m]);let q={rootStates:e,val_options:m,set_options:y,val_optionFocused:D,set_optionFocused:O,val_optionsDict:h,set_optionsDict:w,val_optionsModified:o,set_optionsModified:a,val_preventOpenSelector:r,set_preventOpenSelector:p,val_openSelector:n,set_openSelector:d,val_activeInput:s,set_activeInput:u,val_keyword:i,set_keyword:S,val_status:I,set_status:x},j=!!e.multiSelect;M.CommonEffects({type:j?"autocomplete.multi":"autocomplete.single",states:e,val_status:I,set_status:x,SystemValidation:ve});let K=I.dataValue.length&&I.dataValue[0]!==null;return K=K||n||s,A(Se,{val_status:I,set_status:x,states:e,children:[l(me,{componentId:e.componentId,fontSize:e.fontSize,required:e.required,label:e.label,isActive:K}),l(L.Shallow,f({},q)),l(L.Button,f({},q))]})}},ae=e=>{let t=f({},e);return t=g(f({value:[],min:0,max:65535,multiSelect:!0,SearchInput:!0,emptySelect:!0,SelectorComponent:({option:r,isSelected:p,isFocused:o,addCallback:a})=>r?(r==null?void 0:r.type)=="label"?l(H,{children:r.label}):l(te.Sub.S,{color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1.5],isActive:o,isActiveStyles:{backgroundColor:"cloud"},onClick:a,children:A(P.Left,{gap:"1/2",children:[p&&l(N.Check,{fontColor:"theme"}),l(U.Supplement,{transition:"short",children:r.label})]})}):null,SelectedComponent:({value:r,label:p,removeCallback:o})=>A(P.Left,{ssCardBox:"cloud",borderRadius:"2.tone.secondary",fontSize:"1.mini",padding:"1/2",gap:0,children:[l(E,{padding:[0,"1/4"],children:p}),l(te.Clear,{flexSizing:"none",color:"nega",fontColor:"4.thin",tabIndex:-1,isRounded:!0,padding:"1/4",onClick:o,freeCSS:{lineHeight:1,aspectRatio:"1/1"},children:l(N.X,{})})]}),SelectorPosition:3},t),{freeCSS:f({cursor:"pointer"},t.freeCSS)}),t.multiSelect||(t.min=0,t.max=1),t.options=t.options||[],t.emptySelect&&(t.options=[{value:null,label:l(U.Supplement,{fontColor:"4.thin",children:"\u9078\u629E\u3092\u89E3\u9664"})},...t.options]),t.value=c.flatArray(t.value),t.options=z.InitOptions(t.options),c.is.nullish(t.rightIcon)&&(t.rightIcon=l(oe,{children:l(N.Search,{})}),t.disabled&&(t.rightIcon=l(oe,{fontColor:"5.translucent",children:l(N.Ban,{})}))),t.rightIcon&&(t=f({paddingRight:3},t)),t.leftIcon&&(t=f({paddingLeft:3},t)),l(de,{componentId:t.componentId,children:L.Core,states:fe(t)})};export{ae as Autocomplete,ae as default};
@@ -1 +1 @@
1
- import{b as a,c as n,d as S}from"../../chunk-C5N2D3ZX.js";import{jsx as I}from"react/jsx-runtime";import{UUID as m}from"jmini";import{useState as T}from"react";import h from"../../atoms/Box";import{OptionalInputWrapper as x,BoxWrapper as B,CoreEffects as c,DefaultBoxishStyles as _}from"./core";import{InputSwitchClasses as k}from"../../@styles/componentClasses";function R(e){let{value:u,states:f}=e,{required:p}=f,l=[];return p&&!u&&l.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!l.filter(({type:C})=>C=="invalid").length,notice:l}}const U=e=>{let V=e,{componentId:u,required:f,form:p,enableFormSubmit:l,checkValidationAtFirst:C,onChange:y,onKeyDown:v,onValidate:w,onValidateDelay:E,onUpdateValue:W,onUpdateValidValue:A,onUserAction:H,value:D=""}=V,t=S(V,["componentId","required","form","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value"]),[r,i]=T(c.DefaultStatus(e.componentId||"",D)),[d,g]=T({ok:!1,notice:[]});return c.CommonEffects({type:"color",states:e,val_status:r,set_status:i,val_validate:d,set_validate:g,SystemValidation:R}),I(B,{val_status:r,set_status:i,val_validate:d,states:e,children:I(h,a({htmlTag:"input",type:"color","data-component-id":r.componentId,value:r.dataValue,className:k("Input"),onKeyDown:o=>{v&&v(o),l&&c.SubmitForm(o,p)},onChange:o=>{let{value:s}=o.target;d.ok&&g({ok:!1,notice:[]}),i(F=>n(a({},F),{dataValue:s,eventType:"update",eventID:m(),isInspected:!1})),y&&y(o)},onFocus:o=>{t!=null&&t.onFocus&&(t==null||t.onFocus(o)),i(s=>n(a({},s),{eventID:m(),isFocusing:!0}))},onBlur:o=>{t!=null&&t.onBlur&&(t==null||t.onBlur(o)),i(s=>n(a({},s),{eventID:m(),isFocusing:!1}))}},t))})},b=e=>{let u=n(a(n(a({},_(e)),{backgroundColor:"cloud",unitHeight:3}),e),{freeCSS:a({minWidth:108},e.freeCSS)});return I(x,{componentId:e.componentId,children:U,states:u})};export{b as Color,b as default};
1
+ import{b as n,c as a,d as v}from"../../chunk-C5N2D3ZX.js";import{jsx as c}from"react/jsx-runtime";import{UUID as m}from"jmini";import{useState as D}from"react";import F from"../../atoms/Box";import{OptionalInputWrapper as T,BoxWrapper as h,CoreEffects as d,DefaultBoxishStyles as x}from"./core";import{InputSwitchClasses as B}from"../../@styles/componentClasses";function U(e){let{value:s,states:I}=e,{required:p}=I,l=[];return p&&!s&&l.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!l.filter(({type:f})=>f=="invalid").length,notice:l}}const w=e=>{let g=e,{componentId:s,required:I,form:p,enableFormSubmit:l,checkValidationAtFirst:f,onChange:C,onKeyDown:y,onValidate:E,onValidateDelay:R,onUpdateValue:W,onUpdateValidValue:_,onUserAction:k,value:S=""}=g,t=v(g,["componentId","required","form","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value"]),[i,r]=D(d.DefaultStatus(e.componentId||"",S));return d.CommonEffects({type:"color",states:e,val_status:i,set_status:r,SystemValidation:U}),c(h,{val_status:i,set_status:r,states:e,children:c(F,n({htmlTag:"input",type:"color","data-component-id":i.componentId,value:i.dataValue,className:B("Input"),onKeyDown:o=>{y&&y(o),l&&d.SubmitForm(o,p)},onChange:o=>{let{value:u}=o.target;r(b=>a(n({},b),{dataValue:u,eventType:"update",eventID:m(12),isInspected:!1,isValidated:!1,notice:[]})),C&&C(o)},onFocus:o=>{t!=null&&t.onFocus&&(t==null||t.onFocus(o)),r(u=>a(n({},u),{eventID:m(12),isFocusing:!0}))},onBlur:o=>{t!=null&&t.onBlur&&(t==null||t.onBlur(o)),r(u=>a(n({},u),{eventID:m(12),isFocusing:!1}))}},t))})},V=e=>{let s=a(n(a(n({},x(e)),{backgroundColor:"cloud",unitHeight:3}),e),{freeCSS:n({minWidth:108},e.freeCSS)});return c(T,{componentId:e.componentId,children:w,states:s})};export{V as Color,V as default};
@@ -1 +1 @@
1
- import{b as o,c as r,d as b}from"../../chunk-C5N2D3ZX.js";import{jsx as c}from"react/jsx-runtime";import{UUID as g}from"jmini";import{useState as h}from"react";import{OptionalInputWrapper as w,BoxWrapper as _,CoreEffects as s,DefaultBoxishStyles as B}from"./core";import{Box as k}from"../../atoms";function F(t){let{value:e,states:u}=t,{required:m}=u,n=[];return m&&!e&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!n.filter(({type:p})=>p=="invalid").length,notice:n}}const H=t=>{let T=t,{componentId:e,tone:u,required:m,form:n,value:p,enableFormSubmit:S,checkValidationAtFirst:C,onInput:f,onKeyDown:I,onValidate:L,onValidateDelay:M,onUpdateValue:U,onUpdateValidValue:A,onUserAction:W,children:E="",leftIndicator:q,rightIndicator:K,leftIcon:G,rightIcon:N,freeCSS:O,wrapStyles:P}=T,V=b(T,["componentId","tone","required","form","value","enableFormSubmit","checkValidationAtFirst","onInput","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","children","leftIndicator","rightIndicator","leftIcon","rightIcon","freeCSS","wrapStyles"]),[i,d]=h(s.DefaultStatus(e,p)),[l,y]=h({ok:!1,notice:[]});return s.CommonEffects({type:"contenteditable",states:t,val_status:i,set_status:d,val_validate:l,set_validate:y,SystemValidation:F}),c(_,{val_status:i,set_status:d,val_validate:l,states:t,children:c(k,r(o({contentEditable:!0,"data-show-validation":s.isShowValidation(l,i,!!C),"data-component-id":i.componentId,onKeyDown:a=>{I&&I(a),S&&s.SubmitForm(a,n)},onInput:a=>{let R=a.currentTarget,{innerHTML:z,innerText:x}=R;l.ok&&y({ok:!1,notice:[]}),d(D=>r(o({},D),{dataValue:x,eventType:"update",eventID:g(),isInspected:!1})),f&&f(a)}},V),{children:E}))})},v=t=>{t=r(o({rows:5},t),{freeCSS:o({whiteSpace:"pre-wrap"},t.freeCSS)});let e=B(t);return c(w,{componentId:t.componentId,children:H,states:e})};export{v as Contenteditable,v as default};
1
+ import{b as o,c as l,d as y}from"../../chunk-C5N2D3ZX.js";import{jsx as d}from"react/jsx-runtime";import{UUID as x}from"jmini";import{useState as R}from"react";import{OptionalInputWrapper as D,BoxWrapper as g,CoreEffects as r,DefaultBoxishStyles as w}from"./core";import{Box as B}from"../../atoms";function F(t){let{value:e,states:c}=t,{required:u}=c,n=[];return u&&!e&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!n.filter(({type:s})=>s=="invalid").length,notice:n}}const H=t=>{let I=t,{componentId:e,tone:c,required:u,form:n,value:s,enableFormSubmit:h,checkValidationAtFirst:S,onInput:m,onKeyDown:f,onValidate:L,onValidateDelay:M,onUpdateValue:U,onUpdateValidValue:_,onUserAction:A,children:T="",leftIndicator:W,rightIndicator:k,leftIcon:q,rightIcon:K,freeCSS:G,wrapStyles:N}=I,C=y(I,["componentId","tone","required","form","value","enableFormSubmit","checkValidationAtFirst","onInput","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","children","leftIndicator","rightIndicator","leftIcon","rightIcon","freeCSS","wrapStyles"]),[i,p]=R(r.DefaultStatus(e,s));return r.CommonEffects({type:"contenteditable",states:t,val_status:i,set_status:p,SystemValidation:F}),d(g,{val_status:i,set_status:p,states:t,children:d(B,l(o({contentEditable:!0,"data-show-validation":r.isShowValidation(i,!!S),"data-component-id":i.componentId,onKeyDown:a=>{f&&f(a),h&&r.SubmitForm(a,n)},onInput:a=>{let E=a.currentTarget,{innerHTML:O,innerText:V}=E;p(v=>l(o({},v),{dataValue:V,eventType:"update",eventID:x(12),isInspected:!1,isValidated:!1,notice:[]})),m&&m(a)}},C),{children:T}))})},b=t=>{t=l(o({rows:5},t),{freeCSS:o({whiteSpace:"pre-wrap"},t.freeCSS)});let e=w(t);return d(D,{componentId:t.componentId,children:H,states:e})};export{b as Contenteditable,b as default};
@@ -1 +1 @@
1
- import{b as t,c as s,d as V}from"../../chunk-C5N2D3ZX.js";import{jsx as D}from"react/jsx-runtime";import{useState as w}from"react";import K,{UUID as g}from"jmini";import{$$fromRoot as U,GenerateHTMLProps as W}from"../../@utils";import{OptionalInputWrapper as $,BoxWrapper as P,CoreEffects as R,DefaultBoxishStyles as q}from"./core";import{Flex as j}from"../../atoms";import{InputClasses as A}from"../../@styles/componentClasses";function z(e){let{value:a,states:u}=e,{required:d,numericOnly:p=!1,digits:C}=u,l=[];return d&&!a&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),a&&(p&&a.match(/\D/)&&l.push({type:"invalid",label:"\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),a.length!=C&&l.push({type:"warn",label:"\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"})),{ok:!l.filter(({type:S})=>S=="invalid"||S=="warn").length,notice:l}}const G=(e,a="")=>{let u=String(a),d=[];for(let p=0;p<e;p++)d[p]=u[p]||"";return{formatValue:d,dataValue:u}},B=(e="")=>{let a=e,u=a.join("");return{formatValue:a,dataValue:u}},J=e=>{let x=e,{tone:a,required:u,form:d,name:p,className:C="",digits:l,numericOnly:h=!1,enableFormSubmit:S,checkValidationAtFirst:Q,onChange:X,onKeyDown:Y,onValidate:Z,onValidateDelay:ee,onUpdateValue:te,onUpdateValidValue:ae,onUserAction:ne,value:N="",override:ie,freeCSS:re,wrapStyles:le,combineInput:oe,componentId:se,listStyles:_}=x,n=V(x,["tone","required","form","name","className","digits","numericOnly","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","override","freeCSS","wrapStyles","combineInput","componentId","listStyles"]),[m,f]=w(s(t({componentId:e.componentId||""},G(l,N)),{eventType:"init",eventID:g()})),[v,k]=w({ok:!1,notice:[]});R.CommonEffects({type:"textfield",states:e,val_status:m,set_status:f,val_validate:v,set_validate:k,SystemValidation:z});let b=[];for(let i=0;i<l;i++){let E=m.formatValue[i],H={},T=C;e.combineInput&&(T=[C,A("DigitCharacterCell"),A("Combined")].join(" ")),b.push(D("input",{type:"text",inputMode:h?"numeric":e.inputMode||"text",value:E,id:"Digit-"+i+"-"+m.componentId,className:T,style:t(t({},e.style),H),onKeyDown:c=>{let{key:o,code:L}=c;if(o=="Tab")return;c.preventDefault();let y=null;if(o=="Backspace"){let r=m.formatValue;r[i]="",f(I=>s(t(t({},I),B(r)),{eventType:"update",eventID:g(),isInspected:!1})),y=i-1}else if(["ArrowLeft","ArrowRight"].includes(o)){let r=+(o=="ArrowRight")*2-1;y=i+r}else S&&R.SubmitForm(c,d),(()=>{let r=L.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);if(!r)return;let I=r[2]||r[3]||r[4];if(h&&!I.match(/\d/)||!I)return;let F=m.formatValue;F[i]=I,f(O=>s(t(t({},O),B(F)),{eventType:"update",eventID:g(),isInspected:!1})),y=i+1})();K.is.exist(y)&&U("#Digit-"+y+"-"+m.componentId).focus()},onChange:()=>{},onFocus:c=>{n!=null&&n.onFocus&&(n==null||n.onFocus(c)),f(o=>s(t({},o),{eventID:g(),isFocusing:!0}))},onBlur:c=>{n!=null&&n.onBlur&&(n==null||n.onBlur(c)),f(o=>s(t({},o),{eventID:g(),isFocusing:!1}))}},i))}return D(P,{val_status:m,set_status:f,val_validate:v,states:e,children:D(j,s(t({gap:"1/2",flexChilds:"even",flexWrap:!1,flexSizing:"auto"},_),{children:b}))})},M=e=>{e=t({},e),e=t({textAlign:"center",width:0},e),e.combineInput&&(e=s(t({textAlign:"center",width:0},e),{freeCSS:t({minWidth:12*2,marginRight:-1},e.freeCSS),listStyles:t({borderRadius:"2.tone.secondary",border:"unset",gap:0},e.listStyles)}));let a=W(q(e));return D($,{componentId:e.componentId,children:J,states:a})};export{M as DigitCharacters,M as default};
1
+ import{b as t,c as s,d as F}from"../../chunk-C5N2D3ZX.js";import{jsx as D}from"react/jsx-runtime";import{useState as O}from"react";import k,{UUID as I}from"jmini";import{$$fromRoot as K,GenerateHTMLProps as U}from"../../@utils";import{OptionalInputWrapper as W,BoxWrapper as _,CoreEffects as V,DefaultBoxishStyles as $}from"./core";import{Flex as P}from"../../atoms";import{InputClasses as w}from"../../@styles/componentClasses";function q(e){let{value:n,states:u}=e,{required:d,numericOnly:p=!1,digits:C}=u,o=[];return d&&!n&&o.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),n&&(p&&n.match(/\D/)&&o.push({type:"invalid",label:"\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n.length!=C&&o.push({type:"warn",label:"\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"})),{ok:!o.filter(({type:S})=>S=="invalid"||S=="warn").length,notice:o}}const j=(e,n="")=>{let u=String(n),d=[];for(let p=0;p<e;p++)d[p]=u[p]||"";return{formatValue:d,dataValue:u}},R=(e="")=>{let n=e,u=n.join("");return{formatValue:n,dataValue:u}},z=e=>{let x=e,{tone:n,required:u,form:d,name:p,className:C="",digits:o,numericOnly:h=!1,enableFormSubmit:S,checkValidationAtFirst:G,onChange:J,onKeyDown:Q,onValidate:X,onValidateDelay:Y,onUpdateValue:Z,onUpdateValidValue:ee,onUserAction:te,value:B="",override:ne,freeCSS:ae,wrapStyles:ie,combineInput:re,componentId:oe,listStyles:M}=x,a=F(x,["tone","required","form","name","className","digits","numericOnly","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","override","freeCSS","wrapStyles","combineInput","componentId","listStyles"]),[m,f]=O(s(t({componentId:e.componentId||""},j(o,B)),{eventType:"init",eventID:I(12)}));V.CommonEffects({type:"textfield",states:e,val_status:m,set_status:f,SystemValidation:q});let b=[];for(let i=0;i<o;i++){let N=m.formatValue[i],E={},T=C;e.combineInput&&(T=[C,w("DigitCharacterCell"),w("Combined")].join(" ")),b.push(D("input",{type:"text",inputMode:h?"numeric":e.inputMode||"text",value:N,id:"Digit-"+i+"-"+m.componentId,className:T,style:t(t({},e.style),E),onKeyDown:c=>{let{key:l,code:H}=c;if(l=="Tab")return;c.preventDefault();let y=null;if(l=="Backspace"){let r=m.formatValue;r[i]="",f(g=>s(t(t({},g),R(r)),{eventType:"update",eventID:I(12),isInspected:!1})),y=i-1}else if(["ArrowLeft","ArrowRight"].includes(l)){let r=+(l=="ArrowRight")*2-1;y=i+r}else S&&V.SubmitForm(c,d),(()=>{let r=H.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);if(!r)return;let g=r[2]||r[3]||r[4];if(h&&!g.match(/\d/)||!g)return;let v=m.formatValue;v[i]=g,f(L=>s(t(t({},L),R(v)),{eventType:"update",eventID:I(12),isInspected:!1})),y=i+1})();k.is.exist(y)&&K("#Digit-"+y+"-"+m.componentId).focus()},onChange:()=>{},onFocus:c=>{a!=null&&a.onFocus&&(a==null||a.onFocus(c)),f(l=>s(t({},l),{eventID:I(12),isFocusing:!0}))},onBlur:c=>{a!=null&&a.onBlur&&(a==null||a.onBlur(c)),f(l=>s(t({},l),{eventID:I(12),isFocusing:!1}))}},i))}return D(_,{val_status:m,set_status:f,states:e,children:D(P,s(t({gap:"1/2",flexChilds:"even",flexWrap:!1,flexSizing:"auto"},M),{children:b}))})},A=e=>{e=t({},e),e=t({textAlign:"center",width:0},e),e.combineInput&&(e=s(t({textAlign:"center",width:0},e),{freeCSS:t({minWidth:12*2,marginRight:-1},e.freeCSS),listStyles:t({borderRadius:"2.tone.secondary",border:"unset",gap:0},e.listStyles)}));let n=U($(e));return D(W,{componentId:e.componentId,children:z,states:n})};export{A as DigitCharacters,A as default};
@@ -1 +1 @@
1
- import{b as r,c as f,d as ee,e as j}from"../../chunk-C5N2D3ZX.js";import{Fragment as ie,jsx as a,jsxs as d}from"react/jsx-runtime";import{useState as H,useEffect as te}from"react";import q,{UUID as v,useStore as le}from"jmini";import{$$fromRoot as D,ExtractStyles as pe}from"../../@utils";import{Box as S,FAI as R,Flex as P,Column as ae}from"../../atoms";import{Row as ue}from"../../mols";import{Button as L}from"../Button";import K from"../Snackbar";import{OptionalInputWrapper as de,BoxWrapper as ce,CoreEffects as ne,DefaultBoxishStyles as me}from"./core";import fe from"./TextField";import{InputFilerClasses as y}from"../../@styles/componentClasses";import{faCloudArrowUp as ge}from"@fortawesome/free-solid-svg-icons/faCloudArrowUp";function Se(e){let{value:t,states:o}=e,{required:c}=o,l=[];return c&&!t.length&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!l.filter(({type:p})=>p=="invalid").length,notice:l}}const oe={List:e=>{let{rootStates:t,val_status:o,set_status:c}=e;if(t.useSystemOnly)return null;let l=t.limit-(o.dataValue||[]).length,p=(o.dataValue||[]).map((n,u)=>a(oe.ListCell,f(r({},e),{index:u,val_file:n}),n.name));return l>0&&p.push(a(S,f(r({htmlTag:"label"},t.cellStyles),{className:[t.cellClassName,y("AddButton")].join(" "),"data-component-id":o.componentId,htmlFor:t.id,tabIndex:t.tabIndex,onKeyDown:n=>{let{key:u}=n;t.tabIndex!=-1&&[" ","Enter"].includes(u)&&D("#"+t.id).click()},children:d(ue.Center,{padding:["1/3",0],children:[a(S,{isRounded:!0,className:y("AddIcon"),children:a(R,{icon:ge,className:y("Icon"),fontColor:"theme",fontSize:"4.thirdTitle",backgroundColor:"theme.opa.low",ssSphere:3,padding:"1/2"})}),d(S,{children:[d(S,{fontColor:"theme",fontSize:"2.normal",isSemiBoldFont:!0,children:["\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E(",l,")"]}),a(S,{fontColor:"4.thin",fontSize:"0.xs",isSemiBoldFont:!0,children:"\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7"})]})]})}),"AddButton")),a(ae,f(r({flexSizing:"auto"},pe(t)),{className:t.className,children:p}))},ListCell:e=>{let{index:t,rootStates:o,val_file:c,val_status:l,set_status:p}=e,{name:n,size:u,type:i}=c,[m,b]=H(!1),I=v(),X=u.rank(),[Z,W]=n.replace(/\s/g,"_").replace(/(.*)\.(.*)$/,"$1 $2").split(" "),s="\u30D5\u30A1\u30A4\u30EB";return i.match(/image/)?s=i.replace(/image\//,""):i.match(/pdf/)?s="PDF":i.match(/csv/)?s="CSV":i.match(/spreadsheet/)?s="SpreadSheet":i.match(/presentation/)?s="PowerPoint":i.match(/word/)?s="Word":i.match(/zip/)?s="Zip":i.match(/powerpoint/)?s="PowerPoint":i.match(/html/)?s="HTML":i.match(/js/)?s="JavaScript":i.match(/css/)?s="CSS":i.match(/text\/plain/)&&(s="\u30C6\u30AD\u30B9\u30C8"),te(()=>{m&&setTimeout(()=>{D("#"+I).focus()},100)},[m]),d(P,f(r({verticalAlign:"center",flexWrap:!1,gap:1,className:o.cellClassName},o.cellStyles),{children:[a(R.File,{fontSize:"4.thirdTitle",fontColor:"4.thin"}),d(S,{flexSizing:0,children:[a(S,{children:a(P,{verticalAlign:"center",gap:"2/3",flexWrap:!1,className:y("FileName"),children:m?a(ie,{children:d(ae,{flexSizing:0,gap:"1/2",children:[d(P,{gap:"2/3",verticalAlign:"center",children:[a(fe,{tone:"border",wrapStyles:{flexSizing:"auto"},restrict:"fileName",name:"name",required:!0,id:I,form:"form-"+I,enableFormSubmit:!0,value:Z,onKeyDown:F=>{let{key:w}=F;w=="Escape"&&b(!1)}}),d(S,{children:[". ",W]})]}),d(P,{gap:"2/3",horizontalAlign:"right",flexWrap:!1,children:[a(L.Sub.S,{padding:["2/3",1],onClick:()=>{b(!1)},children:"\u9589\u3058\u308B"}),a(L.Prime.S,{padding:["2/3",1],onFormSubmit:["form-"+I,F=>j(void 0,null,function*(){let{name:w}=F.body,T=[...l.dataValue],A=T[t],G=A.id;if(!A)return;let k=yield A.convert();k=String(k);let M=yield k.toBlob(c.type);if(!M)return;let $=new File([M],w+"."+W,{type:A.type});$.id=G,T[t]=$,p(O=>f(r({},O),{dataValue:T,eventType:"update",eventID:v(),isInspected:!1})),b(!1)})],children:"\u6C7A\u5B9A"})]})]})}):d(ie,{children:[n,!!o.isNameEditable&&a(L.Clear,{ssSphere:2.5,flexSizing:"none",fontColor:"4.thin",padding:"1/3",ssEffectsOnActive:"expand",color:"cloud",onClick:()=>{b(!0)},children:a(R.Pen,{})})]})})}),!m&&d(S,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:[s,"\u30D5\u30A1\u30A4\u30EB / ",X,"B"]})]}),a(L.Sub,{color:"cloud",fontColor:"4.thin",ssSphere:3,onClick:()=>{let F=[...l.dataValue];F[t]&&(F.splice(t,1),p(T=>f(r({},T),{dataValue:F,eventType:"update",eventID:v(),isInspected:!1})))},children:a(R.X,{})})]}))}},ye=e=>{let Y=e,{tone:t,required:o,form:c,isNameEditable:l,useSystemOnly:p,accept:n="*",limit:u=1,checkValidationAtFirst:i,onChange:m,onValidate:b,onValidateDelay:I,onUpdateValue:X,onUpdateValidValue:Z,onUserAction:W,value:s=[],className:F,cellStyles:w,cellClassName:T,componentId:A,status_id:G,enableFormSubmit:k,freeCSS:M,wrapStyles:$}=Y,O=ee(Y,["tone","required","form","isNameEditable","useSystemOnly","accept","limit","checkValidationAtFirst","onChange","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","className","cellStyles","cellClassName","componentId","status_id","enableFormSubmit","freeCSS","wrapStyles"]),[B,N]=H(ne.DefaultStatus(e.componentId||"",s)),[Q,se]=H({ok:!1,notice:[]}),re={rootStates:e,val_status:B,set_status:N};te(()=>{le.set({["AddFiles-"+B.componentId]:x=>{N(_=>{let C=_.dataValue,V=[];for(var g=0;g<(x==null?void 0:x.length);g++){let h=x[g],{type:E,name:z}=h;if(g+1+C.length>u){K.add({componentId:z,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u9078\u629E\u4E0A\u9650\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${z}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}if(n&&n=="image"&&!E.match(/image/)){K.add({componentId:z,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u7570\u306A\u308B\u305F\u3081\u3001${z} \u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}V.push(h)}return f(r({},_),{dataValue:[...C,...V],eventType:"update",eventID:v(),isInspected:!1})})}})},[]),ne.CommonEffects({type:"file",states:e,val_status:B,set_status:N,val_validate:Q,set_validate:se,SystemValidation:Se});let U="";return n&&(n=="image"?U="image/png,image/jpeg":U=n),d(ce,{val_status:B,set_status:N,val_validate:Q,states:e,children:[a(S,f(r({htmlTag:"input",type:"file",className:y("Input"),"data-component-id":B.componentId,accept:U,multiple:u!=1,onChange:x=>j(void 0,null,function*(){m&&m(x);let _=x.target,C=_.files,V=[];for(var g=0;g<(C==null?void 0:C.length);g++){if(!C[g])continue;let h=C[g].clone(),E=h.name;if(h.id=v(),g+1+B.dataValue.length>u){K.add({componentId:E,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u767B\u9332\u6570\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${E}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,backgroundColor:"nega"});continue}V.push(h)}N(h=>f(r({},h),{dataValue:[...h.dataValue,...V],eventType:"update",eventID:v(),isInspected:!1})),_.value=""})},O),{opacity:"low",tabIndex:-1,value:""})),a(oe.List,r({},re))]})},J=e=>(e=f(r({limit:1,isNameEditable:!0,useSystemOnly:!1,tone:"border",value:[]},e),{override:"force",cellStyles:r(r({},me({tone:e.tone||"border"})),e.cellStyles)}),a(de,{componentId:e.componentId,children:ye,states:e}));J.fn={openDialog:e=>{let{multiple:t,accept:o}=e,c=v();const l=document.createElement("input");l.type="file",l.multiple=!!t,l.value="",l.id=c,o&&(o=="image"?l.accept="image/png,image/jpeg,image/jpg,image/webp":l.accept=o),q("body").append(l),l.onchange=p=>{var i;let n=((i=p==null?void 0:p.target)==null?void 0:i.files)||[];if(!(n!=null&&n.length))return;let u=[];for(let m=0;m<n.length;m++){let I=n[m].clone();u.push(I)}e.onChange(u),q("#"+c).remove()},l.click()}},typeof window!="undefined"&&window.document&&q(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),D("."+y("AddButton")).addClass(y("Draggable"))},options:{passive:!1}}).addEvent({eventType:"drop",callback:e=>{e.preventDefault(),D("."+y("AddButton")).removeClass(y("Draggable"));let t=e.dataTransfer.files;if(t.length){let o=e.target;if(D(o).hasClass(y("AddButton"))){let{componentId:c}=o.dataset,l=le.get("AddFiles-"+c);l&&l(t)}}},options:{passive:!1}});export{J as Filer,J as default};
1
+ import{b as r,c as f,d as Q,e as j}from"../../chunk-C5N2D3ZX.js";import{Fragment as oe,jsx as a,jsxs as m}from"react/jsx-runtime";import{useState as Y,useEffect as ee}from"react";import H,{UUID as b,useStore as te}from"jmini";import{$$fromRoot as _,ExtractStyles as se}from"../../@utils";import{Box as S,FAI as P,Flex as R,Column as le}from"../../atoms";import{Row as re}from"../../mols";import{Button as L}from"../Button";import q from"../Snackbar";import{OptionalInputWrapper as pe,BoxWrapper as ue,CoreEffects as ae,DefaultBoxishStyles as me}from"./core";import ce from"./TextField";import{InputFilerClasses as y}from"../../@styles/componentClasses";import{faCloudArrowUp as de}from"@fortawesome/free-solid-svg-icons/faCloudArrowUp";function fe(e){let{value:t,states:o}=e,{required:c}=o,l=[];return c&&!t.length&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!l.filter(({type:p})=>p=="invalid").length,notice:l}}const ne={List:e=>{let{rootStates:t,val_status:o,set_status:c}=e;if(t.useSystemOnly)return null;let l=t.limit-(o.dataValue||[]).length,p=(o.dataValue||[]).map((n,u)=>a(ne.ListCell,f(r({},e),{index:u,val_file:n}),n.name));return l>0&&p.push(a(S,f(r({htmlTag:"label"},t.cellStyles),{className:[t.cellClassName,y("AddButton")].join(" "),"data-component-id":o.componentId,htmlFor:t.id,tabIndex:t.tabIndex,onKeyDown:n=>{let{key:u}=n;t.tabIndex!=-1&&[" ","Enter"].includes(u)&&_("#"+t.id).click()},children:m(re.Center,{padding:["1/3",0],children:[a(S,{isRounded:!0,className:y("AddIcon"),children:a(P,{icon:de,className:y("Icon"),fontColor:"theme",fontSize:"4.thirdTitle",backgroundColor:"theme.opa.low",ssSphere:3,padding:"1/2"})}),m(S,{children:[m(S,{fontColor:"theme",fontSize:"2.normal",isSemiBoldFont:!0,children:["\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E(",l,")"]}),a(S,{fontColor:"4.thin",fontSize:"0.xs",isSemiBoldFont:!0,children:"\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7"})]})]})}),"AddButton")),a(le,f(r({flexSizing:"auto"},se(t)),{className:t.className,children:p}))},ListCell:e=>{let{index:t,rootStates:o,val_file:c,val_status:l,set_status:p}=e,{name:n,size:u,type:i}=c,[d,v]=Y(!1),I=b(),J=u.rank(),[X,W]=n.replace(/\s/g,"_").replace(/(.*)\.(.*)$/,"$1 $2").split(" "),s="\u30D5\u30A1\u30A4\u30EB";return i.match(/image/)?s=i.replace(/image\//,""):i.match(/pdf/)?s="PDF":i.match(/csv/)?s="CSV":i.match(/spreadsheet/)?s="SpreadSheet":i.match(/presentation/)?s="PowerPoint":i.match(/word/)?s="Word":i.match(/zip/)?s="Zip":i.match(/powerpoint/)?s="PowerPoint":i.match(/html/)?s="HTML":i.match(/js/)?s="JavaScript":i.match(/css/)?s="CSS":i.match(/text\/plain/)&&(s="\u30C6\u30AD\u30B9\u30C8"),ee(()=>{d&&setTimeout(()=>{_("#"+I).focus()},100)},[d]),m(R,f(r({verticalAlign:"center",flexWrap:!1,gap:1,className:o.cellClassName},o.cellStyles),{children:[a(P.File,{fontSize:"4.thirdTitle",fontColor:"4.thin"}),m(S,{flexSizing:0,children:[a(S,{children:a(R,{verticalAlign:"center",gap:"2/3",flexWrap:!1,className:y("FileName"),children:d?a(oe,{children:m(le,{flexSizing:0,gap:"1/2",children:[m(R,{gap:"2/3",verticalAlign:"center",children:[a(ce,{tone:"border",wrapStyles:{flexSizing:"auto"},restrict:"fileName",name:"name",required:!0,id:I,form:"form-"+I,enableFormSubmit:!0,value:X,onKeyDown:F=>{let{key:w}=F;w=="Escape"&&v(!1)}}),m(S,{children:[". ",W]})]}),m(R,{gap:"2/3",horizontalAlign:"right",flexWrap:!1,children:[a(L.Sub.S,{padding:["2/3",1],onClick:()=>{v(!1)},children:"\u9589\u3058\u308B"}),a(L.Prime.S,{padding:["2/3",1],onFormSubmit:["form-"+I,F=>j(void 0,null,function*(){let{name:w}=F.body,T=[...l.dataValue],A=T[t],Z=A.id;if(!A)return;let k=yield A.convert();k=String(k);let M=yield k.toBlob(c.type);if(!M)return;let $=new File([M],w+"."+W,{type:A.type});$.id=Z,T[t]=$,p(O=>f(r({},O),{dataValue:T,eventType:"update",eventID:b(12),isInspected:!1})),v(!1)})],children:"\u6C7A\u5B9A"})]})]})}):m(oe,{children:[n,!!o.isNameEditable&&a(L.Clear,{ssSphere:2.5,flexSizing:"none",fontColor:"4.thin",padding:"1/3",ssEffectsOnActive:"expand",color:"cloud",onClick:()=>{v(!0)},children:a(P.Pen,{})})]})})}),!d&&m(S,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:[s,"\u30D5\u30A1\u30A4\u30EB / ",J,"B"]})]}),a(L.Sub,{color:"cloud",fontColor:"4.thin",ssSphere:3,onClick:()=>{let F=[...l.dataValue];F[t]&&(F.splice(t,1),p(T=>f(r({},T),{dataValue:F,eventType:"update",eventID:b(12),isInspected:!1})))},children:a(P.X,{})})]}))}},ge=e=>{let G=e,{tone:t,required:o,form:c,isNameEditable:l,useSystemOnly:p,accept:n="*",limit:u=1,checkValidationAtFirst:i,onChange:d,onValidate:v,onValidateDelay:I,onUpdateValue:J,onUpdateValidValue:X,onUserAction:W,value:s=[],className:F,cellStyles:w,cellClassName:T,componentId:A,status_id:Z,enableFormSubmit:k,freeCSS:M,wrapStyles:$}=G,O=Q(G,["tone","required","form","isNameEditable","useSystemOnly","accept","limit","checkValidationAtFirst","onChange","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","className","cellStyles","cellClassName","componentId","status_id","enableFormSubmit","freeCSS","wrapStyles"]),[B,N]=Y(ae.DefaultStatus(e.componentId||"",s)),ie={rootStates:e,val_status:B,set_status:N};ee(()=>{te.set({["AddFiles-"+B.componentId]:x=>{N(D=>{let C=D.dataValue,V=[];for(var g=0;g<(x==null?void 0:x.length);g++){let h=x[g],{type:E,name:z}=h;if(g+1+C.length>u){q.add({componentId:z,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u9078\u629E\u4E0A\u9650\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${z}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}if(n&&n=="image"&&!E.match(/image/)){q.add({componentId:z,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u7570\u306A\u308B\u305F\u3081\u3001${z} \u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}V.push(h)}return f(r({},D),{dataValue:[...C,...V],eventType:"update",eventID:b(12),isInspected:!1})})}})},[]),ae.CommonEffects({type:"file",states:e,val_status:B,set_status:N,SystemValidation:fe});let U="";return n&&(n=="image"?U="image/png,image/jpeg":U=n),m(ue,{val_status:B,set_status:N,states:e,children:[a(S,f(r({htmlTag:"input",type:"file",className:y("Input"),"data-component-id":B.componentId,accept:U,multiple:u!=1,onChange:x=>j(void 0,null,function*(){d&&d(x);let D=x.target,C=D.files,V=[];for(var g=0;g<(C==null?void 0:C.length);g++){if(!C[g])continue;let h=C[g].clone(),E=h.name;if(h.id=b(),g+1+B.dataValue.length>u){q.add({componentId:E,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u767B\u9332\u6570\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${E}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,backgroundColor:"nega"});continue}V.push(h)}N(h=>f(r({},h),{dataValue:[...h.dataValue,...V],eventType:"update",eventID:b(12),isInspected:!1})),D.value=""})},O),{opacity:"low",tabIndex:-1,value:""})),a(ne.List,r({},ie))]})},K=e=>(e=f(r({limit:1,isNameEditable:!0,useSystemOnly:!1,tone:"border",value:[]},e),{override:"force",cellStyles:r(r({},me({tone:e.tone||"border"})),e.cellStyles)}),a(pe,{componentId:e.componentId,children:ge,states:e}));K.fn={openDialog:e=>{let{multiple:t,accept:o}=e,c=b();const l=document.createElement("input");l.type="file",l.multiple=!!t,l.value="",l.id=c,o&&(o=="image"?l.accept="image/png,image/jpeg,image/jpg,image/webp":l.accept=o),H("body").append(l),l.onchange=p=>{var i;let n=((i=p==null?void 0:p.target)==null?void 0:i.files)||[];if(!(n!=null&&n.length))return;let u=[];for(let d=0;d<n.length;d++){let I=n[d].clone();u.push(I)}e.onChange(u),H("#"+c).remove()},l.click()}},typeof window!="undefined"&&window.document&&H(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),_("."+y("AddButton")).addClass(y("Draggable"))},options:{passive:!1}}).addEvent({eventType:"drop",callback:e=>{e.preventDefault(),_("."+y("AddButton")).removeClass(y("Draggable"));let t=e.dataTransfer.files;if(t.length){let o=e.target;if(_(o).hasClass(y("AddButton"))){let{componentId:c}=o.dataset,l=te.get("AddFiles-"+c);l&&l(t)}}},options:{passive:!1}});export{K as Filer,K as default};
@@ -1 +1 @@
1
- import{b as n,c as a,d as u}from"../../chunk-C5N2D3ZX.js";import{jsx as m}from"react/jsx-runtime";import d,{UUID as p}from"jmini";import{useState as r,useEffect as b}from"react";import{OptionalInputWrapper as V,CoreEffects as g}from"./core";const D=e=>{let s=e,{componentId:c="",enableFormSubmit:H,form:S,value:t=""}=s,I=u(s,["componentId","enableFormSubmit","form","value"]),[o,i]=r({componentId:e.componentId||"",dataValue:t,eventType:"init",eventID:p()}),[f,v]=r({ok:!1,notice:[]});return b(()=>{d.is.equal(o.dataValue,t)||i(y=>a(n({},y),{dataValue:t,eventType:"update",eventID:p(),isInspected:!1}))},[e.value]),g.CommonEffects({type:"hidden",states:e,val_status:o,set_status:i,val_validate:f,set_validate:v,SystemValidation:()=>({ok:!0,notice:[]})}),m("input",a(n({value:d.Stringify(t),"data-component-id":c},I),{type:"hidden"}))},l=e=>m(V,{componentId:e.componentId,children:D,states:e});export{l as Hidden,l as default};
1
+ import{b as n,c as a,d as r}from"../../chunk-C5N2D3ZX.js";import{jsx as m}from"react/jsx-runtime";import d,{UUID as p}from"jmini";import{useState as f,useEffect as y}from"react";import{OptionalInputWrapper as v,CoreEffects as b}from"./core";const g=e=>{let u=e,{componentId:l="",enableFormSubmit:D,form:H,value:t=""}=u,c=r(u,["componentId","enableFormSubmit","form","value"]),[o,i]=f({componentId:e.componentId||"",dataValue:t,eventType:"init",eventID:p(12)});return y(()=>{d.is.equal(o.dataValue,t)||i(I=>a(n({},I),{dataValue:t,eventType:"update",eventID:p(12),isInspected:!1}))},[e.value]),b.CommonEffects({type:"hidden",states:e,val_status:o,set_status:i,SystemValidation:()=>({ok:!0,notice:[]})}),m("input",a(n({value:d.Stringify(t),"data-component-id":l},c),{type:"hidden"}))},s=e=>m(v,{componentId:e.componentId,children:g,states:e});export{s as Hidden,s as default};
@@ -1 +1 @@
1
- import{b as o,c as p,d as B}from"../../chunk-C5N2D3ZX.js";import{jsx as i}from"react/jsx-runtime";import C,{UUID as w}from"jmini";import{useState as ae}from"react";import{$$fromRoot as ne,GenerateHTMLProps as se}from"../../@utils";import{Box as T,Flex as re,FAI as ce,Span as de}from"../../atoms";import{Button as ue}from"../Button";import{OptionalInputWrapper as pe,BoxWrapper as me,CoreEffects as M}from"./core";import{InputListClasses as b}from"../../@styles/componentClasses";function Ce(t){let{value:l,states:a}=t,{type:e,required:s,min:n,max:m}=a;n=n||0,m=m||65535;let c=[],f=l.length;return s&&(f||e=="radio"&&c.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),f<n&&c.push({type:"invalid",label:n+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),f>m&&c.push({type:"invalid",label:m+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!c.filter(({type:V})=>V=="invalid").length,notice:c}}const h={InitOptions:t=>{let l=[];return t.forEach(a=>{if(!a)return;let{label:e,value:s}=a;C.is.nullish(e)&&(e=String(s)),l.push(p(o({},a),{label:e,value:s}))}),l},OptionalListWrapper:t=>{let{value:l,options:a=[]}=t,e=C.is.exist(l)?C.flatArray(l):[],s=[];return e.forEach(n=>{a.findIndex(c=>C.is.equal(c.value,n))!=-1&&s.push(n)}),i(h.Core,p(o({},t),{value:s,options:a}))},Core:t=>{let S=t,{type:l,tone:a,required:e,componentId:s="",form:n,override:m,icon:c,iconType:f,iconSize:V,iconPosition:P,iconColor:v,CustomIcon:X,enableFormSubmit:A,checkValidationAtFirst:$,onValidate:U,onValidateDelay:R,onUpdateValue:W,onUpdateValidValue:H,onUserAction:q,value:y,options:K,className:j,cellStyles:G,cellClassName:Q,cellCheckedStyles:Y,cellCheckedClassName:Z,min:D,max:d,hideInput:N,freeCSS:x,wrapStyles:ee}=S,L=B(S,["type","tone","required","componentId","form","override","icon","iconType","iconSize","iconPosition","iconColor","CustomIcon","enableFormSubmit","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","options","className","cellStyles","cellClassName","cellCheckedStyles","cellCheckedClassName","min","max","hideInput","freeCSS","wrapStyles"]),[k,O]=ae(M.DefaultStatus(s,y)),[_,E]=ae({ok:!1,notice:[]});return M.CommonEffects({type:"list."+l,states:t,val_status:k,set_status:O,val_validate:_,set_validate:E,SystemValidation:Ce}),i(me,{val_status:k,set_status:O,val_validate:_,states:t,children:i(h.List,{rootStates:t,val_status:k,set_status:O})})},List:t=>{let{rootStates:l,val_status:a,set_status:e}=t,{componentId:s,type:n,tone:m,icon:c,iconSize:f,iconColor:V,isChecker:P,options:v,name:X,form:A,tabIndex:$,hideInput:U,disabled:R,className:W,cellStyles:H,cellClassName:q="",cellCheckedStyles:y,cellCheckedClassName:K="",enableFormSubmit:j}=l,{dataValue:G}=a,Q=l.CustomIcon,Y=v.map((Z,D)=>{let le=Z,{value:d,label:N,disabled:x,className:ee="",checkedStyles:L,checkedClassName:k="",freeCSS:O}=le,_=B(le,["value","label","disabled","className","checkedStyles","checkedClassName","freeCSS"]),E=w(),S=G.findIndex(r=>r===d||C.is.equal(r,d))!=-1,I=o(o({},H),_),z=[b("Label"),q,ee];S&&(I=p(o(o(o({},I),y),L),{freeCSS:o(o(o({},I==null?void 0:I.freeCSS),y==null?void 0:y.freeCSS),L==null?void 0:L.freeCSS)}),z=[...z,K,k]);const te=()=>{if(R||x)return;let r=[];if(n=="radio")r=[d];else if(n=="checkbox"||P)if(!S)r=[...a.dataValue,d];else{let u=[...a.dataValue];u.splice(a.dataValue.findIndex(F=>F==d),1),r=u}e(u=>p(o({},u),{dataValue:r,eventType:"update",eventID:w(),isInspected:!1}))};let oe=[i(de,{position:"relative",freeCSS:{zIndex:2},flexSizing:0,children:C.is.string(N)?i(T,{children:N}):N},"content")];return c&&oe[l.iconPosition=="right"?"push":"unshift"](i(Q,{isChecked:S,iconSize:f,iconColor:V,toggle:te},"icon")),[i(T,{htmlTag:"input",type:n=="radio"?"radio":"checkbox",className:b("Input"),name:"RadioCheckbox-"+X,"data-list-index":s+"-"+D,id:E,value:String(d),disabled:R||x,checked:S,onFocus:r=>{x||n=="radio"&&(a.dataValue.length||e(u=>p(o({},u),{dataValue:[d],eventType:"update",eventID:w(),isInspected:!1})))},onChange:()=>{te()},onKeyDown:r=>{let{key:u,shiftKey:F}=r;if((n=="checkbox"||t.rootStates.isChecker)&&u!="Tab"){if(u.match(/Arrow/)){r.preventDefault();let ie=["ArrowLeft","ArrowUp"].includes(u)?-1:1,g=D+ie;g<0?g=v.length-1:g>=v.length&&(g=0),ne(`input[data-list-index="${s}-${g}"]`).focus()}}j&&M.SubmitForm(r,A)},tabIndex:$},"List-"+C.Stringify(d)),i(T,p(o({htmlTag:"label","data-disabled":R||x,htmlFor:E,className:z.join(" "),tabIndex:-1,display:"flex",verticalAlign:"center",flexWrap:!1},I),{children:oe}),"ListTrigger-"+C.Stringify(d))]});return i(re,{flexSizing:"auto",style:l.style,freeCSS:o({},l.freeCSS),className:[W,b("CellBase"),b("HideInput_"+U),b("IconIndicator_"+!!c),b("Tone_"+m)].join(" "),children:Y})},_Icon:t=>{let l=1.5;return t.iconSize=="small"?l=1.2:t.iconSize=="large"&&(l=2),i(ue.Normal,{ssPushable:!0,color:"cloud",tabIndex:-1,ssEffectsOnActive:"ripple.cloud",ssSphere:2,freeCSS:{transform:`scale(${l})`},onClick:a=>{a.preventDefault(),a.stopPropagation(),t.toggle()},children:t.children})},RadioIcon:t=>i(h._Icon,p(o({type:"radio"},t),{children:i(T,{flexCenter:!0,isRounded:!0,border:t.isChecked?"0.trans":"3.thick",borderColor:t.isChecked?t.iconColor:"3.thick",position:"relative",transition:"middle",freeCSS:{width:"50%",height:"50%"},children:i(T,{position:"absolute",transition:"middle",isRounded:!0,backgroundColor:t.iconColor,opacity:t.isChecked?"max":"trans",freeCSS:{width:"60%",height:"60%",transform:t.isChecked?"scale(1)":"scale(.4)"}})})})),CheckboxIcon:t=>i(h._Icon,p(o({type:"checkbox"},t),{children:i(T,{flexCenter:!0,boxShadow:t.isChecked?"0.remark":"none",border:t.isChecked?"0.trans":"3.thick",backgroundColor:t.isChecked?t.iconColor:"trans",position:"relative",transition:"middle",fontColor:"white",freeCSS:{borderRadius:"25%",padding:"4%",width:"50%",height:"50%"},children:i(ce.Check,{transition:"middle",opacity:t.isChecked?"max":"trans",freeCSS:{zIndex:8,width:"100%",height:"100%",transform:t.isChecked?"scale(1)":"scale(.5)"}})})}))},J=t=>{t=t||"checkbox";const l=e=>(e=p(o({gap:1,icon:!0,iconSize:"regular",iconType:t=="radio"?"radio":"checkbox",iconPosition:"left",iconColor:"theme"},e),{type:t,cellStyles:o({gap:"1/6",position:"relative",borderRadius:"2.tone.secondary",transition:"middle"},e.cellStyles)}),e.CustomIcon||(e.iconType=="radio"?e.CustomIcon=h.RadioIcon:e.iconType=="checkbox"&&(e.CustomIcon=h.CheckboxIcon)),e.iconSize=="small"?e.cellStyles.gap=0:e.iconSize=="large"&&(e.cellStyles.gap="1/2"),e.tone=="normal"?(e.cellStyles=o({padding:["1/4",1],border:"1.thin",backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme",boxShadow:"1.normal"},e.cellCheckedStyles)):e.tone=="border"?(e.cellStyles=o({border:"1.thin",backgroundColor:"layer.1",padding:["1/2",1,"1/2","1/2"]},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):e.tone=="cloud"&&(e.cellStyles=o({border:"1.thin",backgroundColor:"layer.2",padding:["1/2",1,"1/2","1/2"]},e.cellStyles),e.cellCheckedStyles=o({backgroundColor:"cloud",fontColor:"theme"},e.cellCheckedStyles)),e=se(e),e.options=h.InitOptions(e.options),i(pe,{componentId:e.componentId,children:h.OptionalListWrapper,states:e})),a=l;return a.Normal=e=>i(l,o({type:t,tone:"normal",icon:!1},e)),a.Border=e=>i(l,o({type:t,tone:"border"},e)),a.Cloud=e=>i(l,o({type:t,tone:"cloud"},e)),a.Vivid=e=>i(l,o({type:t,tone:"normal",icon:!1,cellCheckedStyles:{backgroundColor:"theme",fontColor:"white"}},e)),a.Simple=e=>i(l,o({type:t,tone:"plain",icon:!1,cellCheckedStyles:{fontColor:"theme"}},e)),a},he=J("radio"),Se=J("checkbox"),fe=J();export{Se as Checkbox,fe as List,he as Radio};
1
+ import{b as o,c as m,d as F}from"../../chunk-C5N2D3ZX.js";import{jsx as i}from"react/jsx-runtime";import C,{UUID as B}from"jmini";import{useState as ie}from"react";import{$$fromRoot as ne,GenerateHTMLProps as se}from"../../@utils";import{Box as I,Flex as re,FAI as ce,Span as ue}from"../../atoms";import{Button as de}from"../Button";import{OptionalInputWrapper as me,BoxWrapper as pe,CoreEffects as w}from"./core";import{InputListClasses as T}from"../../@styles/componentClasses";function Ce(t){let{value:l,states:a}=t,{type:e,required:s,min:n,max:p}=a;n=n||0,p=p||65535;let c=[],S=l.length;return s&&(S||e=="radio"&&c.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),S<n&&c.push({type:"invalid",label:n+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),S>p&&c.push({type:"invalid",label:p+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!c.filter(({type:k})=>k=="invalid").length,notice:c}}const h={InitOptions:t=>{let l=[];return t.forEach(a=>{if(!a)return;let{label:e,value:s}=a;C.is.nullish(e)&&(e=String(s)),l.push(m(o({},a),{label:e,value:s}))}),l},OptionalListWrapper:t=>{let{value:l,options:a=[]}=t,e=C.is.exist(l)?C.flatArray(l):[],s=[];return e.forEach(n=>{a.findIndex(c=>C.is.equal(c.value,n))!=-1&&s.push(n)}),i(h.Core,m(o({},t),{value:s,options:a}))},Core:t=>{let O=t,{type:l,tone:a,required:e,componentId:s="",form:n,override:p,icon:c,iconType:S,iconSize:k,iconPosition:J,iconColor:V,CustomIcon:P,enableFormSubmit:X,checkValidationAtFirst:A,onValidate:$,onValidateDelay:v,onUpdateValue:U,onUpdateValidValue:W,onUserAction:H,value:f,options:q,className:K,cellStyles:j,cellClassName:G,cellCheckedStyles:Q,cellCheckedClassName:Y,min:D,max:u,hideInput:N,freeCSS:b,wrapStyles:Z}=O,x=F(O,["type","tone","required","componentId","form","override","icon","iconType","iconSize","iconPosition","iconColor","CustomIcon","enableFormSubmit","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","options","className","cellStyles","cellClassName","cellCheckedStyles","cellCheckedClassName","min","max","hideInput","freeCSS","wrapStyles"]),[L,R]=ie(w.DefaultStatus(s,f));return w.CommonEffects({type:"list."+l,states:t,val_status:L,set_status:R,SystemValidation:Ce}),i(pe,{val_status:L,set_status:R,states:t,children:i(h.List,{rootStates:t,val_status:L,set_status:R})})},List:t=>{let{rootStates:l,val_status:a,set_status:e}=t,{componentId:s,type:n,tone:p,icon:c,iconSize:S,iconColor:k,isChecker:J,options:V,name:P,form:X,tabIndex:A,hideInput:$,disabled:v,className:U,cellStyles:W,cellClassName:H="",cellCheckedStyles:f,cellCheckedClassName:q="",enableFormSubmit:K}=l,{dataValue:j}=a,G=l.CustomIcon,Q=V.map((Y,D)=>{let le=Y,{value:u,label:N,disabled:b,className:Z="",checkedStyles:x,checkedClassName:L="",freeCSS:R}=le,O=F(le,["value","label","disabled","className","checkedStyles","checkedClassName","freeCSS"]),ee=B(),E=j.findIndex(r=>r===u||C.is.equal(r,u))!=-1,y=o(o({},W),O),_=[T("Label"),H,Z];E&&(y=m(o(o(o({},y),f),x),{freeCSS:o(o(o({},y==null?void 0:y.freeCSS),f==null?void 0:f.freeCSS),x==null?void 0:x.freeCSS)}),_=[..._,q,L]);const te=()=>{if(v||b)return;let r=[];if(n=="radio")r=[u];else if(n=="checkbox"||J)if(!E)r=[...a.dataValue,u];else{let d=[...a.dataValue];d.splice(a.dataValue.findIndex(z=>z==u),1),r=d}e(d=>m(o({},d),{dataValue:r,eventType:"update",eventID:B(12),isInspected:!1}))};let oe=[i(ue,{position:"relative",freeCSS:{zIndex:2},flexSizing:0,children:C.is.string(N)?i(I,{children:N}):N},"content")];return c&&oe[l.iconPosition=="right"?"push":"unshift"](i(G,{isChecked:E,iconSize:S,iconColor:k,toggle:te},"icon")),[i(I,{htmlTag:"input",type:n=="radio"?"radio":"checkbox",className:T("Input"),name:"RadioCheckbox-"+P,"data-list-index":s+"-"+D,id:ee,value:String(u),disabled:v||b,checked:E,onFocus:r=>{b||n=="radio"&&(a.dataValue.length||e(d=>m(o({},d),{dataValue:[u],eventType:"update",eventID:B(12),isInspected:!1})))},onChange:()=>{te()},onKeyDown:r=>{let{key:d,shiftKey:z}=r;if((n=="checkbox"||t.rootStates.isChecker)&&d!="Tab"){if(d.match(/Arrow/)){r.preventDefault();let ae=["ArrowLeft","ArrowUp"].includes(d)?-1:1,g=D+ae;g<0?g=V.length-1:g>=V.length&&(g=0),ne(`input[data-list-index="${s}-${g}"]`).focus()}}K&&w.SubmitForm(r,X)},tabIndex:A},"List-"+C.Stringify(u)),i(I,m(o({htmlTag:"label","data-disabled":v||b,htmlFor:ee,className:_.join(" "),tabIndex:-1,display:"flex",verticalAlign:"center",flexWrap:!1},y),{children:oe}),"ListTrigger-"+C.Stringify(u))]});return i(re,{flexSizing:"auto",style:l.style,freeCSS:o({},l.freeCSS),className:[U,T("CellBase"),T("HideInput_"+$),T("IconIndicator_"+!!c),T("Tone_"+p)].join(" "),children:Q})},_Icon:t=>{let l=1.5;return t.iconSize=="small"?l=1.2:t.iconSize=="large"&&(l=2),i(de.Normal,{ssPushable:!0,color:"cloud",tabIndex:-1,ssEffectsOnActive:"ripple.cloud",ssSphere:2,freeCSS:{transform:`scale(${l})`},onClick:a=>{a.preventDefault(),a.stopPropagation(),t.toggle()},children:t.children})},RadioIcon:t=>i(h._Icon,m(o({type:"radio"},t),{children:i(I,{flexCenter:!0,isRounded:!0,border:t.isChecked?"0.trans":"3.thick",borderColor:t.isChecked?t.iconColor:"3.thick",position:"relative",transition:"middle",freeCSS:{width:"50%",height:"50%"},children:i(I,{position:"absolute",transition:"middle",isRounded:!0,backgroundColor:t.iconColor,opacity:t.isChecked?"max":"trans",freeCSS:{width:"60%",height:"60%",transform:t.isChecked?"scale(1)":"scale(.4)"}})})})),CheckboxIcon:t=>i(h._Icon,m(o({type:"checkbox"},t),{children:i(I,{flexCenter:!0,boxShadow:t.isChecked?"0.remark":"none",border:t.isChecked?"0.trans":"3.thick",backgroundColor:t.isChecked?t.iconColor:"trans",position:"relative",transition:"middle",fontColor:"white",freeCSS:{borderRadius:"25%",padding:"4%",width:"50%",height:"50%"},children:i(ce.Check,{transition:"middle",opacity:t.isChecked?"max":"trans",freeCSS:{zIndex:8,width:"100%",height:"100%",transform:t.isChecked?"scale(1)":"scale(.5)"}})})}))},M=t=>{t=t||"checkbox";const l=e=>(e=m(o({gap:1,icon:!0,iconSize:"regular",iconType:t=="radio"?"radio":"checkbox",iconPosition:"left",iconColor:"theme"},e),{type:t,cellStyles:o({gap:"1/6",position:"relative",borderRadius:"2.tone.secondary",transition:"middle"},e.cellStyles)}),e.CustomIcon||(e.iconType=="radio"?e.CustomIcon=h.RadioIcon:e.iconType=="checkbox"&&(e.CustomIcon=h.CheckboxIcon)),e.iconSize=="small"?e.cellStyles.gap=0:e.iconSize=="large"&&(e.cellStyles.gap="1/2"),e.tone=="normal"?(e.cellStyles=o({padding:["1/4",1],border:"1.thin",backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme",boxShadow:"1.normal"},e.cellCheckedStyles)):e.tone=="border"?(e.cellStyles=o({border:"1.thin",backgroundColor:"layer.1",padding:["1/2",1,"1/2","1/2"]},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):e.tone=="cloud"&&(e.cellStyles=o({border:"1.thin",backgroundColor:"layer.2",padding:["1/2",1,"1/2","1/2"]},e.cellStyles),e.cellCheckedStyles=o({backgroundColor:"cloud",fontColor:"theme"},e.cellCheckedStyles)),e=se(e),e.options=h.InitOptions(e.options),i(me,{componentId:e.componentId,children:h.OptionalListWrapper,states:e})),a=l;return a.Normal=e=>i(l,o({type:t,tone:"normal",icon:!1},e)),a.Border=e=>i(l,o({type:t,tone:"border"},e)),a.Cloud=e=>i(l,o({type:t,tone:"cloud"},e)),a.Vivid=e=>i(l,o({type:t,tone:"normal",icon:!1,cellCheckedStyles:{backgroundColor:"theme",fontColor:"white"}},e)),a.Simple=e=>i(l,o({type:t,tone:"plain",icon:!1,cellCheckedStyles:{fontColor:"theme"}},e)),a},he=M("radio"),Se=M("checkbox"),fe=M();export{Se as Checkbox,fe as List,he as Radio};
@@ -46,8 +46,6 @@ declare namespace Select {
46
46
  set_preventOpenSelectorOnFocus: React.Dispatch<React.SetStateAction<boolean>>;
47
47
  val_status: InputTypes.Status.Plain<Value>;
48
48
  set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
49
- val_validate: InputTypes.Validation.Result;
50
- set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
51
49
  val_selectorOpen: boolean;
52
50
  set_selectorOpen: React.Dispatch<React.SetStateAction<boolean>>;
53
51
  val_optionFocused: string | null;
@@ -1 +1 @@
1
- import{b as n,c as u,d as H}from"../../chunk-C5N2D3ZX.js";import{Fragment as J,jsx as a,jsxs as O}from"react/jsx-runtime";import d,{UUID as C}from"jmini";import{useState as A,useEffect as $}from"react";import{ExtractStyles as Ve}from"../../@utils";import{Box as _,Span as Oe,FAI as le,Column as Te}from"../../atoms";import{Literal as W,Row as j}from"../../mols";import{Button as Fe}from"../Button";import{Sheet as xe}from"../Sheet";import{OptionalInputWrapper as De,BoxWrapper as we,CoreEffects as k,DefaultBoxishStyles as Re}from"./core";import{InputAutocompleteClasses as B}from"../../@styles/componentClasses";import{InputLabel as ke}from"./Label";import{RightIcon as Ae}from".";function Be(e){let{value:t,states:l}=e,{required:o,options:i}=l,v=[];return o&&t===null&&v.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!v.filter(({type:S})=>S=="invalid").length,notice:v}}const ae={FilterSelectableOptions:(e,t)=>{let l=e.rootStates.options;return t||(l=l.filter(o=>(o==null?void 0:o.type)!="label")),l}},V={Shallow:e=>{let{rootStates:t,val_status:l}=e,o=Ve(t);return a(_,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:a(W.Description,u(n({className:t.className},o),{position:"absolute",width:1,freeCSS:u(n({},o.freeCSS),{color:"orange"}),children:a(_,{"data-input-value-shallow":l.componentId,children:"A"})}))})},Button:e=>O(J,{children:[a(V.LegacySelector,n({},e)),a(V.Original,n({},e))]}),Placeholder:e=>!e.rootStates.placeholder||e.val_status.dataValue!==null?null:a(_,{position:"absolute",opacity:"middle",fontColor:"3.blur",children:e.rootStates.placeholder||""}),Original:e=>{let{rootStates:t,val_preventOpenSelectorOnFocus:l,set_preventOpenSelectorOnFocus:o,val_optionFocused:i,set_optionFocused:v,val_validate:S,set_validate:I,val_status:p,set_status:b,val_selectorOpen:g,set_selectorOpen:f}=e,U=t,{tone:E,required:L,form:x,className:T,label:oe,isLabelActive:re,placeholder:se,enableFormSubmit:P,emptySelect:X,checkValidationAtFirst:M,onValidate:ie,onValidateDelay:ce,onUpdateValue:ue,onUpdateValidValue:de,onUserAction:pe,value:N="",options:K,leftIndicator:Se,rightIndicator:G,leftIcon:fe,rightIcon:me,componentId:ve,status_id:ye,wrapStyles:ge,SelectedCellStyles:be,SelectorCellStyles:Ie,SelectorMode:he,SelectorStyles:Ce,SelectorPosition:_e}=U,r=H(U,["tone","required","form","className","label","isLabelActive","placeholder","enableFormSubmit","emptySelect","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentId","status_id","wrapStyles","SelectedCellStyles","SelectorCellStyles","SelectorMode","SelectorStyles","SelectorPosition"]);return $(()=>{if(e.rootStates.SelectorMode!="original"||t.disabled)return;let c="select-click-"+t.componentId;if(g){if(!d('[data-input-origin="'+t.componentId+'"]'))return;d(document).addEvent({eventID:c,eventType:"click",callback:s=>{let D=d(s.target),w=!!d(D).parent("."+B("Core")).length;d(D).parent("."+B("Selector")).length||w||f(!1)}})}else d(document).removeEvent([c])},[g]),$(()=>{if(e.rootStates.SelectorMode!="original"||p.eventType=="init"||!g)return;let c=d('[data-input-origin="'+t.componentId+'"]');c&&c.focus()},[p.dataValue]),e.rootStates.SelectorMode!="original"?null:O(J,{children:[a(_,u(n({tabIndex:0},r),{"data-disabled":t.disabled,"data-show-validation":k.isShowValidation(S,p,!!M),"data-component-id":p.componentId,"data-input-origin":p.componentId,className:[T,B("Core")].join(" "),onFocus:c=>{if(r!=null&&r.onFocus&&(r==null||r.onFocus(c)),b(m=>u(n({},m),{eventID:C(),isFocusing:!0})),!t.disabled){if(l)return o(!1);f(!0)}},onBlur:c=>{r!=null&&r.onBlur&&(r==null||r.onBlur(c)),b(m=>u(n({},m),{eventID:C(),isFocusing:!1}))},onClick:c=>{r!=null&&r.onClick&&(r==null||r.onClick(c)),!t.disabled&&f(!0)},onKeyDown:c=>{let{key:m,metaKey:s,ctrlKey:D}=c,w=s||D;if(r!=null&&r.onKeyDown&&(r==null||r.onKeyDown(c)),P&&k.SubmitForm(c,x),!t.disabled){if(d.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(m))return;if(c.preventDefault(),!g)return f(!0);let h=m=="ArrowDown"?1:-1,y=ae.FilterSelectableOptions(e),q=y.length-1,F=null;d.scope(()=>{var Q,Y,Z,ee,te;let R=y.findIndex(z=>(z==null?void 0:z.id)==i);if(h==1){if(F=(Q=y[0])==null?void 0:Q.id,w){F=y[q].id;return}if(R==-1||R==q)return;F=(Y=y[R+1])==null?void 0:Y.id}else{if(F=(Z=y[q])==null?void 0:Z.id,w){F=(ee=y[0])==null?void 0:ee.id;return}if(R==-1||R==0)return;F=(te=y[R-1])==null?void 0:te.id}}),v(F)}),m=="Escape")f(!1);else if(m=="Tab")f(!1);else if(m=="Backspace")b(h=>u(n({},h),{dataValue:null,eventType:"update",eventID:C(),isInspected:!1}));else if(m==" ")c.preventDefault(),f(!0);else if(m=="Enter"){if(!g)return f(!0);c.preventDefault();let h=t.options.find(y=>(y==null?void 0:y.id)==i);if(!h)return;b(y=>u(n({},y),{dataValue:h==null?void 0:h.value,eventType:"update",eventID:C(),isInspected:!1})),f(!1)}}},children:O(j.Left,{gap:0,children:[a(Oe,{width:0,overflow:"hidden",opacity:"trans",children:"A"}),O(j.Left,{flexWrap:!0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[a(V.Placeholder,n({},e)),a(V.Selected,n({},e))]})]})})),g&&a(V.Selector,n({},e))]})},LegacySelector:e=>{let{rootStates:t,val_preventOpenSelectorOnFocus:l,set_preventOpenSelectorOnFocus:o,val_optionFocused:i,set_optionFocused:v,val_validate:S,set_validate:I,val_status:p,set_status:b,val_selectorOpen:g,set_selectorOpen:f}=e,m=t,{tone:E,required:L,form:x,className:T,label:oe,isLabelActive:re,placeholder:se,enableFormSubmit:P,emptySelect:X,checkValidationAtFirst:M,onValidate:ie,onValidateDelay:ce,onUpdateValue:ue,onUpdateValidValue:de,onUserAction:pe,onKeyDown:N,onChange:K,value:Se="",options:G,leftIndicator:fe,rightIndicator:me,leftIcon:ve,rightIcon:ye,componentId:ge,status_id:be,wrapStyles:Ie,SelectedCellStyles:he,SelectorCellStyles:Ce,SelectorMode:_e,SelectorStyles:r,SelectorPosition:U}=m,c=H(m,["tone","required","form","className","label","isLabelActive","placeholder","enableFormSubmit","emptySelect","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","onKeyDown","onChange","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentId","status_id","wrapStyles","SelectedCellStyles","SelectorCellStyles","SelectorMode","SelectorStyles","SelectorPosition"]);return e.rootStates.SelectorMode!="legacy"?null:O(_,u(n({htmlTag:"select",tabIndex:0},c),{"data-disabled":t.disabled,"data-show-validation":k.isShowValidation(S,p,!!M),"data-component-id":p.componentId,"data-input-origin":p.componentId,className:[T,B("Core")].join(" "),onKeyDown:s=>{N&&N(s),P&&k.SubmitForm(s,x)},onChange:s=>{let{value:D}=s.target;S.ok&&I({ok:!1,notice:[]}),b(w=>u(n({},w),{dataValue:D,eventType:"update",eventID:C(),isInspected:!1})),K&&K(s)},children:[!!X&&a("option",{value:"null",children:"\u9078\u629E"}),G.map(s=>d.is.nullish(s==null?void 0:s.value)?null:a("option",{value:s==null?void 0:s.value,children:(s==null?void 0:s.label)||(s==null?void 0:s.value)},String(s==null?void 0:s.value)))]}))},Selector:e=>{var o;$(()=>{let i=d(`[data-selector-id="${e.val_status.componentId}"]`)[0];if(!i)return;let v=d(`[data-select-input-value="${e.val_optionFocused}"]`)[0];v&&(i.scrollTop=v.offsetTop-24)},[e.val_optionFocused]);let t=ae.FilterSelectableOptions(e,!0),l={position:"absolute",minWidth:1,freeCSS:{zIndex:1e3}};switch(e.rootStates.SelectorPosition){case 1:l.bottom="100%",l.left=0,l.paddingBottom="1/3";break;case 2:l.bottom="100%",l.right=0,l.paddingBottom="1/3";break;case 3:l.top="100%",l.left=0,l.paddingTop="1/3";break;case 4:l.top="100%",l.right=0,l.paddingTop="1/3";break;default:break}return a(_,u(n({},l),{children:a(xe.Body,u(n({className:B("Selector"),ssCardBox:!0,borderRadius:"2.tone.secondary",boxShadow:"1.normal",overflow:"auto","data-selector-id":e.val_status.componentId},e.rootStates.SelectorStyles),{freeCSS:n({minWidth:12*6,maxHeight:12*24},(o=e.rootStates.SelectorStyles)==null?void 0:o.freeCSS),children:O(Te,{gap:"1/12",padding:[1,0],children:[t.map((i,v)=>{if(!i)return null;let{type:S,value:I}=i,p=e.val_optionFocused==i.id,b=e.val_status.dataValue===I;return S=="label"?a(_,{children:i.label||i.value},C()):a(Fe.Sub.S,u(n({"data-select-input-value":i.id,color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1],isActive:b||p,isActiveStyles:p?{backgroundColor:"cloud"}:{backgroundColor:"theme.opa.few",fontColor:"theme"}},e.rootStates.SelectorCellStyles),{onClick:g=>{e.set_status(f=>u(n({},f),{dataValue:I,eventType:"update",eventID:C(),isInspected:!1})),e.set_selectorOpen(!1),e.set_preventOpenSelectorOnFocus(!0)},children:O(j.Left,{gap:"1/2",children:[b&&a(le.Check,{fontColor:"theme"}),a(W.Supplement,{transition:"short",flexSizing:0,children:i.label||i.value})]})}),i.id)}),!t.length&&a(W.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},"no-selector-notice")]})}))}))},Selected:e=>{let t=[];return e.val_status.dataValue!==null&&d.scope(()=>{let l=e.rootStates.options.find(o=>d.is.equal(o==null?void 0:o.value,e.val_status.dataValue));l&&t.push(a(_,u(n({},e.rootStates.SelectedCellStyles),{children:(l==null?void 0:l.label)||(l==null?void 0:l.value)}),String(l==null?void 0:l.value)))}),a(J,{children:t})},Core:e=>{var L,x;let{value:t}=e,[l,o]=A(k.DefaultStatus(e.componentId,t)),[i,v]=A(!1),[S,I]=A(!1),[p,b]=A(((L=e.options.find(T=>(T==null?void 0:T.value)===e.value))==null?void 0:L.id)||((x=e.options[0])==null?void 0:x.id)||""),[g,f]=A({ok:!1,notice:[]}),E={rootStates:e,val_preventOpenSelectorOnFocus:i,set_preventOpenSelectorOnFocus:v,val_optionFocused:p,set_optionFocused:b,val_selectorOpen:S,set_selectorOpen:I,val_status:l,set_status:o,val_validate:g,set_validate:f};return k.CommonEffects({type:"select",states:e,val_status:l,set_status:o,val_validate:g,set_validate:f,SystemValidation:Be}),O(we,{val_status:l,set_status:o,val_validate:g,states:e,children:[a(ke,{componentId:e.componentId,fontSize:e.fontSize,required:e.required,label:e.label,isActive:e.isLabelActive||l.dataValue!==null}),a(V.Shallow,n({},E)),a(V.Button,n({},E))]})}},ne=e=>{var l;let t=n({},e);return t=u(n({emptySelect:!0,SelectorMode:"original",SelectorPosition:3},t),{freeCSS:n({cursor:"pointer"},t.freeCSS)}),t.emptySelect&&(t.options=[{value:null,label:a(W.Supplement,{fontColor:"4.thin",children:"\u672A\u9078\u629E"})},...t.options]),t.value=(l=t.value)!=null?l:null,t.options.forEach((o,i)=>{if(!o)return;let{type:v,value:S,searchValue:I}=o,p=I||d.is.string(S)&&S||d.Stringify(S||"")||"";t.options[i]=u(n({id:C()},o),{value:S,searchValue:p,type:v||"selector"})}),d.is.nullish(t.rightIcon)&&(t.rightIcon=a(Ae,{children:a(le.AngleDown,{})})),a(De,{componentId:t.componentId,children:V.Core,states:Re(t)})};export{ne as Select,ne as default};
1
+ import{b as n,c as d,d as q}from"../../chunk-C5N2D3ZX.js";import{Fragment as $,jsx as a,jsxs as V}from"react/jsx-runtime";import S,{UUID as I}from"jmini";import{useState as B,useEffect as z}from"react";import{ExtractStyles as Ce}from"../../@utils";import{Box as h,Span as Ve,FAI as ee,Column as Oe}from"../../atoms";import{Literal as E,Row as H}from"../../mols";import{Button as _e}from"../Button";import{Sheet as Fe}from"../Sheet";import{OptionalInputWrapper as Te,BoxWrapper as xe,CoreEffects as k,DefaultBoxishStyles as we}from"./core";import{InputAutocompleteClasses as A}from"../../@styles/componentClasses";import{InputLabel as De}from"./Label";import{RightIcon as ke}from".";function Re(e){let{value:t,states:l}=e,{required:o,options:i}=l,m=[];return o&&t===null&&m.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!m.filter(({type:c})=>c=="invalid").length,notice:m}}const te={FilterSelectableOptions:(e,t)=>{let l=e.rootStates.options;return t||(l=l.filter(o=>(o==null?void 0:o.type)!="label")),l}},C={Shallow:e=>{let{rootStates:t,val_status:l}=e,o=Ce(t);return a(h,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:a(E.Description,d(n({className:t.className},o),{position:"absolute",width:1,freeCSS:d(n({},o.freeCSS),{color:"orange"}),children:a(h,{"data-input-value-shallow":l.componentId,children:"A"})}))})},Button:e=>V($,{children:[a(C.LegacySelector,n({},e)),a(C.Original,n({},e))]}),Placeholder:e=>!e.rootStates.placeholder||e.val_status.dataValue!==null?null:a(h,{position:"absolute",opacity:"middle",fontColor:"3.blur",children:e.rootStates.placeholder||""}),Original:e=>{let{rootStates:t,val_preventOpenSelectorOnFocus:l,set_preventOpenSelectorOnFocus:o,val_optionFocused:i,set_optionFocused:m,val_status:c,set_status:g,val_selectorOpen:y,set_selectorOpen:p}=e,N=t,{tone:R,required:F,form:T,className:O,label:ae,isLabelActive:ne,placeholder:oe,enableFormSubmit:L,emptySelect:j,checkValidationAtFirst:W,onValidate:re,onValidateDelay:se,onUpdateValue:ie,onUpdateValidValue:ce,onUserAction:ue,value:P="",options:M,leftIndicator:de,rightIndicator:J,leftIcon:Se,rightIcon:pe,componentId:fe,status_id:me,wrapStyles:ye,SelectedCellStyles:ve,SelectorCellStyles:ge,SelectorMode:be,SelectorStyles:Ie,SelectorPosition:he}=N,r=q(N,["tone","required","form","className","label","isLabelActive","placeholder","enableFormSubmit","emptySelect","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentId","status_id","wrapStyles","SelectedCellStyles","SelectorCellStyles","SelectorMode","SelectorStyles","SelectorPosition"]);return z(()=>{if(e.rootStates.SelectorMode!="original"||t.disabled)return;let u="select-click-"+t.componentId;if(y){if(!S('[data-input-origin="'+t.componentId+'"]'))return;S(document).addEvent({eventID:u,eventType:"click",callback:s=>{let x=S(s.target),w=!!S(x).parent("."+A("Core")).length;S(x).parent("."+A("Selector")).length||w||p(!1)}})}else S(document).removeEvent([u])},[y]),z(()=>{if(e.rootStates.SelectorMode!="original"||c.eventType=="init"||!y)return;let u=S('[data-input-origin="'+t.componentId+'"]');u&&u.focus()},[c.dataValue]),e.rootStates.SelectorMode!="original"?null:V($,{children:[a(h,d(n({tabIndex:0},r),{"data-disabled":t.disabled,"data-show-validation":k.isShowValidation(c,!!W),"data-component-id":c.componentId,"data-input-origin":c.componentId,className:[O,A("Core")].join(" "),onFocus:u=>{if(r!=null&&r.onFocus&&(r==null||r.onFocus(u)),g(f=>d(n({},f),{eventID:I(12),isFocusing:!0})),!t.disabled){if(l)return o(!1);p(!0)}},onBlur:u=>{r!=null&&r.onBlur&&(r==null||r.onBlur(u)),g(f=>d(n({},f),{eventID:I(12),isFocusing:!1}))},onClick:u=>{r!=null&&r.onClick&&(r==null||r.onClick(u)),!t.disabled&&p(!0)},onKeyDown:u=>{let{key:f,metaKey:s,ctrlKey:x}=u,w=s||x;if(r!=null&&r.onKeyDown&&(r==null||r.onKeyDown(u)),L&&k.SubmitForm(u,T),!t.disabled){if(S.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(f))return;if(u.preventDefault(),!y)return p(!0);let b=f=="ArrowDown"?1:-1,v=te.FilterSelectableOptions(e),K=v.length-1,_=null;S.scope(()=>{var X,G,Q,Y,Z;let D=v.findIndex(U=>(U==null?void 0:U.id)==i);if(b==1){if(_=(X=v[0])==null?void 0:X.id,w){_=v[K].id;return}if(D==-1||D==K)return;_=(G=v[D+1])==null?void 0:G.id}else{if(_=(Q=v[K])==null?void 0:Q.id,w){_=(Y=v[0])==null?void 0:Y.id;return}if(D==-1||D==0)return;_=(Z=v[D-1])==null?void 0:Z.id}}),m(_)}),f=="Escape")p(!1);else if(f=="Tab")p(!1);else if(f=="Backspace")g(b=>d(n({},b),{dataValue:null,eventType:"update",eventID:I(12),isInspected:!1}));else if(f==" ")u.preventDefault(),p(!0);else if(f=="Enter"){if(!y)return p(!0);u.preventDefault();let b=t.options.find(v=>(v==null?void 0:v.id)==i);if(!b)return;g(v=>d(n({},v),{dataValue:b==null?void 0:b.value,eventType:"update",eventID:I(12),isInspected:!1})),p(!1)}}},children:V(H.Left,{gap:0,children:[a(Ve,{width:0,overflow:"hidden",opacity:"trans",children:"A"}),V(H.Left,{flexWrap:!0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[a(C.Placeholder,n({},e)),a(C.Selected,n({},e))]})]})})),y&&a(C.Selector,n({},e))]})},LegacySelector:e=>{let{rootStates:t,val_preventOpenSelectorOnFocus:l,set_preventOpenSelectorOnFocus:o,val_optionFocused:i,set_optionFocused:m,val_status:c,set_status:g,val_selectorOpen:y,set_selectorOpen:p}=e,f=t,{tone:R,required:F,form:T,className:O,label:ae,isLabelActive:ne,placeholder:oe,enableFormSubmit:L,emptySelect:j,checkValidationAtFirst:W,onValidate:re,onValidateDelay:se,onUpdateValue:ie,onUpdateValidValue:ce,onUserAction:ue,onKeyDown:P,onChange:M,value:de="",options:J,leftIndicator:Se,rightIndicator:pe,leftIcon:fe,rightIcon:me,componentId:ye,status_id:ve,wrapStyles:ge,SelectedCellStyles:be,SelectorCellStyles:Ie,SelectorMode:he,SelectorStyles:r,SelectorPosition:N}=f,u=q(f,["tone","required","form","className","label","isLabelActive","placeholder","enableFormSubmit","emptySelect","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","onKeyDown","onChange","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentId","status_id","wrapStyles","SelectedCellStyles","SelectorCellStyles","SelectorMode","SelectorStyles","SelectorPosition"]);return e.rootStates.SelectorMode!="legacy"?null:V(h,d(n({htmlTag:"select",tabIndex:0},u),{"data-disabled":t.disabled,"data-show-validation":k.isShowValidation(c,!!W),"data-component-id":c.componentId,"data-input-origin":c.componentId,className:[O,A("Core")].join(" "),onKeyDown:s=>{P&&P(s),L&&k.SubmitForm(s,T)},onChange:s=>{let{value:x}=s.target;g(w=>d(n({},w),{dataValue:x,eventType:"update",eventID:I(12),isInspected:!1,isValidated:!1,notice:[]})),M&&M(s)},children:[!!j&&a("option",{value:"null",children:"\u9078\u629E"}),J.map(s=>S.is.nullish(s==null?void 0:s.value)?null:a("option",{value:s==null?void 0:s.value,children:(s==null?void 0:s.label)||(s==null?void 0:s.value)},String(s==null?void 0:s.value)))]}))},Selector:e=>{var o;z(()=>{let i=S(`[data-selector-id="${e.val_status.componentId}"]`)[0];if(!i)return;let m=S(`[data-select-input-value="${e.val_optionFocused}"]`)[0];m&&(i.scrollTop=m.offsetTop-24)},[e.val_optionFocused]);let t=te.FilterSelectableOptions(e,!0),l={position:"absolute",minWidth:1,freeCSS:{zIndex:1e3}};switch(e.rootStates.SelectorPosition){case 1:l.bottom="100%",l.left=0,l.paddingBottom="1/3";break;case 2:l.bottom="100%",l.right=0,l.paddingBottom="1/3";break;case 3:l.top="100%",l.left=0,l.paddingTop="1/3";break;case 4:l.top="100%",l.right=0,l.paddingTop="1/3";break;default:break}return a(h,d(n({},l),{children:a(Fe.Body,d(n({className:A("Selector"),ssCardBox:!0,borderRadius:"2.tone.secondary",boxShadow:"1.normal",overflow:"auto","data-selector-id":e.val_status.componentId},e.rootStates.SelectorStyles),{freeCSS:n({minWidth:12*6,maxHeight:12*24},(o=e.rootStates.SelectorStyles)==null?void 0:o.freeCSS),children:V(Oe,{gap:"1/12",padding:[1,0],children:[t.map((i,m)=>{if(!i)return null;let{type:c,value:g}=i,y=e.val_optionFocused==i.id,p=e.val_status.dataValue===g;return c=="label"?a(h,{children:i.label||i.value},I()):a(_e.Sub.S,d(n({"data-select-input-value":i.id,color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1],isActive:p||y,isActiveStyles:y?{backgroundColor:"cloud"}:{backgroundColor:"theme.opa.few",fontColor:"theme"}},e.rootStates.SelectorCellStyles),{onClick:R=>{e.set_status(F=>d(n({},F),{dataValue:g,eventType:"update",eventID:I(12),isInspected:!1})),e.set_selectorOpen(!1),e.set_preventOpenSelectorOnFocus(!0)},children:V(H.Left,{gap:"1/2",children:[p&&a(ee.Check,{fontColor:"theme"}),a(E.Supplement,{transition:"short",flexSizing:0,children:i.label||i.value})]})}),i.id)}),!t.length&&a(E.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},"no-selector-notice")]})}))}))},Selected:e=>{let t=[];return e.val_status.dataValue!==null&&S.scope(()=>{let l=e.rootStates.options.find(o=>S.is.equal(o==null?void 0:o.value,e.val_status.dataValue));l&&t.push(a(h,d(n({},e.rootStates.SelectedCellStyles),{children:(l==null?void 0:l.label)||(l==null?void 0:l.value)}),String(l==null?void 0:l.value)))}),a($,{children:t})},Core:e=>{var F,T;let{value:t}=e,[l,o]=B(k.DefaultStatus(e.componentId,t)),[i,m]=B(!1),[c,g]=B(!1),[y,p]=B(((F=e.options.find(O=>(O==null?void 0:O.value)===e.value))==null?void 0:F.id)||((T=e.options[0])==null?void 0:T.id)||""),R={rootStates:e,val_preventOpenSelectorOnFocus:i,set_preventOpenSelectorOnFocus:m,val_optionFocused:y,set_optionFocused:p,val_selectorOpen:c,set_selectorOpen:g,val_status:l,set_status:o};return k.CommonEffects({type:"select",states:e,val_status:l,set_status:o,SystemValidation:Re}),V(xe,{val_status:l,set_status:o,states:e,children:[a(De,{componentId:e.componentId,fontSize:e.fontSize,required:e.required,label:e.label,isActive:e.isLabelActive||l.dataValue!==null}),a(C.Shallow,n({},R)),a(C.Button,n({},R))]})}},le=e=>{var l;let t=n({},e);return t=d(n({emptySelect:!0,SelectorMode:"original",SelectorPosition:3},t),{freeCSS:n({cursor:"pointer"},t.freeCSS)}),t.emptySelect&&(t.options=[{value:null,label:a(E.Supplement,{fontColor:"4.thin",children:"\u672A\u9078\u629E"})},...t.options]),t.value=(l=t.value)!=null?l:null,t.options.forEach((o,i)=>{if(!o)return;let{type:m,value:c,searchValue:g}=o,y=g||S.is.string(c)&&c||S.Stringify(c||"")||"";t.options[i]=d(n({id:I()},o),{value:c,searchValue:y,type:m||"selector"})}),S.is.nullish(t.rightIcon)&&(t.rightIcon=a(ke,{children:a(ee.AngleDown,{})})),a(Te,{componentId:t.componentId,children:C.Core,states:we(t)})};export{le as Select,le as default};
@@ -1 +1 @@
1
- import{b,c as h,d as B}from"../../chunk-C5N2D3ZX.js";import{jsx as p,jsxs as U}from"react/jsx-runtime";import L,{UUID as x}from"jmini";import{useState as k,useEffect as $}from"react";import{$$fromRoot as C,GenerateHTMLProps as q}from"../../@utils";import{Box as w,Flex as A,Column as O}from"../../atoms";import{Button as G}from"../Button";import{OptionalInputWrapper as X,BoxWrapper as j,CoreEffects as F}from"./core";import{InputSliderClasses as m}from"../../@styles/componentClasses";function J(t){let{value:e,states:o}=t,{required:s}=o,n=[];return s&&!e&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!n.filter(({type:i})=>i=="invalid").length,notice:n}}const z=t=>{let{value:e,val_status:o}=t,{min:s,max:n,step:i}=o;e=Math.max(e,s),e=Math.min(e,n);let a=e/n*n;return a=Math.round(a/i),{stepValue:a*i,stepIndex:a,positionLeft:a*i/n*100+"%"}},N={IndicatorLabels:t=>{let{componentId:e,min:o,max:s,step:n,customLegends:i}=t,u=[],a=Math.round(o/n),r=Math.round(s/n),c=r-a+1;for(var d=a;d<=r;d++){let l=d*n;l=Math.max(l,o),l=Math.min(l,s);let S=l/s*100+"%";u.push(p(w,{className:m("Label"),id:"Legend-"+e+"-"+d,display:d==a||d==r?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",verticalAlign:"center",horizontalAlign:"center",freeCSS:{left:S,whiteSpace:"nowrap",textAlign:"center"},children:i?i(l):l.rank()},l))}return $(()=>{const l=()=>{let S=C("#Labels-"+e),{width:f}=S.position(),R=Math.round(f/50)-1,g=Math.round(c/R);for(let v=a+1;v<r;v++)C("#Legend-"+e+"-"+v).css({display:v%g==0?"flex":"none"})};return L(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{L(window).removeEvent("SliderResizeCallback-"+e)}},[]),p(A,{className:m("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:p(w,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:u})})},Rail:t=>{let{val_status:e,set_status:o,DotData:s,form:n,enableFormSubmit:i}=t,{componentId:u}=e;return U(A,{className:m("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{zIndex:1,cursor:"pointer"},onPointerDown:a=>{t.rootStates.disabled||(a.stopPropagation(),y.Effects.Start(a,{val_status:e,set_status:o,DotData:s}))},children:[p(w,{className:m("Bar"),backgroundColor:"layer.4",position:"relative",borderRadius:"1.tone.primary",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:u+"_Bar",children:p(w,{className:m("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:t.color,opacity:"middle",overflow:"hidden",freeCSS:{width:s.positionLeft},id:u+"_BarColor"})}),p(w,{className:m("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:p(G.Plain,{className:m("Ball"),position:"absolute",boxShadow:"1.remark",backgroundColor:t.color,top:0,left:0,ssSquare:1.5,borderRadius:"1.tone.primary",freeCSS:{zIndex:2,left:s.positionLeft},id:u+"_Ball",onKeyDown:a=>{y.KeyDownEvent({event:a,val_status:e,set_status:o,DotData:s}),i&&F.SubmitForm(a,n)},onFocus:a=>{o(r=>h(b({},r),{eventID:x(),isFocusing:!0}))},onBlur:a=>{o(r=>h(b({},r),{eventID:x(),isFocusing:!1}))}})})]})}},y={Effects:{Start:(t,e)=>{L(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{y.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{y.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{y.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{y.Effects.End()}})},Move:(t,e)=>{let o=L.getCursor(t).x,{val_status:s,set_status:n}=e,{componentId:i,min:u,max:a}=s,r=C("#"+i+"_Ball"),c=C("#"+i+"_Bar"),d=C("#"+i+"_BarColor"),{width:l,left:S}=c.position(),f=(o-S)/l;f=Math.max(f,0),f=Math.min(f,1);let R=f*a,g=z({value:R,val_status:s}),v=g.positionLeft,T=g.stepValue;return r.css({left:v}),d.css({width:v}),n(D=>{let E=D.dataValue;return T==E?D:h(b({},D),{dataValue:T,eventType:"update",eventID:x(),isInspected:!1})}),t.preventDefault(),t.stopPropagation(),!1},End:()=>{L(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:t=>{let{event:e,val_status:o,set_status:s}=t,{min:n,max:i,step:u}=o,{key:a,metaKey:r,ctrlKey:c}=e,d=c||r,l=o.dataValue;a.match(/Arrow/)&&(e.preventDefault(),a.match(/Left|Up/)?d?l=n:l-=u:a.match(/Right|Down/)&&(d?l=i:l+=u),l=Math.max(Math.min(l,i),n),s(S=>h(b({},S),{dataValue:l,eventType:"update",eventID:x(),isInspected:!1})))}},Q=t=>{let V=t,{color:e="theme",required:o,form:s="",legends:{enable:n=!0,custom:i,showAlways:u=!1}={},min:a,max:r,step:c,enableFormSubmit:d,checkValidationAtFirst:l,onValidate:S,onValidateDelay:f,onUpdateValue:R,onUpdateValidValue:g,onUserAction:v,value:T="",className:D,wrapStyles:E}=V,W=B(V,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","className","wrapStyles"]),[I,_]=k({componentId:t.componentId||"",dataValue:T,min:a,max:r,step:c,eventType:"init",eventID:x()}),[M,K]=k({ok:!1,notice:[]});F.CommonEffects({type:"slider",states:t,val_status:I,set_status:_,val_validate:M,set_validate:K,SystemValidation:J});let P=z({value:I.dataValue,val_status:I});return p(j,{val_status:I,set_status:_,val_validate:M,states:t,children:U(O,h(b({gap:"1/2",flexSizing:"auto"},W),{className:[m("Wrap"),D,m("ShowLegendsAlways_"+u)].join(" "),children:[p(N.Rail,{rootStates:t,color:e,val_status:I,set_status:_,DotData:P,form:s,enableFormSubmit:d}),!!n&&p(N.IndicatorLabels,{componentId:I.componentId,min:a,max:r,step:c,customLegends:i})]}))})},H=t=>{let e=h(b({},t),{freeCSS:b({minWidth:120},t.freeCSS)});return p(X,{componentId:t.componentId,children:Q,states:q(e)})};export{H as Slider,H as default};
1
+ import{b,c as h,d as V}from"../../chunk-C5N2D3ZX.js";import{jsx as p,jsxs as N}from"react/jsx-runtime";import L,{UUID as x}from"jmini";import{useState as W,useEffect as K}from"react";import{$$fromRoot as C,GenerateHTMLProps as P}from"../../@utils";import{Box as w,Flex as B,Column as $}from"../../atoms";import{Button as q}from"../Button";import{OptionalInputWrapper as O,BoxWrapper as G,CoreEffects as k}from"./core";import{InputSliderClasses as m}from"../../@styles/componentClasses";function X(t){let{value:e,states:o}=t,{required:s}=o,n=[];return s&&!e&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!n.filter(({type:r})=>r=="invalid").length,notice:n}}const A=t=>{let{value:e,val_status:o}=t,{min:s,max:n,step:r}=o;e=Math.max(e,s),e=Math.min(e,n);let a=e/n*n;return a=Math.round(a/r),{stepValue:a*r,stepIndex:a,positionLeft:a*r/n*100+"%"}},F={IndicatorLabels:t=>{let{componentId:e,min:o,max:s,step:n,customLegends:r}=t,u=[],a=Math.round(o/n),i=Math.round(s/n),c=i-a+1;for(var d=a;d<=i;d++){let l=d*n;l=Math.max(l,o),l=Math.min(l,s);let S=l/s*100+"%";u.push(p(w,{className:m("Label"),id:"Legend-"+e+"-"+d,display:d==a||d==i?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",verticalAlign:"center",horizontalAlign:"center",freeCSS:{left:S,whiteSpace:"nowrap",textAlign:"center"},children:r?r(l):l.rank()},l))}return K(()=>{const l=()=>{let S=C("#Labels-"+e),{width:f}=S.position(),R=Math.round(f/50)-1,y=Math.round(c/R);for(let v=a+1;v<i;v++)C("#Legend-"+e+"-"+v).css({display:v%y==0?"flex":"none"})};return L(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{L(window).removeEvent("SliderResizeCallback-"+e)}},[]),p(B,{className:m("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:p(w,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:u})})},Rail:t=>{let{val_status:e,set_status:o,DotData:s,form:n,enableFormSubmit:r}=t,{componentId:u}=e;return N(B,{className:m("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{zIndex:1,cursor:"pointer"},onPointerDown:a=>{t.rootStates.disabled||(a.stopPropagation(),g.Effects.Start(a,{val_status:e,set_status:o,DotData:s}))},children:[p(w,{className:m("Bar"),backgroundColor:"layer.4",position:"relative",borderRadius:"1.tone.primary",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:u+"_Bar",children:p(w,{className:m("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:t.color,opacity:"middle",overflow:"hidden",freeCSS:{width:s.positionLeft},id:u+"_BarColor"})}),p(w,{className:m("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:p(q.Plain,{className:m("Ball"),position:"absolute",boxShadow:"1.remark",backgroundColor:t.color,top:0,left:0,ssSquare:1.5,borderRadius:"1.tone.primary",freeCSS:{zIndex:2,left:s.positionLeft},id:u+"_Ball",onKeyDown:a=>{g.KeyDownEvent({event:a,val_status:e,set_status:o,DotData:s}),r&&k.SubmitForm(a,n)},onFocus:a=>{o(i=>h(b({},i),{eventID:x(12),isFocusing:!0}))},onBlur:a=>{o(i=>h(b({},i),{eventID:x(12),isFocusing:!1}))}})})]})}},g={Effects:{Start:(t,e)=>{L(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{g.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{g.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{g.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{g.Effects.End()}})},Move:(t,e)=>{let o=L.getCursor(t).x,{val_status:s,set_status:n}=e,{componentId:r,min:u,max:a}=s,i=C("#"+r+"_Ball"),c=C("#"+r+"_Bar"),d=C("#"+r+"_BarColor"),{width:l,left:S}=c.position(),f=(o-S)/l;f=Math.max(f,0),f=Math.min(f,1);let R=f*a,y=A({value:R,val_status:s}),v=y.positionLeft,T=y.stepValue;return i.css({left:v}),d.css({width:v}),n(D=>{let E=D.dataValue;return T==E?D:h(b({},D),{dataValue:T,eventType:"update",eventID:x(12),isInspected:!1})}),t.preventDefault(),t.stopPropagation(),!1},End:()=>{L(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:t=>{let{event:e,val_status:o,set_status:s}=t,{min:n,max:r,step:u}=o,{key:a,metaKey:i,ctrlKey:c}=e,d=c||i,l=o.dataValue;a.match(/Arrow/)&&(e.preventDefault(),a.match(/Left|Up/)?d?l=n:l-=u:a.match(/Right|Down/)&&(d?l=r:l+=u),l=Math.max(Math.min(l,r),n),s(S=>h(b({},S),{dataValue:l,eventType:"update",eventID:x(12),isInspected:!1})))}},j=t=>{let M=t,{color:e="theme",required:o,form:s="",legends:{enable:n=!0,custom:r,showAlways:u=!1}={},min:a,max:i,step:c,enableFormSubmit:d,checkValidationAtFirst:l,onValidate:S,onValidateDelay:f,onUpdateValue:R,onUpdateValidValue:y,onUserAction:v,value:T="",className:D,wrapStyles:E}=M,H=V(M,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","value","className","wrapStyles"]),[I,_]=W({componentId:t.componentId||"",dataValue:T,min:a,max:i,step:c,eventType:"init",eventID:x(12)});k.CommonEffects({type:"slider",states:t,val_status:I,set_status:_,SystemValidation:X});let U=A({value:I.dataValue,val_status:I});return p(G,{val_status:I,set_status:_,states:t,children:N($,h(b({gap:"1/2",flexSizing:"auto"},H),{className:[m("Wrap"),D,m("ShowLegendsAlways_"+u)].join(" "),children:[p(F.Rail,{rootStates:t,color:e,val_status:I,set_status:_,DotData:U,form:s,enableFormSubmit:d}),!!n&&p(F.IndicatorLabels,{componentId:I.componentId,min:a,max:i,step:c,customLegends:r})]}))})},z=t=>{let e=h(b({},t),{freeCSS:b({minWidth:120},t.freeCSS)});return p(O,{componentId:t.componentId,children:j,states:P(e)})};export{z as Slider,z as default};
@@ -1 +1 @@
1
- import{b as o,c as l,d as D}from"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as z}from"react/jsx-runtime";import{UUID as S}from"jmini";import{useState as M}from"react";import I from"../../atoms/Box";import{Row as U}from"../../mols";import{Label as A}from"../Button";import{OptionalInputWrapper as W,BoxWrapper as P,CoreEffects as N}from"./core";import{InputSwitchClasses as g}from"../../@styles/componentClasses";function H(e){let{value:n,states:s}=e,{required:x}=s,r=[];return x&&!n&&r.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!r.filter(({type:f})=>f=="invalid").length,notice:r}}const O=e=>{let B=e,{componentId:n,color:s="posi",required:x,form:r,id:f,enableFormSubmit:E,checkValidationAtFirst:q,onChange:F,onKeyDown:T,onValidate:K,onValidateDelay:$,onUpdateValue:G,onUpdateValidValue:J,onUserAction:Q,size:R="regular",value:L="",icon:V="",isApply:p=!1}=B,t=D(B,["componentId","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","size","value","icon","isApply"]),[u,c]=M({componentId:e.componentId||"",dataValue:L,eventType:"init",eventID:S()}),[v,k]=M({ok:!1,notice:[]}),d=!!u.dataValue;N.CommonEffects({type:"switch",states:e,val_status:u,set_status:c,val_validate:v,set_validate:k,SystemValidation:H});let y="middle",w=5,C=3;return p&&(C=4),z(P,{val_status:u,set_status:c,val_validate:v,states:e,children:[a(I,l(o({htmlTag:"input",type:"checkbox","data-component-id":u.componentId,checked:u.dataValue,className:g("Input"),id:f,onKeyDown:i=>{T&&T(i),E&&N.SubmitForm(i,r)},onChange:i=>{let{checked:m}=i.target;v.ok&&k({ok:!1,notice:[]}),c(_=>l(o({},_),{dataValue:m,eventType:"update",eventID:S(),isInspected:!1})),F&&F(i)}},t),{onFocus:i=>{t!=null&&t.onFocus&&(t==null||t.onFocus(i)),c(m=>l(o({},m),{eventID:S(),isFocusing:!0}))},onBlur:i=>{t!=null&&t.onBlur&&(t==null||t.onBlur(i)),c(m=>l(o({},m),{eventID:S(),isFocusing:!1}))}})),a(A.Plain,{tabIndex:-1,htmlFor:f,padding:"1/4",transition:y,borderRadius:"1.tone.primary",className:g("Label"),children:a(I,l(o({},p?{padding:"1/4",isRounded:!0,backgroundColor:d?s:"layer.3"}:{}),{children:z(U.Center,{unitHeight:R=="small"?2:R=="regular"?2.5:R=="large"?3:0,position:"relative",freeCSS:{aspectRatio:(w+C)/w},children:[!p&&a(I,{position:"absolute",backgroundColor:d?s:"layer.5",isRounded:!0,transition:y,width:1,opacity:"middle",className:g("Bar"),freeCSS:{height:"40%"}}),a(I,{position:"absolute",top:0,backgroundColor:!p&&d?s:"white",transition:y,isRounded:!0,flexCenter:!0,boxShadow:"1.remark",className:g("Dot"),freeCSS:{height:"100%",aspectRatio:"1",left:d?`calc(${C.ratio(w+C)}%)`:0},children:V&&a(I,{transition:y,flexCenter:!0,fontColor:d?p?s:"white":"6.clear",children:V})})]})}))})]})},b=e=>{let n=o({},e);return n.value=!!n.value,n.color=n.color||"theme",a(W,{componentId:n.componentId,children:O,states:n})},h=b;h.S=e=>a(b,l(o({},e),{size:"small"})),h.R=e=>a(b,l(o({},e),{size:"regular"})),h.L=e=>a(b,l(o({},e),{size:"large"}));export{h as Switch,h as default};
1
+ import{b as o,c as l,d as k}from"../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as D}from"react/jsx-runtime";import{UUID as S}from"jmini";import{useState as E}from"react";import I from"../../atoms/Box";import{Row as L}from"../../mols";import{Label as U}from"../Button";import{OptionalInputWrapper as A,BoxWrapper as W,CoreEffects as B}from"./core";import{InputSwitchClasses as g}from"../../@styles/componentClasses";function P(e){let{value:n,states:s}=e,{required:R}=s,r=[];return R&&!n&&r.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!r.filter(({type:f})=>f=="invalid").length,notice:r}}const _=e=>{let V=e,{componentId:n,color:s="posi",required:R,form:r,id:f,enableFormSubmit:M,checkValidationAtFirst:H,onChange:F,onKeyDown:v,onValidate:O,onValidateDelay:q,onUpdateValue:K,onUpdateValidValue:$,onUserAction:G,size:w="regular",value:N="",icon:T="",isApply:p=!1}=V,t=k(V,["componentId","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","size","value","icon","isApply"]),[c,u]=E({componentId:e.componentId||"",dataValue:N,eventType:"init",eventID:S(12)}),d=!!c.dataValue;B.CommonEffects({type:"switch",states:e,val_status:c,set_status:u,SystemValidation:P});let y="middle",x=5,C=3;return p&&(C=4),D(W,{val_status:c,set_status:u,states:e,children:[a(I,l(o({htmlTag:"input",type:"checkbox","data-component-id":c.componentId,checked:c.dataValue,className:g("Input"),id:f,onKeyDown:i=>{v&&v(i),M&&B.SubmitForm(i,r)},onChange:i=>{let{checked:m}=i.target;u(z=>l(o({},z),{dataValue:m,eventType:"update",eventID:S(12),isInspected:!1,isValidated:!1,notice:[]})),F&&F(i)}},t),{onFocus:i=>{t!=null&&t.onFocus&&(t==null||t.onFocus(i)),u(m=>l(o({},m),{eventID:S(12),isFocusing:!0}))},onBlur:i=>{t!=null&&t.onBlur&&(t==null||t.onBlur(i)),u(m=>l(o({},m),{eventID:S(12),isFocusing:!1}))}})),a(U.Plain,{tabIndex:-1,htmlFor:f,padding:"1/4",transition:y,borderRadius:"1.tone.primary",className:g("Label"),children:a(I,l(o({},p?{padding:"1/4",isRounded:!0,backgroundColor:d?s:"layer.3"}:{}),{children:D(L.Center,{unitHeight:w=="small"?2:w=="regular"?2.5:w=="large"?3:0,position:"relative",freeCSS:{aspectRatio:(x+C)/x},children:[!p&&a(I,{position:"absolute",backgroundColor:d?s:"layer.5",isRounded:!0,transition:y,width:1,opacity:"middle",className:g("Bar"),freeCSS:{height:"40%"}}),a(I,{position:"absolute",top:0,backgroundColor:!p&&d?s:"white",transition:y,isRounded:!0,flexCenter:!0,boxShadow:"1.remark",className:g("Dot"),freeCSS:{height:"100%",aspectRatio:"1",left:d?`calc(${C.ratio(x+C)}%)`:0},children:T&&a(I,{transition:y,flexCenter:!0,fontColor:d?p?s:"white":"6.clear",children:T})})]})}))})]})},b=e=>{let n=o({},e);return n.value=!!n.value,n.color=n.color||"theme",a(A,{componentId:n.componentId,children:_,states:n})},h=b;h.S=e=>a(b,l(o({},e),{size:"small"})),h.R=e=>a(b,l(o({},e),{size:"regular"})),h.L=e=>a(b,l(o({},e),{size:"large"}));export{h as Switch,h as default};
@@ -41,8 +41,6 @@ declare namespace TextField {
41
41
  set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Text>>;
42
42
  val_inputType: React.HTMLInputTypeAttribute;
43
43
  set_inputType: React.Dispatch<React.SetStateAction<React.HTMLInputTypeAttribute>>;
44
- val_validate: InputTypes.Validation.Result;
45
- set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
46
44
  };
47
45
  namespace Methods {
48
46
  type Component = {