@alphakits/ui 1.17.0 → 1.18.0
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/{_commonjsHelpers-2cfff74b.js → _commonjsHelpers-598fc4da.js} +0 -0
- package/dist/amount/component.js +1 -1
- package/dist/amount/index.js +1 -1
- package/dist/amount-input/component.d.ts +1 -1
- package/dist/amount-input/component.js +1 -1
- package/dist/amount-input/index.js +1 -1
- package/dist/avatar/component.js +1 -1
- package/dist/avatar/index.js +1 -1
- package/dist/base-card/component.js +1 -1
- package/dist/base-card/index.js +1 -1
- package/dist/bottom-sheet/component.js +1 -1
- package/dist/bottom-sheet/index.js +1 -1
- package/dist/button/component.d.ts +1 -1
- package/dist/button/component.js +1 -1
- package/dist/button/index.js +1 -1
- package/dist/calendar/component.js +1 -1
- package/dist/calendar/components/days-table/component.js +1 -1
- package/dist/calendar/components/days-table/index.js +1 -1
- package/dist/calendar/components/header/index.js +1 -1
- package/dist/calendar/components/header//321/201omponent.js +1 -1
- package/dist/calendar/components/months-table/index.js +1 -1
- package/dist/calendar/components/months-table//321/201omponent.js +1 -1
- package/dist/calendar/components/select-button/index.js +1 -1
- package/dist/calendar/components/select-button//321/201omponent.js +1 -1
- package/dist/calendar/components/years-table/index.js +1 -1
- package/dist/calendar/components/years-table//321/201omponent.js +1 -1
- package/dist/calendar/index.js +1 -1
- package/dist/calendar/use-calendar.d.ts +6 -6
- package/dist/calendar-input/component.d.ts +4 -4
- package/dist/calendar-input/component.js +1 -1
- package/dist/calendar-input/index.js +1 -1
- package/dist/calendar-input/utils.d.ts +1 -1
- package/dist/card/component.js +1 -1
- package/dist/card/images/index.js +1 -1
- package/dist/card/index.js +1 -1
- package/dist/cell/base/component.js +1 -1
- package/dist/cell/base/index.d.ts +1 -1
- package/dist/cell/base/index.js +1 -1
- package/dist/cell/component.js +1 -1
- package/dist/cell/index.js +1 -1
- package/dist/cell/pure/component.d.ts +1 -1
- package/dist/cell/pure/component.js +1 -1
- package/dist/cell/pure/index.js +1 -1
- package/dist/checkbox/component.d.ts +6 -6
- package/dist/checkbox/component.js +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox-group/component.js +1 -1
- package/dist/checkbox-group/index.js +1 -1
- package/dist/checkbox-lists/component.js +1 -1
- package/dist/checkbox-lists/index.js +1 -1
- package/dist/collapsable-row/addons.js +1 -1
- package/dist/collapsable-row/component.js +1 -1
- package/dist/collapsable-row/index.js +1 -1
- package/dist/collapse/component.js +1 -1
- package/dist/collapse/index.js +1 -1
- package/dist/{colors.module-fa56222e.js → colors.module-3b4fd590.js} +0 -0
- package/dist/{common.module-78e1bdef.js → common.module-1f20b0cc.js} +0 -0
- package/dist/{component-f5a1396c.d.ts → component-f392c22f.d.ts} +0 -0
- package/dist/{component-f5a1396c.js → component-f392c22f.js} +0 -0
- package/dist/{contact-block-66af7817.d.ts → contact-block-89f5620b.d.ts} +0 -0
- package/dist/{contact-block-66af7817.js → contact-block-89f5620b.js} +0 -0
- package/dist/copy-button/component.js +1 -1
- package/dist/copy-button/index.js +1 -1
- package/dist/date/component.d.ts +1 -1
- package/dist/date/component.js +1 -1
- package/dist/date/index.js +1 -1
- package/dist/date-switcher/component.js +1 -1
- package/dist/date-switcher/index.js +1 -1
- package/dist/footer/component.js +1 -1
- package/dist/footer/contact-block.js +1 -1
- package/dist/footer/index.js +1 -1
- package/dist/form/component.js +1 -1
- package/dist/form/components/form-footer/index.js +1 -1
- package/dist/form/components/index.js +1 -1
- package/dist/form/index.js +1 -1
- package/dist/form/templates/crud-form/index.js +1 -1
- package/dist/form/templates/filters-form/index.js +1 -1
- package/dist/form/templates/rest-form/index.d.ts +2 -2
- package/dist/form/templates/rest-form/index.js +1 -1
- package/dist/form/utils/get-default-values.js +1 -1
- package/dist/form/utils/remove-undefined-from-object.d.ts +1 -2
- package/dist/form-control/component.d.ts +5 -5
- package/dist/form-control/component.js +1 -1
- package/dist/form-control/index.js +1 -1
- package/dist/{formik.esm-bbafe73a.js → formik.esm-afc2d983.js} +1 -1
- package/dist/grid/col/component.js +1 -1
- package/dist/grid/col/index.js +1 -1
- package/dist/grid/component.js +1 -1
- package/dist/grid/index.js +1 -1
- package/dist/grid/row/component.js +1 -1
- package/dist/grid/row/index.js +1 -1
- package/dist/{gutters.module-3c6d3471.js → gutters.module-4362067b.js} +0 -0
- package/dist/header-search/component.js +1 -1
- package/dist/header-search/index.js +1 -1
- package/dist/heading/component.js +1 -1
- package/dist/heading/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-crud-form-requests/index.js +1 -1
- package/dist/hooks/use-get-one/index.d.ts +2 -2
- package/dist/hooks/use-get-one/index.js +1 -1
- package/dist/icon-button/component.d.ts +1 -1
- package/dist/icon-button/component.js +1 -1
- package/dist/icon-button/index.js +1 -1
- package/dist/image/component.js +1 -1
- package/dist/image/image-base.js +1 -1
- package/dist/image/index.js +1 -1
- package/dist/image/use-image-render-component.js +1 -1
- package/dist/image-gallery/component.js +1 -1
- package/dist/image-gallery/components/header/index.js +1 -1
- package/dist/image-gallery/components/header-info-block/index.js +1 -1
- package/dist/image-gallery/components/image-viewer/index.d.ts +2 -2
- package/dist/image-gallery/components/image-viewer/index.js +1 -1
- package/dist/image-gallery/components/image-viewer/slide.js +1 -1
- package/dist/image-gallery/components/index.js +1 -1
- package/dist/image-gallery/index.js +1 -1
- package/dist/image-uploader/component.d.ts +2 -2
- package/dist/image-uploader/component.js +1 -1
- package/dist/image-uploader/index.js +1 -1
- package/dist/{index-255a9b3d.js → index-eba9044b.js} +2 -2
- package/dist/index.css +1 -1
- package/dist/info-block-header/component.js +1 -1
- package/dist/info-block-header/index.js +1 -1
- package/dist/info-block-item/component.js +1 -1
- package/dist/info-block-item/index.js +1 -1
- package/dist/input/component.d.ts +7 -7
- package/dist/input/component.js +1 -1
- package/dist/input/index.js +1 -1
- package/dist/{intersection-observer-c2477ad2.js → intersection-observer-02f4f9d8.js} +0 -0
- package/dist/link/component.d.ts +2 -2
- package/dist/link/component.js +1 -1
- package/dist/link/index.js +1 -1
- package/dist/list-allert/component.js +1 -1
- package/dist/list-allert/index.js +1 -1
- package/dist/masked-input/component.d.ts +4 -7
- package/dist/masked-input/component.js +1 -1
- package/dist/masked-input/index.js +1 -1
- package/dist/menu/component.js +1 -1
- package/dist/menu/components/content-header/index.js +1 -1
- package/dist/menu/components/index.js +1 -1
- package/dist/menu/components/menu-avatar/index.js +1 -1
- package/dist/menu/components/menu-button/index.js +1 -1
- package/dist/menu/components/menu-buttons-list/index.js +1 -1
- package/dist/menu/components/user-button/index.js +1 -1
- package/dist/menu/index.js +1 -1
- package/dist/message/component.js +1 -1
- package/dist/message/index.js +1 -1
- package/dist/modal/components/modals/index.js +1 -1
- package/dist/modal/context.js +1 -1
- package/dist/modal/hooks/use-modal.d.ts +2 -2
- package/dist/modal/hooks/use-modal.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/not-found/component.js +1 -1
- package/dist/not-found/index.js +1 -1
- package/dist/notification/component.js +1 -1
- package/dist/notification/index.js +1 -1
- package/dist/{parse-query-params-dedce862.d.ts → parse-query-params-f52e36cf.d.ts} +0 -0
- package/dist/{parse-query-params-dedce862.js → parse-query-params-f52e36cf.js} +1 -1
- package/dist/picker-button/common/index.js +1 -1
- package/dist/picker-button/common/labeled-button/index.js +1 -1
- package/dist/picker-button/component.d.ts +2 -2
- package/dist/picker-button/component.js +1 -1
- package/dist/picker-button/field/Component.js +1 -1
- package/dist/picker-button/field/index.js +1 -1
- package/dist/picker-button/index.js +1 -1
- package/dist/popover/component.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/progress-bar/component.js +1 -1
- package/dist/progress-bar/index.js +1 -1
- package/dist/progress-index/component.js +1 -1
- package/dist/progress-index/index.js +1 -1
- package/dist/radio/component.d.ts +6 -6
- package/dist/radio/component.js +1 -1
- package/dist/radio/index.js +1 -1
- package/dist/radio-group/component.js +1 -1
- package/dist/radio-group/index.js +1 -1
- package/dist/radio-groups/component.js +1 -1
- package/dist/radio-groups/index.js +1 -1
- package/dist/select/component.d.ts +1 -1
- package/dist/select/component.js +1 -1
- package/dist/select/components/base-select/component.js +1 -1
- package/dist/select/components/base-select/index.js +1 -1
- package/dist/select/components/field/component.d.ts +2 -21
- package/dist/select/components/field/component.js +1 -1
- package/dist/select/components/field/index.js +1 -1
- package/dist/select/components/index.js +1 -1
- package/dist/select/components/native-select/component.d.ts +1 -1
- package/dist/select/components/native-select/component.js +1 -1
- package/dist/select/components/native-select/index.js +1 -1
- package/dist/select/components/option/component.js +1 -1
- package/dist/select/components/option/index.js +1 -1
- package/dist/select/components/virtual-options-list/component.js +1 -1
- package/dist/select/components/virtual-options-list/index.js +1 -1
- package/dist/select/index.js +1 -1
- package/dist/select/presets/index.js +1 -1
- package/dist/select/presets/use-lazy-loading/index.d.ts +1 -1
- package/dist/select/presets/use-lazy-loading/index.js +1 -1
- package/dist/select/presets/use-select-with-loading/hook.js +1 -1
- package/dist/select/utils.d.ts +1 -1
- package/dist/sidepanel-header/component.js +1 -1
- package/dist/sidepanel-header/index.js +1 -1
- package/dist/{slide-858ffa1a.d.ts → slide-06a2ffa8.d.ts} +3 -3
- package/dist/slide-06a2ffa8.js +1 -0
- package/dist/space/Item.js +1 -1
- package/dist/space/component.js +1 -1
- package/dist/space/index.js +1 -1
- package/dist/suffix-input/component.d.ts +1 -1
- package/dist/suffix-input/component.js +1 -1
- package/dist/suffix-input/index.js +1 -1
- package/dist/super-list-header/component.js +1 -1
- package/dist/super-list-header/index.js +1 -1
- package/dist/super-list-item/component.js +1 -1
- package/dist/super-list-item/index.js +1 -1
- package/dist/{swiper-slide-970dfced.js → swiper-slide-44315503.js} +0 -0
- package/dist/switch/component.d.ts +6 -6
- package/dist/switch/component.js +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/table/columns.d.ts +5 -12
- package/dist/table/columns.js +1 -1
- package/dist/table/component.d.ts +5 -7
- package/dist/table/component.js +1 -1
- package/dist/table/components/cell/component.js +1 -1
- package/dist/table/components/cell/index.js +1 -1
- package/dist/table/components/cells/index.js +1 -1
- package/dist/table/components/empty-list/index.d.ts +1 -1
- package/dist/table/components/empty-list/index.js +1 -1
- package/dist/table/components/error/index.d.ts +1 -1
- package/dist/table/components/error/index.js +1 -1
- package/dist/table/components/pagination/index.js +1 -1
- package/dist/table/components/row/component.js +1 -1
- package/dist/table/components/row/index.js +1 -1
- package/dist/table/components/rows/index.d.ts +6 -7
- package/dist/table/components/rows/index.js +1 -1
- package/dist/table/components/table-header/index.js +1 -1
- package/dist/table/hooks/use-table-data.d.ts +3 -3
- package/dist/table/hooks/use-table-data.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/table/table.d.ts +13 -10
- package/dist/table/table.js +1 -1
- package/dist/table/types.d.ts +5 -6
- package/dist/table/utils/add-query-param.js +1 -1
- package/dist/table/utils/get-query-from-url.js +1 -1
- package/dist/table/utils/index.d.ts +1 -1
- package/dist/table/utils/index.js +1 -1
- package/dist/table/utils/parse-query-params.js +1 -1
- package/dist/table/utils/query-adapter.js +1 -1
- package/dist/table/utils/remove-query-param.js +1 -1
- package/dist/table/utils/reset-query-param.js +1 -1
- package/dist/table/utils/serialize-data.d.ts +2 -1
- package/dist/table/utils/serialize-data.js +1 -1
- package/dist/table/utils/sort-array.d.ts +2 -1
- package/dist/table/utils/sort-array.js +1 -1
- package/dist/table-status/component.js +1 -1
- package/dist/table-status/index.js +1 -1
- package/dist/tag/component.js +1 -1
- package/dist/tag/index.js +1 -1
- package/dist/tags-list/component.js +1 -1
- package/dist/tags-list/index.js +1 -1
- package/dist/tariff-builder/component.js +1 -1
- package/dist/tariff-builder/index.js +1 -1
- package/dist/textarea/component.d.ts +2 -2
- package/dist/textarea/component.js +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/toast/component.js +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast-notifier/component.js +1 -1
- package/dist/toast-notifier/index.js +1 -1
- package/dist/toast-plate/component.d.ts +4 -4
- package/dist/toast-plate/component.js +1 -1
- package/dist/toast-plate/index.js +1 -1
- package/dist/tooltip/component.js +1 -1
- package/dist/tooltip/index.js +1 -1
- package/dist/tslib.es6-e799146e.js +1 -0
- package/dist/typography/component.js +1 -1
- package/dist/typography/index.js +1 -1
- package/dist/typography/text/component.js +1 -1
- package/dist/typography/text/index.js +1 -1
- package/dist/typography/title/component.d.ts +3 -3
- package/dist/typography/title/component.js +1 -1
- package/dist/typography/title/index.js +1 -1
- package/dist/typography/title-responsive/component.js +1 -1
- package/dist/typography/title-responsive/index.js +1 -1
- package/dist/{use-image-render-component-93d55cc2.d.ts → use-image-render-component-d9d25b4d.d.ts} +0 -0
- package/dist/{use-image-render-component-93d55cc2.js → use-image-render-component-d9d25b4d.js} +0 -0
- package/dist/utils/get-currency-symbol/util.d.ts +2 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/show-toast/index.js +1 -1
- package/dist/with-suffix/component.d.ts +4 -35
- package/dist/with-suffix/component.js +1 -1
- package/dist/with-suffix/index.js +1 -1
- package/package.json +6 -5
- package/dist/slide-858ffa1a.js +0 -1
- package/dist/tslib.es6-77545e10.js +0 -15
package/dist/space/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Space}from"./component.js";import"../tslib.es6-
|
|
1
|
+
export{Space}from"./component.js";import"../tslib.es6-e799146e.js";import"react";import"classnames";import"./Item.js";
|
|
@@ -10,7 +10,7 @@ type SuffixInputProps = Omit<InputProps, 'value' | 'onChange' | 'type'> & {
|
|
|
10
10
|
value: string;
|
|
11
11
|
}) => void;
|
|
12
12
|
};
|
|
13
|
-
declare const SuffixInput: React.ForwardRefExoticComponent<
|
|
13
|
+
declare const SuffixInput: React.ForwardRefExoticComponent<Omit<InputProps, "value" | "type" | "onChange"> & {
|
|
14
14
|
value: string;
|
|
15
15
|
suffix?: string | undefined;
|
|
16
16
|
required?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as o}from"../tslib.es6-
|
|
1
|
+
import{_ as e,a as o}from"../tslib.es6-e799146e.js";import n,{forwardRef as r,useState as t,useEffect as a,useCallback as i,Fragment as l}from"react";import s from"classnames";import{Input as m}from"../input/component.js";import{withSuffix as c}from"../with-suffix/component.js";import"react-merge-refs";import"../button/component.js";import"../hooks/useFocus/index.js";import"../loader/component.js";import"../form-control/component.js";import"../portal/component.js";import"react-dom";import"../portal/utils.js";var d={container:"index-module_container__tczFF",minorPartAndCurrency:"index-module_minorPartAndCurrency__0K7XF",bold:"index-module_bold__r3hvn",input:"index-module_input__SIj3W",suffixContainer:"index-module_suffixContainer__8eIxg",filled:"index-module_filled__nKrpt"},u=c(m),f=r((function(r,m){var c,f=r.value,p=r.suffix,_=r.placeholder,C=void 0===_?"":_,x=r.bold,v=void 0===x||x,j=r.className,N=r.focusedClassName,h=r.required,b=r.dataTestId,g=r.clear,E=void 0!==g&&g,F=r.onChange,I=r.onClear,q=e(r,["value","suffix","placeholder","bold","className","focusedClassName","required","dataTestId","clear","onChange","onClear"]),A=t(f),w=A[0],y=A[1];a((function(){return w!==f?y(f):function(){}}),[f]);var P=i((function(e){y(""),I&&I(e)}),[I]);return n.createElement("div",{className:s(d.container,(c={},c[d.bold]=v,c[d.filled]=Boolean(w),c))},n.createElement(u,o({},q,{suffix:n.createElement(l,null,w,n.createElement("span",{className:d.minorPartAndCurrency}," ",p)),suffixContainerClassName:d.suffixContainer,clear:E,required:h,placeholder:C,value:w,className:s(d.component,j),focusedClassName:N,inputClassName:d.input,onChange:function(e){var o=e.target,n=o.value;if(n===w){var r=o.selectionStart;window.requestAnimationFrame((function(){o.selectionStart=r,o.selectionEnd=r}))}y(n),F&&F(e,{value:n})},onClear:P,dataTestId:b,ref:m})))}));export{f as SuffixInput};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SuffixInput}from"./component.js";import"../tslib.es6-
|
|
1
|
+
export{SuffixInput}from"./component.js";import"../tslib.es6-e799146e.js";import"react";import"classnames";import"../input/component.js";import"react-merge-refs";import"../button/component.js";import"../hooks/useFocus/index.js";import"../loader/component.js";import"../form-control/component.js";import"../with-suffix/component.js";import"../portal/component.js";import"react-dom";import"../portal/utils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{Typography as t}from"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-
|
|
1
|
+
import e from"react";import{Typography as t}from"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-e799146e.js";import"../typography/title/component.js";import"classnames";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";var o="index-module_component__cofLq",m="index-module_leftSide__qNA7Y",n="index-module_leftAddons__l-m-3",r="index-module_rightAddons__m-u4n",i=function(i){var s=i.text,p=i.leftAddons,d=i.rightAddons;return e.createElement("div",{className:o},e.createElement("div",{className:m},e.createElement(t.Text,{weight:"bold",tag:"span"},s),p&&e.createElement("div",{className:n},p)),d&&e.createElement("div",{className:r},d))};export{i as SuperListHeader};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SuperListHeader}from"./component.js";import"react";import"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-
|
|
1
|
+
export{SuperListHeader}from"./component.js";import"react";import"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-e799146e.js";import"../typography/title/component.js";import"classnames";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import t from"classnames";import{Typography as o}from"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-
|
|
1
|
+
import e from"react";import t from"classnames";import{Typography as o}from"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-e799146e.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";var m="index-module_component__exnSI",r="index-module_leftSide__t9PJZ",s="index-module_leftAddons__AhXk-",a="index-module_disabled_dot__Ret4Z",i="index-module_rightAddons__UjV9O",n=function(n){var d=n.text,l=n.rightAddons,c=n.leftAddons,p=n.color,_=void 0===p?"secondary":p,g=n.disabled,v=n.className,x=n.weight,y=void 0===x?"regular":x;return e.createElement("div",{className:t(m,v)},e.createElement("div",{className:r},c&&!g&&e.createElement("div",{className:s},c),g&&e.createElement("div",{className:s},e.createElement("span",{className:a})),e.createElement(o.Text,{weight:y,color:_,view:"title",tag:"span"},d)),l&&e.createElement("div",{className:i},l))};export{n as SuperListItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SuperListItem}from"./component.js";import"react";import"classnames";import"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-
|
|
1
|
+
export{SuperListItem}from"./component.js";import"react";import"classnames";import"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-e799146e.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";
|
|
File without changes
|
|
@@ -16,17 +16,17 @@ type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'hint' |
|
|
|
16
16
|
}) => void;
|
|
17
17
|
dataTestId?: string;
|
|
18
18
|
};
|
|
19
|
-
declare const Switch: React.ForwardRefExoticComponent<
|
|
19
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "onChange" | "hint"> & {
|
|
20
20
|
checked?: boolean | undefined;
|
|
21
|
-
label?:
|
|
22
|
-
hint?:
|
|
21
|
+
label?: ReactNode;
|
|
22
|
+
hint?: ReactNode;
|
|
23
23
|
reversed?: boolean | undefined;
|
|
24
|
-
align?:
|
|
24
|
+
align?: Align | undefined;
|
|
25
25
|
addons?: React.ReactNode;
|
|
26
26
|
block?: boolean | undefined;
|
|
27
|
-
onChange: (event:
|
|
27
|
+
onChange: (event: ChangeEvent<HTMLInputElement>, payload: {
|
|
28
28
|
checked: boolean;
|
|
29
|
-
name:
|
|
29
|
+
name: InputHTMLAttributes<HTMLInputElement>['name'];
|
|
30
30
|
}) => void;
|
|
31
31
|
dataTestId?: string | undefined;
|
|
32
32
|
} & React.RefAttributes<HTMLLabelElement>>;
|
package/dist/switch/component.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a}from"../tslib.es6-
|
|
1
|
+
import{_ as e,a}from"../tslib.es6-e799146e.js";import d,{forwardRef as n,useRef as s,useCallback as t}from"react";import o from"react-merge-refs";import l from"classnames";import{useFocus as c}from"../hooks/useFocus/index.js";var m={component:"index-module_component__uXwqU",checked:"index-module_checked__dMpWF",switch:"index-module_switch__c7Qyf",start:"index-module_start__6RfRJ",center:"index-module_center__1n6sQ",addons:"index-module_addons__ZqO-o",block:"index-module_block__m7SjH",content:"index-module_content__hoWfv",label:"index-module_label__earxI",hint:"index-module_hint__LstQQ",reversed:"index-module_reversed__fS7Bs",disabled:"index-module_disabled__s1L6d",focused:"index-module_focused__v7jCm"},r=n((function(n,r){var i,_=n.reversed,u=void 0!==_&&_,h=n.checked,b=void 0!==h&&h,p=n.align,x=void 0===p?"start":p,f=n.addons,k=n.block,v=n.disabled,N=n.label,g=n.hint,E=n.name,j=n.value,w=n.className,C=n.onChange,Q=n.dataTestId,y=e(n,["reversed","checked","align","addons","block","disabled","label","hint","name","value","className","onChange","dataTestId"]),I=s(null),q=c(I,"keyboard")[0],F=t((function(e){C&&C(e,{checked:e.target.checked,name:E})}),[C,E]);return d.createElement("label",{className:l(m.component,m[x],w,(i={},i[m.disabled]=v,i[m.checked]=b,i[m.reversed]=u,i[m.focused]=q,i[m.block]=k,i)),ref:o([I,r])},d.createElement("input",a({type:"checkbox",onChange:F,disabled:v,checked:b,name:E,value:j,"data-test-id":Q},y)),d.createElement("span",{className:m.switch}),(N||g)&&d.createElement("span",{className:m.content},N&&d.createElement("span",{className:m.label},N),g&&d.createElement("span",{className:m.hint},g)),f&&d.createElement("span",{className:m.addons},f))}));export{r as Switch};
|
package/dist/switch/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Switch}from"./component.js";import"../tslib.es6-
|
|
1
|
+
export{Switch}from"./component.js";import"../tslib.es6-e799146e.js";import"react";import"react-merge-refs";import"classnames";import"../hooks/useFocus/index.js";
|
package/dist/table/columns.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
declare const ClientsColumns:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
enableSort?: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
Header: any;
|
|
9
|
-
accessor: string;
|
|
10
|
-
enableSort: boolean;
|
|
11
|
-
Cell: ({ cell, row: { original } }: any) => JSX.Element;
|
|
12
|
-
})[];
|
|
1
|
+
import { TableColumn } from "./types";
|
|
2
|
+
declare const ClientsColumns: Array<TableColumn<{
|
|
3
|
+
title: string;
|
|
4
|
+
photo: string;
|
|
5
|
+
}>>;
|
|
13
6
|
export { ClientsColumns };
|
package/dist/table/columns.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{Image as e}from"../image/component.js";import"../image/typings.js";import"../image/constants.js";import{Table as
|
|
1
|
+
import t from"react";import{Button as o}from"../button/component.js";import{Image as e}from"../image/component.js";import"../image/typings.js";import"../image/constants.js";import{Table as r}from"./component.js";import"classnames";import"../cell/pure/component.js";import"../tslib.es6-e799146e.js";import"react-merge-refs";import"../hooks/useFocus/index.js";import"../loader/component.js";import"../skeleton/component.js";import"../typography/component.js";import"../typography/title/index.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";import"../use-image-render-component-d9d25b4d.js";import"alpha-cli-icons";import"../spinner/component.js";import"../image/utils.js";import"./components/cell/component.js";import"../component-f392c22f.js";import"../__internal/utils/getDataTestId.js";import"./components/row/component.js";import"./table.js";import"react-table";import"./components/cells/index.js";import"./components/pagination/index.js";import"./languages/index.js";import"./components/rows/index.js";import"./components/empty-list/index.js";import"./components/error/index.js";import"./components/loading/index.js";import"./components/table-header/index.js";import"rooks";import"../header-search/component.js";import"./hooks/use-table-data.js";import"./utils/get-query-from-url.js";import"../parse-query-params-f52e36cf.js";import"../_commonjsHelpers-598fc4da.js";import"./utils/add-query-param.js";import"./utils/set-query-to-url.js";import"./utils/get-tags.js";import"./utils/remove-query-param.js";import"./utils/reset-query-param.js";import"./utils/serialize-data.js";import"./utils/sort-array.js";import"./utils/is-object.js";var s=[{Header:"Header",accessor:"title",Cell:function(o){var s=o.row.original;return t.createElement(r.Cell,{title:s.title,addon:t.createElement(e,{src:s.photo,text:s.title,view:"ellipse"})})}},{Header:"Orders",accessor:"photo",enableSort:!0,Cell:function(e){var s=e.refetch;return t.createElement(r.Cell,null,t.createElement(o,{onClick:s},"Refetch"))}}];export{s as ClientsColumns};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { RowProps } from "./components/row/index";
|
|
4
|
-
import { Props } from "./table";
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Table as T } from "./table";
|
|
5
3
|
declare const Table: {
|
|
6
|
-
Cell: FC<CellProps>;
|
|
7
|
-
Row: FC<RowProps>;
|
|
8
|
-
TableComponent:
|
|
4
|
+
Cell: import("react").FC<import("./components/cell/index").CellProps>;
|
|
5
|
+
Row: import("react").FC<import("./components/row/index").RowProps>;
|
|
6
|
+
TableComponent: typeof T;
|
|
9
7
|
};
|
|
10
8
|
export { Table };
|
package/dist/table/component.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TableCell as o}from"./components/cell/component.js";import{Row as t}from"./components/row/component.js";import{Table as e}from"./table.js";import"../tslib.es6-
|
|
1
|
+
import{TableCell as o}from"./components/cell/component.js";import{Row as t}from"./components/row/component.js";import{Table as e}from"./table.js";import"../tslib.es6-e799146e.js";import"react";import"classnames";import"../component-f392c22f.js";import"../__internal/utils/getDataTestId.js";import"../hooks/useFocus/index.js";import"../typography/component.js";import"../typography/title/index.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";import"../cell/pure/component.js";import"react-table";import"./components/cells/index.js";import"alpha-cli-icons";import"./components/pagination/index.js";import"../button/component.js";import"react-merge-refs";import"../loader/component.js";import"./languages/index.js";import"./components/rows/index.js";import"./components/empty-list/index.js";import"./components/error/index.js";import"./components/loading/index.js";import"./components/table-header/index.js";import"rooks";import"../header-search/component.js";import"./hooks/use-table-data.js";import"./utils/get-query-from-url.js";import"../parse-query-params-f52e36cf.js";import"../_commonjsHelpers-598fc4da.js";import"./utils/add-query-param.js";import"./utils/set-query-to-url.js";import"./utils/get-tags.js";import"./utils/remove-query-param.js";import"./utils/reset-query-param.js";import"./utils/serialize-data.js";import"./utils/sort-array.js";import"./utils/is-object.js";var r={Cell:o,Row:t,TableComponent:e};export{r as Table};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"../../../tslib.es6-
|
|
1
|
+
import{a as t}from"../../../tslib.es6-e799146e.js";import e from"react";import o from"classnames";import{C as s}from"../../../component-f392c22f.js";import"../../../__internal/utils/getDataTestId.js";import"../../../hooks/useFocus/index.js";import"../../../typography/component.js";import"../../../typography/title/index.js";import"../../../typography/title/component.js";import"../../../colors.module-3b4fd590.js";import"../../../common.module-1f20b0cc.js";import"../../../typography/text/component.js";import"../../../typography/title-responsive/component.js";import"../../../cell/pure/component.js";var r="index-module_cell__SVZPV",i="index-module_children__X0572",m="index-module_is_div__XHlH-",p=function(p){var a,l=p.dataTestID,n=p.className,c=p.children,d=p.title,u=p.subtitle,j=p.tableProps,_=p.cellProps,y=p.addon,f=p.tag,h=void 0===f?"td":f;return e.createElement(h,t({"data-test-id":l,className:o(r,n,(a={},a[m]="div"===h,a))},j),c?e.createElement("div",{className:o(i)},c):e.createElement(s.Base,t({title:d||"-",subtitle:u,addon:y},_)))};export{p as TableCell};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{TableCell}from"./component.js";import"../../../tslib.es6-
|
|
1
|
+
export{TableCell}from"./component.js";import"../../../tslib.es6-e799146e.js";import"react";import"classnames";import"../../../component-f392c22f.js";import"../../../__internal/utils/getDataTestId.js";import"../../../hooks/useFocus/index.js";import"../../../typography/component.js";import"../../../typography/title/index.js";import"../../../typography/title/component.js";import"../../../colors.module-3b4fd590.js";import"../../../common.module-1f20b0cc.js";import"../../../typography/text/component.js";import"../../../typography/title-responsive/component.js";import"../../../cell/pure/component.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../../tslib.es6-
|
|
1
|
+
import{a as e}from"../../../tslib.es6-e799146e.js";import r from"react";import{ChevronForwardS as o}from"alpha-cli-icons";import t from"classnames";import{Typography as a}from"../../../typography/component.js";import{Row as n}from"../row/component.js";import"../../../typography/title/index.js";import"../../../typography/title/component.js";import"../../../colors.module-3b4fd590.js";import"../../../common.module-1f20b0cc.js";import"../../../typography/text/component.js";import"../../../typography/title-responsive/component.js";var d={header_row:"index-module_header_row__-IYYq",head_cell:"index-module_head_cell__BKHWf",clickable:"index-module_clickable__uhIIg",head_wrapper:"index-module_head_wrapper__WjtNB",arrow:"index-module_arrow__svnkJ",accent:"index-module_accent__5Dn8Q",up:"index-module_up__IP8Eg",down:"index-module_down__8Moeu"},l=function(l){var i=l.headerGroups,m=l.addParam,s=l.params;return r.createElement(r.Fragment,null,i.map((function(l){return r.createElement(n,e({className:d.header_row},l.getHeaderGroupProps()),l.headers.map((function(n){var l,i;n.isSorted=(null==s?void 0:s.sort)===n.id,n.isSortedDesc="ASC"===(null==s?void 0:s.order);var c=!n.isSorted||n.isSortedDesc?"down":"up";return r.createElement("th",e({className:t(d.head_cell,(l={},l[d.clickable]=n.enableSort,l)),align:"left",onClick:function(){return function(e){return e.enableSort?(e.isSorted&&e.isSortedDesc?m({sort:void 0,order:void 0}):m({sort:e.id,order:e.isSorted?"ASC":"DESC"}),null):null}(n)}},n.getHeaderProps()),r.createElement(a.Text,{className:d.head_wrapper,tag:"div",view:"caps",color:"secondary",weight:"medium"},n.render("Header").toUpperCase(),n.enableSort&&r.createElement("span",{className:t(d.arrow,d[c],(i={},i[d.accent]=n.isSorted,i))},r.createElement(o,null))))})))})))};export{l as Cells};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{Typography as e}from"../../../typography/component.js";import{translate as o}from"../../languages/index.js";import"../../../typography/title/index.js";import"../../../tslib.es6-
|
|
1
|
+
import t from"react";import{Typography as e}from"../../../typography/component.js";import{translate as o}from"../../languages/index.js";import"../../../typography/title/index.js";import"../../../tslib.es6-e799146e.js";import"../../../typography/title/component.js";import"classnames";import"../../../colors.module-3b4fd590.js";import"../../../common.module-1f20b0cc.js";import"../../../typography/text/component.js";import"../../../typography/title-responsive/component.js";var m="index-module_empty_list__dwgN3",p=function(p){var r=p.language;return t.createElement("div",{className:m},t.createElement(e.Text,{view:"title"},o(r)("emptyList")))};export{p as EmptyList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{Typography as e}from"../../../typography/component.js";import{translate as o}from"../../languages/index.js";import"../../../typography/title/index.js";import"../../../tslib.es6-
|
|
1
|
+
import t from"react";import{Typography as e}from"../../../typography/component.js";import{translate as o}from"../../languages/index.js";import"../../../typography/title/index.js";import"../../../tslib.es6-e799146e.js";import"../../../typography/title/component.js";import"classnames";import"../../../colors.module-3b4fd590.js";import"../../../common.module-1f20b0cc.js";import"../../../typography/text/component.js";import"../../../typography/title-responsive/component.js";var r="index-module_empty_list__FWx71",m=function(m){var p=m.language;return t.createElement("div",{className:r},t.createElement(e.Text,{view:"title"},o(p)("error")))};export{m as Error};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{ChevronForwardS as t}from"alpha-cli-icons";import n from"classnames";import{Button as o}from"../../../button/component.js";import{Typography as r}from"../../../typography/component.js";import{translate as a}from"../../languages/index.js";import"../../../tslib.es6-
|
|
1
|
+
import e from"react";import{ChevronForwardS as t}from"alpha-cli-icons";import n from"classnames";import{Button as o}from"../../../button/component.js";import{Typography as r}from"../../../typography/component.js";import{translate as a}from"../../languages/index.js";import"../../../tslib.es6-e799146e.js";import"react-merge-refs";import"../../../hooks/useFocus/index.js";import"../../../loader/component.js";import"../../../typography/title/index.js";import"../../../typography/title/component.js";import"../../../colors.module-3b4fd590.js";import"../../../common.module-1f20b0cc.js";import"../../../typography/text/component.js";import"../../../typography/title-responsive/component.js";var i="index-module_pagination_wrap__kmile",l="index-module_pagination__36rf5",m="index-module_pages_info__9QuwE",s="index-module_prev_btn__UnDy5",c="index-module_disabled_btn__G6J6W",p="index-module_pagination_btn__vexgb",u="index-module_btn__-Zrx2",d="index-module_active__F46kP",g="index-module_select__XysEX";var _=function(_){var f,v,h,x,E,y=_.pagesCount,b=_.currentPage,j=_.recordsPerPage,k=void 0===j?30:j,N=_.total,w=_.language,C=_.addParam,P=function(e,t){for(var n=e-2,o=e+2+1,r=[],a=[],i=0,l=1;l<=t;l++)(1===l||l===t||l>=n&&l<o)&&r.push(l);return r.forEach((function(e){i&&(e-i==2?a.push(i+1):e-i!=1&&a.push("...")),a.push(e),i=e})),a}(b,y),F=1===b,A=b===y;return e.createElement("div",{className:i},e.createElement("div",{className:m},(h=1===b?1:(b-1)*k,E=(x=k*b)>N?N:x,e.createElement(r.Text,{view:"title",weight:"medium",color:"secondary"},a(w)("resultsFromTo")," ",a(w)("from")," ",e.createElement("strong",null,h," "),a(w)("to")," ",e.createElement("strong",null,E," "),a(w)("totalCount")," ",e.createElement("strong",null,N," ")))),P.length>1&&e.createElement("div",{className:l},e.createElement(o,{className:n(s,u,(f={},f[c]=F,f)),leftAddons:e.createElement(t,null),view:"ghost",onClick:function(){return C({page:b-1})},disabled:F}),P.map((function(t,r){var a;return Number.isFinite(t)?e.createElement(o,{className:n(p,(a={},a[d]=t===b,a)),size:"xs",view:"ghost",key:t,onClick:function(){return C({page:t})}},t):e.createElement(o,{key:t+r,className:n(p),view:"ghost",disabled:!0},"...")})),e.createElement(o,{className:n(u,(v={},v[c]=A,v)),leftAddons:e.createElement(t,null),view:"ghost",onClick:function(){C({page:b+1})},disabled:A})),e.createElement("select",{value:k,className:g,onChange:function(e){C({page:1,limit:e.target.value})}},[5,10,20,30,40,50].map((function(t){return e.createElement("option",{key:t,value:t},a(w)("resultsOnPage")+" "+t+" ")}))))};export{_ as Pagination};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as
|
|
1
|
+
import{_ as e,a}from"../../../tslib.es6-e799146e.js";import r from"react";import t from"classnames";var s="index-module_row__Ub-Ap",l="index-module_clickable__rB-Ja",c=function(c){var i,o=c.children,m=c.onClick,n=c.dataTestID,d=c.className,_=e(c,["children","onClick","dataTestID","className"]);return r.createElement("tr",a({onClick:m},_,{"data-test-id":n,className:t(s,d,(i={},i[l]=!!m,i))}),o)};export{c as Row};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Row}from"./component.js";import"../../../tslib.es6-
|
|
1
|
+
export{Row}from"./component.js";import"../../../tslib.es6-e799146e.js";import"react";import"classnames";
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
type Props = {
|
|
4
|
-
rows:
|
|
2
|
+
import { Row } from 'react-table';
|
|
3
|
+
type Props<T extends object> = {
|
|
4
|
+
rows: Array<Row<T>>;
|
|
5
5
|
loading: boolean;
|
|
6
6
|
error: boolean;
|
|
7
7
|
language: 'en' | 'de' | 'ru';
|
|
8
|
+
refetch: () => void;
|
|
8
9
|
prepareRow: (val: any) => void;
|
|
9
|
-
onRowClick?: (params:
|
|
10
|
-
recordId: string;
|
|
11
|
-
}) => void;
|
|
10
|
+
onRowClick?: (params: T) => void;
|
|
12
11
|
};
|
|
13
|
-
declare
|
|
12
|
+
declare function Rows<T extends object>({ onRowClick, prepareRow, refetch, rows, loading, error, language, }: Props<T>): JSX.Element;
|
|
14
13
|
export { Rows };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../../tslib.es6-
|
|
1
|
+
import{a as e}from"../../../tslib.es6-e799146e.js";import o from"react";import t from"classnames";import{EmptyList as r}from"../empty-list/index.js";import{Error as n}from"../error/index.js";import{Loading as m}from"../loading/index.js";import{Row as p}from"../row/component.js";import"../../../typography/component.js";import"../../../typography/title/index.js";import"../../../typography/title/component.js";import"../../../colors.module-3b4fd590.js";import"../../../common.module-1f20b0cc.js";import"../../../typography/text/component.js";import"../../../typography/title-responsive/component.js";import"../../languages/index.js";import"../../../loader/component.js";var l={empty_list:"index-module_empty_list__EmSmG"};function a(a){var i=a.onRowClick,s=a.prepareRow,c=a.refetch,g=a.rows,u=a.loading,d=a.error,f=a.language;return d?o.createElement(n,{language:f}):u?o.createElement(m,null):g.length?o.createElement(o.Fragment,null,g.map((function(r){var n;s(r);var m=r.getRowProps().key;return o.createElement(p,e({dataTestID:""+m,onClick:function(){i&&i(r.original)},className:t(l.table_row,(n={},n[l.clickable]=!!i,n))},r.getRowProps()),r.cells.map((function(o){return o.render("Cell",e(e({},o.getCellProps()),{refetch:c}))})))}))):o.createElement(r,{language:f})}export{a as Rows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{PlusS as
|
|
1
|
+
import e,{useState as t}from"react";import{PlusS as o,ControllerS as r}from"alpha-cli-icons";import{useDebounce as n}from"rooks";import{Button as a}from"../../../button/component.js";import{HeaderSearch as l}from"../../../header-search/component.js";import{translate as i}from"../../languages/index.js";import"../../../tslib.es6-e799146e.js";import"react-merge-refs";import"classnames";import"../../../hooks/useFocus/index.js";import"../../../loader/component.js";var s="index-module_table_header__GXu4u",c="index-module_actions__GZKJC",m="index-module_tags__PpKzF",d="index-module_buttons__3CQYG",u=function(u){var p=u.tags,f=u.searchPlaceholder,h=void 0===f?"Type something..":f,x=u.searchText,_=u.addParam,v=u.onCreateClick,C=u.onDownloadClick,g=u.onFiltersClick,E=u.showFiltersButton,k=u.language,j=t(x),b=j[0],w=j[1],z=n((function(e){return _({searchText:e||void 0,page:1})}),1e3),F=function(e){w(e),z(e)};return e.createElement("div",{className:s},e.createElement("div",{className:c},e.createElement(l,{value:b,onChange:F,placeholder:h,onClearClick:function(){return F("")}}),e.createElement("div",{className:d},!!v&&e.createElement(a,{dataTestId:"createbtn",onClick:v,view:"primary",leftAddons:e.createElement(o,null),size:"xs"},i(k)("create")),!!C&&e.createElement(a,{view:"outlined",size:"xs",onClick:C},i(k)("export")),E&&e.createElement(a,{leftAddons:e.createElement(r,null),onClick:g,view:"outlined",size:"xs"},i(k)("filters")))),!!p.length&&e.createElement("div",{className:m},p))};export{u as TableHeader};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { TableProps } from "../table";
|
|
3
3
|
import { QueryDTO } from "../types";
|
|
4
|
-
declare function useTableData(promise?:
|
|
4
|
+
declare function useTableData<T extends object>(promise?: TableProps<T>['promise']): {
|
|
5
5
|
loading: boolean;
|
|
6
6
|
error: boolean;
|
|
7
|
-
asyncData:
|
|
7
|
+
asyncData: T[];
|
|
8
8
|
total: number;
|
|
9
9
|
params: QueryDTO | undefined;
|
|
10
10
|
pagesCount: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,d as r}from"../../tslib.es6-
|
|
1
|
+
import{c as t,d as r}from"../../tslib.es6-e799146e.js";import{useState as e,useCallback as s,useEffect as a}from"react";import{getQueryFromUrl as n}from"../utils/get-query-from-url.js";import"../../parse-query-params-f52e36cf.js";import"../../_commonjsHelpers-598fc4da.js";function o(o){var i=this,u=e(!1),c=u[0],m=u[1],f=e(!1),l=f[0],p=f[1],d=e([]),h=d[0],j=d[1],g=e(0),v=g[0],y=g[1],b=e(1),q=b[0],P=b[1],w=e(),x=w[0],C=w[1],D=s((function(){return t(i,void 0,void 0,(function(){var t,e,s,a;return r(this,(function(r){switch(r.label){case 0:if(t=n(),C(t),!o)return[2];p(!1),m(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,o(t)];case 2:return e=r.sent().data,s=e.items,a=e.meta,y(a.totalItems),P(a.totalPages),j(s),[3,5];case 3:return r.sent(),p(!0),[3,5];case 4:return m(!1),[7];case 5:return[2]}}))}))}),[o]);return a((function(){D()}),[]),{loading:c,error:l,asyncData:h,total:v,params:x,pagesCount:q,fetch:D,setParams:C}}export{o as useTableData};
|
package/dist/table/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Table}from"./component.js";export{TableCell}from"./components/cell/component.js";export{Row}from"./components/row/component.js";import"./table.js";import"../tslib.es6-
|
|
1
|
+
export{Table}from"./component.js";export{TableCell}from"./components/cell/component.js";export{Row}from"./components/row/component.js";import"./table.js";import"../tslib.es6-e799146e.js";import"react";import"react-table";import"./components/cells/index.js";import"alpha-cli-icons";import"classnames";import"../typography/component.js";import"../typography/title/index.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";import"./components/pagination/index.js";import"../button/component.js";import"react-merge-refs";import"../hooks/useFocus/index.js";import"../loader/component.js";import"./languages/index.js";import"./components/rows/index.js";import"./components/empty-list/index.js";import"./components/error/index.js";import"./components/loading/index.js";import"./components/table-header/index.js";import"rooks";import"../header-search/component.js";import"./hooks/use-table-data.js";import"./utils/get-query-from-url.js";import"../parse-query-params-f52e36cf.js";import"../_commonjsHelpers-598fc4da.js";import"./utils/add-query-param.js";import"./utils/set-query-to-url.js";import"./utils/get-tags.js";import"./utils/remove-query-param.js";import"./utils/reset-query-param.js";import"./utils/serialize-data.js";import"./utils/sort-array.js";import"./utils/is-object.js";import"../component-f392c22f.js";import"../__internal/utils/getDataTestId.js";import"../cell/pure/component.js";
|
package/dist/table/table.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { Column } from 'react-table';
|
|
3
|
+
import { ApiMethodDeclaration, MakeServiceFromServiceDeclaration } from "../typings/api";
|
|
2
4
|
import { FiltersMapper, OnFiltersClickProps } from "./types";
|
|
3
|
-
type
|
|
4
|
-
columns:
|
|
5
|
+
type TableProps<T extends object> = {
|
|
6
|
+
columns: Array<Column<T>>;
|
|
5
7
|
searchPlaceholder?: string;
|
|
6
|
-
loadedData?:
|
|
8
|
+
loadedData?: T[];
|
|
7
9
|
tagsBuilder?: (props: FiltersMapper) => JSX.Element | null;
|
|
8
|
-
promise?: any
|
|
9
|
-
|
|
10
|
+
promise?: MakeServiceFromServiceDeclaration<ApiMethodDeclaration<any, {
|
|
11
|
+
items: T[];
|
|
12
|
+
meta: any;
|
|
13
|
+
}>>;
|
|
14
|
+
onCreateClick?: (refech: () => void) => void;
|
|
10
15
|
onFiltersClick?: (props: OnFiltersClickProps) => void;
|
|
11
|
-
onRowClick?: (params:
|
|
12
|
-
recordId: string;
|
|
13
|
-
}) => void;
|
|
16
|
+
onRowClick?: (params: T, refech: () => void) => void;
|
|
14
17
|
onDownloadClick?: () => void;
|
|
15
18
|
language: 'de' | 'ru' | 'en';
|
|
16
19
|
};
|
|
17
|
-
declare
|
|
18
|
-
export {
|
|
20
|
+
declare function Table<T extends object>({ columns, searchPlaceholder, loadedData, tagsBuilder, promise, onRowClick, onCreateClick, onFiltersClick, onDownloadClick, language, }: TableProps<T>): JSX.Element;
|
|
21
|
+
export { TableProps, Table };
|
package/dist/table/table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../tslib.es6-
|
|
1
|
+
import{a as e}from"../tslib.es6-e799146e.js";import o,{useState as t,useEffect as r}from"react";import{useTable as a}from"react-table";import{Cells as n}from"./components/cells/index.js";import{Pagination as i}from"./components/pagination/index.js";import{Rows as s}from"./components/rows/index.js";import{TableHeader as m}from"./components/table-header/index.js";import{useTableData as l}from"./hooks/use-table-data.js";import{addQueryParam as p}from"./utils/add-query-param.js";import{getTags as c}from"./utils/get-tags.js";import{removeQueryParam as d}from"./utils/remove-query-param.js";import{resetQueryParam as u}from"./utils/reset-query-param.js";import"../parse-query-params-f52e36cf.js";import{serializeData as g}from"./utils/serialize-data.js";import"alpha-cli-icons";import"classnames";import"../typography/component.js";import"../typography/title/index.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";import"./components/row/component.js";import"../button/component.js";import"react-merge-refs";import"../hooks/useFocus/index.js";import"../loader/component.js";import"./languages/index.js";import"./components/empty-list/index.js";import"./components/error/index.js";import"./components/loading/index.js";import"rooks";import"../header-search/component.js";import"./utils/get-query-from-url.js";import"./utils/set-query-to-url.js";import"../_commonjsHelpers-598fc4da.js";import"./utils/sort-array.js";import"./utils/is-object.js";var j="index-module_table_wrapper__SeB5n",f="index-module_table__9sbda";function h(h){var y=h.columns,b=h.searchPlaceholder,x=void 0===b?"Поиск по таблице":b,w=h.loadedData,C=h.tagsBuilder,k=h.promise,v=h.onRowClick,P=h.onCreateClick,E=h.onFiltersClick,_=h.onDownloadClick,q=h.language,B=l(k),D=B.loading,T=B.error,F=B.asyncData,R=B.total,G=B.params,N=B.pagesCount,S=B.fetch,z=t([]),H=z[0],V=z[1],A=v?function(e){return v(e,S)}:void 0,I=P?function(){return P(S)}:void 0;r((function(){V([]),setTimeout((function(){V(w?g(w,G):F)}))}),[F,w,G]);var J=function(){return E?E({submitCallback:function(e){return u(e),void S()},initialValues:G}):null},K=function(e){p(e),S()},L=c({params:(null==G?void 0:G.where)||{},onDelete:function(e,o){d(e,o),S()},tagsBuilder:C,onClick:J}),M=a({columns:y,data:H}),O=M.getTableProps,Q=M.getTableBodyProps,U=M.headerGroups,W=M.rows,X=M.prepareRow;return o.createElement("div",{className:j},o.createElement(m,{language:q,searchText:(null==G?void 0:G.searchText)||"",addParam:K,searchPlaceholder:x,tags:L,onCreateClick:I,onDownloadClick:_,onFiltersClick:J,showFiltersButton:!!E}),o.createElement("div",{className:f},o.createElement("table",e({},O(),{cellSpacing:"0",cellPadding:"0",style:{width:"100%"}}),o.createElement("thead",null,o.createElement(n,{addParam:K,headerGroups:U,params:G})),o.createElement("tbody",e({},Q()),o.createElement(s,{language:q,refetch:S,prepareRow:X,onRowClick:A,rows:W,error:T,loading:D})))),!w&&o.createElement(i,{language:q,currentPage:G?+G.page:1,recordsPerPage:G?+G.limit:10,pagesCount:+N,addParam:K,total:+R}))}export{h as Table};
|
package/dist/table/types.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Header: any;
|
|
3
|
-
accessor: string;
|
|
4
|
-
Cell: (params: any) => Element;
|
|
5
|
-
};
|
|
1
|
+
import { Column } from 'react-table';
|
|
6
2
|
type QueryDTO = {
|
|
7
3
|
page: number;
|
|
8
4
|
limit: number;
|
|
@@ -13,6 +9,9 @@ type QueryDTO = {
|
|
|
13
9
|
[key: string]: any;
|
|
14
10
|
};
|
|
15
11
|
};
|
|
12
|
+
type TableColumn<T extends object> = Column<T> & {
|
|
13
|
+
enableSort?: boolean;
|
|
14
|
+
};
|
|
16
15
|
type Query = {
|
|
17
16
|
[x: string]: any;
|
|
18
17
|
};
|
|
@@ -34,4 +33,4 @@ type OnFiltersClickProps = {
|
|
|
34
33
|
}) => void;
|
|
35
34
|
initialValues?: QueryDTO;
|
|
36
35
|
};
|
|
37
|
-
export {
|
|
36
|
+
export { QueryDTO, TableColumn, Query, Tag, FiltersMapper, OnFiltersClickProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"../../tslib.es6-
|
|
1
|
+
import{a as r}from"../../tslib.es6-e799146e.js";import{p as s,q as o}from"../../parse-query-params-f52e36cf.js";import{setQueryToUrl as e}from"./set-query-to-url.js";import"../../_commonjsHelpers-598fc4da.js";function m(m){var a=s();e(o(r(r({},a),m)))}export{m as addQueryParam};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as r}from"../../tslib.es6-
|
|
1
|
+
import{_ as r}from"../../tslib.es6-e799146e.js";import{p as e}from"../../parse-query-params-f52e36cf.js";import"../../_commonjsHelpers-598fc4da.js";function t(){var t=e(),s=t.limit,o=t.page,a=t.searchText,i=t.sort,m=t.order,p={where:r(t,["limit","page","searchText","sort","order"]),limit:Number(s)||10,page:Number(o)||1};return"ASC"!==m&&"DESC"!==m||(p.order=m),"string"==typeof a&&(p.searchText=a),"string"==typeof i&&(p.sort=i),p}export{t as getQueryFromUrl};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./add-query-param";
|
|
2
2
|
export * from "./get-query-from-url";
|
|
3
3
|
export * from "./get-tags";
|
|
4
|
-
export * from "../../parse-query-params-
|
|
4
|
+
export * from "../../parse-query-params-f52e36cf";
|
|
5
5
|
export * from "./remove-query-param";
|
|
6
6
|
export * from "./reset-query-param";
|
|
7
7
|
export * from "./set-query-to-url";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{addQueryParam}from"./add-query-param.js";export{getQueryFromUrl}from"./get-query-from-url.js";export{getTags}from"./get-tags.js";export{p as parseQueryParams}from"../../parse-query-params-
|
|
1
|
+
export{addQueryParam}from"./add-query-param.js";export{getQueryFromUrl}from"./get-query-from-url.js";export{getTags}from"./get-tags.js";export{p as parseQueryParams}from"../../parse-query-params-f52e36cf.js";export{removeQueryParam}from"./remove-query-param.js";export{resetQueryParam}from"./reset-query-param.js";export{setQueryToUrl}from"./set-query-to-url.js";export{serializeData}from"./serialize-data.js";import"../../tslib.es6-e799146e.js";import"../../_commonjsHelpers-598fc4da.js";import"./sort-array.js";import"./is-object.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{p as parseQueryParams}from"../../parse-query-params-
|
|
1
|
+
export{p as parseQueryParams}from"../../parse-query-params-f52e36cf.js";import"../../_commonjsHelpers-598fc4da.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"../../tslib.es6-
|
|
1
|
+
import{a as r}from"../../tslib.es6-e799146e.js";var e={dev:{limit:"_limit",page:"_page",sort:"_sort",order:"_order",searchText:"q"},prod:{limit:"limit",page:"page",sort:"sort",order:"order",searchText:"searchText"}};function t(t,o){return Object.entries(t).reduce((function(t,i){var s,a=i[0],c=i[1],d=e[o][a]||a;return r(((s={})[d]=c,s),t)}),{})}export{t as queryAdapter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r,q as e}from"../../parse-query-params-
|
|
1
|
+
import{p as r,q as e}from"../../parse-query-params-f52e36cf.js";import{setQueryToUrl as o}from"./set-query-to-url.js";import"../../_commonjsHelpers-598fc4da.js";function s(s,t){var a=r();Array.isArray(a[s])&&t?a[s]=a[s].filter((function(r){return r!==t})):delete a[s],o(e(a))}export{s as removeQueryParam};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"../../tslib.es6-
|
|
1
|
+
import{a as r}from"../../tslib.es6-e799146e.js";import{p as e,q as t}from"../../parse-query-params-f52e36cf.js";import{setQueryToUrl as s}from"./set-query-to-url.js";import"../../_commonjsHelpers-598fc4da.js";function o(o){var a=Object.fromEntries(Object.entries(o).filter((function(r){return""!==r[1]}))),i=e(),m=i.searchText,f=i.order,p=i.sort;s(t(r({limit:10,page:1,searchText:m,order:f,sort:p},a)))}export{o as resetQueryParam};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { QueryDTO } from "../types";
|
|
2
|
+
declare function serializeData<T>(data: T[], query: QueryDTO | undefined): T[];
|
|
2
3
|
export { serializeData };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sortArray as r}from"./sort-array.js";import"./is-object.js";function t(t
|
|
1
|
+
import{sortArray as r}from"./sort-array.js";import"./is-object.js";function e(e,t){if(!t)return e;var o=e;return t.order&&(o=r(e,t.order,t.sort)),t.searchText&&(o=o.filter((function(r){return JSON.stringify(r).toUpperCase().includes((t.searchText||"").toUpperCase())}))),o}export{e as serializeData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject as r}from"./is-object.js";function t(t,o,n){var
|
|
1
|
+
import{isObject as r}from"./is-object.js";function t(t,o,n){var e=r(t[0])&&!!n;return t.sort((function(r,t){var i=e?r[n]:r,u=e?t[n]:r;return("ASC"===o?i<u:u<i)?1:-1}))}export{t as sortArray};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{CloseMarkM as t,CheckmarkRoudedM as o,ClockRoundM as r,AlertCircleM as m}from"alpha-cli-icons";import n from"classnames";import{Typography as a}from"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-
|
|
1
|
+
import e from"react";import{CloseMarkM as t,CheckmarkRoudedM as o,ClockRoundM as r,AlertCircleM as m}from"alpha-cli-icons";import n from"classnames";import{Typography as a}from"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-e799146e.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";var i="index-module_icon__xCdQr",l="index-module_text__0SHQw",p={negative:e.createElement(t,null),positive:e.createElement(o,null),secondary:e.createElement(r,null),accent:e.createElement(t,null),attention:e.createElement(m,null)},c=function(t){var o=t.text,r=t.view,m=void 0===r?"secondary":r,c=t.className;return e.createElement(a.Text,{className:n(l,c),tag:"div",view:"caps",weight:"medium",color:m},e.createElement("span",{className:i},p[m])," ",o)};export{c as TableStatus};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{TableStatus}from"./component.js";import"react";import"alpha-cli-icons";import"classnames";import"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-
|
|
1
|
+
export{TableStatus}from"./component.js";import"react";import"alpha-cli-icons";import"classnames";import"../typography/component.js";import"../typography/title/index.js";import"../tslib.es6-e799146e.js";import"../typography/title/component.js";import"../colors.module-3b4fd590.js";import"../common.module-1f20b0cc.js";import"../typography/text/component.js";import"../typography/title-responsive/component.js";
|