streamlit 1.50.0__py3-none-any.whl → 1.51.0__py3-none-any.whl
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.
- streamlit/__init__.py +4 -1
- streamlit/commands/navigation.py +4 -6
- streamlit/commands/page_config.py +4 -6
- streamlit/components/v2/__init__.py +458 -0
- streamlit/components/v2/bidi_component/__init__.py +20 -0
- streamlit/components/v2/bidi_component/constants.py +29 -0
- streamlit/components/v2/bidi_component/main.py +386 -0
- streamlit/components/v2/bidi_component/serialization.py +265 -0
- streamlit/components/v2/bidi_component/state.py +92 -0
- streamlit/components/v2/component_definition_resolver.py +143 -0
- streamlit/components/v2/component_file_watcher.py +403 -0
- streamlit/components/v2/component_manager.py +431 -0
- streamlit/components/v2/component_manifest_handler.py +122 -0
- streamlit/components/v2/component_path_utils.py +245 -0
- streamlit/components/v2/component_registry.py +409 -0
- streamlit/components/v2/get_bidi_component_manager.py +51 -0
- streamlit/components/v2/manifest_scanner.py +615 -0
- streamlit/components/v2/presentation.py +198 -0
- streamlit/components/v2/types.py +324 -0
- streamlit/config.py +456 -53
- streamlit/config_option.py +4 -1
- streamlit/config_util.py +650 -1
- streamlit/dataframe_util.py +15 -8
- streamlit/delta_generator.py +6 -4
- streamlit/delta_generator_singletons.py +3 -1
- streamlit/deprecation_util.py +17 -6
- streamlit/elements/arrow.py +37 -9
- streamlit/elements/deck_gl_json_chart.py +97 -39
- streamlit/elements/dialog_decorator.py +2 -1
- streamlit/elements/exception.py +3 -1
- streamlit/elements/graphviz_chart.py +1 -3
- streamlit/elements/heading.py +3 -5
- streamlit/elements/image.py +2 -4
- streamlit/elements/layouts.py +31 -11
- streamlit/elements/lib/built_in_chart_utils.py +1 -3
- streamlit/elements/lib/color_util.py +8 -18
- streamlit/elements/lib/column_config_utils.py +4 -8
- streamlit/elements/lib/column_types.py +40 -12
- streamlit/elements/lib/dialog.py +2 -2
- streamlit/elements/lib/image_utils.py +3 -5
- streamlit/elements/lib/layout_utils.py +50 -13
- streamlit/elements/lib/mutable_status_container.py +2 -2
- streamlit/elements/lib/options_selector_utils.py +2 -2
- streamlit/elements/lib/utils.py +4 -4
- streamlit/elements/map.py +80 -37
- streamlit/elements/media.py +5 -7
- streamlit/elements/metric.py +3 -5
- streamlit/elements/pdf.py +2 -4
- streamlit/elements/plotly_chart.py +125 -17
- streamlit/elements/progress.py +2 -4
- streamlit/elements/space.py +113 -0
- streamlit/elements/vega_charts.py +339 -148
- streamlit/elements/widgets/audio_input.py +5 -5
- streamlit/elements/widgets/button.py +2 -4
- streamlit/elements/widgets/button_group.py +33 -7
- streamlit/elements/widgets/camera_input.py +2 -4
- streamlit/elements/widgets/chat.py +7 -1
- streamlit/elements/widgets/color_picker.py +1 -1
- streamlit/elements/widgets/data_editor.py +28 -24
- streamlit/elements/widgets/file_uploader.py +5 -10
- streamlit/elements/widgets/multiselect.py +4 -3
- streamlit/elements/widgets/number_input.py +2 -4
- streamlit/elements/widgets/radio.py +10 -3
- streamlit/elements/widgets/select_slider.py +8 -5
- streamlit/elements/widgets/selectbox.py +6 -3
- streamlit/elements/widgets/slider.py +38 -42
- streamlit/elements/widgets/time_widgets.py +6 -12
- streamlit/elements/write.py +27 -6
- streamlit/emojis.py +1 -1
- streamlit/errors.py +115 -0
- streamlit/hello/hello.py +8 -0
- streamlit/hello/utils.py +2 -1
- streamlit/material_icon_names.py +1 -1
- streamlit/navigation/page.py +4 -1
- streamlit/proto/ArrowData_pb2.py +27 -0
- streamlit/proto/ArrowData_pb2.pyi +46 -0
- streamlit/proto/BidiComponent_pb2.py +34 -0
- streamlit/proto/BidiComponent_pb2.pyi +153 -0
- streamlit/proto/Block_pb2.py +7 -7
- streamlit/proto/Block_pb2.pyi +4 -1
- streamlit/proto/DeckGlJsonChart_pb2.py +10 -4
- streamlit/proto/DeckGlJsonChart_pb2.pyi +9 -3
- streamlit/proto/Element_pb2.py +5 -3
- streamlit/proto/Element_pb2.pyi +14 -4
- streamlit/proto/HeightConfig_pb2.py +2 -2
- streamlit/proto/HeightConfig_pb2.pyi +6 -3
- streamlit/proto/NewSession_pb2.py +18 -18
- streamlit/proto/NewSession_pb2.pyi +25 -6
- streamlit/proto/PlotlyChart_pb2.py +8 -6
- streamlit/proto/PlotlyChart_pb2.pyi +3 -1
- streamlit/proto/Space_pb2.py +27 -0
- streamlit/proto/Space_pb2.pyi +42 -0
- streamlit/proto/WidgetStates_pb2.py +2 -2
- streamlit/proto/WidgetStates_pb2.pyi +13 -3
- streamlit/proto/WidthConfig_pb2.py +2 -2
- streamlit/proto/WidthConfig_pb2.pyi +6 -3
- streamlit/runtime/app_session.py +27 -1
- streamlit/runtime/caching/cache_data_api.py +4 -4
- streamlit/runtime/caching/cache_errors.py +4 -1
- streamlit/runtime/caching/cache_resource_api.py +3 -2
- streamlit/runtime/caching/cache_utils.py +2 -1
- streamlit/runtime/caching/cached_message_replay.py +3 -3
- streamlit/runtime/caching/hashing.py +3 -4
- streamlit/runtime/caching/legacy_cache_api.py +2 -1
- streamlit/runtime/connection_factory.py +1 -3
- streamlit/runtime/forward_msg_queue.py +4 -1
- streamlit/runtime/fragment.py +2 -1
- streamlit/runtime/memory_media_file_storage.py +1 -1
- streamlit/runtime/metrics_util.py +6 -2
- streamlit/runtime/runtime.py +14 -0
- streamlit/runtime/scriptrunner/exec_code.py +2 -1
- streamlit/runtime/scriptrunner/script_runner.py +2 -2
- streamlit/runtime/scriptrunner_utils/script_run_context.py +3 -6
- streamlit/runtime/secrets.py +2 -4
- streamlit/runtime/session_manager.py +3 -1
- streamlit/runtime/state/common.py +30 -5
- streamlit/runtime/state/presentation.py +85 -0
- streamlit/runtime/state/safe_session_state.py +2 -2
- streamlit/runtime/state/session_state.py +220 -16
- streamlit/runtime/state/widgets.py +19 -3
- streamlit/runtime/websocket_session_manager.py +3 -1
- streamlit/source_util.py +2 -2
- streamlit/static/index.html +2 -2
- streamlit/static/manifest.json +243 -226
- streamlit/static/static/css/{index.CIiu7Ygf.css → index.BpABIXK9.css} +1 -1
- streamlit/static/static/css/index.DgR7E2CV.css +1 -0
- streamlit/static/static/js/{ErrorOutline.esm.DUpR0_Ka.js → ErrorOutline.esm.YoJdlW1p.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CN4j9-1w.js → FileDownload.esm.Ddx8VEYy.js} +1 -1
- streamlit/static/static/js/{FileHelper.CaIUKG91.js → FileHelper.90EtOmj9.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.DTcdrasw.js → FormClearHelper.BB1Km6eP.js} +1 -1
- streamlit/static/static/js/InputInstructions.jhH15PqV.js +1 -0
- streamlit/static/static/js/{Particles.CElH0XX2.js → Particles.DUsputn1.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DetlP5aY.js → ProgressBar.DLY8H6nE.js} +1 -1
- streamlit/static/static/js/{Toolbar.C77ar7rq.js → Toolbar.D8nHCkuz.js} +1 -1
- streamlit/static/static/js/{base-input.BQft14La.js → base-input.CJGiNqed.js} +3 -3
- streamlit/static/static/js/{checkbox.yZOfXCeX.js → checkbox.Cpdd482O.js} +1 -1
- streamlit/static/static/js/{createSuper.Dh9w1cs8.js → createSuper.CuQIogbW.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DcuHuCyW.js → data-grid-overlay-editor.2Ufgxc6y.js} +1 -1
- streamlit/static/static/js/{downloader.MeHtkq8r.js → downloader.CN0K7xlu.js} +1 -1
- streamlit/static/static/js/{es6.VpBPGCnM.js → es6.BJcsVXQ0.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.yMw_ARIL.js → iframeResizer.contentWindow.XzUvQqcZ.js} +1 -1
- streamlit/static/static/js/index.B1ZQh4P1.js +1 -0
- streamlit/static/static/js/index.BKstZk0M.js +27 -0
- streamlit/static/static/js/{index.Cnpi3o3E.js → index.BMcFsUee.js} +1 -1
- streamlit/static/static/js/{index.DKv_lNO7.js → index.BR-IdcTb.js} +1 -1
- streamlit/static/static/js/{index.FFOzOWzC.js → index.B_dWA3vd.js} +1 -1
- streamlit/static/static/js/{index.Bj9JgOEC.js → index.BgnZEMVh.js} +1 -1
- streamlit/static/static/js/{index.Bxz2yX3P.js → index.BohqXifI.js} +1 -1
- streamlit/static/static/js/{index.Dbe-Q3C-.js → index.Br5nxKNj.js} +1 -1
- streamlit/static/static/js/{index.BjCwMzj4.js → index.BrIKVbNc.js} +2 -2
- streamlit/static/static/js/index.BtWUPzle.js +1 -0
- streamlit/static/static/js/{index.CGYqqs6j.js → index.C0RLraek.js} +1 -1
- streamlit/static/static/js/{index.D2QEXQq_.js → index.CAIjskgG.js} +1 -1
- streamlit/static/static/js/{index.6xX1278W.js → index.CAj-7vWz.js} +131 -157
- streamlit/static/static/js/{index.DK7hD7_w.js → index.CMtEit2O.js} +1 -1
- streamlit/static/static/js/{index.DNLrMXgm.js → index.CkRlykEE.js} +1 -1
- streamlit/static/static/js/{index.ClELlchS.js → index.CmN3FXfI.js} +1 -1
- streamlit/static/static/js/{index.GRUzrudl.js → index.CwbFI1_-.js} +1 -1
- streamlit/static/static/js/{index.Ctn27_AE.js → index.CxIUUfab.js} +27 -27
- streamlit/static/static/js/index.D2KPNy7e.js +1 -0
- streamlit/static/static/js/{index.B0H9IXUJ.js → index.D3GPA5k4.js} +3 -3
- streamlit/static/static/js/{index.BycLveZ4.js → index.DGAh7DMq.js} +1 -1
- streamlit/static/static/js/index.DKb_NvmG.js +197 -0
- streamlit/static/static/js/{index.BPQo7BKk.js → index.DMqgUYKq.js} +1 -1
- streamlit/static/static/js/{index.CH1tqnSs.js → index.DOFlg3dS.js} +1 -1
- streamlit/static/static/js/{index.64ejlaaT.js → index.DPUXkcQL.js} +1 -1
- streamlit/static/static/js/{index.B-hiXRzw.js → index.DX1xY89g.js} +1 -1
- streamlit/static/static/js/index.DYATBCsq.js +2 -0
- streamlit/static/static/js/{index.DHh-U0dK.js → index.DaSmGJ76.js} +3 -3
- streamlit/static/static/js/{index.DuxqVQpd.js → index.Dd7bMeLP.js} +1 -1
- streamlit/static/static/js/{index.B4cAbHP6.js → index.DjmmgI5U.js} +1 -1
- streamlit/static/static/js/{index.DcPNYEUo.js → index.Dq56CyM2.js} +1 -1
- streamlit/static/static/js/{index.CiAQIz1H.js → index.DuiXaS5_.js} +1 -1
- streamlit/static/static/js/index.DvFidMLe.js +2 -0
- streamlit/static/static/js/{index.C9BdUqTi.js → index.DwkhC5Pc.js} +1 -1
- streamlit/static/static/js/{index.B4dUQfni.js → index.Q-3sFn1v.js} +1 -1
- streamlit/static/static/js/{index.CMItVsFA.js → index.QJ5QO9sJ.js} +1 -1
- streamlit/static/static/js/{index.CTBk8Vk2.js → index.VwTaeety.js} +1 -1
- streamlit/static/static/js/{index.Ck8rQ9OL.js → index.YOqQbeX8.js} +1 -1
- streamlit/static/static/js/{input.s6pjQ49A.js → input.D4MN_FzN.js} +1 -1
- streamlit/static/static/js/{memory.Cuvsdfrl.js → memory.DrZjtdGT.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DdgVR5m3.js → number-overlay-editor.DRwAw1In.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CqidKeei.js → possibleConstructorReturn.exeeJQEP.js} +1 -1
- streamlit/static/static/js/record.B-tDciZb.js +1 -0
- streamlit/static/static/js/{sandbox.CCQREcJx.js → sandbox.ClO3IuUr.js} +1 -1
- streamlit/static/static/js/{timepicker.mkJF97Bb.js → timepicker.DAhu-vcF.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.De7I7KVR.js → toConsumableArray.DNbljYEC.js} +1 -1
- streamlit/static/static/js/{uniqueId.RI1LJdtz.js → uniqueId.oG4Gvj1v.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.CedkNjUW.js → useBasicWidgetState.D6sOH6oI.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.Ca7w8dVs.js → useTextInputAutoExpand.4u3_GcuN.js} +1 -1
- streamlit/static/static/js/{useUpdateUiValue.DeXelfRH.js → useUpdateUiValue.F2R3eTeR.js} +1 -1
- streamlit/static/static/js/wavesurfer.esm.vI8Eid4k.js +73 -0
- streamlit/static/static/js/{withFullScreenWrapper.C3561XxJ.js → withFullScreenWrapper.zothJIsI.js} +1 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
- streamlit/string_util.py +1 -3
- streamlit/testing/v1/app_test.py +2 -2
- streamlit/testing/v1/element_tree.py +23 -9
- streamlit/testing/v1/util.py +2 -2
- streamlit/type_util.py +3 -4
- streamlit/url_util.py +1 -3
- streamlit/user_info.py +1 -2
- streamlit/util.py +3 -1
- streamlit/watcher/event_based_path_watcher.py +23 -12
- streamlit/watcher/local_sources_watcher.py +11 -1
- streamlit/watcher/path_watcher.py +9 -6
- streamlit/watcher/polling_path_watcher.py +4 -1
- streamlit/watcher/util.py +2 -2
- streamlit/web/cli.py +51 -22
- streamlit/web/server/bidi_component_request_handler.py +193 -0
- streamlit/web/server/component_file_utils.py +97 -0
- streamlit/web/server/component_request_handler.py +8 -21
- streamlit/web/server/oidc_mixin.py +3 -1
- streamlit/web/server/routes.py +2 -2
- streamlit/web/server/server.py +9 -0
- streamlit/web/server/server_util.py +3 -1
- streamlit/web/server/upload_file_request_handler.py +3 -1
- {streamlit-1.50.0.dist-info → streamlit-1.51.0.dist-info}/METADATA +4 -5
- {streamlit-1.50.0.dist-info → streamlit-1.51.0.dist-info}/RECORD +222 -194
- streamlit/static/static/css/index.CHEnSPGk.css +0 -1
- streamlit/static/static/js/Hooks.BRba_Own.js +0 -1
- streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +0 -1
- streamlit/static/static/js/index.Baqa90pe.js +0 -2
- streamlit/static/static/js/index.Bm3VbPB5.js +0 -1
- streamlit/static/static/js/index.CFMf5_ez.js +0 -197
- streamlit/static/static/js/index.Cj7DSzVR.js +0 -73
- streamlit/static/static/js/index.DH71Ezyj.js +0 -1
- streamlit/static/static/js/index.DW0Grddz.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
- {streamlit-1.50.0.data → streamlit-1.51.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.51.0.dist-info}/WHEEL +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.51.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.51.0.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.gdg-r17m35ur{flex-grow:1;border:none;outline:none;background-color:var(--gdg-bg-header-has-focus);border-radius:9px;padding:0 8px;box-shadow:0 0 0 1px var(--gdg-border-color);color:var(--gdg-text-group-header);min-height:var(--r17m35ur-0);font:var(--gdg-header-font-style) var(--gdg-font-family)}.gdg-c1tqibwd{padding:0 8px;display:flex;align-items:center;background-color:var(--gdg-bg-header)}.gdg-wmyidgi{position:relative;min-width:10px;min-height:10px;max-width:100%;max-height:100%;width:var(--wmyidgi-0);height:var(--wmyidgi-1);overflow:hidden;overflow:clip;direction:ltr}.gdg-wmyidgi>:first-child{position:absolute;left:0;top:0;width:100%;height:100%}.gdg-s1dgczr6 .dvn-scroller{overflow:var(--s1dgczr6-0);transform:translateZ(0)}.gdg-s1dgczr6 .dvn-hidden{visibility:hidden}.gdg-s1dgczr6 .dvn-scroll-inner{display:flex;pointer-events:none}.gdg-s1dgczr6 .dvn-scroll-inner>*{flex-shrink:0}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-spacer{flex-grow:1}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-stack{display:flex;flex-direction:column}.gdg-s1dgczr6 .dvn-underlay>*{position:absolute;left:0;top:0}.gdg-s1dgczr6 canvas{outline:none}.gdg-s1dgczr6 canvas *{height:0}.gdg-seveqep{position:absolute;top:4px;right:20px;background-color:var(--gdg-bg-cell);color:var(--gdg-text-dark);padding:8px;border:1px solid var(--gdg-border-color);border-radius:6px;font-size:var(--gdg-editor-font-size);animation:gdg-search-fadein-gdg-seveqep .15s forwards}.gdg-seveqep.out{animation:gdg-search-fadeout-gdg-seveqep .15s forwards}.gdg-seveqep .gdg-search-bar-inner{display:flex}.gdg-seveqep .gdg-search-status{padding-top:4px;font-size:11px}.gdg-seveqep .gdg-search-progress{position:absolute;height:4px;left:0;bottom:0;background-color:var(--gdg-text-light)}.gdg-seveqep input{width:220px;color:var(--gdg-text-dark);background-color:var(--gdg-bg-cell);border:none;border-width:0;outline:none}.gdg-seveqep button{width:24px;height:24px;padding:0;border:none;outline:none;background:none;display:flex;justify-content:center;align-items:center;cursor:pointer;color:var(--gdg-text-medium)}.gdg-seveqep button:hover{color:var(--gdg-text-dark)}.gdg-seveqep button .button-icon{width:16px;height:16px}.gdg-seveqep button:disabled{opacity:.4;pointer-events:none}@-webkit-keyframes gdg-search-fadeout-gdg-seveqep{0%{transform:translate(0)}to{transform:translate(400px)}}@keyframes gdg-search-fadeout-gdg-seveqep{0%{transform:translate(0)}to{transform:translate(400px)}}@-webkit-keyframes gdg-search-fadein-gdg-seveqep{0%{transform:translate(400px)}to{transform:translate(0)}}@keyframes gdg-search-fadein-gdg-seveqep{0%{transform:translate(400px)}to{transform:translate(0)}}.gdg-mnuv029{word-break:break-word;-webkit-touch-callout:default;padding-top:6px}.gdg-mnuv029>*{margin:0}.gdg-mnuv029 *:last-child{margin-bottom:0}.gdg-mnuv029 p img{width:100%}.gdg-izpuzkl{position:absolute;inset:0;width:100%;height:100%;border-radius:0;resize:none;white-space:pre-wrap;min-width:100%;overflow:hidden;border:0;background-color:transparent;font-size:var(--gdg-editor-font-size);line-height:16px;font-family:var(--gdg-font-family);-webkit-text-fill-color:var(--gdg-text-dark);color:var(--gdg-text-dark);padding:0;margin:0}.gdg-invalid .gdg-izpuzkl{text-decoration:underline;text-decoration-color:#d60606}.gdg-izpuzkl ::-webkit-input-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl ::-moz-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl :-ms-input-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl ::placeholder{color:var(--gdg-text-light)}.gdg-s69h75o{visibility:hidden;white-space:pre-wrap;word-wrap:break-word;width:max-content;max-width:100%;min-width:100%;font-size:var(--gdg-editor-font-size);line-height:16px;font-family:var(--gdg-font-family);color:var(--gdg-text-dark);padding:0 0 2px;margin:0}.gdg-g1y0xocz{position:relative;margin-top:6px}.gdg-i2iowwq{display:flex;height:100%}.gdg-i2iowwq .gdg-centering-container{display:flex;justify-content:center;align-items:center;height:100%}.gdg-i2iowwq .gdg-centering-container img,.gdg-i2iowwq .gdg-centering-container canvas{max-height:calc(100vh - var(--overlay-top) - 20px);object-fit:contain;-webkit-user-select:none;user-select:none}.gdg-i2iowwq .gdg-centering-container canvas{max-width:380px}.gdg-i2iowwq .gdg-edit-icon{position:absolute;top:12px;right:0;width:48px;height:48px;color:var(--gdg-accent-color);cursor:pointer;display:flex;justify-content:center;align-items:center}.gdg-i2iowwq .gdg-edit-icon>*{width:24px;height:24px}.gdg-i2iowwq textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-d4zsq0x{display:flex;flex-wrap:wrap}.gdg-d4zsq0x .doe-bubble{display:flex;justify-content:center;align-items:center;padding:0 8px;height:24px;background-color:var(--gdg-bg-cell);color:var(--gdg-text-dark);margin:2px;border-radius:var(--gdg-rounding-radius, 6px);box-shadow:0 0 1px #3e415666,0 1px 3px #3e415666}.gdg-d4zsq0x .doe-bubble img{height:16px;object-fit:contain;margin-right:4px}.gdg-d4zsq0x textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-u1rrojo{display:flex;flex-grow:1;align-items:center;min-height:21px}.gdg-u1rrojo .gdg-link-area{flex-grow:1;flex-shrink:1;cursor:pointer;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gdg-link-color);text-decoration:underline!important}.gdg-u1rrojo .gdg-edit-icon{flex-shrink:0;width:32px;color:var(--gdg-accent-color);cursor:pointer;display:flex;justify-content:center;align-items:center}.gdg-u1rrojo .gdg-edit-icon>*{width:24px;height:24px}.gdg-u1rrojo textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-n15fjm3e{display:flex;margin:6px 0 3px;color:var(--gdg-text-dark)}.gdg-n15fjm3e>input{font-size:var(--gdg-editor-font-size);padding:0;font-family:var(--gdg-font-family);color:var(--gdg-text-dark);background-color:var(--gdg-bg-cell)}.gdg-m1pnx84e{min-width:var(--m1pnx84e-0);width:100%;display:flex;align-items:flex-start;justify-content:space-between;position:relative;color:var(--gdg-text-dark)}.gdg-m1pnx84e .gdg-g1y0xocz{flex-shrink:1;min-width:0}.gdg-m1pnx84e .gdg-spacer{flex:1}.gdg-m1pnx84e .gdg-edit-icon{position:relative;cursor:pointer;display:flex;justify-content:center;align-items:center;color:var(--gdg-accent-color);padding:0;height:24px;width:24px;flex-shrink:0;transition:all "0.125s ease";border-radius:6px}.gdg-m1pnx84e .gdg-edit-icon>*{width:16px;height:16px}.gdg-m1pnx84e .gdg-edit-hover :hover{background-color:var(--gdg-accent-light);transition:background-color .15s}.gdg-m1pnx84e .gdg-checkmark-hover :hover{color:#fff;background-color:var(--gdg-accent-color)}.gdg-m1pnx84e .gdg-md-edit-textarea{position:relative;top:0;left:0;width:0px;height:0px;margin-top:25px;opacity:0;padding:0}.gdg-m1pnx84e .gdg-ml-6{margin-left:6px}.gdg-b1ygi5by{display:flex;flex-wrap:wrap;margin-top:auto;margin-bottom:auto;overflow:auto}.gdg-b1ygi5by .boe-bubble{display:flex;justify-content:center;align-items:center;border-radius:var(--gdg-rounding-radius, calc(var(--gdg-bubble-height) / 2));padding:0 var(--gdg-bubble-padding);height:var(--gdg-bubble-height);background-color:var(--gdg-bg-bubble);color:var(--gdg-text-dark);margin:var(--gdg-bubble-margin);white-space:nowrap}.gdg-b1ygi5by textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-d19meir1{position:absolute;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;--overlay-top:var(--d19meir1-0);left:var(--d19meir1-1);top:var(--d19meir1-0);min-width:var(--d19meir1-2);min-height:var(--d19meir1-3);width:max-content;max-width:400px;max-height:calc(100vh - var(--d19meir1-4));font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);text-align:start}@-webkit-keyframes glide_fade_in-gdg-d19meir1{0%{opacity:0%}to{opacity:100%}}@keyframes glide_fade_in-gdg-d19meir1{0%{opacity:0%}to{opacity:100%}}.gdg-d19meir1.gdg-style{border-radius:2px;background-color:var(--gdg-bg-cell);box-shadow:0 0 0 1px var(--gdg-accent-color),0 0 1px #3e415666,0 6px 12px #3e415626;animation:glide_fade_in-gdg-d19meir1 60ms 1}.gdg-d19meir1.gdg-pad{padding:var(--d19meir1-5) 8.5px 3px}.gdg-d19meir1 .gdg-clip-region{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;border-radius:2px;flex-grow:1}.gdg-d19meir1 .gdg-clip-region .gdg-growing-entry{height:100%}.gdg-d19meir1 .gdg-clip-region input.gdg-input{width:100%;border:none;border-width:0;outline:none}.gdg-d19meir1 .gdg-clip-region textarea.gdg-input{border:none;border-width:0;outline:none}.gdg-w1hnqk7o .gdg-footer{display:flex;justify-content:flex-end;padding:20px}.gdg-w1hnqk7o .gdg-footer button{border:none;padding:8px 16px;font-size:14px;font-weight:500;font-family:var(--gdg-font-family);cursor:pointer;border-radius:var(--gdg-rounding-radius, 9px)}.gdg-w1hnqk7o .gdg-save-button{background-color:var(--gdg-accent-color);color:var(--gdg-accent-fg)}.gdg-w1hnqk7o .gdg-close-button{background-color:var(--gdg-bg-header);color:var(--gdg-text-medium);margin-right:8px}.gdg-wghi2zc{display:flex;flex-direction:column;align-items:stretch}.gdg-wghi2zc .glide-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size)}.gdg-p13nj8j0{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark)}.gdg-p13nj8j0>div{border-radius:4px;border:1px solid var(--gdg-border-color)}.gdg-r6sia3g{display:"flex";margin:auto 8.5px;padding-bottom:3px}.gdg-e1wnlokz{display:flex;flex-direction:column;align-items:stretch;padding-top:6px;color:var(--gdg-text-dark);box-sizing:border-box}.gdg-e1wnlokz *{box-sizing:border-box}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label{display:flex;cursor:pointer}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label input{cursor:pointer;width:auto}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label .gdg-pill{margin-left:8px;margin-right:6px;margin-bottom:6px;border-radius:var(--gdg-rounding-radius, var(--e1wnlokz-0));min-height:var(--e1wnlokz-1);padding:2px var(--e1wnlokz-2);display:flex;align-items:center;font:12px var(--gdg-font-family);background-color:var(--gdg-bg-bubble);transition:box-shadow .15s}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz label .gdg-pill.gdg-unselected{opacity:.8}.gdg-e1wnlokz label:hover .gdg-pill{box-shadow:0 1px 4px #00000026}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-readonly label{cursor:default}.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-e1wnlokz.gdg-readonly label .gdg-pill{box-shadow:none!important}.gdg-e1ywxz2x{display:flex;align-items:center;padding:6px 0;color:var(--gdg-text-light)}.gdg-e1ywxz2x .gdg-active{color:var(--gdg-text-dark)}.gdg-e1ywxz2x>*{position:relative;width:16px;height:16px;cursor:pointer;margin-right:2px}.gdg-e1ywxz2x>* svg{width:100%;height:100%}.gdg-w1i61rz{display:flex;flex-direction:column;align-items:stretch;margin-top:auto;margin-bottom:auto}.gdg-w1i61rz .gdg-multi-select{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size)}.gdg-phbadu4{font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);color:var(--gdg-text-dark)}.gdg-phbadu4>div{border-radius:4px;border:1px solid var(--gdg-border-color)}.gdg-lw5nakc{display:flex;flex-direction:column;margin:4px 0}.gdg-lw5nakc>button{color:var(--gdg-accent-color);font-weight:600;align-self:flex-end;border:none;outline:none;background-color:transparent;transition:background-color .2s;border-radius:4px;padding:6px 8px;cursor:pointer}.gdg-lw5nakc>button:hover,.gdg-lw5nakc>button:focus-visible{background-color:var(--gdg-accent-light)}.gdg-lw5nakc>button:disabled{opacity:.4;pointer-events:none}.gdg-lw5nakc .gdg-link-title-editor{display:flex;min-width:250px}.gdg-lw5nakc .gdg-link-title-editor>input{outline:none;border:1px solid var(--gdg-border-color);border-radius:4px;box-shadow:none;padding:6px 8px;min-width:0;width:0;flex-grow:1;transition:border .2s}.gdg-lw5nakc .gdg-link-title-editor>input:not(:last-child){margin-right:4px}.gdg-lw5nakc .gdg-link-title-editor>input:focus{border:1px solid var(--gdg-accent-color)}.gdg-lw5nakc .gdg-link-title-editor:not(:last-child){margin-bottom:4px}.gdg-lw5nakc .gdg-link-title-editor>button{border:none;outline:none;border-radius:4px;background-color:transparent;cursor:pointer;transition:background-color .2s,color .2s;color:var(--gdg-text-medium)}.gdg-lw5nakc .gdg-link-title-editor>button:hover,.gdg-lw5nakc .gdg-link-title-editor>button:focus-visible{background-color:var(--gdg-accent-light);color:var(--gdg-text-dark)}.gdg-s1wtovjx{min-height:26px;border:none;outline:none;background-color:transparent;font-size:var(--gdg-editor-font-size);font-family:var(--gdg-font-family);color:var(--gdg-text-dark)}.gdg-s1wtovjx ::-webkit-calendar-picker-indicator{background-color:#fff}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t}from"./index.6xX1278W.js";const o=r=>{const e=t.useRef();return t.useEffect(()=>{e.current=r},[r]),e.current};export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as u,$ as d,j as c,a0 as p,a1 as f}from"./index.6xX1278W.js";const $=d("50%{color:rgba(0,0,0,0);}"),I=u("span",{target:"eh6ncro0"})(({includeDot:o,shouldBlink:n,theme:t})=>({...o?{"&::before":{opacity:1,content:'"•"',animation:"none",color:t.colors.grayTextColor,margin:`0 ${t.spacing.twoXS}`}}:{},...n?{color:t.colors.redTextColor,animationName:`${$}`,animationDuration:"0.5s",animationIterationCount:5}:{}})),b=({dirty:o,value:n,inForm:t,maxLength:r,className:m,type:a="single",allowEnterToSubmit:g=!0})=>{const s=[],i=(e,l=!1)=>{s.push(c(I,{includeDot:s.length>0,shouldBlink:l,children:e},s.length))};if(g){const e=t?"submit form":"apply";if(a==="multiline"){const l=f()?"⌘":"Ctrl";i(`Press ${l}+Enter to ${e}`)}else a==="single"&&i(`Press Enter to ${e}`)}return r&&(a!=="chat"||o)&&i(`${n.length}/${r}`,o&&n.length>=r),c(p,{"data-testid":"InputInstructions",className:m,children:s})};export{b as I};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a$ as Ye,ab as Q,r as E,bq as vt,ac as mt,p as Z,aF as bt,aG as yt,v as me,t as ze,bg as Tt,u as kt,br as Ot,j as re,e as Ge,l as wt,Q as Rt,T as St,P as Mt,W as _t,bs as $t,bt as $e}from"./index.6xX1278W.js";import{s as Ve}from"./sprintf.D7DtBTRn.js";import{u as Et}from"./useBasicWidgetState.CedkNjUW.js";import"./FormClearHelper.DTcdrasw.js";var se={},H={},ue={},ce={},Ne;function Ie(){if(Ne)return ce;Ne=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Direction=void 0;var e;return function(r){r.Right="to right",r.Left="to left",r.Down="to bottom",r.Up="to top"}(e||(ce.Direction=e={})),ce}var Ue;function Ze(){return Ue||(Ue=1,function(e){var r=ue&&ue.__spreadArray||function(i,s,u){if(u||arguments.length===2)for(var h=0,m=s.length,v;h<m;h++)(v||!(h in s))&&(v||(v=Array.prototype.slice.call(s,0,h)),v[h]=s[h]);return i.concat(v||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.isIOS=e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var n=Ye(),o=Ie(),p=function(i){var s=i.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=p;function S(i){return i.touches&&i.touches.length||i.changedTouches&&i.changedTouches.length}e.isTouchEvent=S;function l(i,s,u){var h=(s-i)/u,m=8,v=Number(h.toFixed(m));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function g(i,s,u,h,m,v,T){var _=1e11;if(i=Math.round(i*_)/_,!v){var D=T[s-1],x=T[s+1];if(D&&D>i)return D;if(x&&x<i)return x}if(i>h)return h;if(i<u)return u;var U=Math.floor(i*_-u*_)%Math.floor(m*_),V=Math.floor(i*_-Math.abs(U)),W=U===0?i:V/_,B=Math.abs(U/_)<m/2?W:W+m,A=(0,e.getStepDecimals)(m);return parseFloat(B.toFixed(A))}e.normalizeValue=g;function F(i,s,u){return(i-s)/(u-s)}e.relativeValue=F;function j(i){return i===o.Direction.Up||i===o.Direction.Down}e.isVertical=j;function z(i,s,u){if(s>=u)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(u,")"));if(i<s)throw new RangeError("value (".concat(i,") is smaller than min (").concat(s,")"));if(i>u)throw new RangeError("value (".concat(i,") is bigger than max (").concat(u,")"))}e.checkBoundaries=z;function $(i,s,u){return i<s?s:i>u?u:i}e.checkValuesAgainstBoundaries=$;function y(i){if(!(i.length<2)&&!i.slice(1).every(function(s,u){return i[u]<=s}))throw new RangeError("values={[".concat(i,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function d(i){var s=window.getComputedStyle(i);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=d;function t(i){var s=window.getComputedStyle(i);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(i,s,u){var h=u?-1:1;i.forEach(function(m,v){return f(m,h*s[v].x,s[v].y)})}e.translateThumbs=a;function c(i,s,u,h){for(var m=0,v=C(i[0],s,u,h),T=1;T<i.length;T++){var _=C(i[T],s,u,h);_<v&&(v=_,m=T)}return m}e.getClosestThumbIndex=c;function f(i,s,u){i.style.transform="translate(".concat(s,"px, ").concat(u,"px)")}e.translate=f;var b=function(i){var s=[],u=null,h=function(){for(var m=[],v=0;v<arguments.length;v++)m[v]=arguments[v];s=m,!u&&(u=requestAnimationFrame(function(){u=null,i.apply(void 0,s)}))};return h};e.schd=b;function k(i,s,u){var h=i.slice(0);return h[s]=u,h}e.replaceAt=k;function I(i){var s=i.values,u=i.colors,h=i.min,m=i.max,v=i.direction,T=v===void 0?o.Direction.Right:v,_=i.rtl,D=_===void 0?!1:_;D&&T===o.Direction.Right?T=o.Direction.Left:D&&o.Direction.Left&&(T=o.Direction.Right);var x=s.slice(0).sort(function(V,W){return V-W}).map(function(V){return(V-h)/(m-h)*100}),U=x.reduce(function(V,W,B){return"".concat(V,", ").concat(u[B]," ").concat(W,"%, ").concat(u[B+1]," ").concat(W,"%")},"");return"linear-gradient(".concat(T,", ").concat(u[0]," 0%").concat(U,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=I;function O(){}e.voidFn=O;function w(i){throw new Error("Didn't expect to get here")}e.assertUnreachable=w;var M=function(i,s,u,h,m){m===void 0&&(m=function(T){return T});var v=Math.ceil(r([i],Array.from(i.children),!0).reduce(function(T,_){var D=Math.ceil(_.getBoundingClientRect().width);if(_.innerText&&_.innerText.includes(u)&&_.childElementCount===0){var x=_.cloneNode(!0);x.innerHTML=m(s.toFixed(h)),x.style.visibility="hidden",document.body.appendChild(x),D=Math.ceil(x.getBoundingClientRect().width),document.body.removeChild(x)}return D>T?D:T},i.getBoundingClientRect().width));return v},P=function(i,s,u,h,m,v,T){T===void 0&&(T=function(x){return x});var _=[],D=function(x){var U=M(u[x],h[x],m,v,T),V=s[x].x;s.forEach(function(W,B){var A=W.x,G=M(u[B],h[B],m,v,T);x!==B&&(V>=A&&V<=A+G||V+U>=A&&V+U<=A+G)&&(_.includes(B)||(_.push(x),_.push(B),_=r(r([],_,!0),[x,B],!1),D(B)))})};return D(i),Array.from(new Set(_.sort()))},R=function(i,s,u,h,m,v){h===void 0&&(h=.1),m===void 0&&(m=" - "),v===void 0&&(v=function(B){return B});var T=(0,e.getStepDecimals)(h),_=(0,n.useState)({}),D=_[0],x=_[1],U=(0,n.useState)(v(s[u].toFixed(T))),V=U[0],W=U[1];return(0,n.useEffect)(function(){if(i){var B=i.getThumbs();if(B.length<1)return;var A={},G=i.getOffsets(),ne=P(u,G,B,s,m,T,v),le=v(s[u].toFixed(T));if(ne.length){var J=ne.reduce(function(ee,oe,ge,pe){return ee.length?r(r([],ee,!0),[G[pe[ge]].x],!1):[G[pe[ge]].x]},[]);if(Math.min.apply(Math,J)===G[u].x){var de=[];ne.forEach(function(ee){de.push(s[ee].toFixed(T))}),le=Array.from(new Set(de.sort(function(ee,oe){return parseFloat(ee)-parseFloat(oe)}))).map(v).join(m);var fe=Math.min.apply(Math,J),he=Math.max.apply(Math,J),_e=B[ne[J.indexOf(he)]].getBoundingClientRect().width;A.left="".concat(Math.abs(fe-(he+_e))/2,"px"),A.transform="translate(-50%, 0)"}else A.visibility="hidden"}W(le),x(A)}},[i,s]),[V,D]};e.useThumbOverlap=R;function C(i,s,u,h){var m=i.getBoundingClientRect(),v=m.left,T=m.top,_=m.width,D=m.height;return j(h)?Math.abs(u-(T+D/2)):Math.abs(s-(v+_/2))}var L=function(){var i,s=((i=navigator.userAgentData)===null||i===void 0?void 0:i.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(s)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};e.isIOS=L}(ue)),ue}var He;function It(){if(He)return H;He=1;var e=H&&H.__extends||function(){var $=function(y,d){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])},$(y,d)};return function(y,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");$(y,d);function t(){this.constructor=y}y.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),r=H&&H.__createBinding||(Object.create?function($,y,d,t){t===void 0&&(t=d);var a=Object.getOwnPropertyDescriptor(y,d);(!a||("get"in a?!y.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return y[d]}}),Object.defineProperty($,t,a)}:function($,y,d,t){t===void 0&&(t=d),$[t]=y[d]}),n=H&&H.__setModuleDefault||(Object.create?function($,y){Object.defineProperty($,"default",{enumerable:!0,value:y})}:function($,y){$.default=y}),o=H&&H.__importStar||function($){if($&&$.__esModule)return $;var y={};if($!=null)for(var d in $)d!=="default"&&Object.prototype.hasOwnProperty.call($,d)&&r(y,$,d);return n(y,$),y},p=H&&H.__spreadArray||function($,y,d){if(d||arguments.length===2)for(var t=0,a=y.length,c;t<a;t++)(c||!(t in y))&&(c||(c=Array.prototype.slice.call(y,0,t)),c[t]=y[t]);return $.concat(c||Array.prototype.slice.call(y))};Object.defineProperty(H,"__esModule",{value:!0});var S=o(Ye()),l=Ze(),g=Ie(),F=["ArrowRight","ArrowUp","k","PageUp"],j=["ArrowLeft","ArrowDown","j","PageDown"],z=function($){e(y,$);function y(d){var t=$.call(this,d)||this;if(t.trackRef=S.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,c=a.direction,f=a.values,b=a.min,k=a.max,I=t.trackRef.current;if(!I)return console.warn("No track element found."),[];var O=I.getBoundingClientRect(),w=(0,l.getPaddingAndBorder)(I);return t.getThumbs().map(function(M,P){var R={x:0,y:0},C=M.getBoundingClientRect(),L=(0,l.getMargin)(M);switch(c){case g.Direction.Right:return R.x=(L.left+w.left)*-1,R.y=((C.height-O.height)/2+w.top)*-1,R.x+=O.width*(0,l.relativeValue)(f[P],b,k)-C.width/2,R;case g.Direction.Left:return R.x=(L.right+w.right)*-1,R.y=((C.height-O.height)/2+w.top)*-1,R.x+=O.width-O.width*(0,l.relativeValue)(f[P],b,k)-C.width/2,R;case g.Direction.Up:return R.x=((C.width-O.width)/2+L.left+w.left)*-1,R.y=-w.left,R.y+=O.height-O.height*(0,l.relativeValue)(f[P],b,k)-C.height/2,R;case g.Direction.Down:return R.x=((C.width-O.width)/2+L.left+w.left)*-1,R.y=-w.left,R.y+=O.height*(0,l.relativeValue)(f[P],b,k)-C.height/2,R;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(c){return c===a.target||c.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var c;if(!(a.button!==0||(0,l.isIOS)()))if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),a.clientX,a.clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var c;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(b){var k;return(k=b.current)===null||k===void 0?void 0:k.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var f=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(b){return b.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(c=t.thumbRefs[f].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:f},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var c=(0,l.isTouchEvent)(a);if(!(!c&&a.button!==0)){var f=t.getTargetIndex(a);f!==-1&&(c?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:f,thumbZIndexes:t.state.thumbZIndexes.map(function(b,k){return k===f?Math.max.apply(Math,t.state.thumbZIndexes):b<=t.state.thumbZIndexes[f]?b:b-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var c=t.props,f=c.values,b=c.onChange,k=c.step,I=c.rtl,O=c.direction,w=t.state.isChanged,M=t.getTargetIndex(a.nativeEvent),P=I||O===g.Direction.Left||O===g.Direction.Down?-1:1;M!==-1&&(F.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((0,l.replaceAt)(f,M,t.normalizeValue(f[M]+P*(a.key==="PageUp"?k*10:k),M)))):j.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),b((0,l.replaceAt)(f,M,t.normalizeValue(f[M]-P*(a.key==="PageDown"?k*10:k),M)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){w&&t.fireOnFinalChange()}):w&&t.fireOnFinalChange())},t.onKeyUp=function(a){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(a,c){var f=t.state,b=f.draggedThumbIndex,k=f.draggedTrackPos,I=t.props,O=I.direction,w=I.min,M=I.max,P=I.onChange,R=I.values,C=I.step,L=I.rtl;if(b===-1&&k[0]===-1&&k[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var s=i.getBoundingClientRect(),u=(0,l.isVertical)(O)?s.height:s.width;if(k[0]!==-1&&k[1]!==-1){var h=a-k[0],m=c-k[1],v=0;switch(O){case g.Direction.Right:case g.Direction.Left:v=h/u*(M-w);break;case g.Direction.Down:case g.Direction.Up:v=m/u*(M-w);break;default:(0,l.assertUnreachable)(O)}if(L&&(v*=-1),Math.abs(v)>=C/2){for(var T=0;T<t.thumbRefs.length;T++){if(R[T]===M&&Math.sign(v)===1||R[T]===w&&Math.sign(v)===-1)return;var _=R[T]+v;_>M?v=M-R[T]:_<w&&(v=w-R[T])}for(var D=R.slice(0),T=0;T<t.thumbRefs.length;T++)D=(0,l.replaceAt)(D,T,t.normalizeValue(R[T]+v,T));t.setState({draggedTrackPos:[a,c]}),P(D)}}else{var x=0;switch(O){case g.Direction.Right:x=(a-s.left)/u*(M-w)+w;break;case g.Direction.Left:x=(u-(a-s.left))/u*(M-w)+w;break;case g.Direction.Down:x=(c-s.top)/u*(M-w)+w;break;case g.Direction.Up:x=(u-(c-s.top))/u*(M-w)+w;break;default:(0,l.assertUnreachable)(O)}L&&(x=M+w-x),Math.abs(R[b]-x)>=C/2&&P((0,l.replaceAt)(R,b,t.normalizeValue(x,b)))}},t.normalizeValue=function(a,c){var f=t.props,b=f.min,k=f.max,I=f.step,O=f.allowOverlap,w=f.values;return(0,l.normalizeValue)(a,c,b,k,I,O,w)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,c=a.onFinalChange,f=a.values;c&&c(f)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=S.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),c=parseInt(a.width,10),f=parseInt(a.height,10),b=parseInt(a.paddingLeft,10),k=parseInt(a.paddingTop,10),I=[],O=0;O<t.numOfMarks+1;O++){var w=9999,M=9999;if(t.markRefs[O].current){var P=t.markRefs[O].current.getBoundingClientRect();w=P.height,M=P.width}t.props.direction===g.Direction.Left||t.props.direction===g.Direction.Right?I.push([Math.round(c/t.numOfMarks*O+b-M/2),-Math.round((w-f)/2)]):I.push([Math.round(f/t.numOfMarks*O+k-w/2),-Math.round((M-c)/2)])}t.setState({markOffsets:I})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return S.createRef()}),t.updateMarkRefs(d),t}return y.prototype.componentDidMount=function(){var d=this,t=this.props,a=t.values,c=t.min,f=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(b){return(0,l.checkBoundaries)(b,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(b){(0,l.isStepDivisible)(c,b,f)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},y.prototype.componentDidUpdate=function(d,t){var a=this.props,c=a.max,f=a.min,b=a.step,k=a.values,I=a.rtl;(d.max!==c||d.min!==f||d.step!==b)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),I),(d.max!==c||d.min!==f||d.step!==b||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),k.forEach(function(O){(0,l.isStepDivisible)(f,O,b)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},y.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},y.prototype.render=function(){var d=this,t=this.props,a=t.label,c=t.labelledBy,f=t.renderTrack,b=t.renderThumb,k=t.renderMark,I=k===void 0?function(){return null}:k,O=t.values,w=t.min,M=t.max,P=t.allowOverlap,R=t.disabled,C=this.state,L=C.draggedThumbIndex,i=C.thumbZIndexes,s=C.markOffsets;return f({props:{style:{transform:"scale(1)",cursor:L>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":O.length===1&&!R?"pointer":"inherit"},onMouseDown:R?l.voidFn:this.onMouseDownTrack,onTouchStart:R?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:R,children:p(p([],s.map(function(u,h,m){return I({props:{style:d.props.direction===g.Direction.Left||d.props.direction===g.Direction.Right?{position:"absolute",left:"".concat(u[0],"px"),marginTop:"".concat(u[1],"px")}:{position:"absolute",top:"".concat(u[0],"px"),marginLeft:"".concat(u[1],"px")},key:"mark".concat(h),ref:d.markRefs[h]},index:h})}),!0),O.map(function(u,h){var m=d.state.draggedThumbIndex===h;return b({index:h,value:u,isDragged:m,props:{style:{position:"absolute",zIndex:i[h],cursor:R?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:h,tabIndex:R?void 0:0,"aria-valuemax":P?M:O[h+1]||M,"aria-valuemin":P?w:O[h-1]||w,"aria-valuenow":u,draggable:!1,ref:d.thumbRefs[h],"aria-label":a,"aria-labelledby":c,role:"slider",onKeyDown:R?l.voidFn:d.onKeyDown,onKeyUp:R?l.voidFn:d.onKeyUp}})}),!0)})},y.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:g.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y}(S.Component);return H.default=z,H}var We;function xt(){return We||(We=1,function(e){var r=se&&se.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var n=r(It());e.Range=n.default;var o=Ze();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return o.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return o.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return o.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return o.checkValuesAgainstBoundaries}});var p=Ie();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return p.Direction}})}(se)),se}var Qe=xt();function qe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function ve(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(n),!0).forEach(function(o){Ct(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ct(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var be=Q("div",{position:"relative",width:"100%"});be.displayName="Root";be.displayName="Root";be.displayName="StyledRoot";var ye=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$disabled,S=e.$isDragged,l=r.sizing,g="inherit";return p?g="not-allowed":S?g="grabbing":o.length===1&&(g="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:g,backgroundColor:r.colors.sliderTrackFill}});ye.displayName="Track";ye.displayName="Track";ye.displayName="StyledTrack";var Te=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$min,S=e.$max,l=e.$disabled,g=r.colors,F=r.borders,j=r.direction,z=r.borders.useRoundedCorners?F.radius100:0;return{borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,background:Qe.getTrackBackground({values:o,colors:o.length===1?[l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque]:[l?g.backgroundSecondary:g.borderOpaque,l?g.borderOpaque:g.primary,l?g.backgroundSecondary:g.borderOpaque],min:p||0,max:S||0,rtl:j==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});Te.displayName="InnerTrack";Te.displayName="InnerTrack";Te.displayName="StyledInnerTrack";var ke=Q("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ke.displayName="Mark";ke.displayName="Mark";ke.displayName="StyledMark";var Oe=Q("div",function(e){return ve(ve({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});Oe.displayName="Tick";Oe.displayName="Tick";Oe.displayName="StyledTick";var we=Q("div",function(e){var r=e.$theme,n=r.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:n.scale600,paddingLeft:n.scale600,paddingBottom:n.scale400}});we.displayName="TickBar";we.displayName="TickBar";we.displayName="StyledTickBar";var Re=Q("div",function(e){var r=e.$theme,n=e.$value,o=n===void 0?[]:n,p=e.$thumbIndex,S=e.$disabled,l=o.length===2&&p===0,g=o.length===2&&p===1;return r.direction==="rtl"&&(g||l)&&(l=!l,g=!g),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:S?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(r.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:S?"not-allowed":"inherit"}});Re.displayName="Thumb";Re.displayName="Thumb";Re.displayName="StyledThumb";var Se=Q("div",function(e){var r=e.$disabled,n=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill}});Se.displayName="InnerThumb";Se.displayName="InnerThumb";Se.displayName="StyledInnerThumb";var Me=Q("div",function(e){var r=e.$disabled,n=e.$theme;return ve(ve({position:"absolute",top:"-".concat(n.sizing.scale1400)},n.typography.font200),{},{backgroundColor:r?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleInnerFill,color:n.colors.contentInversePrimary,paddingLeft:n.sizing.scale600,paddingRight:n.sizing.scale600,paddingTop:n.sizing.scale500,paddingBottom:n.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});Me.displayName="ThumbValue";Me.displayName="ThumbValue";Me.displayName="StyledThumbValue";function Ke(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(e,p).enumerable})),n.push.apply(n,o)}return n}function Dt(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ke(Object(n),!0).forEach(function(o){Pt(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Pt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},X.apply(this,arguments)}function K(e,r){return Ft(e)||Lt(e,r)||At(e,r)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(e,r){if(e){if(typeof e=="string")return Xe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xe(e,r)}}function Xe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,o=new Array(r);n<r;n++)o[n]=e[n];return o}function Lt(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],p=!0,S=!1,l,g;try{for(n=n.call(e);!(p=(l=n.next()).done)&&(o.push(l.value),!(r&&o.length===r));p=!0);}catch(F){S=!0,g=F}finally{try{!p&&n.return!=null&&n.return()}finally{if(S)throw g}}return o}}function Ft(e){if(Array.isArray(e))return e}var jt=function(r){if(r.length>2||r.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return r};function zt(e){var r=e.overrides,n=r===void 0?{}:r,o=e.disabled,p=o===void 0?!1:o,S=e.marks,l=S===void 0?!1:S,g=e.onChange,F=g===void 0?function(){}:g,j=e.onFinalChange,z=j===void 0?function(){}:j,$=e.min,y=$===void 0?0:$,d=e.max,t=d===void 0?100:d,a=e.step,c=a===void 0?1:a,f=e.persistentThumb,b=f===void 0?!1:f,k=e.valueToLabel,I=k===void 0?function(Y){return Y}:k,O=e.value,w=E.useContext(vt),M=E.useState(!1),P=K(M,2),R=P[0],C=P[1],L=E.useState(!1),i=K(L,2),s=i[0],u=i[1],h=E.useState(!1),m=K(h,2),v=m[0],T=m[1],_=E.useState(-1),D=K(_,2),x=D[0],U=D[1],V=E.useCallback(function(Y){mt(Y)&&T(!0);var N=Y.target.parentNode.firstChild===Y.target?0:1;U(N)},[]),W=E.useCallback(function(Y){v!==!1&&T(!1),U(-1)},[]),B=jt(O),A={$disabled:p,$step:c,$min:y,$max:t,$marks:l,$value:B,$isFocusVisible:v},G=Z(n.Root,be),ne=K(G,2),le=ne[0],J=ne[1],de=Z(n.Track,ye),fe=K(de,2),he=fe[0],_e=fe[1],ee=Z(n.InnerTrack,Te),oe=K(ee,2),ge=oe[0],pe=oe[1],Je=Z(n.Thumb,Re),xe=K(Je,2),et=xe[0],tt=xe[1],rt=Z(n.InnerThumb,Se),Ce=K(rt,2),nt=Ce[0],at=Ce[1],it=Z(n.ThumbValue,Me),De=K(it,2),ot=De[0],st=De[1],ut=Z(n.Tick,Oe),Pe=K(ut,2),Be=Pe[0],Ae=Pe[1],ct=Z(n.TickBar,we),Le=K(ct,2),lt=Le[0],dt=Le[1],ft=Z(n.Mark,ke),Fe=K(ft,2),ht=Fe[0],gt=Fe[1];return E.createElement(le,X({"data-baseweb":"slider"},A,J,{onFocus:yt(J,V),onBlur:bt(J,W)}),E.createElement(Qe.Range,X({step:c,min:y,max:t,values:B,disabled:p,onChange:function(N){return F({value:N})},onFinalChange:function(N){return z({value:N})},rtl:w.direction==="rtl",renderTrack:function(N){var te=N.props,q=N.children,ae=N.isDragged;return E.createElement(he,X({onMouseDown:te.onMouseDown,onTouchStart:te.onTouchStart,$isDragged:ae},A,_e),E.createElement(ge,X({$isDragged:ae,ref:te.ref},A,pe),q))},renderThumb:function(N){var te=N.props,q=N.index,ae=N.isDragged,je=b||(!!q&&s||!q&&R||ae)&&!p;return E.createElement(et,X({},te,{onMouseEnter:function(){q===0?C(!0):u(!0)},onMouseLeave:function(){q===0?C(!1):u(!1)},$thumbIndex:q,$isDragged:ae,style:Dt({},te.style)},A,tt,{$isFocusVisible:v&&x===q}),je&&E.createElement(ot,X({$thumbIndex:q,$isDragged:ae},A,st),I(B[q])),je&&E.createElement(nt,X({$thumbIndex:q,$isDragged:ae},A,at)))}},l?{renderMark:function(N){var te=N.props,q=N.index;return E.createElement(ht,X({$markIndex:q},te,A,gt))}}:{})),E.createElement(lt,X({},A,dt),E.createElement(Be,X({},A,Ae),I(y)),E.createElement(Be,X({},A,Ae),I(t))))}const Vt=me("div",{target:"ezks3vl0"})({position:"relative"}),Nt=me("div",{target:"ezks3vl1"})(({disabled:e,theme:r,isDragged:n})=>({alignItems:"center",backgroundColor:e?r.colors.gray60:r.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",display:"flex",justifyContent:"center",height:r.sizes.sliderThumb,width:r.sizes.sliderThumb,boxShadow:n?`0 0 0 0.2rem ${ze(r.colors.primary,.5)}`:"none",":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${ze(r.colors.primary,.5)}`}})),Ut=me("div",{target:"ezks3vl2"})(({disabled:e,theme:r})=>({fontFamily:r.genericFonts.bodyFont,fontSize:r.fontSizes.sm,color:e?r.colors.gray60:r.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:r.colors.transparent,lineHeight:r.lineHeights.base,fontWeight:r.fontWeights.normal,pointerEvents:"none"})),Ht=me("div",{target:"ezks3vl3"})(({theme:e,isHovered:r,isDisabled:n})=>({position:"absolute",left:0,right:0,top:"100%",display:"flex",justifyContent:"space-between",pointerEvents:"none",marginTop:`-${e.spacing.md}`,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,fontWeight:e.fontWeights.normal,color:n?e.colors.fadedText40:e.colors.fadedText60,opacity:r?1:0,transition:"opacity 70ms ease-in-out"}));function Wt({minLabel:e,maxLabel:r,isHovered:n,isDisabled:o}){return Ge(Ht,{"data-testid":"stSliderTickBar",isHovered:n,isDisabled:o,children:[re("span",{children:e}),re("span",{children:r})]})}function qt({disabled:e,element:r,widgetMgr:n,fragmentId:o}){const[p,S]=Et({getStateFromWidgetMgr:Kt,getDefaultStateFromProto:Xt,getCurrStateFromProto:Yt,updateWidgetMgrState:Gt,element:r,widgetMgr:n,fragmentId:o}),[l,g]=E.useState(p),[F,j]=E.useState(!1),[z,$]=E.useState(!1),y=E.useCallback(()=>j(!0),[]),d=E.useCallback(()=>j(!1),[]),t=E.useRef(null),[a]=E.useState([]),[c]=E.useState([]),f=kt(),b=l.map(C=>Ee(C,r)),k=Ee(r.min,r),I=Ee(r.max,r),O=r.label;E.useEffect(()=>{g(p)},[p]);const w=E.useCallback(({value:C})=>{S({value:C,fromUi:!0}),$(!1)},[S]),M=E.useCallback(({value:C})=>{g(C),$(!0)},[]),P=E.useCallback(E.forwardRef(function(L,i){const{$thumbIndex:s}=L,u=s||0;a[u]=i,c[u]||=E.createRef();const h=Ot(L,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),m=b[u];return re(Nt,{...h,disabled:L.$disabled===!0,isDragged:L.$isDragged===!0,ref:a[u],"aria-valuetext":m,"aria-label":O,children:re(Ut,{"data-testid":"stSliderThumbValue",disabled:L.$disabled===!0,ref:c[u],children:m})})}),[]);E.useEffect(()=>{c.map((h,m)=>{h.current&&(h.current.innerText=b[m])}),a.map((h,m)=>{h.current&&h.current.setAttribute("aria-valuetext",b[m])});const C=t.current??null,L=a[0].current,i=a[1]?.current,s=c[0].current,u=c[1]?.current;Jt(C,L,i,s,u)});const R=E.useCallback(({$disabled:C})=>({height:f.spacing.twoXS,...C?{background:f.colors.darkenedBgMix25}:{}}),[f.colors.darkenedBgMix25,f.spacing.twoXS]);return Ge(Vt,{ref:t,className:"stSlider","data-testid":"stSlider",onMouseEnter:y,onMouseLeave:d,children:[re(_t,{label:r.label,disabled:e,labelVisibility:wt(r.labelVisibility?.value),children:r.help&&re(Rt,{children:re(St,{content:r.help,placement:Mt.TOP_RIGHT})})}),re(zt,{min:r.min,max:r.max,step:r.step,value:Qt(l,r),onChange:M,onFinalChange:w,disabled:e,overrides:{Thumb:P,Track:{style:{backgroundColor:"none !important",paddingLeft:f.spacing.none,paddingRight:f.spacing.none,paddingTop:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`,paddingBottom:`calc((${f.sizes.minElementHeight} - ${f.spacing.twoXS}) / 2)`}},InnerTrack:{style:R},TickBar:{component:Wt,props:{minLabel:k,maxLabel:I,isHovered:F||z,isDisabled:e}}}})]})}function Kt(e,r){return e.getDoubleArrayValue(r)}function Xt(e){return e.default}function Yt(e){return e.value}function Gt(e,r,n,o){r.setDoubleArrayValue(e,n.value,{fromUi:n.fromUi},o)}function Zt(e){const{dataType:r}=e;return r===$e.DataType.DATETIME||r===$e.DataType.DATE||r===$e.DataType.TIME}function Ee(e,r){const{format:n,options:o}=r;return Zt(r)?$t.utc(e/1e3).format(n):o.length>0?Ve.sprintf(n,o[e]):Ve.sprintf(n,e)}function Qt(e,r){const{min:n,max:o}=r;let p=e[0],S=e.length>1?e[1]:e[0];return p>S&&(p=S),p<n&&(p=n),p>o&&(p=o),S<n&&(S=n),S>o&&(S=o),e.length>1?[p,S]:[p]}function Jt(e,r,n,o,p){!e||!r||!o||(ie(e,r,o),n&&p&&(ie(e,n,p),er(e,r,n,o,p)))}function ie(e,r,n){const o=e.getBoundingClientRect(),p=r.getBoundingClientRect(),S=n.getBoundingClientRect(),l=p.left+p.width/2,g=l-S.width/2<o.left,F=l+S.width/2>o.right;n.style.left=g?"0":"",n.style.right=F?"0":""}function er(e,r,n,o,p){const l=e.getBoundingClientRect(),g=r.getBoundingClientRect(),F=n.getBoundingClientRect(),j=o.getBoundingClientRect(),z=p.getBoundingClientRect(),$=l.left+l.width/2,y=g.left+g.width/2,d=F.left+F.width/2,t=y-j.width/2>=l.left,a=d+z.width/2<=l.right,c=g.left-j.width>=l.left,f=F.right+z.width<=l.right,b=t?j.width/2:j.width,k=a?z.width/2:z.width,I=y+b;if(d-k-I>24){ie(e,r,o),ie(e,n,p);return}if(c&&f){o.style.left="",o.style.right=`${Math.round(g.width)}px`,p.style.left=`${Math.round(F.width)}px`,p.style.right="";return}y<$?(ie(e,r,o),p.style.left=`${Math.round(y+b+24-d)}px`,p.style.right=""):(ie(e,n,p),o.style.left="",o.style.right=`${-Math.round(d-k-24-y)}px`)}const ir=Tt(E.memo(qt));export{ir as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as n,l as c,k as g}from"./index.6xX1278W.js";import{u as m}from"./useBasicWidgetState.CedkNjUW.js";import"./FormClearHelper.DTcdrasw.js";const b=(t,e)=>t.getStringValue(e),f=t=>t.default??null,p=t=>t.value??null,C=(t,e,r,o)=>{e.setStringValue(t,r.value,{fromUi:r.fromUi},o)},d=({element:t,disabled:e,widgetMgr:r,fragmentId:o})=>{const[i,l]=m({getStateFromWidgetMgr:b,getDefaultStateFromProto:f,getCurrStateFromProto:p,updateWidgetMgrState:C,element:t,widgetMgr:r,fragmentId:o}),s=a.useCallback(u=>{l({value:u,fromUi:!0})},[l]);return n(g,{label:t.label,labelVisibility:c(t.labelVisibility?.value),help:t.help,onChange:s,disabled:e,value:i})},k=a.memo(d);export{k as default};
|