@mhmo91/schmancy 0.4.21 → 0.4.23
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/ai/context.md +25 -2
- package/ai/store.md +4 -4
- package/dist/ai/context.md +25 -2
- package/dist/ai/store.md +4 -4
- package/dist/{avatar-CQceYbCt.cjs → avatar-D1ojwes6.cjs} +2 -2
- package/dist/{avatar-CQceYbCt.cjs.map → avatar-D1ojwes6.cjs.map} +1 -1
- package/dist/{avatar-CPbVhMW7.js → avatar-DzJUPJtZ.js} +4 -4
- package/dist/{avatar-CPbVhMW7.js.map → avatar-DzJUPJtZ.js.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +192 -190
- package/dist/input-BN9xQTH0.cjs +111 -0
- package/dist/{input-DcWJTrr9.cjs.map → input-BN9xQTH0.cjs.map} +1 -1
- package/dist/{input-P8bwT-4D.js → input-DHNBYBq4.js} +5 -1
- package/dist/{input-P8bwT-4D.js.map → input-DHNBYBq4.js.map} +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +5 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{selector-hook-CYMLsOvh.cjs → selector-hook-Bf_lCnGW.cjs} +2 -2
- package/dist/{selector-hook-CYMLsOvh.cjs.map → selector-hook-Bf_lCnGW.cjs.map} +1 -1
- package/dist/{selector-hook-BvXML7_4.js → selector-hook-DPe2CGKx.js} +21 -21
- package/dist/{selector-hook-BvXML7_4.js.map → selector-hook-DPe2CGKx.js.map} +1 -1
- package/dist/{sheet-BiUUD0Td.cjs → sheet-BVr3bq9r.cjs} +2 -2
- package/dist/{sheet-BiUUD0Td.cjs.map → sheet-BVr3bq9r.cjs.map} +1 -1
- package/dist/{sheet-WpG2m2yT.js → sheet-CdcA_ZIk.js} +2 -2
- package/dist/{sheet-WpG2m2yT.js.map → sheet-CdcA_ZIk.js.map} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +2 -2
- package/dist/{sheet.service-COPNmxwp.js → sheet.service-CKznL-dB.js} +125 -111
- package/dist/{sheet.service-COPNmxwp.js.map → sheet.service-CKznL-dB.js.map} +1 -1
- package/dist/{sheet.service-B5sh8d0k.cjs → sheet.service-D_jE8pUg.cjs} +3 -3
- package/dist/{sheet.service-B5sh8d0k.cjs.map → sheet.service-D_jE8pUg.cjs.map} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/types/mixins/index.d.ts +1 -0
- package/types/src/busy/spinner.d.ts +1 -0
- package/types/src/card/actions.d.ts +3 -3
- package/types/src/card/content.d.ts +0 -3
- package/types/src/card/media.d.ts +1 -0
- package/types/src/chips/chip.d.ts +1 -1
- package/types/src/chips/chips.d.ts +1 -1
- package/types/src/date-range/date-range-dialog.d.ts +28 -0
- package/types/src/date-range/date-range-helpers.d.ts +27 -0
- package/types/src/date-range/date-range-presets.d.ts +18 -0
- package/types/src/date-range/date-range.d.ts +1 -27
- package/types/src/date-range-inline/date-range-inline.d.ts +111 -0
- package/types/src/date-range-inline/index.d.ts +2 -0
- package/types/src/index.d.ts +2 -0
- package/types/src/input/index.d.ts +2 -2
- package/types/src/input/input.d.ts +118 -34
- package/types/src/progress/index.d.ts +1 -0
- package/types/src/progress/progress.d.ts +17 -0
- package/types/src/radio-group/radio-button.d.ts +1 -1
- package/types/src/radio-group/radio-group.d.ts +1 -1
- package/dist/input-DcWJTrr9.cjs +0 -111
- package/types/src/data/countries.d.ts +0 -5
- package/types/src/data/index.d.ts +0 -1
- package/types/src/notification/$notification.d.ts +0 -13
- package/types/src/store/action-creator.d.ts +0 -8
- package/types/src/store/clear.d.ts +0 -1
- package/types/src/v2/form.d.ts +0 -51
- package/types/src/v2/index.d.ts +0 -2
- package/types/src/v2/input.d.ts +0 -71
package/dist/store.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-Bf_lCnGW.cjs");exports.BaseStore=r.BaseStore,exports.IndexedDBStorageManager=r.IndexedDBStorageManager,exports.LocalStorageManager=r.LocalStorageManager,exports.MemoryStorageManager=r.MemoryStorageManager,exports.SchmancyArrayStore=r.SchmancyArrayStore,exports.SchmancyStoreObject=r.SchmancyStoreObject,exports.SessionStorageManager=r.SessionStorageManager,exports.StoreError=r.StoreError,exports.createStorageManager=r.createStorageManager,exports.compareValues=e.compareValues,exports.createArrayContext=e.createArrayContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createOptimizedSelector=e.createOptimizedSelector,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.createTestArrayContext=e.createTestArrayContext,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.isArray=e.isArray,exports.isDate=e.isDate,exports.isIterable=e.isIterable,exports.isMap=e.isMap,exports.isNil=e.isNil,exports.isNumber=e.isNumber,exports.isPlainObject=e.isPlainObject,exports.isSet=e.isSet,exports.isString=e.isString,exports.select=e.select,exports.selectItem=e.selectItem;
|
|
2
2
|
//# sourceMappingURL=store.cjs.map
|
package/dist/store.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { B as r, I as t, L as s, M as c, S as o, a as l, b as S, d as i, c as n } from "./context-object-CDDP4bTk.js";
|
|
2
|
-
import { p as g, a as y, v as M, G as p, c as d, E as I, z as f, C as x, B as A, x as C, w as b, y as u, D as B, F, u as h, A as j, b as D, r as E, d as O, q as z, f as L, g as N, i as V, j as k, k as q, l as v, o as w, h as G, n as K, m as P, e as T, s as H, t as J } from "./selector-hook-
|
|
2
|
+
import { p as g, a as y, v as M, G as p, c as d, E as I, z as f, C as x, B as A, x as C, w as b, y as u, D as B, F, u as h, A as j, b as D, r as E, d as O, q as z, f as L, g as N, i as V, j as k, k as q, l as v, o as w, h as G, n as K, m as P, e as T, s as H, t as J } from "./selector-hook-DPe2CGKx.js";
|
|
3
3
|
export {
|
|
4
4
|
r as BaseStore,
|
|
5
5
|
t as IndexedDBStorageManager,
|
package/dist/teleport.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-D1ojwes6.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
|
|
2
2
|
//# sourceMappingURL=teleport.cjs.map
|
package/dist/teleport.js
CHANGED
package/dist/theme.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet.service-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet.service-D_jE8pUg.cjs"),m=require("./theme.interface-Xg5Zi46a.cjs");Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>e.SchmancyThemeComponent}),exports.ThemeHereIAm=e.ThemeHereIAm,exports.ThemeWhereAreYou=e.ThemeWhereAreYou,exports.formateTheme=e.formateTheme,exports.tailwindStyles=e.tailwindStyles,exports.SchmancyTheme=m.SchmancyTheme;
|
|
2
2
|
//# sourceMappingURL=theme.cjs.map
|
package/dist/theme.js
CHANGED
package/package.json
CHANGED
package/types/mixins/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const SchmancyCardAction_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
2
|
/**
|
|
3
3
|
* @element schmancy-card-action
|
|
4
4
|
* @slot - The content of the action
|
|
5
5
|
*/
|
|
6
|
-
export default class
|
|
6
|
+
export default class SchmancyCardAction extends SchmancyCardAction_base {
|
|
7
7
|
protected render(): unknown;
|
|
8
8
|
}
|
|
9
9
|
declare global {
|
|
10
10
|
interface HTMLElementTagNameMap {
|
|
11
|
-
'schmancy-card-action':
|
|
11
|
+
'schmancy-card-action': SchmancyCardAction;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
declare const SchmancyCardContent_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
2
|
/**
|
|
3
3
|
* @element schmancy-card-content
|
|
4
|
-
* @slot headline
|
|
5
|
-
* @slot subhead
|
|
6
|
-
* @slot default - The content of the card
|
|
7
4
|
*/
|
|
8
5
|
export default class SchmancyCardContent extends SchmancyCardContent_base {
|
|
9
6
|
protected render(): unknown;
|
|
@@ -5,6 +5,7 @@ declare const SchmancyCardMedia_base: import("@mixins/index").Constructor<Custom
|
|
|
5
5
|
export default class SchmancyCardMedia extends SchmancyCardMedia_base {
|
|
6
6
|
src: string;
|
|
7
7
|
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
8
|
+
alt: string;
|
|
8
9
|
protected render(): unknown;
|
|
9
10
|
}
|
|
10
11
|
declare global {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@material/web/chips/chip-set.js';
|
|
2
2
|
import '@material/web/chips/filter-chip.js';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
declare const SchmancyChip_base: CustomElementConstructor & import("@mixins/
|
|
4
|
+
declare const SchmancyChip_base: import("../../mixins").Constructor<CustomElementConstructor> & import("../../mixins").Constructor<import("@mixins/tailwind.mixin").ITailwindElementMixin> & import("../../mixins").Constructor<LitElement> & import("../../mixins").Constructor<import("../../mixins").IBaseMixin>;
|
|
5
5
|
export default class SchmancyChip extends SchmancyChip_base {
|
|
6
6
|
value: string;
|
|
7
7
|
selected: boolean;
|
|
@@ -10,7 +10,7 @@ export default class SchmancyChips extends SchmancyChips_base {
|
|
|
10
10
|
values: string[];
|
|
11
11
|
value: string;
|
|
12
12
|
chips: SchmancyChip[];
|
|
13
|
-
wrap:
|
|
13
|
+
wrap: boolean;
|
|
14
14
|
change(e: CustomEvent<SchmancyChipChangeEvent>): Promise<void>;
|
|
15
15
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
16
16
|
attributeChangedCallback(name: string, old: string, value: string): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PresetCategory } from './date-range-presets';
|
|
2
|
+
declare const SchmancyDateRangeDialog_base: CustomElementConstructor & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
3
|
+
/**
|
|
4
|
+
* Dialog content component for date range selection
|
|
5
|
+
*
|
|
6
|
+
* @element schmancy-date-range-dialog
|
|
7
|
+
*/
|
|
8
|
+
export declare class SchmancyDateRangeDialog extends SchmancyDateRangeDialog_base {
|
|
9
|
+
type: 'date' | 'datetime-local';
|
|
10
|
+
dateFrom: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
dateTo: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
};
|
|
18
|
+
minDate?: string;
|
|
19
|
+
maxDate?: string;
|
|
20
|
+
activePreset: string | null;
|
|
21
|
+
presetCategories: PresetCategory[];
|
|
22
|
+
private handleFromDateChange;
|
|
23
|
+
private handleToDateChange;
|
|
24
|
+
private handlePresetSelection;
|
|
25
|
+
private applyManualDateSelection;
|
|
26
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { PresetUnit } from './date-range-presets';
|
|
3
|
+
/**
|
|
4
|
+
* Format a date range into a human-readable string
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatDateRange(fromValue: string, toValue: string, type: 'date' | 'datetime-local', placeholder: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Detect the type of date range (full month, full quarter, etc.)
|
|
9
|
+
*/
|
|
10
|
+
export interface DateRangeType {
|
|
11
|
+
isFullMonth: boolean;
|
|
12
|
+
isFullQuarter: boolean;
|
|
13
|
+
isFullYear: boolean;
|
|
14
|
+
isFullWeek: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function detectDateRangeType(fromDate: dayjs.Dayjs, toDate: dayjs.Dayjs): DateRangeType;
|
|
17
|
+
/**
|
|
18
|
+
* Calculate the appropriate shift unit and amount for a date range
|
|
19
|
+
*/
|
|
20
|
+
export declare function calculateShiftParams(fromDate: dayjs.Dayjs, toDate: dayjs.Dayjs, activePresetStep?: PresetUnit): {
|
|
21
|
+
unit: PresetUnit;
|
|
22
|
+
amount: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Helper method to safely add/subtract quarter values
|
|
26
|
+
*/
|
|
27
|
+
export declare function adjustQuarter(date: dayjs.Dayjs, amount: number, direction: 1 | -1): dayjs.Dayjs;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
export type PresetUnit = dayjs.OpUnitType | 'quarter';
|
|
3
|
+
export interface DateRangePreset {
|
|
4
|
+
label: string;
|
|
5
|
+
range: {
|
|
6
|
+
dateFrom: string;
|
|
7
|
+
dateTo: string;
|
|
8
|
+
};
|
|
9
|
+
step: PresetUnit;
|
|
10
|
+
}
|
|
11
|
+
export interface PresetCategory {
|
|
12
|
+
name: string;
|
|
13
|
+
presets: DateRangePreset[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Generate date range presets for different time periods
|
|
17
|
+
*/
|
|
18
|
+
export declare function generatePresetCategories(format: string, includeTime?: boolean): PresetCategory[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropertyValues } from 'lit';
|
|
2
|
+
import './date-range-dialog';
|
|
2
3
|
export type SchmancyDateRangeChangeEvent = CustomEvent<{
|
|
3
4
|
dateFrom: string;
|
|
4
5
|
dateTo: string;
|
|
@@ -32,17 +33,13 @@ export declare class SchmancyDateRange extends SchmancyDateRange_base {
|
|
|
32
33
|
required: boolean;
|
|
33
34
|
placeholder: string;
|
|
34
35
|
clearable: boolean;
|
|
35
|
-
allowDirectInput: boolean;
|
|
36
36
|
private isOpen;
|
|
37
37
|
private selectedDateRange;
|
|
38
38
|
private activePreset;
|
|
39
39
|
private announceMessage;
|
|
40
40
|
private isMobile;
|
|
41
|
-
private isTyping;
|
|
42
|
-
private typedValue;
|
|
43
41
|
private presetRanges;
|
|
44
42
|
private presetCategories;
|
|
45
|
-
private inputRef;
|
|
46
43
|
private memoizedPresets;
|
|
47
44
|
connectedCallback(): void;
|
|
48
45
|
private setupEventHandlers;
|
|
@@ -55,17 +52,11 @@ export declare class SchmancyDateRange extends SchmancyDateRange_base {
|
|
|
55
52
|
*/
|
|
56
53
|
private updateSelectedDateRange;
|
|
57
54
|
private setDateRange;
|
|
58
|
-
private handlePresetSelection;
|
|
59
55
|
private toggleDropdown;
|
|
60
56
|
private openDropdown;
|
|
61
57
|
private closeDropdown;
|
|
62
|
-
/**
|
|
63
|
-
* Helper method to safely add/subtract quarter values
|
|
64
|
-
*/
|
|
65
|
-
private adjustQuarter;
|
|
66
58
|
/**
|
|
67
59
|
* Shifts the date range based on its type (preset or custom)
|
|
68
|
-
* Enhanced to properly handle various time units and preserve date patterns
|
|
69
60
|
*/
|
|
70
61
|
private shiftDateRange;
|
|
71
62
|
/**
|
|
@@ -77,27 +68,10 @@ export declare class SchmancyDateRange extends SchmancyDateRange_base {
|
|
|
77
68
|
* and updates the activePreset accordingly
|
|
78
69
|
*/
|
|
79
70
|
private checkAndUpdateActivePreset;
|
|
80
|
-
private applyManualDateSelection;
|
|
81
71
|
/**
|
|
82
72
|
* Check if view is mobile
|
|
83
73
|
*/
|
|
84
74
|
private checkMobileView;
|
|
85
|
-
/**
|
|
86
|
-
* Handle direct text input
|
|
87
|
-
*/
|
|
88
|
-
private handleDirectInput;
|
|
89
|
-
/**
|
|
90
|
-
* Parse typed date range
|
|
91
|
-
*/
|
|
92
|
-
private parseTypedDateRange;
|
|
93
|
-
/**
|
|
94
|
-
* Handle input blur to parse typed dates
|
|
95
|
-
*/
|
|
96
|
-
private handleInputBlur;
|
|
97
|
-
/**
|
|
98
|
-
* Create dialog content
|
|
99
|
-
*/
|
|
100
|
-
private createDialogContent;
|
|
101
75
|
/**
|
|
102
76
|
* Announce messages to screen readers
|
|
103
77
|
*/
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HTMLElementTagNameMap {
|
|
3
|
+
'schmancy-date-range-inline': SchmancyDateRangeInline;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
export type SchmancyDateRangeInlineChangeEvent = CustomEvent<{
|
|
7
|
+
dateFrom: string;
|
|
8
|
+
dateTo: string;
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
declare const SchmancyDateRangeInline_base: import("@mixins/index").Constructor<import("@mixins/index").IFormFieldMixin> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
12
|
+
/**
|
|
13
|
+
* Smart inline date range picker that handles all the heavy lifting.
|
|
14
|
+
* Auto-corrects invalid ranges, provides smart defaults, and validates dates.
|
|
15
|
+
*/
|
|
16
|
+
export default class SchmancyDateRangeInline extends SchmancyDateRangeInline_base {
|
|
17
|
+
/**
|
|
18
|
+
* Input type - 'date' or 'datetime-local'
|
|
19
|
+
*/
|
|
20
|
+
type: 'date' | 'datetime-local';
|
|
21
|
+
/**
|
|
22
|
+
* From date configuration
|
|
23
|
+
*/
|
|
24
|
+
dateFrom: {
|
|
25
|
+
label: string;
|
|
26
|
+
value: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* To date configuration
|
|
30
|
+
*/
|
|
31
|
+
dateTo: {
|
|
32
|
+
label: string;
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Minimum allowed date
|
|
37
|
+
*/
|
|
38
|
+
minDate?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum allowed date
|
|
41
|
+
*/
|
|
42
|
+
maxDate?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Compact mode for smaller UI
|
|
45
|
+
*/
|
|
46
|
+
compact: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Auto-correct invalid date ranges
|
|
49
|
+
*/
|
|
50
|
+
autoCorrect: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Minimum gap between dates (in days)
|
|
53
|
+
*/
|
|
54
|
+
minGap: number;
|
|
55
|
+
/**
|
|
56
|
+
* Maximum gap between dates (in days)
|
|
57
|
+
*/
|
|
58
|
+
maxGap?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Default gap when auto-setting dates (in days)
|
|
61
|
+
*/
|
|
62
|
+
defaultGap: number;
|
|
63
|
+
/**
|
|
64
|
+
* Whether to allow same date selection
|
|
65
|
+
*/
|
|
66
|
+
allowSameDate: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Internal validation state
|
|
69
|
+
*/
|
|
70
|
+
private validationState;
|
|
71
|
+
connectedCallback(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Set smart default dates based on context
|
|
74
|
+
*/
|
|
75
|
+
private setSmartDefaults;
|
|
76
|
+
/**
|
|
77
|
+
* Format date to required string format
|
|
78
|
+
*/
|
|
79
|
+
private formatDate;
|
|
80
|
+
/**
|
|
81
|
+
* Parse date string to Date object
|
|
82
|
+
*/
|
|
83
|
+
private parseDate;
|
|
84
|
+
/**
|
|
85
|
+
* Calculate days between two dates
|
|
86
|
+
*/
|
|
87
|
+
private getDaysBetween;
|
|
88
|
+
/**
|
|
89
|
+
* Handle from date change with validation and auto-correction
|
|
90
|
+
*/
|
|
91
|
+
private handleDateFromChange;
|
|
92
|
+
/**
|
|
93
|
+
* Handle to date change with validation and auto-correction
|
|
94
|
+
*/
|
|
95
|
+
private handleDateToChange;
|
|
96
|
+
/**
|
|
97
|
+
* Validate dates and auto-correct if enabled
|
|
98
|
+
*/
|
|
99
|
+
private validateAndCorrect;
|
|
100
|
+
/**
|
|
101
|
+
* Get computed min date for the "to" field based on "from" value
|
|
102
|
+
*/
|
|
103
|
+
private getComputedMinDateTo;
|
|
104
|
+
/**
|
|
105
|
+
* Get computed max date for the "from" field based on "to" value
|
|
106
|
+
*/
|
|
107
|
+
private getComputedMaxDateFrom;
|
|
108
|
+
emitChange(): void;
|
|
109
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
110
|
+
}
|
|
111
|
+
export {};
|
package/types/src/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './code-highlight';
|
|
|
13
13
|
export * from './components';
|
|
14
14
|
export * from './content-drawer';
|
|
15
15
|
export * from './date-range';
|
|
16
|
+
export * from './date-range-inline';
|
|
16
17
|
export * from './delay';
|
|
17
18
|
export * from './dialog';
|
|
18
19
|
export * from './directives';
|
|
@@ -28,6 +29,7 @@ export * from './menu';
|
|
|
28
29
|
export * from './nav-drawer';
|
|
29
30
|
export * from './notification';
|
|
30
31
|
export * from './option';
|
|
32
|
+
export * from './progress';
|
|
31
33
|
export * from './radio-group';
|
|
32
34
|
export * from './rxjs-utils';
|
|
33
35
|
export * from './select';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { default as SchmancyInputV2, type InputSize, type SchmancyInputChangeEventV2 } from './input-v2';
|
|
2
|
+
export { default as SchmancyInput, type SchmancyInputChangeEvent } from './input';
|
|
@@ -16,35 +16,33 @@ type EventDetails = {
|
|
|
16
16
|
export type SchmancyInputInputEvent = CustomEvent<EventDetails>;
|
|
17
17
|
export type SchmancyInputChangeEvent = CustomEvent<EventDetails>;
|
|
18
18
|
export type SchmancyInputEnterEvent = CustomEvent<EventDetails>;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Size variants for the input.
|
|
21
|
+
* - sm: Small, compact input (40px height)
|
|
22
|
+
* - md: Medium input (50px height, default)
|
|
23
|
+
* - lg: Large, spacious input (60px height)
|
|
24
|
+
*/
|
|
25
|
+
export type InputSize = 'sm' | 'md' | 'lg';
|
|
26
|
+
declare const SchmancyInput_base: import("@mixins/index").Constructor<import("@mixins/index").IFormFieldMixin> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
27
|
+
/**
|
|
28
|
+
* Enhanced version of the SchmancyInput component with improved form integration
|
|
29
|
+
* and compatibility with legacy API.
|
|
30
|
+
*
|
|
31
|
+
* This component uses the native form association API and maintains parity with
|
|
32
|
+
* native input behaviors while providing a stylish, accessible interface.
|
|
33
|
+
*/
|
|
20
34
|
export default class SchmancyInput extends SchmancyInput_base {
|
|
21
|
-
/**
|
|
35
|
+
/** Auto-incrementing counter for generating unique IDs */
|
|
22
36
|
static _idCounter: number;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* The label for the control. If populated, we render a `<label for="...">`.
|
|
26
|
-
* If empty, we add an `aria-label` to the <input> for better screenreader support.
|
|
27
|
-
*/
|
|
28
|
-
label: string;
|
|
37
|
+
/** Override value to be string only for input element */
|
|
38
|
+
value: string;
|
|
29
39
|
/**
|
|
30
40
|
* The type of input. (e.g. 'text', 'password', 'email', etc.)
|
|
31
41
|
*/
|
|
32
42
|
type: HTMLInputElement['type'];
|
|
33
|
-
/**
|
|
34
|
-
* Name attribute (for form submissions). By default, a unique fallback.
|
|
35
|
-
*/
|
|
36
|
-
name: string;
|
|
37
43
|
placeholder: string;
|
|
38
|
-
/** Current value of the input. */
|
|
39
|
-
value: string;
|
|
40
44
|
/** Pattern validation attribute. */
|
|
41
45
|
pattern?: string;
|
|
42
|
-
/** Whether the control is required for form validation. */
|
|
43
|
-
required: boolean;
|
|
44
|
-
/** Whether the control is disabled. */
|
|
45
|
-
disabled: boolean;
|
|
46
|
-
/** Whether the input is read-only. */
|
|
47
|
-
readonly: boolean;
|
|
48
46
|
/** If true, we visually show a pointer cursor even if readOnly. */
|
|
49
47
|
clickable: boolean;
|
|
50
48
|
/** Whether browser spellcheck is enabled. */
|
|
@@ -70,47 +68,133 @@ export default class SchmancyInput extends SchmancyInput_base {
|
|
|
70
68
|
*/
|
|
71
69
|
tabIndex: number;
|
|
72
70
|
/**
|
|
73
|
-
*
|
|
71
|
+
* The size of the input.
|
|
72
|
+
* - 'sm': Small, compact size
|
|
73
|
+
* - 'md': Medium size (default)
|
|
74
|
+
* - 'lg': Large size
|
|
74
75
|
*/
|
|
75
|
-
|
|
76
|
+
size: InputSize;
|
|
76
77
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
78
|
+
* Controls when validation should show.
|
|
79
|
+
* - 'always' - Always show validation
|
|
80
|
+
* - 'touched' - Only show after field has been focused and then blurred
|
|
81
|
+
* - 'dirty' - Only show after value has changed
|
|
82
|
+
* - 'submitted' - Only show after form submission
|
|
79
83
|
*/
|
|
80
|
-
|
|
84
|
+
validateOn: 'always' | 'touched' | 'dirty' | 'submitted';
|
|
85
|
+
/**
|
|
86
|
+
* For datalist support
|
|
87
|
+
*/
|
|
88
|
+
list?: string;
|
|
81
89
|
private inputElement;
|
|
82
90
|
private inputRef;
|
|
83
|
-
|
|
91
|
+
/**
|
|
92
|
+
* For integration with browser's autofill support
|
|
93
|
+
*/
|
|
94
|
+
private isAutofilled;
|
|
95
|
+
/**
|
|
96
|
+
* Track user interaction state for validation
|
|
97
|
+
*/
|
|
98
|
+
private touched;
|
|
99
|
+
private dirty;
|
|
100
|
+
private submitted;
|
|
101
|
+
/**
|
|
102
|
+
* Store the default value for reset behavior
|
|
103
|
+
*/
|
|
104
|
+
private defaultValue;
|
|
84
105
|
protected static shadowRootOptions: {
|
|
85
106
|
delegatesFocus: boolean;
|
|
86
107
|
mode: ShadowRootMode;
|
|
87
108
|
serializable?: boolean;
|
|
88
109
|
slotAssignment?: SlotAssignmentMode;
|
|
89
110
|
};
|
|
90
|
-
private
|
|
91
|
-
constructor();
|
|
111
|
+
private formResetObserver?;
|
|
92
112
|
/**
|
|
93
113
|
* If user did not provide an ID, auto-generate one so <label for="...">
|
|
94
114
|
* and various aria-* attributes can reference it.
|
|
95
115
|
*/
|
|
96
116
|
protected willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
97
|
-
/** The form this element is associated with, if any. */
|
|
98
|
-
get form(): HTMLFormElement;
|
|
99
117
|
protected updated(changedProps: Map<string, unknown>): void;
|
|
100
118
|
/**
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
119
|
+
* Connect to the closest form element and set up form integration
|
|
120
|
+
*/
|
|
121
|
+
connectedCallback(): void;
|
|
122
|
+
/**
|
|
123
|
+
* Set up form integration with ElementInternals
|
|
124
|
+
*/
|
|
125
|
+
private setupFormIntegration;
|
|
126
|
+
/**
|
|
127
|
+
* Set up external label association for native HTML label support
|
|
128
|
+
*/
|
|
129
|
+
private setupExternalLabelAssociation;
|
|
130
|
+
disconnectedCallback(): void;
|
|
131
|
+
/**
|
|
132
|
+
* Reset the input to its default state
|
|
133
|
+
*/
|
|
134
|
+
private resetToDefault;
|
|
135
|
+
/**
|
|
136
|
+
* Determines if validation errors should be shown based on current state
|
|
137
|
+
* and validation strategy
|
|
138
|
+
*/
|
|
139
|
+
private shouldShowValidation;
|
|
140
|
+
/**
|
|
141
|
+
* Validate input based on required, pattern, etc.
|
|
142
|
+
* This mimics native validation behavior
|
|
143
|
+
*/
|
|
144
|
+
private validateInput;
|
|
145
|
+
/**
|
|
146
|
+
* Check validity without showing validation UI
|
|
105
147
|
*/
|
|
106
148
|
checkValidity(): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Show validation UI and check validity
|
|
151
|
+
*/
|
|
107
152
|
reportValidity(): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Set a custom validation error message
|
|
155
|
+
*/
|
|
108
156
|
setCustomValidity(message: string): void;
|
|
109
157
|
firstUpdated(): void;
|
|
158
|
+
/**
|
|
159
|
+
* Set up input event handling for value changes
|
|
160
|
+
*/
|
|
161
|
+
private setupInputEvents;
|
|
162
|
+
/**
|
|
163
|
+
* Set up focus/blur event handling
|
|
164
|
+
*/
|
|
165
|
+
private setupFocusBlurEvents;
|
|
166
|
+
/**
|
|
167
|
+
* Set up autofill detection
|
|
168
|
+
*/
|
|
169
|
+
private setupAutofillDetection;
|
|
170
|
+
/**
|
|
171
|
+
* Set up enter key event handling
|
|
172
|
+
*/
|
|
173
|
+
private setupEnterKeyEvents;
|
|
110
174
|
/** Selects all text within the input. */
|
|
111
175
|
select(): void;
|
|
112
176
|
/** Returns the native validity state of the inner <input>. */
|
|
113
177
|
getValidity(): ValidityState | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Sets the selection range. Mirrors native input.setSelectionRange
|
|
180
|
+
*/
|
|
181
|
+
setSelectionRange(start: number, end: number, direction?: 'forward' | 'backward' | 'none'): void;
|
|
182
|
+
/**
|
|
183
|
+
* Returns the selected text within the input (start position)
|
|
184
|
+
*/
|
|
185
|
+
get selectionStart(): number | null;
|
|
186
|
+
/**
|
|
187
|
+
* Returns the selected text within the input (end position)
|
|
188
|
+
*/
|
|
189
|
+
get selectionEnd(): number | null;
|
|
190
|
+
/**
|
|
191
|
+
* Returns the direction of selection
|
|
192
|
+
*/
|
|
193
|
+
get selectionDirection(): 'forward' | 'backward' | 'none' | null;
|
|
194
|
+
/**
|
|
195
|
+
* Sets the range of text to be selected.
|
|
196
|
+
*/
|
|
197
|
+
setRangeText(replacement: string, start?: number, end?: number, selectMode?: 'select' | 'start' | 'end' | 'preserve'): void;
|
|
114
198
|
/**
|
|
115
199
|
* Override to forward focus to the internal <input>.
|
|
116
200
|
* Also dispatch a 'focus' event for external listeners.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './progress';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const SchmancyProgress_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
|
+
export default class SchmancyProgress extends SchmancyProgress_base {
|
|
3
|
+
value: number;
|
|
4
|
+
max: number;
|
|
5
|
+
indeterminate: boolean;
|
|
6
|
+
size: 'sm' | 'md' | 'lg';
|
|
7
|
+
color: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
|
|
8
|
+
glass: boolean;
|
|
9
|
+
private get percentage();
|
|
10
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'schmancy-progress': SchmancyProgress;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const RadioButton_base: import("@mixins/index").Constructor<import("
|
|
1
|
+
declare const RadioButton_base: import("@mixins/index").Constructor<import("@mixins/index").IFormFieldMixin> & import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
2
|
export declare class RadioButton extends RadioButton_base {
|
|
3
3
|
value: string;
|
|
4
4
|
checked: boolean;
|