trotl-filter 1.0.46 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -11675,8 +11675,269 @@ Upload.propTypes = {
11675
11675
  customText: PropTypes.node
11676
11676
  };
11677
11677
 
11678
+ const upper = 20;
11679
+ const bellow = 180;
11680
+ const _markers = [{
11681
+ key: "18",
11682
+ x: 15,
11683
+ y: upper
11684
+ }, {
11685
+ key: "17",
11686
+ x: 45,
11687
+ y: upper
11688
+ }, {
11689
+ key: "16",
11690
+ x: 75,
11691
+ y: upper
11692
+ }, {
11693
+ key: "15",
11694
+ x: 105,
11695
+ y: upper
11696
+ }, {
11697
+ key: "14",
11698
+ x: 135,
11699
+ y: upper
11700
+ }, {
11701
+ key: "13",
11702
+ x: 165,
11703
+ y: upper
11704
+ }, {
11705
+ key: "12",
11706
+ x: 195,
11707
+ y: upper
11708
+ }, {
11709
+ key: "11",
11710
+ x: 225,
11711
+ y: upper
11712
+ }, {
11713
+ key: "21",
11714
+ x: 255,
11715
+ y: upper
11716
+ }, {
11717
+ key: "22",
11718
+ x: 285,
11719
+ y: upper
11720
+ }, {
11721
+ key: "23",
11722
+ x: 315,
11723
+ y: upper
11724
+ }, {
11725
+ key: "24",
11726
+ x: 345,
11727
+ y: upper
11728
+ }, {
11729
+ key: "25",
11730
+ x: 375,
11731
+ y: upper
11732
+ }, {
11733
+ key: "26",
11734
+ x: 405,
11735
+ y: upper
11736
+ }, {
11737
+ key: "27",
11738
+ x: 435,
11739
+ y: upper
11740
+ }, {
11741
+ key: "28",
11742
+ x: 465,
11743
+ y: upper
11744
+ }, {
11745
+ key: "48",
11746
+ x: 15,
11747
+ y: bellow
11748
+ }, {
11749
+ key: "47",
11750
+ x: 45,
11751
+ y: bellow
11752
+ }, {
11753
+ key: "46",
11754
+ x: 75,
11755
+ y: bellow
11756
+ }, {
11757
+ key: "45",
11758
+ x: 105,
11759
+ y: bellow
11760
+ }, {
11761
+ key: "44",
11762
+ x: 135,
11763
+ y: bellow
11764
+ }, {
11765
+ key: "43",
11766
+ x: 165,
11767
+ y: bellow
11768
+ }, {
11769
+ key: "42",
11770
+ x: 195,
11771
+ y: bellow
11772
+ }, {
11773
+ key: "41",
11774
+ x: 225,
11775
+ y: bellow
11776
+ }, {
11777
+ key: "31",
11778
+ x: 255,
11779
+ y: bellow
11780
+ }, {
11781
+ key: "32",
11782
+ x: 285,
11783
+ y: bellow
11784
+ }, {
11785
+ key: "33",
11786
+ x: 315,
11787
+ y: bellow
11788
+ }, {
11789
+ key: "34",
11790
+ x: 345,
11791
+ y: bellow
11792
+ }, {
11793
+ key: "35",
11794
+ x: 375,
11795
+ y: bellow
11796
+ }, {
11797
+ key: "36",
11798
+ x: 405,
11799
+ y: bellow
11800
+ }, {
11801
+ key: "37",
11802
+ x: 435,
11803
+ y: bellow
11804
+ }, {
11805
+ key: "38",
11806
+ x: 465,
11807
+ _x: 625,
11808
+ y: bellow
11809
+ }];
11810
+ const getBackgroundColor = (isSelected, card) => {
11811
+ let color = "white";
11812
+ if (isSelected) color = "#e6f7ff";
11813
+ if (card?.basicMaterial?.Color) color = "#dedede";
11814
+ if (card?.productValue?.colorTooth) color = card?.productValue?.colorTooth;
11815
+ return color;
11816
+ };
11817
+ const CardSelect = ({
11818
+ mk,
11819
+ sk,
11820
+ finalMarkers = () => {},
11821
+ callbackValues,
11822
+ callbackEvent,
11823
+ lines = true,
11824
+ linesColor = "#e6e6e6"
11825
+ }) => {
11826
+ const [disabled, setDisabled] = React.useState(true);
11827
+ const [markers, setMarkers] = React.useState(mk ?? _markers);
11828
+ const [selectedKeys, setSelectedKeys] = React.useState(sk ?? []);
11829
+ const [isMouseDown, setIsMouseDown] = React.useState(false);
11830
+ const {
11831
+ lang
11832
+ } = React.useMemo(() => ({
11833
+ lang: {}
11834
+ }), []);
11835
+ React.useEffect(() => {
11836
+ const handleGlobalMouseUp = () => setIsMouseDown(false);
11837
+ window.addEventListener("mouseup", handleGlobalMouseUp);
11838
+ return () => window.removeEventListener("mouseup", handleGlobalMouseUp);
11839
+ }, []);
11840
+ React.useEffect(() => {
11841
+ finalMarkers(selectedKeys);
11842
+ if (callbackValues) callbackValues(selectedKeys);
11843
+ if (callbackEvent) callbackEvent({
11844
+ type: "selection",
11845
+ values: selectedKeys
11846
+ });
11847
+ }, [selectedKeys]);
11848
+ const toggleCardSelection = card => {
11849
+ setSelectedKeys(prev => prev.includes(card.key) ? prev.filter(k => k !== card.key) : [...prev, card.key]);
11850
+ };
11851
+ const addCardToSelection = card => {
11852
+ setSelectedKeys(prev => prev.includes(card.key) ? prev : [...prev, card.key]);
11853
+ };
11854
+ const renderCard = card => {
11855
+ const isSelected = selectedKeys.includes(card?.key);
11856
+ return /*#__PURE__*/React.createElement("div", {
11857
+ key: card?.key,
11858
+ className: `no-select custom-card-tooth ${isSelected ? "selected" : ""}`,
11859
+ onMouseDown: e => {
11860
+ if (e.button === 0) {
11861
+ setIsMouseDown(true);
11862
+ toggleCardSelection(card);
11863
+ }
11864
+ },
11865
+ onMouseOver: () => {
11866
+ if (isMouseDown) addCardToSelection(card);
11867
+ },
11868
+ style: {
11869
+ backgroundColor: getBackgroundColor(isSelected, card)
11870
+ }
11871
+ }, /*#__PURE__*/React.createElement("div", {
11872
+ className: "card-header-tooth",
11873
+ style: {
11874
+ zIndex: 2
11875
+ }
11876
+ }, card?.key), /*#__PURE__*/React.createElement("div", {
11877
+ title: card?.basicMaterial?.MaterialTypeLabel,
11878
+ className: "card-body-tooth"
11879
+ }, card?.basicMaterial?.MaterialTypeLabel), /*#__PURE__*/React.createElement("div", {
11880
+ title: card?.colorLotRef && card?.colorLotRef?.length > 0 ? card?.colorLotRef.map(el => JSON.stringify(el, null, 4)) : "",
11881
+ className: "card-body-tooth"
11882
+ }, card?.colorLotRef && card?.colorLotRef?.length > 0 ? "colors" : ""), /*#__PURE__*/React.createElement("div", {
11883
+ title: card?.productValue?.label,
11884
+ className: "card-body-tooth"
11885
+ }, card?.productValue?.label ? " " + card?.productValue?.label + " " : ""), /*#__PURE__*/React.createElement("div", {
11886
+ title: card?.basicMaterial?.MaterialTypeLabel,
11887
+ className: "card-body-tooth"
11888
+ }, card?.basicMaterial?.disk ? " " + card?.basicMaterial?.disk + " " : ""), /*#__PURE__*/React.createElement("div", {
11889
+ className: "card-footer-tooth"
11890
+ }, /*#__PURE__*/React.createElement("div", {
11891
+ className: "card-footer-tooth-multi"
11892
+ }, card?.clen ? /*#__PURE__*/React.createElement("b", null, "X") : "", card?.ankerValues?.value ? " A " : "", card?.implantatValues ? " I " : "")));
11893
+ };
11894
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11895
+ className: "fieldsInline001 fieldsInlineTeeth"
11896
+ }, /*#__PURE__*/React.createElement(Button, {
11897
+ title: lang?.["clearSelectedDescription"] ?? "clearSelectedDescription",
11898
+ type: "delete",
11899
+ style: {
11900
+ float: "end"
11901
+ },
11902
+ onClick: () => setSelectedKeys([]),
11903
+ disabled: selectedKeys?.length === 0
11904
+ }, lang?.["clearSelected"] ?? "clearSelected"), /*#__PURE__*/React.createElement(Button, {
11905
+ title: lang?.["selectAllDescription"] ?? "selectAllDescription",
11906
+ type: "ok",
11907
+ style: {
11908
+ float: "end"
11909
+ },
11910
+ onClick: () => setSelectedKeys(_markers.map(el => el.key))
11911
+ }, lang?.["selectAll"] ?? "selectAll"), /*#__PURE__*/React.createElement(Button, {
11912
+ title: lang?.["clearLastSelectedOneAtOnceDescription"] ?? "clearLastSelectedOneAtOnceDescription",
11913
+ type: "cancel",
11914
+ style: {
11915
+ float: "end"
11916
+ },
11917
+ onClick: () => setSelectedKeys(prev => prev.slice(0, -1)),
11918
+ disabled: selectedKeys?.length === 0
11919
+ }, lang?.["clearLastSelectedOneAtOnce"] ?? "clearLastSelectedOneAtOnce")), /*#__PURE__*/React.createElement("div", {
11920
+ className: "bodyTeeth"
11921
+ }, /*#__PURE__*/React.createElement("div", {
11922
+ className: "bodyTeeth-first-row"
11923
+ }, markers.slice(0, 16).map(m => renderCard(m))), /*#__PURE__*/React.createElement("div", {
11924
+ className: "bodyTeeth-second-row"
11925
+ }, markers.slice(16, 32).map(m => renderCard(m))), lines && /*#__PURE__*/React.createElement("div", {
11926
+ className: "horizontal-line-h",
11927
+ style: {
11928
+ backgroundColor: linesColor
11929
+ }
11930
+ }), lines && /*#__PURE__*/React.createElement("div", {
11931
+ className: "vertical-line-v",
11932
+ style: {
11933
+ backgroundColor: linesColor
11934
+ }
11935
+ })));
11936
+ };
11937
+
11678
11938
  exports.Button = Button;
11679
11939
  exports.CalendarRangePicker = CalendarRangePicker;
11940
+ exports.CardSelect = CardSelect;
11680
11941
  exports.ColorPicker = ColorPicker;
11681
11942
  exports.DateTimeInput = DateTimeInput;
11682
11943
  exports.DebounceSelect = DebounceSelect;