lkt-vue-kernel 1.0.36 → 1.0.37
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.d.ts +23 -9
- package/dist/index.js +1 -1
- package/package.json +3 -5
package/dist/index.d.ts
CHANGED
|
@@ -861,7 +861,8 @@ declare enum TableType {
|
|
|
861
861
|
Table = "table",
|
|
862
862
|
Item = "item",
|
|
863
863
|
Ul = "ul",
|
|
864
|
-
Ol = "ol"
|
|
864
|
+
Ol = "ol",
|
|
865
|
+
Carousel = "carousel"
|
|
865
866
|
}
|
|
866
867
|
|
|
867
868
|
declare class Column extends LktItem implements ColumnConfig {
|
|
@@ -926,6 +927,18 @@ type ValidDragConfig = DragConfig | undefined;
|
|
|
926
927
|
|
|
927
928
|
type ValidPaginatorConfig = PaginatorConfig | undefined;
|
|
928
929
|
|
|
930
|
+
interface CarouselConfig {
|
|
931
|
+
itemsToShow?: number;
|
|
932
|
+
itemsToScroll?: number;
|
|
933
|
+
autoplay?: number;
|
|
934
|
+
infinite?: boolean;
|
|
935
|
+
mouseDrag?: boolean;
|
|
936
|
+
touchDrag?: boolean;
|
|
937
|
+
pauseAutoplayOnHover?: boolean;
|
|
938
|
+
dir?: 'ltr' | 'rtl';
|
|
939
|
+
snapAlign?: 'start' | 'end' | 'center' | 'center-odd' | 'center-even';
|
|
940
|
+
}
|
|
941
|
+
|
|
929
942
|
interface TableConfig {
|
|
930
943
|
modelValue: LktObject[];
|
|
931
944
|
type?: TableType;
|
|
@@ -934,6 +947,7 @@ interface TableConfig {
|
|
|
934
947
|
hideEmptyColumns?: boolean;
|
|
935
948
|
itemDisplayChecker?: Function;
|
|
936
949
|
rowDisplayType?: ValidTableRowTypeValue;
|
|
950
|
+
slotItemVar?: string;
|
|
937
951
|
loading?: boolean;
|
|
938
952
|
page?: number;
|
|
939
953
|
perms?: ValidTablePermission[];
|
|
@@ -944,6 +958,7 @@ interface TableConfig {
|
|
|
944
958
|
initialSorting?: boolean;
|
|
945
959
|
drag?: ValidDragConfig;
|
|
946
960
|
paginator?: ValidPaginatorConfig;
|
|
961
|
+
carousel?: CarouselConfig;
|
|
947
962
|
header?: HeaderConfig;
|
|
948
963
|
title?: string;
|
|
949
964
|
titleTag?: string;
|
|
@@ -955,14 +970,13 @@ interface TableConfig {
|
|
|
955
970
|
dropButton?: ButtonConfig;
|
|
956
971
|
editButton?: ButtonConfig;
|
|
957
972
|
hiddenSave?: boolean;
|
|
973
|
+
requiredItemsForTopCreate?: number;
|
|
974
|
+
requiredItemsForBottomCreate?: number;
|
|
975
|
+
addNavigation?: boolean;
|
|
976
|
+
newValueGenerator?: Function;
|
|
958
977
|
wrapContentTag?: string;
|
|
959
978
|
wrapContentClass?: string;
|
|
960
979
|
itemsContainerClass?: string;
|
|
961
|
-
addNavigation?: boolean;
|
|
962
|
-
newValueGenerator?: Function;
|
|
963
|
-
requiredItemsForTopCreate?: number;
|
|
964
|
-
requiredItemsForBottomCreate?: number;
|
|
965
|
-
slotItemVar?: string;
|
|
966
980
|
createEnabledValidator?: Function;
|
|
967
981
|
}
|
|
968
982
|
|
|
@@ -1222,9 +1236,7 @@ declare class Table extends LktItem implements TableConfig {
|
|
|
1222
1236
|
modelValue: LktObject[];
|
|
1223
1237
|
type?: TableType;
|
|
1224
1238
|
columns: Column[];
|
|
1225
|
-
resource?: string;
|
|
1226
1239
|
noResultsText?: string;
|
|
1227
|
-
filters?: LktObject[];
|
|
1228
1240
|
hideEmptyColumns?: boolean;
|
|
1229
1241
|
itemDisplayChecker?: Function;
|
|
1230
1242
|
rowDisplayType?: ValidTableRowTypeValue;
|
|
@@ -1238,6 +1250,7 @@ declare class Table extends LktItem implements TableConfig {
|
|
|
1238
1250
|
initialSorting?: boolean;
|
|
1239
1251
|
drag?: ValidDragConfig;
|
|
1240
1252
|
paginator?: ValidPaginatorConfig;
|
|
1253
|
+
carousel?: CarouselConfig;
|
|
1241
1254
|
header?: HeaderConfig;
|
|
1242
1255
|
title?: string;
|
|
1243
1256
|
titleTag?: string;
|
|
@@ -1333,6 +1346,7 @@ type ValidScanPropTarget = ScanPropTarget | ((...args: any[]) => ScanPropTarget)
|
|
|
1333
1346
|
|
|
1334
1347
|
declare const extractPropValue: (needle: ValidScanPropTarget, haystack: LktObject) => ValidScanPropTarget;
|
|
1335
1348
|
declare const extractI18nValue: (needle: ValidTextValue) => any;
|
|
1349
|
+
declare const prepareResourceData: (resourceData: LktObject | undefined, haystack: LktObject) => LktObject;
|
|
1336
1350
|
|
|
1337
1351
|
declare const ensureButtonConfig: (buttonConfig: Partial<ButtonConfig> | undefined, settingsConfig: Partial<ButtonConfig>) => Partial<ButtonConfig>;
|
|
1338
1352
|
|
|
@@ -1349,4 +1363,4 @@ declare function getDefaultValues<T>(cls: {
|
|
|
1349
1363
|
lktDefaultValues: (keyof T)[];
|
|
1350
1364
|
}): Partial<T>;
|
|
1351
1365
|
|
|
1352
|
-
export { Accordion, type AccordionConfig, AccordionToggleMode, AccordionType, Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, type EventsConfig, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, FieldValidation, type FieldValidationConfig, Icon, type IconConfig, IconType, Image, type ImageConfig, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktItem, type LktObject, LktSettings, LktStrictItem, Menu, type MenuConfig, MenuEntry, type MenuEntryConfig, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, NotificationType, Option, type OptionConfig, Paginator, type PaginatorConfig, PaginatorType, Progress, type ProgressConfig, ProgressType, ProgressValueFormat, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, Tabs, type TabsConfig, Tag, type TagConfig, TagType, Toast, type ToastConfig, ToastPositionX, ToastType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidButtonDot, type ValidColSpan, type ValidCustomSlot, type ValidDragConfig, type ValidFieldMinMax, type ValidFieldValue, type ValidIsDisabledValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidPaginatorConfig, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, type ValidTextValue, ValidationCode, ValidationStatus, booleanFieldTypes, createColumn, ensureButtonConfig, extractI18nValue, extractPropValue, fieldTypesWithOptions, fieldTypesWithoutClear, fieldTypesWithoutUndo, fieldsWithMultipleMode, getDefaultValues, lktDebug, textFieldTypes, textFieldTypesWithOptions };
|
|
1366
|
+
export { Accordion, type AccordionConfig, AccordionToggleMode, AccordionType, Anchor, type AnchorConfig, AnchorType, type BeforeCloseModalData, Button, type ButtonConfig, ButtonType, Column, type ColumnConfig, ColumnType, type DragConfig, type EmptyModalKey, type EventsConfig, Field, FieldAutoValidationTrigger, type FieldConfig, FieldType, FieldValidation, type FieldValidationConfig, Icon, type IconConfig, IconType, Image, type ImageConfig, type IsDisabledChecker, type IsDisabledCheckerArgs, ItemCrud, ItemCrudButtonNavPosition, ItemCrudButtonNavVisibility, type ItemCrudConfig, ItemCrudMode, ItemCrudView, LktItem, type LktObject, LktSettings, LktStrictItem, Menu, type MenuConfig, MenuEntry, type MenuEntryConfig, Modal, ModalCallbackAction, type ModalCallbackConfig, type ModalConfig, ModalType, MultipleOptionsDisplay, NotificationType, Option, type OptionConfig, Paginator, type PaginatorConfig, PaginatorType, Progress, type ProgressConfig, ProgressType, ProgressValueFormat, SafeString, type SaveConfig, SaveType, type ScanPropTarget, SortDirection, Table, type TableConfig, TablePermission, TableRowType, TableType, Tabs, type TabsConfig, Tag, type TagConfig, TagType, Toast, type ToastConfig, ToastPositionX, ToastType, ToggleMode, Tooltip, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidBeforeCloseModal, type ValidButtonDot, type ValidColSpan, type ValidCustomSlot, type ValidDragConfig, type ValidFieldMinMax, type ValidFieldValue, type ValidIsDisabledValue, type ValidModalKey, type ValidModalName, type ValidOptionValue, type ValidPaginatorConfig, type ValidSafeStringValue, type ValidScanPropTarget, type ValidTabIndex, type ValidTablePermission, type ValidTableRowTypeValue, type ValidTextValue, ValidationCode, ValidationStatus, booleanFieldTypes, createColumn, ensureButtonConfig, extractI18nValue, extractPropValue, fieldTypesWithOptions, fieldTypesWithoutClear, fieldTypesWithoutUndo, fieldsWithMultipleMode, getDefaultValues, lktDebug, prepareResourceData, textFieldTypes, textFieldTypesWithOptions };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=(u=>(u.Button="button",u.Submit="submit",u.Reset="reset",u.Anchor="anchor",u.Content="content",u.Switch="switch",u.HiddenSwitch="hidden-switch",u.Split="split",u.SplitLazy="split-lazy",u.SplitEver="split-ever",u.Tooltip="tooltip",u.TooltipLazy="tooltip-lazy",u.TooltipEver="tooltip-ever",u))(N||{});var f=(e,t)=>typeof e>"u"?t:{...t,...e};var c=class e{static debugEnabled=!1;static debugMode(t=!0){return e.debugEnabled=t,e}static defaultCreateErrorText="Creation failed";static defaultCreateErrorDetails="An error occurred while creating the item. Please try again.";static defaultCreateErrorIcon="";static setDefaultCreateError(t){e.defaultCreateErrorText=t.text??e.defaultCreateErrorText,e.defaultCreateErrorDetails=t.details??e.defaultCreateErrorDetails,e.defaultCreateErrorIcon=t.icon??e.defaultCreateErrorIcon}static defaultUpdateErrorText="Update failed";static defaultUpdateErrorDetails="An error occurred while updating the item. Please try again.";static defaultUpdateErrorIcon="";static setDefaultUpdateError(t){e.defaultUpdateErrorText=t.text??e.defaultUpdateErrorText,e.defaultUpdateErrorDetails=t.details??e.defaultUpdateErrorDetails,e.defaultUpdateErrorIcon=t.icon??e.defaultUpdateErrorIcon}static defaultDropErrorText="Drop failed";static defaultDropErrorDetails="An error occurred while removing the item. Please try again.";static defaultDropErrorIcon="";static setDefaultDropError(t){e.defaultDropErrorText=t.text??e.defaultDropErrorText,e.defaultDropErrorDetails=t.details??e.defaultDropErrorDetails,e.defaultDropErrorIcon=t.icon??e.defaultDropErrorIcon}static defaultCreateSuccessText="Item created";static defaultCreateSuccessDetails="";static defaultCreateSuccessIcon="";static setDefaultCreateSuccess(t){e.defaultCreateSuccessText=t.text??e.defaultCreateSuccessText,e.defaultCreateSuccessDetails=t.details??e.defaultCreateSuccessDetails,e.defaultCreateSuccessIcon=t.icon??e.defaultCreateSuccessIcon}static defaultUpdateSuccessText="Item updated";static defaultUpdateSuccessDetails="";static defaultUpdateSuccessIcon="";static setDefaultUpdateSuccess(t){e.defaultUpdateSuccessText=t.text??e.defaultUpdateSuccessText,e.defaultUpdateSuccessDetails=t.details??e.defaultUpdateSuccessDetails,e.defaultUpdateSuccessIcon=t.icon??e.defaultUpdateSuccessIcon}static defaultDropSuccessText="Item removed";static defaultDropSuccessDetails="";static defaultDropSuccessIcon="";static setDefaultDropSuccess(t){e.defaultDropSuccessText=t.text??e.defaultDropSuccessText,e.defaultDropSuccessDetails=t.details??e.defaultDropSuccessDetails,e.defaultDropSuccessIcon=t.icon??e.defaultDropSuccessIcon}static defaultSaveButton={text:"Save"};static setDefaultSaveButton(t,o=!0){return o?e.defaultSaveButton=t:e.defaultSaveButton=f(t,e.defaultSaveButton),e}static defaultConfirmButton={text:"Confirm"};static setDefaultConfirmButton(t,o=!0){return o?e.defaultConfirmButton=t:e.defaultConfirmButton=f(t,e.defaultConfirmButton),e}static defaultCancelButton={text:"Cancel"};static setDefaultCancelButton(t,o=!0){return o?e.defaultCancelButton=t:e.defaultCancelButton=f(t,e.defaultCancelButton),e}static defaultCreateButton={text:"Create"};static setDefaultCreateButton(t,o=!0){return o?e.defaultCreateButton=t:e.defaultCreateButton=f(t,e.defaultCreateButton),e}static defaultUpdateButton={text:"Update"};static setDefaultUpdateButton(t,o=!0){return o?e.defaultUpdateButton=t:e.defaultUpdateButton=f(t,e.defaultUpdateButton),e}static defaultDropButton={text:"Drop"};static setDefaultDropButton(t,o=!0){return o?e.defaultDropButton=t:e.defaultDropButton=f(t,e.defaultDropButton),e}static defaultEditModeButton={text:"Edit mode",type:"switch"};static setDefaultEditModeButton(t,o=!0){return o?e.defaultEditModeButton=t:e.defaultEditModeButton=f(t,e.defaultEditModeButton),e}static defaultToggleButton={text:"Toggle",textOn:"Close",textOff:"Show more",type:"hidden-switch"};static setDefaultToggleButton(t,o=!0){return o?e.defaultToggleButton=t:e.defaultToggleButton=f(t,e.defaultToggleButton),e}static defaultLoadMoreButton={text:"Load more",type:"hidden-switch"};static setDefaultLoadMoreButton(t,o=!0){return o?e.defaultLoadMoreButton=t:e.defaultLoadMoreButton=f(t,e.defaultLoadMoreButton),e}static defaultCloseModalIcon="lkt-icn-cancel";static setDefaultCloseModalIcon(t){return e.defaultCloseModalIcon=t,e}static defaultCloseToastIcon="lkt-icn-cancel";static setDefaultCloseToastIcon(t){return e.defaultCloseToastIcon=t,e}static defaultTableSortAscIcon="lkt-icn-arrow-bottom";static defaultTableSortDescIcon="lkt-icn-arrow-top";static setDefaultTableSortAscIcon(t){return e.defaultTableSortAscIcon=t,e}static setDefaultTableSortDescIcon(t){return e.defaultTableSortDescIcon=t,e}static defaultPaginatorFirstButton={text:"",icon:"lkt-icn-angle-double-left"};static defaultPaginatorPrevButton={text:"",icon:"lkt-icn-angle-left"};static defaultPaginatorNextButton={text:"",iconEnd:"lkt-icn-angle-right"};static defaultPaginatorLastButton={text:"",iconEnd:"lkt-icn-angle-double-right"};static setDefaultPaginatorFirstButton(t,o=!0){return o?e.defaultPaginatorFirstButton=t:e.defaultPaginatorFirstButton=f(t,e.defaultPaginatorFirstButton),e}static setDefaultPaginatorPrevButton(t,o=!0){return o?e.defaultPaginatorPrevButton=t:e.defaultPaginatorPrevButton=f(t,e.defaultPaginatorPrevButton),e}static setDefaultPaginatorNextButton(t,o=!0){return o?e.defaultPaginatorNextButton=t:e.defaultPaginatorNextButton=f(t,e.defaultPaginatorNextButton),e}static setDefaultPaginatorLastButton(t,o=!0){return o?e.defaultPaginatorLastButton=t:e.defaultPaginatorLastButton=f(t,e.defaultPaginatorLastButton),e}};var U=(i=>(i.Text="text",i.Email="email",i.Tel="tel",i.Password="password",i.Search="search",i.Number="number",i.Color="color",i.Range="range",i.Textarea="textarea",i.Html="html",i.Date="date",i.File="file",i.Image="image",i.Select="select",i.Check="check",i.Switch="switch",i.Calc="calc",i.Card="card",i.Elements="elements",i))(U||{});var xt=["text","search","select"],Ct=["switch","check"],bt=["switch","check"],ht=["text","search"],Vt=["switch","check"],Mt=["select","color","card"],kt=["text","email","password"];var Bt=["lktDateProps","lktStrictItem","lktExcludedProps"],r=class e{static lktAllowUndefinedProps=[];static lktExcludedProps=[];static lktDateProps=[];static lktStrictItem=!1;static lktDefaultValues=[];constructor(t){}feed(t={},o=this){if(typeof t=="object")for(let[n,a]of Object.entries(t))o.assignProp(n,a)}assignProp(t,o){if(!(Bt.includes(t)||e.lktExcludedProps.includes(t))&&!(e.lktStrictItem&&!this.hasOwnProperty(t))){if(e.lktDateProps.includes(t)){this[t]=new Date(o);return}this[t]=o}}};var M=class extends r{lktStrictItem=!0};var j=(a=>(a.Auto="auto",a.Always="always",a.Lazy="lazy",a.Ever="ever",a))(j||{});var K=(n=>(n.Transform="transform",n.Height="height",n.Display="display",n))(K||{});var k=class extends r{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["modelValue","type","toggleMode","actionButton","toggleButton","toggleOnClickIntro","toggleTimeout","title","icon","class","contentClass","iconRotation","minHeight","iconAtEnd","toggleIconAtEnd"];modelValue=!1;type="auto";toggleMode="height";actionButton={};toggleButton={};toggleOnClickIntro=!1;toggleTimeout=0;title="";icon="";class="";contentClass="";iconRotation="90";minHeight=void 0;iconAtEnd=!1;toggleIconAtEnd=!1;constructor(t={}){super(),this.feed(t)}};var R=(m=>(m.Href="href",m.RouterLink="router-link",m.RouterLinkBack="router-link-back",m.Mail="mail",m.Tel="tel",m.Tab="tab",m.Download="download",m.Action="action",m.Legacy="",m))(R||{});var p=class extends r{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","to","class","isActive","downloadFileName","disabled","onClick","confirmModal","confirmModalKey","confirmData","imposter","external","events"];type="router-link";to="";class="";isActive=!1;downloadFileName="";disabled=!1;onClick=void 0;confirmModal="";confirmModalKey="_";confirmData={};imposter=!1;external=!1;events={};getHref(){let t="";return typeof this.to=="string"&&(t=this.to),"mail"===this.type?`mailto:${t}`:"tel"===this.type?`tel:${t}`:["href","mail","tel","tab","download"].includes(this.type)?t:typeof this.to=="string"&&this.to!==""?this.to:""}constructor(t={}){super(),this.feed(t)}};import{generateRandomString as Dt}from"lkt-string-tools";var x=class extends r{lktAllowUndefinedProps=["clickRef","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave"];static lktDefaultValues=["type","name","class","containerClass","value","disabled","loading","wrapContent","splitIcon","resource","resourceData","modal","modalKey","modalData","confirmModal","confirmModalKey","confirmData","modalCallbacks","text","textOn","textOff","icon","iconOn","iconOff","iconEndOn","iconEndOff","dot","iconEnd","img","showTooltipOnHoverDelay","tooltip","checked","clickRef","openTooltip","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave","splitClass","prop","events"];type="button";name=Dt(10);class="";containerClass="";value="";disabled=!1;loading=!1;wrapContent=!1;splitIcon="";resource="";resourceData={};modal="";modalKey="_";modalData={};confirmModal="";confirmModalKey="_";confirmData={};modalCallbacks=[];text="";textOn=void 0;textOff=void 0;iconOn=void 0;iconOff=void 0;iconEndOn=void 0;iconEndOff=void 0;icon="";dot=!1;iconEnd="";img="";showTooltipOnHoverDelay=0;checked=!1;clickRef=void 0;openTooltip=!1;tabindex=void 0;anchor=void 0;showTooltipOnHover=void 0;hideTooltipOnLeave=void 0;splitClass="";tooltip={};prop={};events={};constructor(t={}){super(),this.feed(t),this.anchor=new p(t.anchor)}isDisabled(){return typeof this.disabled=="function"?this.disabled():this.disabled}};var H=(a=>(a.None="",a.Field="field",a.Button="button",a.Anchor="anchor",a))(H||{});import{generateRandomString as St}from"lkt-string-tools";var z=(n=>(n.List="list",n.Inline="inline",n.Count="count",n))(z||{});var W=(a=>(a.None="",a.Focus="focus",a.Blur="blur",a.Always="always",a))(W||{});var C=class extends r{modelValue="";type="text";valid=void 0;placeholder="";searchPlaceholder="";label="";labelIcon="";labelIconAtEnd=!1;name=St(16);autocomplete=!1;disabled=!1;readonly=!1;readMode=!1;allowReadModeSwitch=!1;tabindex=void 0;mandatory=!1;showPassword=!1;canClear=!1;canUndo=!1;canI18n=!1;canStep=!0;canTag=!0;mandatoryMessage="";infoMessage="";errorMessage="";min=void 0;max=void 0;step=1;enableAutoNumberFix=!0;emptyValueSlot="";optionSlot=void 0;valueSlot=void 0;editSlot=void 0;slotData={};resource="";resourceData={};validationResource="";validationResourceData={};autoValidation=!1;autoValidationType="blur";validationStack="default";minNumbers=void 0;maxNumbers=void 0;minChars=void 0;maxChars=void 0;minUpperChars=void 0;maxUpperChars=void 0;minLowerChars=void 0;maxLowerChars=void 0;minSpecialChars=void 0;maxSpecialChars=void 0;checkEqualTo=void 0;featuredButton="";infoButtonEllipsis=!1;fileName="";customButtonText="";customButtonClass="";options=[];multiple=!1;multipleDisplay="list";multipleDisplayEdition="inline";searchable=!1;autoloadOptionsResource=!1;optionsDownload="";optionsModal="";optionsModalData={};optionsText="";optionsIcon="";optionsClass="";optionsLabelFormatter=void 0;optionsResource="";optionsResourceData={};icon="";download="";modal="";modalKey="";modalData={};data={};validation={};constructor(t={}){super(),this.feed(t)}};var b=class e{value;constructor(t){this.value=t}getValue(...t){return typeof this.value=="function"?this.value(...t):typeof this.value=="object"&&typeof this.value==typeof e?this.value.getValue(...t):typeof this.value=="string"?this.value:""}};var h=class extends r{lktExcludedProps=["link","field","anchor","button"];lktAllowUndefinedProps=["formatter","checkEmpty","colspan","field","anchor","button","link","action"];static lktDefaultValues=["type","key","label","sortable","hidden","editable","formatter","checkEmpty","colspan","preferSlot","isForRowKey","extractTitleFromColumn","slotData","field","anchor","button","link","action"];type="";key="";label="";sortable=!0;hidden=!1;editable=!1;formatter=void 0;checkEmpty=void 0;colspan=void 0;preferSlot=!0;isForRowKey=!1;extractTitleFromColumn="";slotData={};field=void 0;anchor=void 0;button=void 0;link=void 0;action=void 0;constructor(t={}){switch(super(),this.feed(t),this.type){case"field":this.field=new C(t.field);break;case"anchor":this.anchor=new p(t.anchor);break;case"button":this.button=new x(t.button);break}this.link=new b(t.link)}getHref(t){return typeof this.link!="object"?"":this.link.getValue(t)}doAction(t){if(typeof this.action=="function")return this.action(t);console.warn("No action defined")}};var q=(s=>(s.MinStringLength="min-str",s.MinNumber="min-num",s.MaxStringLength="max-str",s.MaxNumber="max-num",s.Email="email",s.Empty="empty",s.EqualTo="equal-to",s.MinNumbers="min-numbers",s.MaxNumbers="max-numbers",s.MinChars="min-chars",s.MaxChars="max-chars",s.MinUpperChars="min-upper-chars",s.MaxUpperChars="max-upper-chars",s.MinLowerChars="min-lower-chars",s.MaxLowerChars="max-lower-chars",s.MinSpecialChars="min-special-chars",s.MaxSpecialChars="max-special-chars",s))(q||{});var $=(n=>(n.Ok="ok",n.Ko="ko",n.Info="info",n))($||{});var B=class e{code=void 0;status="info";min=0;max=0;equalToValue=void 0;constructor(t,o){this.code=t,this.status=o}setMin(t){return this.min=t,this}setMax(t){return this.max=t,this}setEqualToValue(t){return this.equalToValue=t,this}static createEmpty(t="ko"){return new e("empty",t)}static createEmail(t="ko"){return new e("email",t)}static createMinStr(t,o="ko"){return new e("min-str",o).setMin(t)}static createMaxStr(t,o="ko"){return new e("max-str",o).setMax(t)}static createMinNum(t,o="ko"){return new e("min-num",o).setMin(t)}static createMaxNum(t,o="ko"){return new e("max-num",o).setMax(t)}static createNumBetween(t,o,n="ko"){return new e("max-num",n).setMin(t).setMax(o)}static createMinNumbers(t,o="ko"){return new e("min-numbers",o).setMin(t)}static createMaxNumbers(t,o="ko"){return new e("max-numbers",o).setMax(t)}static createMinUpperChars(t,o="ko"){return new e("min-upper-chars",o).setMin(t)}static createMaxUpperChars(t,o="ko"){return new e("max-upper-chars",o).setMax(t)}static createMinLowerChars(t,o="ko"){return new e("min-lower-chars",o).setMin(t)}static createMaxLowerChars(t,o="ko"){return new e("max-lower-chars",o).setMax(t)}static createMinSpecialChars(t,o="ko"){return new e("min-special-chars",o).setMin(t)}static createMaxSpecialChars(t,o="ko"){return new e("max-special-chars",o).setMax(t)}static createMinChars(t,o="ko"){return new e("min-chars",o).setMin(t)}static createMaxChars(t,o="ko"){return new e("max-chars",o).setMax(t)}static createEqualTo(t,o="ko"){return new e("equal-to",o).setEqualToValue(t)}};var G=(o=>(o.NotDefined="",o.Button="button",o))(G||{});var D=class extends r{static lktDefaultValues=["icon","text","class","type","events"];icon="";text="";class="";type="";events={};constructor(t={}){super(),this.feed(t)}};var S=class extends r{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["src","alt","text","class","imageStyle"];src="";alt="";text="";class="";imageStyle="";constructor(t={}){super(),this.feed(t)}};var X=(n=>(n.Create="create",n.Update="update",n.Read="read",n))(X||{});var Y=(o=>(o.Inline="inline",o.Modal="modal",o))(Y||{});var J=(o=>(o.Top="top",o.Bottom="bottom",o))(J||{});var Q=(n=>(n.Changed="changed",n.Always="always",n.Never="never",n))(Q||{});var Z=(n=>(n.Manual="manual",n.Auto="auto",n.Delay="delay",n))(Z||{});var _=(o=>(o.Toast="toast",o.Inline="inline",o))(_||{});var y=class extends r{static lktDefaultValues=["modelValue","editing","mode","view","editModeButton","dropButton","createButton","updateButton","modalConfig","saveConfig","title","readResource","readData","beforeEmitUpdate","dataStateConfig","buttonNavPosition","buttonNavVisibility","notificationType"];modelValue={};editing=!1;mode="read";view="inline";editModeButton={};dropButton={};createButton={};updateButton={};modalConfig={};saveConfig={type:"manual"};title="";readResource="";readData={};beforeEmitUpdate=void 0;dataStateConfig={};buttonNavPosition="top";buttonNavVisibility="always";notificationType="toast";constructor(t={}){super(),this.feed(t)}};var V=class extends r{static lktDefaultValues=["key","href","label","icon","isActiveChecker","isOpened","isActive","parent","children","events","onClick"];key="";href="";label="";icon="";isActiveChecker=void 0;isOpened=!1;isActive=!1;parent=void 0;children;events={};onClick=void 0;constructor(t={}){super(),this.feed(t)}setChildren(t){return t.forEach(o=>o.parent=this),this.children=t,this}setOnClick(t){return this.onClick=t,this}setIsActiveChecker(t){return this.isActiveChecker=t,this}setIsActive(t=!0){return this.isActive=t,this}setLabel(t){return this.label=t,this}setIcon(t){return this.icon=t,this}doClose(){this.isOpened=!1}};var I=class extends r{static lktDefaultValues=["modelValue","resource","resourceData"];modelValue=[];resource="";resourceData={};constructor(t={}){super(),this.feed(t),this.modelValue=this.modelValue?.map(o=>new V(o))||[]}};var P=class extends r{static lktDefaultValues=["size","preTitle","preTitleIcon","title","closeIcon","closeConfirm","closeConfirmKey","showClose","disabledClose","disabledVeilClick","hiddenFooter","modalName","modalKey","zIndex","beforeClose","item"];size="";preTitle="";preTitleIcon="";title="";closeIcon=c.defaultCloseModalIcon;closeConfirm="";closeConfirmKey="_";showClose=!0;disabledClose=!1;disabledVeilClick=!1;hiddenFooter=!1;modalName="";modalKey="_";zIndex=500;beforeClose=void 0;item={};confirmButton={};cancelButton={};constructor(t={}){super(),this.feed(t)}};var T=class extends r{value=void 0;label="";data={};disabled=!1;group="";icon="";modal="";constructor(t={}){super(),this.feed(t)}};var tt=(g=>(g.Pages="pages",g.PrevNext="prev-next",g.PagesPrevNext="pages-prev-next",g.PagesPrevNextFirstLast="pages-prev-next-first-last",g.LoadMore="load-more",g.Infinite="infinite",g))(tt||{});var E=class extends r{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","modelValue","class","resource","readOnly","loading","resourceData"];type="pages-prev-next";modelValue=1;class="";resource="";readOnly=!1;loading=!1;resourceData={};constructor(t={}){super(),this.feed(t)}};var et=(n=>(n.None="",n.Incremental="incremental",n.Decremental="decremental",n))(et||{});var ot=(l=>(l.NotDefined="",l.Hidden="hidden",l.Integer="integer",l.Decimal="decimal",l.Auto="auto",l))(ot||{});var w=class extends r{static lktAllowUndefinedProps=[];static lktDefaultValues=["modelValue","type","duration","pauseOnHover","header","valueFormat","palette"];modelValue=0;type="";duration=4e3;pauseOnHover=!1;header="";valueFormat="auto";palette="";constructor(t={}){super(),this.feed(t)}};var rt=(a=>(a.Table="table",a.Item="item",a.Ul="ul",a.Ol="ol",a))(rt||{});var nt=(a=>(a[a.Auto=0]="Auto",a[a.PreferItem=1]="PreferItem",a[a.PreferCustomItem=2]="PreferCustomItem",a[a.PreferColumns=3]="PreferColumns",a))(nt||{});var L=class extends r{static lktDefaultValues=["modelValue","type","columns","noResultsText","hideEmptyColumns","itemDisplayChecker","loading","page","perms","editMode","dataStateConfig","sortable","sorter","initialSorting","drag","paginator","header","title","titleTag","titleIcon","headerClass","editModeButton","saveButton","createButton","dropButton","editButton","wrapContentTag","wrapContentClass","itemsContainerClass","hiddenSave","addNavigation","createEnabledValidator","newValueGenerator","requiredItemsForTopCreate","requiredItemsForBottomCreate","slotItemVar"];modelValue=[];type="table";columns=[];resource="";noResultsText="";filters=[];hideEmptyColumns=!1;itemDisplayChecker=void 0;rowDisplayType=0;loading=!1;page=1;perms=[];editMode=!1;dataStateConfig={};sortable=!1;sorter=void 0;initialSorting=!1;drag=void 0;paginator=void 0;header;title="";titleTag="h2";titleIcon="";headerClass="";editModeButton={};saveButton={};createButton={};dropButton={};editButton={};hiddenSave=!1;wrapContentTag="div";wrapContentClass="";itemsContainerClass="";addNavigation=!1;createEnabledValidator=void 0;newValueGenerator=void 0;requiredItemsForTopCreate=0;requiredItemsForBottomCreate=0;slotItemVar="item";constructor(t={}){super(),this.feed(t)}};var v=class extends r{static lktDefaultValues=["modelValue","id","useSession","cacheLifetime","contentPad","titles"];modelValue="";id="";useSession=!1;cacheLifetime=5;contentPad;titles;constructor(t={}){super(),this.feed(t)}};var at=(o=>(o.NotDefined="",o.ActionIcon="action-icon",o))(at||{});var O=class extends r{static lktDefaultValues=["class","text","featuredText","icon","iconAtEnd","featuredAtStart","type"];class="";text="";featuredText="";icon="";iconAtEnd=!1;featuredAtStart=!1;type="";constructor(t={}){super(),this.feed(t)}};var it=(o=>(o.Message="message",o.Button="button",o))(it||{});var lt=(n=>(n.Left="left",n.Center="center",n.Right="right",n))(lt||{});var F=class extends r{static lktDefaultValues=["type","text","details","icon","positionX","duration","buttonConfig","zIndex"];type="message";text="";details="";icon="";positionX="right";duration=void 0;buttonConfig=void 0;zIndex=1e3;constructor(t={}){super(),this.feed(t)}};var st=(o=>(o.Fixed="fixed",o.Absolute="absolute",o))(st||{});var ft=(a=>(a.Top="top",a.Bottom="bottom",a.Center="center",a.ReferrerCenter="referrer-center",a))(ft||{});var ut=(l=>(l.Left="left",l.Right="right",l.Center="center",l.LeftCorner="left-corner",l.RightCorner="right-corner",l))(ut||{});var A=class extends r{static lktDefaultValues=["modelValue","alwaysOpen","class","text","icon","iconAtEnd","engine","referrerWidth","referrerMargin","windowMargin","referrer","locationY","locationX"];modelValue=!1;alwaysOpen=!1;class="";text="";icon="";iconAtEnd=!1;engine="fixed";referrerWidth=!1;referrerMargin=0;windowMargin=0;referrer=void 0;locationY="bottom";locationX="left-corner";constructor(t={}){super(),this.feed(t)}};var dt=(l=>(l.Refresh="refresh",l.Close="close",l.ReOpen="reOpen",l.Exec="exec",l.Open="open",l))(dt||{});var mt=(o=>(o.Modal="modal",o.Confirm="confirm",o))(mt||{});var ct=(o=>(o.Asc="asc",o.Desc="desc",o))(ct||{});var pt=(d=>(d.Create="create",d.Update="update",d.Edit="edit",d.Drop="drop",d.Sort="sort",d.SwitchEditMode="switch-edit-mode",d.InlineEdit="inline-edit",d.InlineCreate="inline-create",d.ModalCreate="modal-create",d.InlineCreateEver="inline-create-ever",d))(pt||{});var gt=(o=>(o.Lazy="lazy",o.Ever="ever",o))(gt||{});import{__ as yt}from"lkt-i18n";var It=(e,t)=>typeof e=="string"&&e.startsWith("prop:")?t[e.substring(5)]:e,Pt=e=>{let t=String(e);return t.startsWith("__:")?yt(t.substring(3)):t};var Tt=(e,...t)=>{c.debugEnabled&&console.info("::lkt::",`[${e}] `,...t)};var Et=e=>new h(e);function ho(e){let t=new e,o={};if(!Array.isArray(e.lktDefaultValues))throw new Error("lktDefaultValues must be a keys array.");for(let n of e.lktDefaultValues)n in t&&(o[n]=t[n]);return o}export{k as Accordion,K as AccordionToggleMode,j as AccordionType,p as Anchor,R as AnchorType,x as Button,N as ButtonType,h as Column,H as ColumnType,C as Field,W as FieldAutoValidationTrigger,U as FieldType,B as FieldValidation,D as Icon,G as IconType,S as Image,y as ItemCrud,J as ItemCrudButtonNavPosition,Q as ItemCrudButtonNavVisibility,X as ItemCrudMode,Y as ItemCrudView,r as LktItem,c as LktSettings,M as LktStrictItem,I as Menu,V as MenuEntry,P as Modal,dt as ModalCallbackAction,mt as ModalType,z as MultipleOptionsDisplay,_ as NotificationType,T as Option,E as Paginator,tt as PaginatorType,w as Progress,et as ProgressType,ot as ProgressValueFormat,b as SafeString,Z as SaveType,ct as SortDirection,L as Table,pt as TablePermission,nt as TableRowType,rt as TableType,v as Tabs,O as Tag,at as TagType,F as Toast,lt as ToastPositionX,it as ToastType,gt as ToggleMode,A as Tooltip,ut as TooltipLocationX,ft as TooltipLocationY,st as TooltipPositionEngine,q as ValidationCode,$ as ValidationStatus,Vt as booleanFieldTypes,Et as createColumn,f as ensureButtonConfig,Pt as extractI18nValue,It as extractPropValue,xt as fieldTypesWithOptions,Ct as fieldTypesWithoutClear,bt as fieldTypesWithoutUndo,Mt as fieldsWithMultipleMode,ho as getDefaultValues,Tt as lktDebug,kt as textFieldTypes,ht as textFieldTypesWithOptions};
|
|
1
|
+
var N=(u=>(u.Button="button",u.Submit="submit",u.Reset="reset",u.Anchor="anchor",u.Content="content",u.Switch="switch",u.HiddenSwitch="hidden-switch",u.Split="split",u.SplitLazy="split-lazy",u.SplitEver="split-ever",u.Tooltip="tooltip",u.TooltipLazy="tooltip-lazy",u.TooltipEver="tooltip-ever",u))(N||{});var f=(e,t)=>typeof e>"u"?t:{...t,...e};var c=class e{static debugEnabled=!1;static debugMode(t=!0){return e.debugEnabled=t,e}static defaultCreateErrorText="Creation failed";static defaultCreateErrorDetails="An error occurred while creating the item. Please try again.";static defaultCreateErrorIcon="";static setDefaultCreateError(t){e.defaultCreateErrorText=t.text??e.defaultCreateErrorText,e.defaultCreateErrorDetails=t.details??e.defaultCreateErrorDetails,e.defaultCreateErrorIcon=t.icon??e.defaultCreateErrorIcon}static defaultUpdateErrorText="Update failed";static defaultUpdateErrorDetails="An error occurred while updating the item. Please try again.";static defaultUpdateErrorIcon="";static setDefaultUpdateError(t){e.defaultUpdateErrorText=t.text??e.defaultUpdateErrorText,e.defaultUpdateErrorDetails=t.details??e.defaultUpdateErrorDetails,e.defaultUpdateErrorIcon=t.icon??e.defaultUpdateErrorIcon}static defaultDropErrorText="Drop failed";static defaultDropErrorDetails="An error occurred while removing the item. Please try again.";static defaultDropErrorIcon="";static setDefaultDropError(t){e.defaultDropErrorText=t.text??e.defaultDropErrorText,e.defaultDropErrorDetails=t.details??e.defaultDropErrorDetails,e.defaultDropErrorIcon=t.icon??e.defaultDropErrorIcon}static defaultCreateSuccessText="Item created";static defaultCreateSuccessDetails="";static defaultCreateSuccessIcon="";static setDefaultCreateSuccess(t){e.defaultCreateSuccessText=t.text??e.defaultCreateSuccessText,e.defaultCreateSuccessDetails=t.details??e.defaultCreateSuccessDetails,e.defaultCreateSuccessIcon=t.icon??e.defaultCreateSuccessIcon}static defaultUpdateSuccessText="Item updated";static defaultUpdateSuccessDetails="";static defaultUpdateSuccessIcon="";static setDefaultUpdateSuccess(t){e.defaultUpdateSuccessText=t.text??e.defaultUpdateSuccessText,e.defaultUpdateSuccessDetails=t.details??e.defaultUpdateSuccessDetails,e.defaultUpdateSuccessIcon=t.icon??e.defaultUpdateSuccessIcon}static defaultDropSuccessText="Item removed";static defaultDropSuccessDetails="";static defaultDropSuccessIcon="";static setDefaultDropSuccess(t){e.defaultDropSuccessText=t.text??e.defaultDropSuccessText,e.defaultDropSuccessDetails=t.details??e.defaultDropSuccessDetails,e.defaultDropSuccessIcon=t.icon??e.defaultDropSuccessIcon}static defaultSaveButton={text:"Save"};static setDefaultSaveButton(t,o=!0){return o?e.defaultSaveButton=t:e.defaultSaveButton=f(t,e.defaultSaveButton),e}static defaultConfirmButton={text:"Confirm"};static setDefaultConfirmButton(t,o=!0){return o?e.defaultConfirmButton=t:e.defaultConfirmButton=f(t,e.defaultConfirmButton),e}static defaultCancelButton={text:"Cancel"};static setDefaultCancelButton(t,o=!0){return o?e.defaultCancelButton=t:e.defaultCancelButton=f(t,e.defaultCancelButton),e}static defaultCreateButton={text:"Create"};static setDefaultCreateButton(t,o=!0){return o?e.defaultCreateButton=t:e.defaultCreateButton=f(t,e.defaultCreateButton),e}static defaultUpdateButton={text:"Update"};static setDefaultUpdateButton(t,o=!0){return o?e.defaultUpdateButton=t:e.defaultUpdateButton=f(t,e.defaultUpdateButton),e}static defaultDropButton={text:"Drop"};static setDefaultDropButton(t,o=!0){return o?e.defaultDropButton=t:e.defaultDropButton=f(t,e.defaultDropButton),e}static defaultEditModeButton={text:"Edit mode",type:"switch"};static setDefaultEditModeButton(t,o=!0){return o?e.defaultEditModeButton=t:e.defaultEditModeButton=f(t,e.defaultEditModeButton),e}static defaultToggleButton={text:"Toggle",textOn:"Close",textOff:"Show more",type:"hidden-switch"};static setDefaultToggleButton(t,o=!0){return o?e.defaultToggleButton=t:e.defaultToggleButton=f(t,e.defaultToggleButton),e}static defaultLoadMoreButton={text:"Load more",type:"hidden-switch"};static setDefaultLoadMoreButton(t,o=!0){return o?e.defaultLoadMoreButton=t:e.defaultLoadMoreButton=f(t,e.defaultLoadMoreButton),e}static defaultCloseModalIcon="lkt-icn-cancel";static setDefaultCloseModalIcon(t){return e.defaultCloseModalIcon=t,e}static defaultCloseToastIcon="lkt-icn-cancel";static setDefaultCloseToastIcon(t){return e.defaultCloseToastIcon=t,e}static defaultTableSortAscIcon="lkt-icn-arrow-bottom";static defaultTableSortDescIcon="lkt-icn-arrow-top";static setDefaultTableSortAscIcon(t){return e.defaultTableSortAscIcon=t,e}static setDefaultTableSortDescIcon(t){return e.defaultTableSortDescIcon=t,e}static defaultPaginatorFirstButton={text:"",icon:"lkt-icn-angle-double-left"};static defaultPaginatorPrevButton={text:"",icon:"lkt-icn-angle-left"};static defaultPaginatorNextButton={text:"",iconEnd:"lkt-icn-angle-right"};static defaultPaginatorLastButton={text:"",iconEnd:"lkt-icn-angle-double-right"};static setDefaultPaginatorFirstButton(t,o=!0){return o?e.defaultPaginatorFirstButton=t:e.defaultPaginatorFirstButton=f(t,e.defaultPaginatorFirstButton),e}static setDefaultPaginatorPrevButton(t,o=!0){return o?e.defaultPaginatorPrevButton=t:e.defaultPaginatorPrevButton=f(t,e.defaultPaginatorPrevButton),e}static setDefaultPaginatorNextButton(t,o=!0){return o?e.defaultPaginatorNextButton=t:e.defaultPaginatorNextButton=f(t,e.defaultPaginatorNextButton),e}static setDefaultPaginatorLastButton(t,o=!0){return o?e.defaultPaginatorLastButton=t:e.defaultPaginatorLastButton=f(t,e.defaultPaginatorLastButton),e}};var U=(l=>(l.Text="text",l.Email="email",l.Tel="tel",l.Password="password",l.Search="search",l.Number="number",l.Color="color",l.Range="range",l.Textarea="textarea",l.Html="html",l.Date="date",l.File="file",l.Image="image",l.Select="select",l.Check="check",l.Switch="switch",l.Calc="calc",l.Card="card",l.Elements="elements",l))(U||{});var Ct=["text","search","select"],bt=["switch","check"],ht=["switch","check"],Vt=["text","search"],kt=["switch","check"],Mt=["select","color","card"],Bt=["text","email","password"];var Dt=["lktDateProps","lktStrictItem","lktExcludedProps"],r=class e{static lktAllowUndefinedProps=[];static lktExcludedProps=[];static lktDateProps=[];static lktStrictItem=!1;static lktDefaultValues=[];constructor(t){}feed(t={},o=this){if(typeof t=="object")for(let[n,a]of Object.entries(t))o.assignProp(n,a)}assignProp(t,o){if(!(Dt.includes(t)||e.lktExcludedProps.includes(t))&&!(e.lktStrictItem&&!this.hasOwnProperty(t))){if(e.lktDateProps.includes(t)){this[t]=new Date(o);return}this[t]=o}}};var k=class extends r{lktStrictItem=!0};var j=(a=>(a.Auto="auto",a.Always="always",a.Lazy="lazy",a.Ever="ever",a))(j||{});var K=(n=>(n.Transform="transform",n.Height="height",n.Display="display",n))(K||{});var M=class extends r{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["modelValue","type","toggleMode","actionButton","toggleButton","toggleOnClickIntro","toggleTimeout","title","icon","class","contentClass","iconRotation","minHeight","iconAtEnd","toggleIconAtEnd"];modelValue=!1;type="auto";toggleMode="height";actionButton={};toggleButton={};toggleOnClickIntro=!1;toggleTimeout=0;title="";icon="";class="";contentClass="";iconRotation="90";minHeight=void 0;iconAtEnd=!1;toggleIconAtEnd=!1;constructor(t={}){super(),this.feed(t)}};var R=(m=>(m.Href="href",m.RouterLink="router-link",m.RouterLinkBack="router-link-back",m.Mail="mail",m.Tel="tel",m.Tab="tab",m.Download="download",m.Action="action",m.Legacy="",m))(R||{});var p=class extends r{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","to","class","isActive","downloadFileName","disabled","onClick","confirmModal","confirmModalKey","confirmData","imposter","external","events"];type="router-link";to="";class="";isActive=!1;downloadFileName="";disabled=!1;onClick=void 0;confirmModal="";confirmModalKey="_";confirmData={};imposter=!1;external=!1;events={};getHref(){let t="";return typeof this.to=="string"&&(t=this.to),"mail"===this.type?`mailto:${t}`:"tel"===this.type?`tel:${t}`:["href","mail","tel","tab","download"].includes(this.type)?t:typeof this.to=="string"&&this.to!==""?this.to:""}constructor(t={}){super(),this.feed(t)}};import{generateRandomString as St}from"lkt-string-tools";var x=class extends r{lktAllowUndefinedProps=["clickRef","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave"];static lktDefaultValues=["type","name","class","containerClass","value","disabled","loading","wrapContent","splitIcon","resource","resourceData","modal","modalKey","modalData","confirmModal","confirmModalKey","confirmData","modalCallbacks","text","textOn","textOff","icon","iconOn","iconOff","iconEndOn","iconEndOff","dot","iconEnd","img","showTooltipOnHoverDelay","tooltip","checked","clickRef","openTooltip","tabindex","anchor","showTooltipOnHover","hideTooltipOnLeave","splitClass","prop","events"];type="button";name=St(10);class="";containerClass="";value="";disabled=!1;loading=!1;wrapContent=!1;splitIcon="";resource="";resourceData={};modal="";modalKey="_";modalData={};confirmModal="";confirmModalKey="_";confirmData={};modalCallbacks=[];text="";textOn=void 0;textOff=void 0;iconOn=void 0;iconOff=void 0;iconEndOn=void 0;iconEndOff=void 0;icon="";dot=!1;iconEnd="";img="";showTooltipOnHoverDelay=0;checked=!1;clickRef=void 0;openTooltip=!1;tabindex=void 0;anchor=void 0;showTooltipOnHover=void 0;hideTooltipOnLeave=void 0;splitClass="";tooltip={};prop={};events={};constructor(t={}){super(),this.feed(t),this.anchor=new p(t.anchor)}isDisabled(){return typeof this.disabled=="function"?this.disabled():this.disabled}};var H=(a=>(a.None="",a.Field="field",a.Button="button",a.Anchor="anchor",a))(H||{});import{generateRandomString as yt}from"lkt-string-tools";var W=(n=>(n.List="list",n.Inline="inline",n.Count="count",n))(W||{});var z=(a=>(a.None="",a.Focus="focus",a.Blur="blur",a.Always="always",a))(z||{});var C=class extends r{modelValue="";type="text";valid=void 0;placeholder="";searchPlaceholder="";label="";labelIcon="";labelIconAtEnd=!1;name=yt(16);autocomplete=!1;disabled=!1;readonly=!1;readMode=!1;allowReadModeSwitch=!1;tabindex=void 0;mandatory=!1;showPassword=!1;canClear=!1;canUndo=!1;canI18n=!1;canStep=!0;canTag=!0;mandatoryMessage="";infoMessage="";errorMessage="";min=void 0;max=void 0;step=1;enableAutoNumberFix=!0;emptyValueSlot="";optionSlot=void 0;valueSlot=void 0;editSlot=void 0;slotData={};resource="";resourceData={};validationResource="";validationResourceData={};autoValidation=!1;autoValidationType="blur";validationStack="default";minNumbers=void 0;maxNumbers=void 0;minChars=void 0;maxChars=void 0;minUpperChars=void 0;maxUpperChars=void 0;minLowerChars=void 0;maxLowerChars=void 0;minSpecialChars=void 0;maxSpecialChars=void 0;checkEqualTo=void 0;featuredButton="";infoButtonEllipsis=!1;fileName="";customButtonText="";customButtonClass="";options=[];multiple=!1;multipleDisplay="list";multipleDisplayEdition="inline";searchable=!1;autoloadOptionsResource=!1;optionsDownload="";optionsModal="";optionsModalData={};optionsText="";optionsIcon="";optionsClass="";optionsLabelFormatter=void 0;optionsResource="";optionsResourceData={};icon="";download="";modal="";modalKey="";modalData={};data={};validation={};constructor(t={}){super(),this.feed(t)}};var b=class e{value;constructor(t){this.value=t}getValue(...t){return typeof this.value=="function"?this.value(...t):typeof this.value=="object"&&typeof this.value==typeof e?this.value.getValue(...t):typeof this.value=="string"?this.value:""}};var h=class extends r{lktExcludedProps=["link","field","anchor","button"];lktAllowUndefinedProps=["formatter","checkEmpty","colspan","field","anchor","button","link","action"];static lktDefaultValues=["type","key","label","sortable","hidden","editable","formatter","checkEmpty","colspan","preferSlot","isForRowKey","extractTitleFromColumn","slotData","field","anchor","button","link","action"];type="";key="";label="";sortable=!0;hidden=!1;editable=!1;formatter=void 0;checkEmpty=void 0;colspan=void 0;preferSlot=!0;isForRowKey=!1;extractTitleFromColumn="";slotData={};field=void 0;anchor=void 0;button=void 0;link=void 0;action=void 0;constructor(t={}){switch(super(),this.feed(t),this.type){case"field":this.field=new C(t.field);break;case"anchor":this.anchor=new p(t.anchor);break;case"button":this.button=new x(t.button);break}this.link=new b(t.link)}getHref(t){return typeof this.link!="object"?"":this.link.getValue(t)}doAction(t){if(typeof this.action=="function")return this.action(t);console.warn("No action defined")}};var q=(s=>(s.MinStringLength="min-str",s.MinNumber="min-num",s.MaxStringLength="max-str",s.MaxNumber="max-num",s.Email="email",s.Empty="empty",s.EqualTo="equal-to",s.MinNumbers="min-numbers",s.MaxNumbers="max-numbers",s.MinChars="min-chars",s.MaxChars="max-chars",s.MinUpperChars="min-upper-chars",s.MaxUpperChars="max-upper-chars",s.MinLowerChars="min-lower-chars",s.MaxLowerChars="max-lower-chars",s.MinSpecialChars="min-special-chars",s.MaxSpecialChars="max-special-chars",s))(q||{});var $=(n=>(n.Ok="ok",n.Ko="ko",n.Info="info",n))($||{});var B=class e{code=void 0;status="info";min=0;max=0;equalToValue=void 0;constructor(t,o){this.code=t,this.status=o}setMin(t){return this.min=t,this}setMax(t){return this.max=t,this}setEqualToValue(t){return this.equalToValue=t,this}static createEmpty(t="ko"){return new e("empty",t)}static createEmail(t="ko"){return new e("email",t)}static createMinStr(t,o="ko"){return new e("min-str",o).setMin(t)}static createMaxStr(t,o="ko"){return new e("max-str",o).setMax(t)}static createMinNum(t,o="ko"){return new e("min-num",o).setMin(t)}static createMaxNum(t,o="ko"){return new e("max-num",o).setMax(t)}static createNumBetween(t,o,n="ko"){return new e("max-num",n).setMin(t).setMax(o)}static createMinNumbers(t,o="ko"){return new e("min-numbers",o).setMin(t)}static createMaxNumbers(t,o="ko"){return new e("max-numbers",o).setMax(t)}static createMinUpperChars(t,o="ko"){return new e("min-upper-chars",o).setMin(t)}static createMaxUpperChars(t,o="ko"){return new e("max-upper-chars",o).setMax(t)}static createMinLowerChars(t,o="ko"){return new e("min-lower-chars",o).setMin(t)}static createMaxLowerChars(t,o="ko"){return new e("max-lower-chars",o).setMax(t)}static createMinSpecialChars(t,o="ko"){return new e("min-special-chars",o).setMin(t)}static createMaxSpecialChars(t,o="ko"){return new e("max-special-chars",o).setMax(t)}static createMinChars(t,o="ko"){return new e("min-chars",o).setMin(t)}static createMaxChars(t,o="ko"){return new e("max-chars",o).setMax(t)}static createEqualTo(t,o="ko"){return new e("equal-to",o).setEqualToValue(t)}};var G=(o=>(o.NotDefined="",o.Button="button",o))(G||{});var D=class extends r{static lktDefaultValues=["icon","text","class","type","events"];icon="";text="";class="";type="";events={};constructor(t={}){super(),this.feed(t)}};var S=class extends r{static lktAllowUndefinedProps=["onClick"];static lktDefaultValues=["src","alt","text","class","imageStyle"];src="";alt="";text="";class="";imageStyle="";constructor(t={}){super(),this.feed(t)}};var X=(n=>(n.Create="create",n.Update="update",n.Read="read",n))(X||{});var Y=(o=>(o.Inline="inline",o.Modal="modal",o))(Y||{});var J=(o=>(o.Top="top",o.Bottom="bottom",o))(J||{});var Q=(n=>(n.Changed="changed",n.Always="always",n.Never="never",n))(Q||{});var Z=(n=>(n.Manual="manual",n.Auto="auto",n.Delay="delay",n))(Z||{});var _=(o=>(o.Toast="toast",o.Inline="inline",o))(_||{});var y=class extends r{static lktDefaultValues=["modelValue","editing","mode","view","editModeButton","dropButton","createButton","updateButton","modalConfig","saveConfig","title","readResource","readData","beforeEmitUpdate","dataStateConfig","buttonNavPosition","buttonNavVisibility","notificationType"];modelValue={};editing=!1;mode="read";view="inline";editModeButton={};dropButton={};createButton={};updateButton={};modalConfig={};saveConfig={type:"manual"};title="";readResource="";readData={};beforeEmitUpdate=void 0;dataStateConfig={};buttonNavPosition="top";buttonNavVisibility="always";notificationType="toast";constructor(t={}){super(),this.feed(t)}};var V=class extends r{static lktDefaultValues=["key","href","label","icon","isActiveChecker","isOpened","isActive","parent","children","events","onClick"];key="";href="";label="";icon="";isActiveChecker=void 0;isOpened=!1;isActive=!1;parent=void 0;children;events={};onClick=void 0;constructor(t={}){super(),this.feed(t)}setChildren(t){return t.forEach(o=>o.parent=this),this.children=t,this}setOnClick(t){return this.onClick=t,this}setIsActiveChecker(t){return this.isActiveChecker=t,this}setIsActive(t=!0){return this.isActive=t,this}setLabel(t){return this.label=t,this}setIcon(t){return this.icon=t,this}doClose(){this.isOpened=!1}};var I=class extends r{static lktDefaultValues=["modelValue","resource","resourceData"];modelValue=[];resource="";resourceData={};constructor(t={}){super(),this.feed(t),this.modelValue=this.modelValue?.map(o=>new V(o))||[]}};var P=class extends r{static lktDefaultValues=["size","preTitle","preTitleIcon","title","closeIcon","closeConfirm","closeConfirmKey","showClose","disabledClose","disabledVeilClick","hiddenFooter","modalName","modalKey","zIndex","beforeClose","item"];size="";preTitle="";preTitleIcon="";title="";closeIcon=c.defaultCloseModalIcon;closeConfirm="";closeConfirmKey="_";showClose=!0;disabledClose=!1;disabledVeilClick=!1;hiddenFooter=!1;modalName="";modalKey="_";zIndex=500;beforeClose=void 0;item={};confirmButton={};cancelButton={};constructor(t={}){super(),this.feed(t)}};var E=class extends r{value=void 0;label="";data={};disabled=!1;group="";icon="";modal="";constructor(t={}){super(),this.feed(t)}};var tt=(g=>(g.Pages="pages",g.PrevNext="prev-next",g.PagesPrevNext="pages-prev-next",g.PagesPrevNextFirstLast="pages-prev-next-first-last",g.LoadMore="load-more",g.Infinite="infinite",g))(tt||{});var T=class extends r{static lktAllowUndefinedProps=[];static lktDefaultValues=["type","modelValue","class","resource","readOnly","loading","resourceData"];type="pages-prev-next";modelValue=1;class="";resource="";readOnly=!1;loading=!1;resourceData={};constructor(t={}){super(),this.feed(t)}};var et=(n=>(n.None="",n.Incremental="incremental",n.Decremental="decremental",n))(et||{});var ot=(i=>(i.NotDefined="",i.Hidden="hidden",i.Integer="integer",i.Decimal="decimal",i.Auto="auto",i))(ot||{});var w=class extends r{static lktAllowUndefinedProps=[];static lktDefaultValues=["modelValue","type","duration","pauseOnHover","header","valueFormat","palette"];modelValue=0;type="";duration=4e3;pauseOnHover=!1;header="";valueFormat="auto";palette="";constructor(t={}){super(),this.feed(t)}};var rt=(i=>(i.Table="table",i.Item="item",i.Ul="ul",i.Ol="ol",i.Carousel="carousel",i))(rt||{});var nt=(a=>(a[a.Auto=0]="Auto",a[a.PreferItem=1]="PreferItem",a[a.PreferCustomItem=2]="PreferCustomItem",a[a.PreferColumns=3]="PreferColumns",a))(nt||{});var L=class extends r{static lktDefaultValues=["modelValue","type","columns","noResultsText","hideEmptyColumns","itemDisplayChecker","loading","page","perms","editMode","dataStateConfig","sortable","sorter","initialSorting","drag","paginator","header","title","titleTag","titleIcon","headerClass","editModeButton","saveButton","createButton","dropButton","editButton","wrapContentTag","wrapContentClass","itemsContainerClass","hiddenSave","addNavigation","createEnabledValidator","newValueGenerator","requiredItemsForTopCreate","requiredItemsForBottomCreate","slotItemVar","carousel"];modelValue=[];type="table";columns=[];noResultsText="";hideEmptyColumns=!1;itemDisplayChecker=void 0;rowDisplayType=0;loading=!1;page=1;perms=[];editMode=!1;dataStateConfig={};sortable=!1;sorter=void 0;initialSorting=!1;drag=void 0;paginator=void 0;carousel={};header;title="";titleTag="h2";titleIcon="";headerClass="";editModeButton={};saveButton={};createButton={};dropButton={};editButton={};hiddenSave=!1;wrapContentTag="div";wrapContentClass="";itemsContainerClass="";addNavigation=!1;createEnabledValidator=void 0;newValueGenerator=void 0;requiredItemsForTopCreate=0;requiredItemsForBottomCreate=0;slotItemVar="item";constructor(t={}){super(),this.feed(t)}};var v=class extends r{static lktDefaultValues=["modelValue","id","useSession","cacheLifetime","contentPad","titles"];modelValue="";id="";useSession=!1;cacheLifetime=5;contentPad;titles;constructor(t={}){super(),this.feed(t)}};var at=(o=>(o.NotDefined="",o.ActionIcon="action-icon",o))(at||{});var O=class extends r{static lktDefaultValues=["class","text","featuredText","icon","iconAtEnd","featuredAtStart","type"];class="";text="";featuredText="";icon="";iconAtEnd=!1;featuredAtStart=!1;type="";constructor(t={}){super(),this.feed(t)}};var it=(o=>(o.Message="message",o.Button="button",o))(it||{});var lt=(n=>(n.Left="left",n.Center="center",n.Right="right",n))(lt||{});var F=class extends r{static lktDefaultValues=["type","text","details","icon","positionX","duration","buttonConfig","zIndex"];type="message";text="";details="";icon="";positionX="right";duration=void 0;buttonConfig=void 0;zIndex=1e3;constructor(t={}){super(),this.feed(t)}};var st=(o=>(o.Fixed="fixed",o.Absolute="absolute",o))(st||{});var ft=(a=>(a.Top="top",a.Bottom="bottom",a.Center="center",a.ReferrerCenter="referrer-center",a))(ft||{});var ut=(i=>(i.Left="left",i.Right="right",i.Center="center",i.LeftCorner="left-corner",i.RightCorner="right-corner",i))(ut||{});var A=class extends r{static lktDefaultValues=["modelValue","alwaysOpen","class","text","icon","iconAtEnd","engine","referrerWidth","referrerMargin","windowMargin","referrer","locationY","locationX"];modelValue=!1;alwaysOpen=!1;class="";text="";icon="";iconAtEnd=!1;engine="fixed";referrerWidth=!1;referrerMargin=0;windowMargin=0;referrer=void 0;locationY="bottom";locationX="left-corner";constructor(t={}){super(),this.feed(t)}};var dt=(i=>(i.Refresh="refresh",i.Close="close",i.ReOpen="reOpen",i.Exec="exec",i.Open="open",i))(dt||{});var mt=(o=>(o.Modal="modal",o.Confirm="confirm",o))(mt||{});var ct=(o=>(o.Asc="asc",o.Desc="desc",o))(ct||{});var pt=(d=>(d.Create="create",d.Update="update",d.Edit="edit",d.Drop="drop",d.Sort="sort",d.SwitchEditMode="switch-edit-mode",d.InlineEdit="inline-edit",d.InlineCreate="inline-create",d.ModalCreate="modal-create",d.InlineCreateEver="inline-create-ever",d))(pt||{});var gt=(o=>(o.Lazy="lazy",o.Ever="ever",o))(gt||{});import{__ as It}from"lkt-i18n";var xt=(e,t)=>typeof e=="string"&&e.startsWith("prop:")?t[e.substring(5)]:e,Pt=e=>{if(typeof e=="string"&&e.startsWith("__:")){let t=String(e);return t.startsWith("__:")?It(t.substring(3)):t}return e},Et=(e,t)=>{if(!e)return{};let o={};for(let n in e)o[n]=xt(e[n],t);return o};var Tt=(e,...t)=>{c.debugEnabled&&console.info("::lkt::",`[${e}] `,...t)};var wt=e=>new h(e);function Vo(e){let t=new e,o={};if(!Array.isArray(e.lktDefaultValues))throw new Error("lktDefaultValues must be a keys array.");for(let n of e.lktDefaultValues)n in t&&(o[n]=t[n]);return o}export{M as Accordion,K as AccordionToggleMode,j as AccordionType,p as Anchor,R as AnchorType,x as Button,N as ButtonType,h as Column,H as ColumnType,C as Field,z as FieldAutoValidationTrigger,U as FieldType,B as FieldValidation,D as Icon,G as IconType,S as Image,y as ItemCrud,J as ItemCrudButtonNavPosition,Q as ItemCrudButtonNavVisibility,X as ItemCrudMode,Y as ItemCrudView,r as LktItem,c as LktSettings,k as LktStrictItem,I as Menu,V as MenuEntry,P as Modal,dt as ModalCallbackAction,mt as ModalType,W as MultipleOptionsDisplay,_ as NotificationType,E as Option,T as Paginator,tt as PaginatorType,w as Progress,et as ProgressType,ot as ProgressValueFormat,b as SafeString,Z as SaveType,ct as SortDirection,L as Table,pt as TablePermission,nt as TableRowType,rt as TableType,v as Tabs,O as Tag,at as TagType,F as Toast,lt as ToastPositionX,it as ToastType,gt as ToggleMode,A as Tooltip,ut as TooltipLocationX,ft as TooltipLocationY,st as TooltipPositionEngine,q as ValidationCode,$ as ValidationStatus,kt as booleanFieldTypes,wt as createColumn,f as ensureButtonConfig,Pt as extractI18nValue,xt as extractPropValue,Ct as fieldTypesWithOptions,bt as fieldTypesWithoutClear,ht as fieldTypesWithoutUndo,Mt as fieldsWithMultipleMode,Vo as getDefaultValues,Tt as lktDebug,Et as prepareResourceData,Bt as textFieldTypes,Vt as textFieldTypesWithOptions};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lkt-vue-kernel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.37",
|
|
4
4
|
"description": "LKT Vue Kernel",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lkt",
|
|
@@ -34,12 +34,10 @@
|
|
|
34
34
|
"tsup": "^8.3.6",
|
|
35
35
|
"typescript": "^5.7.3"
|
|
36
36
|
},
|
|
37
|
-
"
|
|
37
|
+
"peerDependencies": {
|
|
38
38
|
"lkt-data-state": "^1.0.10",
|
|
39
39
|
"lkt-i18n": "^1.0.6",
|
|
40
|
-
"lkt-string-tools": "^1.0.8"
|
|
41
|
-
},
|
|
42
|
-
"peerDependencies": {
|
|
40
|
+
"lkt-string-tools": "^1.0.8",
|
|
43
41
|
"vue": "^3.5.13",
|
|
44
42
|
"vue-router": "^4.5.0"
|
|
45
43
|
}
|