@hhgtech/hhg-components 1.21.71 → 1.21.72
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.
|
@@ -3,6 +3,7 @@ import { SliderProps as MantineSliderProps } from '@mantine/core';
|
|
|
3
3
|
export type SliderProps = Omit<MantineSliderProps, 'color'> & {
|
|
4
4
|
color?: string;
|
|
5
5
|
withControl?: boolean;
|
|
6
|
+
isStatic?: boolean;
|
|
6
7
|
};
|
|
7
|
-
declare const Slider: ({ color, withControl, onChange, value, min, max, ...props }: SliderProps) => JSX.Element;
|
|
8
|
+
declare const Slider: ({ color, withControl, onChange, value, min, max, isStatic, ...props }: SliderProps) => JSX.Element;
|
|
8
9
|
export { Slider };
|
package/build/esm/mantine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,_ as o}from"./tslib.es6-dcf36680.js";import r,{useMemo as n,useState as a,useEffect as i}from"react";import{Autocomplete as s,Image as l,Select as m,Badge as h,Spoiler as p,LoadingOverlay as u,MantineProvider as v}from"@mantine/core";import{CommonGAssets as w}from"./gAssets.js";import{D as x,S as E,a as
|
|
1
|
+
import{b as t,_ as o}from"./tslib.es6-dcf36680.js";import r,{useMemo as n,useState as a,useEffect as i}from"react";import{Autocomplete as s,Image as l,Select as m,Badge as h,Spoiler as p,LoadingOverlay as u,MantineProvider as v}from"@mantine/core";import{CommonGAssets as w}from"./gAssets.js";import{D as x,S as E,a as S,u as k,g as j}from"./theme-2bf6d1d3.js";export{A as Accordion,c as Avatar,C as Carousel,d as Checkbox,b as DatePicker,I as Input,R as Radio,e as Switch,f as emotionCache,g as getMantineThemeOverride}from"./theme-2bf6d1d3.js";import"date-fns";import"./screenSizeContext-1852eabc.js";import"styled-components";import{t as y}from"./theme-a50a1aa5.js";import"./index-9dd60ba6.js";import"./isProduction-6fc0946c.js";import"./Locale-69030fff.js";import{T as H}from"./index.styled-66f12014.js";import"react-range";import{u as z}from"./useTranslations-85bbb13d.js";import"lodash/debounce";import{useDebouncedValue as P}from"@mantine/hooks";import{B}from"./index-b6575475.js";import"./translationsContext-2c0df9f2.js";import"string-format";import"@mantine/dates";import"@mantine/carousel";import"vanilla-lazyload";import"lodash";var L=function(e){var n=e.keepSearch,a=void 0!==n&&n,i=t(e,["keepSearch"]);return a?r.createElement(s,o({rightSection:r.createElement(l,{src:w.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i)):r.createElement(m,o({rightSection:r.createElement(l,{src:w.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},i))},M=function(e){var n=e.color,a=void 0===n?y.colors.primaryBase:n,i=t(e,["color"]);return r.createElement(h,o({variant:"filled",color:a,styles:{root:{borderRadius:"2px",background:a,textTransform:"unset"}}},i))},D=function(e){var a=e.children,i=e.line,s=e.lineHeight,l=e.maxHeight,c=t(e,["children","line","lineHeight","maxHeight"]),m=z().t,d=n((function(){return l||(i&&s?i*s:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))}),[]);return a||console.error("[HHG-Comp]:[Spoiler] Please provide children"),r.createElement(p,o({showLabel:r.createElement(H,{size:"p3",color:y.colors.primaryBase},m("articlePage.readMore")),hideLabel:r.createElement(H,{size:"p3",color:y.colors.primaryBase},m("articlePage.showLess"))},c,{maxHeight:d}),a)},T=function(e){return r.createElement(u,o({loaderProps:{color:y.colors.primaryBase}},e))},G=function(e){var n=e.color,s=void 0===n?y.colors.primaryBase:n,l=e.withControl,c=e.onChange,m=e.value,d=e.min,h=e.max,p=e.isStatic,u=t(e,["color","withControl","onChange","value","min","max","isStatic"]),f=a(m||d||0),g=f[0],v=f[1],w=P(g,x)[0];return i((function(){null==c||c(w)}),[w]),r.createElement(E,null,l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){v((function(e){return d&&e===d?e:e-1}))}},r.createElement("svg",{width:"10",height:"10",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 3"},r.createElement("path",{d:"M1 1.004h8",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),r.createElement(S,o({thumbSize:21,labelAlwaysOn:!0,radius:"xl",color:s,value:g,onChange:p?function(){return null}:v,min:d,max:h},u)),l&&r.createElement(B,{type:"button",size:"sm",color:"ghost",onClick:function(){v((function(e){return h&&e===h?e:e+1}))}},r.createElement("svg",{width:"16",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},r.createElement("path",{d:"M8 4v8M4 8h8",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))},O=function(e){var n=e.children,a=e.locale,i=t(e,["children","locale"]);return k(a),r.createElement(v,o({theme:j(a),withGlobalStyles:!0,withNormalizeCSS:!0},i),n)};export{M as Badge,T as LoadingOverlay,O as MantineProvider,L as Select,G as Slider,D as Spoiler};
|
package/build/mantine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-e6f346c4.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tslib.es6-e6f346c4.js"),t=require("react"),r=require("@mantine/core"),o=require("./gAssets.js"),n=require("./theme-f97a1fea.js");require("date-fns"),require("./screenSizeContext-8f86eb30.js"),require("styled-components");var i=require("./theme-696d81a9.js");require("./index-d28c27ca.js"),require("./isProduction-32e6a55a.js"),require("./Locale-11b51016.js");var a=require("./index.styled-213d989f.js");require("react-range");var s=require("./useTranslations-5897b4e1.js");require("lodash/debounce");var l=require("@mantine/hooks"),c=require("./index-740c6f7b.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./translationsContext-170d42d0.js"),require("string-format"),require("@mantine/dates"),require("@mantine/carousel"),require("vanilla-lazyload"),require("lodash");var d=u(t);exports.Accordion=n.Accordion,exports.Avatar=n.Avatar,exports.Carousel=n.Carousel,exports.Checkbox=n.Checkbox,exports.DatePicker=n.DatePicker,exports.Input=n.Input,exports.Radio=n.Radio,exports.Switch=n.Switch,exports.emotionCache=n.emotionCache,exports.getMantineThemeOverride=n.getMantineThemeOverride,exports.Badge=function(t){var o=t.color,n=void 0===o?i.theme.colors.primaryBase:o,a=e.__rest(t,["color"]);return d.default.createElement(r.Badge,e.__assign({variant:"filled",color:n,styles:{root:{borderRadius:"2px",background:n,textTransform:"unset"}}},a))},exports.LoadingOverlay=function(t){return d.default.createElement(r.LoadingOverlay,e.__assign({loaderProps:{color:i.theme.colors.primaryBase}},t))},exports.MantineProvider=function(t){var o=t.children,i=t.locale,a=e.__rest(t,["children","locale"]);return n.useMantineLocale(i),d.default.createElement(r.MantineProvider,e.__assign({theme:n.getMantineThemeOverride(i),withGlobalStyles:!0,withNormalizeCSS:!0},a),o)},exports.Select=function(t){var n=t.keepSearch,i=void 0!==n&&n,a=e.__rest(t,["keepSearch"]);return i?d.default.createElement(r.Autocomplete,e.__assign({rightSection:d.default.createElement(r.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},a)):d.default.createElement(r.Select,e.__assign({rightSection:d.default.createElement(r.Image,{src:o.CommonGAssets.getAssetPath("chevron-down.svg"),fit:"none"}),size:"md",maxDropdownHeight:300},a))},exports.Slider=function(r){var o=r.color,a=void 0===o?i.theme.colors.primaryBase:o,s=r.withControl,u=r.onChange,m=r.value,h=r.min,p=r.max,f=r.isStatic,g=e.__rest(r,["color","withControl","onChange","value","min","max","isStatic"]),v=t.useState(m||h||0),x=v[0],_=v[1],w=l.useDebouncedValue(x,n.DEBOUNCED_TIME)[0];return t.useEffect((function(){null==u||u(w)}),[w]),d.default.createElement(n.StyledSliderWrapper,null,s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){_((function(e){return h&&e===h?e:e-1}))}},d.default.createElement("svg",{width:"10",height:"10",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 3"},d.default.createElement("path",{d:"M1 1.004h8",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),d.default.createElement(n.StyledSlider,e.__assign({thumbSize:21,labelAlwaysOn:!0,radius:"xl",color:a,value:x,onChange:f?function(){return null}:_,min:h,max:p},g)),s&&d.default.createElement(c.Button,{type:"button",size:"sm",color:"ghost",onClick:function(){_((function(e){return p&&e===p?e:e+1}))}},d.default.createElement("svg",{width:"16",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},d.default.createElement("path",{d:"M8 4v8M4 8h8",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))},exports.Spoiler=function(o){var n=o.children,l=o.line,c=o.lineHeight,u=o.maxHeight,m=e.__rest(o,["children","line","lineHeight","maxHeight"]),h=s.useTranslations().t,p=t.useMemo((function(){return u||(l&&c?l*c:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))}),[]);return n||console.error("[HHG-Comp]:[Spoiler] Please provide children"),d.default.createElement(r.Spoiler,e.__assign({showLabel:d.default.createElement(a.Text,{size:"p3",color:i.theme.colors.primaryBase},h("articlePage.readMore")),hideLabel:d.default.createElement(a.Text,{size:"p3",color:i.theme.colors.primaryBase},h("articlePage.showLess"))},m,{maxHeight:p}),n)};
|