@mhmo91/schmancy 0.4.39 → 0.4.41
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/date-range.md +27 -1
- package/ai/store.md +31 -0
- package/dist/ai/date-range.md +27 -1
- package/dist/ai/store.md +31 -0
- package/dist/{avatar-sXepW60q.cjs → avatar-B3sAx50a.cjs} +2 -2
- package/dist/{avatar-sXepW60q.cjs.map → avatar-B3sAx50a.cjs.map} +1 -1
- package/dist/{avatar-CnJrdjfS.js → avatar-FYp7eVVT.js} +2 -2
- package/dist/{avatar-CnJrdjfS.js.map → avatar-FYp7eVVT.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/date-range-Bd0bZ5EG.cjs +133 -0
- package/dist/date-range-Bd0bZ5EG.cjs.map +1 -0
- package/dist/date-range-CTx08Buk.js +652 -0
- package/dist/date-range-CTx08Buk.js.map +1 -0
- package/dist/date-range.cjs +1 -1
- package/dist/date-range.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/{selector-hook-DPe2CGKx.js → selector-hook-CIpuCUbr.js} +122 -122
- package/dist/{selector-hook-DPe2CGKx.js.map → selector-hook-CIpuCUbr.js.map} +1 -1
- package/dist/selector-hook-DB8RFC1y.cjs +2 -0
- package/dist/{selector-hook-Bf_lCnGW.cjs.map → selector-hook-DB8RFC1y.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/package.json +2 -2
- package/types/src/autocomplete/autocomplete.d.ts +2 -3
- package/types/src/badge/badge.d.ts +3 -0
- package/types/src/date-range/date-range.d.ts +2 -1
- package/types/src/input/index.d.ts +1 -2
- package/types/src/input/input.d.ts +21 -0
- package/dist/date-range-CJq5E8y0.cjs +0 -131
- package/dist/date-range-CJq5E8y0.cjs.map +0 -1
- package/dist/date-range-DQ057kVi.js +0 -638
- package/dist/date-range-DQ057kVi.js.map +0 -1
- package/dist/selector-hook-Bf_lCnGW.cjs +0 -2
package/ai/date-range.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
required? // Mark as required field
|
|
15
15
|
placeholder?="string" // Placeholder text (default: "Select date range")
|
|
16
16
|
clearable? // Show clear button (default: true)
|
|
17
|
+
step?="day|week|month|year|number" // Navigation step (auto-detects if not set)
|
|
17
18
|
@change=${handler}> // Fires when range changes
|
|
18
19
|
</schmancy-date-range>
|
|
19
20
|
|
|
@@ -87,6 +88,23 @@ interface DateRangeChangeEvent {
|
|
|
87
88
|
.dateTo="${{ label: 'Period End', value: endDate }}"
|
|
88
89
|
@change="${(e) => updateDashboard(e.detail)}"
|
|
89
90
|
></schmancy-date-range>
|
|
91
|
+
|
|
92
|
+
// 7. Fixed step navigation (calendar dialog disabled)
|
|
93
|
+
<schmancy-date-range
|
|
94
|
+
step="week"
|
|
95
|
+
.dateFrom="${{ label: 'Week Start', value: weekStart }}"
|
|
96
|
+
.dateTo="${{ label: 'Week End', value: weekEnd }}"
|
|
97
|
+
minDate="2024-01-01"
|
|
98
|
+
maxDate="2024-12-31"
|
|
99
|
+
@change="${(e) => console.log('Week changed:', e.detail)}"
|
|
100
|
+
></schmancy-date-range>
|
|
101
|
+
|
|
102
|
+
// 8. Custom day step navigation
|
|
103
|
+
<schmancy-date-range
|
|
104
|
+
.step="${7}" // Navigate by 7 days
|
|
105
|
+
.dateFrom="${{ label: 'From', value: startDate }}"
|
|
106
|
+
.dateTo="${{ label: 'To', value: endDate }}"
|
|
107
|
+
></schmancy-date-range>
|
|
90
108
|
```
|
|
91
109
|
|
|
92
110
|
## Related Components
|
|
@@ -110,9 +128,17 @@ The component includes intelligent presets organized by time period:
|
|
|
110
128
|
**Hours** (datetime-local only): Last 12/24 Hours
|
|
111
129
|
|
|
112
130
|
### Smart Navigation Features
|
|
113
|
-
- Arrow buttons intelligently shift ranges based on detected period type
|
|
131
|
+
- Arrow buttons intelligently shift ranges based on detected period type or step property
|
|
132
|
+
- Auto-detects appropriate step when not specified:
|
|
133
|
+
- Full year range → shifts by year
|
|
134
|
+
- Full month range → shifts by month
|
|
135
|
+
- Full week range → shifts by week
|
|
136
|
+
- Single day → shifts by 1 day
|
|
137
|
+
- Custom range → shifts by range duration
|
|
138
|
+
- When step is provided, calendar dialog becomes read-only (not disabled)
|
|
114
139
|
- Preserves full period boundaries (weeks start on Monday, months on 1st)
|
|
115
140
|
- Automatically detects and maintains preset selections
|
|
141
|
+
- Respects min/max date boundaries during navigation
|
|
116
142
|
- Keyboard shortcuts for power users
|
|
117
143
|
|
|
118
144
|
### Keyboard Shortcuts
|
package/ai/store.md
CHANGED
|
@@ -120,6 +120,21 @@ const getFilteredTodos = createSelector(
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
|
+
// 4. Using @select decorator in components
|
|
124
|
+
import { select } from '@mhmo91/schmancy';
|
|
125
|
+
|
|
126
|
+
@customElement('my-component')
|
|
127
|
+
class MyComponent extends LitElement {
|
|
128
|
+
// Auto-subscribes to store state
|
|
129
|
+
@select(store, state => state.count)
|
|
130
|
+
count!: number;
|
|
131
|
+
|
|
132
|
+
// With options
|
|
133
|
+
@select(store, state => state.user, { required: false })
|
|
134
|
+
user?: User;
|
|
135
|
+
|
|
136
|
+
// The component will automatically update when these values change
|
|
137
|
+
}
|
|
123
138
|
```
|
|
124
139
|
|
|
125
140
|
## Related Components
|
|
@@ -171,6 +186,22 @@ store.update(state => {
|
|
|
171
186
|
});
|
|
172
187
|
```
|
|
173
188
|
|
|
189
|
+
### @select Decorator
|
|
190
|
+
The `@select` decorator connects component properties to store state with automatic subscription management:
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
@select(store, selectorFn, options?)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Options:
|
|
197
|
+
- `required: boolean` (default: true) - Wait for non-undefined value before calling connectedCallback
|
|
198
|
+
- `updateOnly: boolean` - Only trigger updates, don't set property value
|
|
199
|
+
- `deepClone: boolean` - Use structuredClone for deep cloning values
|
|
200
|
+
- `equals: (a, b) => boolean` - Custom equality function
|
|
201
|
+
- `debug: boolean` - Enable debug logging
|
|
202
|
+
|
|
203
|
+
The decorator ensures `connectedCallback` is called only once, even with multiple @select decorators.
|
|
204
|
+
|
|
174
205
|
### Common Use Cases
|
|
175
206
|
|
|
176
207
|
1. **Application theme state**
|
package/dist/ai/date-range.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
required? // Mark as required field
|
|
15
15
|
placeholder?="string" // Placeholder text (default: "Select date range")
|
|
16
16
|
clearable? // Show clear button (default: true)
|
|
17
|
+
step?="day|week|month|year|number" // Navigation step (auto-detects if not set)
|
|
17
18
|
@change=${handler}> // Fires when range changes
|
|
18
19
|
</schmancy-date-range>
|
|
19
20
|
|
|
@@ -87,6 +88,23 @@ interface DateRangeChangeEvent {
|
|
|
87
88
|
.dateTo="${{ label: 'Period End', value: endDate }}"
|
|
88
89
|
@change="${(e) => updateDashboard(e.detail)}"
|
|
89
90
|
></schmancy-date-range>
|
|
91
|
+
|
|
92
|
+
// 7. Fixed step navigation (calendar dialog disabled)
|
|
93
|
+
<schmancy-date-range
|
|
94
|
+
step="week"
|
|
95
|
+
.dateFrom="${{ label: 'Week Start', value: weekStart }}"
|
|
96
|
+
.dateTo="${{ label: 'Week End', value: weekEnd }}"
|
|
97
|
+
minDate="2024-01-01"
|
|
98
|
+
maxDate="2024-12-31"
|
|
99
|
+
@change="${(e) => console.log('Week changed:', e.detail)}"
|
|
100
|
+
></schmancy-date-range>
|
|
101
|
+
|
|
102
|
+
// 8. Custom day step navigation
|
|
103
|
+
<schmancy-date-range
|
|
104
|
+
.step="${7}" // Navigate by 7 days
|
|
105
|
+
.dateFrom="${{ label: 'From', value: startDate }}"
|
|
106
|
+
.dateTo="${{ label: 'To', value: endDate }}"
|
|
107
|
+
></schmancy-date-range>
|
|
90
108
|
```
|
|
91
109
|
|
|
92
110
|
## Related Components
|
|
@@ -110,9 +128,17 @@ The component includes intelligent presets organized by time period:
|
|
|
110
128
|
**Hours** (datetime-local only): Last 12/24 Hours
|
|
111
129
|
|
|
112
130
|
### Smart Navigation Features
|
|
113
|
-
- Arrow buttons intelligently shift ranges based on detected period type
|
|
131
|
+
- Arrow buttons intelligently shift ranges based on detected period type or step property
|
|
132
|
+
- Auto-detects appropriate step when not specified:
|
|
133
|
+
- Full year range → shifts by year
|
|
134
|
+
- Full month range → shifts by month
|
|
135
|
+
- Full week range → shifts by week
|
|
136
|
+
- Single day → shifts by 1 day
|
|
137
|
+
- Custom range → shifts by range duration
|
|
138
|
+
- When step is provided, calendar dialog becomes read-only (not disabled)
|
|
114
139
|
- Preserves full period boundaries (weeks start on Monday, months on 1st)
|
|
115
140
|
- Automatically detects and maintains preset selections
|
|
141
|
+
- Respects min/max date boundaries during navigation
|
|
116
142
|
- Keyboard shortcuts for power users
|
|
117
143
|
|
|
118
144
|
### Keyboard Shortcuts
|
package/dist/ai/store.md
CHANGED
|
@@ -120,6 +120,21 @@ const getFilteredTodos = createSelector(
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
|
+
// 4. Using @select decorator in components
|
|
124
|
+
import { select } from '@mhmo91/schmancy';
|
|
125
|
+
|
|
126
|
+
@customElement('my-component')
|
|
127
|
+
class MyComponent extends LitElement {
|
|
128
|
+
// Auto-subscribes to store state
|
|
129
|
+
@select(store, state => state.count)
|
|
130
|
+
count!: number;
|
|
131
|
+
|
|
132
|
+
// With options
|
|
133
|
+
@select(store, state => state.user, { required: false })
|
|
134
|
+
user?: User;
|
|
135
|
+
|
|
136
|
+
// The component will automatically update when these values change
|
|
137
|
+
}
|
|
123
138
|
```
|
|
124
139
|
|
|
125
140
|
## Related Components
|
|
@@ -171,6 +186,22 @@ store.update(state => {
|
|
|
171
186
|
});
|
|
172
187
|
```
|
|
173
188
|
|
|
189
|
+
### @select Decorator
|
|
190
|
+
The `@select` decorator connects component properties to store state with automatic subscription management:
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
@select(store, selectorFn, options?)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Options:
|
|
197
|
+
- `required: boolean` (default: true) - Wait for non-undefined value before calling connectedCallback
|
|
198
|
+
- `updateOnly: boolean` - Only trigger updates, don't set property value
|
|
199
|
+
- `deepClone: boolean` - Use structuredClone for deep cloning values
|
|
200
|
+
- `equals: (a, b) => boolean` - Custom equality function
|
|
201
|
+
- `debug: boolean` - Enable debug logging
|
|
202
|
+
|
|
203
|
+
The decorator ensures `connectedCallback` is called only once, even with multiple @select decorators.
|
|
204
|
+
|
|
174
205
|
### Common Use Cases
|
|
175
206
|
|
|
176
207
|
1. **Application theme state**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("lit"),o=require("lit/decorators.js"),s=require("rxjs");require("./animated-text-CtXY3MHV.cjs");const $=require("./area.component-DQ_erV9e.cjs");require("./autocomplete-PHnzqAII.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const _=require("./tailwind.mixin-DVKI3qb9.cjs"),D=require("./ripple-C2BHbhcS.cjs");require("./boat-B_xZilsk.cjs"),require("./spinner-CV62BBoF.cjs"),require("./icon-button-9V68mzcL.cjs"),require("./media-CIuTybvD.cjs"),require("./checkbox-BAuVXvYL.cjs"),require("./chips-Dg2otqDI.cjs"),require("./circular-progress-DZUJU-z3.cjs"),require("./code-preview-CYHNaPek.cjs"),require("./payment-card-form-ccF9dfGC.cjs");const p=require("./types.cjs"),d=require("./provide-BxZ2kn_p.cjs"),b=require("./litElement.mixin-B01R2oT7.cjs"),m=require("./consume-edta5ng5.cjs");require("./date-range-
|
|
1
|
+
"use strict";const l=require("lit"),o=require("lit/decorators.js"),s=require("rxjs");require("./animated-text-CtXY3MHV.cjs");const $=require("./area.component-DQ_erV9e.cjs");require("./autocomplete-PHnzqAII.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const _=require("./tailwind.mixin-DVKI3qb9.cjs"),D=require("./ripple-C2BHbhcS.cjs");require("./boat-B_xZilsk.cjs"),require("./spinner-CV62BBoF.cjs"),require("./icon-button-9V68mzcL.cjs"),require("./media-CIuTybvD.cjs"),require("./checkbox-BAuVXvYL.cjs"),require("./chips-Dg2otqDI.cjs"),require("./circular-progress-DZUJU-z3.cjs"),require("./code-preview-CYHNaPek.cjs"),require("./payment-card-form-ccF9dfGC.cjs");const p=require("./types.cjs"),d=require("./provide-BxZ2kn_p.cjs"),b=require("./litElement.mixin-B01R2oT7.cjs"),m=require("./consume-edta5ng5.cjs");require("./date-range-Bd0bZ5EG.cjs"),require("./date-range-inline-Czq1wHs1.cjs"),require("./delay-FgtrEHdo.cjs"),require("./dialog-content-ClfiDTji.cjs"),require("./dialog-service-BZZK8N6A.cjs"),require("./divider-2yg9r1tF.cjs"),require("./dropdown-content-DJ4CA3ug.cjs"),require("./timezone-UBBApQoU.cjs"),require("./form-Dpokur4M.cjs"),require("./icon-mhchC8Qw.cjs"),require("./input-DzNoI9qU.cjs"),require("./flex-DWnX0ZPR.cjs"),require("./list-DRbkWHho.cjs"),require("./menu-DEbZxoXr.cjs");const W=require("lit/directives/when.js");require("./notification-service-B6nHqzq5.cjs"),require("./option-BPmOG_Hw.cjs"),require("./progress-BqZ7yHQe.cjs"),require("./radio-button-WmbuT_YW.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-CPnSionr.cjs"),require("./sheet-Cn9heAk0.cjs");const A=require("./sheet.service-CNz7lXHC.cjs");require("./slider-DBNoXRWS.cjs"),require("./schmancy-steps-container-CjAsrjKf.cjs"),require("./context-object-K_1gDFu-.cjs");const N=require("rxjs/operators");require("./surface-ClfeUI6q.cjs"),require("./table-Rqnb4AJl.cjs"),require("./tabs-compatibility-B1bE7hSG.cjs"),require("./textarea-Dlnyyrbq.cjs"),require("./theme-button-Cao8AH8r.cjs"),require("./tooltip-WpE4e-fO.cjs"),require("./tree-Dn0t7MUR.cjs"),require("./typewriter-DwLZUKKQ.cjs"),require("./typography-BhCrqK_b.cjs");const i=require("./theme.interface-Xg5Zi46a.cjs");var X=Object.defineProperty,H=Object.getOwnPropertyDescriptor,g=(e,t,n,a)=>{for(var c,r=a>1?void 0:a?H(t,n):t,h=e.length-1;h>=0;h--)(c=e[h])&&(r=(a?c(t,n,r):c(r))||r);return a&&r&&X(t,n,r),r};exports.SchmancyBadgeV2=class extends _.TailwindElement(l.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
}
|
|
@@ -202,4 +202,4 @@
|
|
|
202
202
|
`}getColorAttributes(){const e={primary:{bgColor:i.SchmancyTheme.sys.color.primary.container,color:i.SchmancyTheme.sys.color.primary.onContainer},secondary:{bgColor:i.SchmancyTheme.sys.color.secondary.container,color:i.SchmancyTheme.sys.color.secondary.onContainer},tertiary:{bgColor:i.SchmancyTheme.sys.color.tertiary.container,color:i.SchmancyTheme.sys.color.tertiary.onContainer},success:{bgColor:i.SchmancyTheme.sys.color.success.container,color:i.SchmancyTheme.sys.color.success.onContainer},error:{bgColor:i.SchmancyTheme.sys.color.error.container,color:i.SchmancyTheme.sys.color.error.onContainer},neutral:{bgColor:i.SchmancyTheme.sys.color.surface.container,color:i.SchmancyTheme.sys.color.surface.on}};return D.color(e[this.color])}renderStatusIndicator(){const e={online:i.SchmancyTheme.sys.color.success.default,offline:i.SchmancyTheme.sys.color.surface.onVariant,busy:i.SchmancyTheme.sys.color.error.default,away:i.SchmancyTheme.sys.color.tertiary.default},t={"absolute bottom-0 right-0 rounded-full border-2 border-surface-default":!0,[{xs:"w-1.5 h-1.5",sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3",xl:"w-4 h-4"}[this.size]]:!0};return l.html`
|
|
203
203
|
<div class="${this.classMap(t)}" style="background-color: ${e[this.status]};"></div>
|
|
204
204
|
`}},u([o.property({type:String})],exports.SchmancyAvatar.prototype,"initials",2),u([o.property({type:String})],exports.SchmancyAvatar.prototype,"src",2),u([o.property({type:String})],exports.SchmancyAvatar.prototype,"icon",2),u([o.property({type:String})],exports.SchmancyAvatar.prototype,"size",2),u([o.property({type:String})],exports.SchmancyAvatar.prototype,"color",2),u([o.property({type:String})],exports.SchmancyAvatar.prototype,"shape",2),u([o.property({type:Boolean})],exports.SchmancyAvatar.prototype,"bordered",2),u([o.property({type:String})],exports.SchmancyAvatar.prototype,"status",2),exports.SchmancyAvatar=u([o.customElement("schmancy-avatar")],exports.SchmancyAvatar),exports.$drawer=Q,exports.HereMorty=B,exports.SchmancyContentDrawerID=I,exports.SchmancyContentDrawerMaxHeight=k,exports.SchmancyContentDrawerMinWidth=M,exports.SchmancyContentDrawerSheetMode=q,exports.SchmancyContentDrawerSheetState=j,exports.SchmancyDrawerNavbarMode=O,exports.SchmancyDrawerNavbarState=z,exports.WhereAreYouRicky=P,exports.schmancyContentDrawer=V,exports.schmancyNavDrawer=R,exports.teleport=x;
|
|
205
|
-
//# sourceMappingURL=avatar-
|
|
205
|
+
//# sourceMappingURL=avatar-B3sAx50a.cjs.map
|