snice 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/templates/base/package.json +2 -2
- package/bin/templates/social/package.json +2 -2
- package/bin/templates/social/src/styles/global.css +56 -47
- package/dist/components/avatar/snice-avatar.d.ts +2 -2
- package/dist/components/avatar/snice-avatar.js +20 -21
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/calendar/snice-calendar.d.ts +8 -2
- package/dist/components/calendar/snice-calendar.js +160 -82
- package/dist/components/calendar/snice-calendar.js.map +1 -1
- package/dist/components/chart/snice-chart.js +50 -18
- package/dist/components/chart/snice-chart.js.map +1 -1
- package/dist/components/checkbox/snice-checkbox.d.ts +4 -1
- package/dist/components/checkbox/snice-checkbox.js +46 -17
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/code-block/highlighter.d.ts +5 -0
- package/dist/components/code-block/highlighter.js +137 -0
- package/dist/components/code-block/highlighter.js.map +1 -0
- package/dist/components/code-block/highlighters/highlight.d.ts +64 -0
- package/dist/components/code-block/highlighters/highlight.js +108 -0
- package/dist/components/code-block/highlighters/highlight.js.map +1 -0
- package/dist/components/code-block/highlighters/prism.d.ts +41 -0
- package/dist/components/code-block/highlighters/prism.js +73 -0
- package/dist/components/code-block/highlighters/prism.js.map +1 -0
- package/dist/components/code-block/snice-code-block.d.ts +19 -1
- package/dist/components/code-block/snice-code-block.js +128 -29
- package/dist/components/code-block/snice-code-block.js.map +1 -1
- package/dist/components/code-block/snice-code-block.types.d.ts +15 -1
- package/dist/components/color-picker/snice-color-picker.d.ts +1 -0
- package/dist/components/color-picker/snice-color-picker.js +17 -6
- package/dist/components/color-picker/snice-color-picker.js.map +1 -1
- package/dist/components/date-picker/snice-date-picker.d.ts +1 -0
- package/dist/components/date-picker/snice-date-picker.js +16 -5
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/doc/snice-doc.d.ts +27 -73
- package/dist/components/doc/snice-doc.js +385 -534
- package/dist/components/doc/snice-doc.js.map +1 -1
- package/dist/components/draw/snice-draw.d.ts +4 -0
- package/dist/components/draw/snice-draw.js +134 -14
- package/dist/components/draw/snice-draw.js.map +1 -1
- package/dist/components/draw/snice-draw.types.d.ts +5 -0
- package/dist/components/file-upload/snice-file-upload.js +1 -1
- package/dist/components/input/snice-input.d.ts +2 -0
- package/dist/components/input/snice-input.js +34 -9
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/kanban/snice-kanban.d.ts +13 -1
- package/dist/components/kanban/snice-kanban.js +191 -36
- package/dist/components/kanban/snice-kanban.js.map +1 -1
- package/dist/components/kanban/snice-kanban.types.d.ts +11 -1
- package/dist/components/kpi/snice-kpi.js +5 -1
- package/dist/components/kpi/snice-kpi.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.js +1 -1
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout.js +1 -1
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/location/snice-location.js +1 -1
- package/dist/components/location/snice-location.js.map +1 -1
- package/dist/components/radio/snice-radio.d.ts +1 -0
- package/dist/components/radio/snice-radio.js +17 -6
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +2 -0
- package/dist/components/select/snice-select.js +48 -19
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/slider/snice-slider.d.ts +2 -0
- package/dist/components/slider/snice-slider.js +34 -14
- package/dist/components/slider/snice-slider.js.map +1 -1
- package/dist/components/snice-cell-HZ2iIBIC.js +4 -0
- package/dist/components/snice-cell-HZ2iIBIC.js.map +1 -0
- package/dist/components/split-pane/snice-split-pane.js +1 -1
- package/dist/components/split-pane/snice-split-pane.js.map +1 -1
- package/dist/components/switch/snice-switch.d.ts +1 -0
- package/dist/components/switch/snice-switch.js +16 -6
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.js +1 -1
- package/dist/components/table/snice-cell-actions.js.map +1 -1
- package/dist/components/table/snice-cell-boolean.js +1 -1
- package/dist/components/table/snice-cell-color.js +1 -1
- package/dist/components/table/snice-cell-color.js.map +1 -1
- package/dist/components/table/snice-cell-currency.js +1 -1
- package/dist/components/table/snice-cell-date.js +1 -1
- package/dist/components/table/snice-cell-duration.js +1 -1
- package/dist/components/table/snice-cell-email.js +1 -1
- package/dist/components/table/snice-cell-email.js.map +1 -1
- package/dist/components/table/snice-cell-filesize.js +1 -1
- package/dist/components/table/snice-cell-image.js +1 -1
- package/dist/components/table/snice-cell-image.js.map +1 -1
- package/dist/components/table/snice-cell-json.js +1 -1
- package/dist/components/table/snice-cell-json.js.map +1 -1
- package/dist/components/table/snice-cell-link.js +1 -1
- package/dist/components/table/snice-cell-link.js.map +1 -1
- package/dist/components/table/snice-cell-location.js +1 -1
- package/dist/components/table/snice-cell-location.js.map +1 -1
- package/dist/components/table/snice-cell-number.js +1 -1
- package/dist/components/table/snice-cell-percentage.js +1 -1
- package/dist/components/table/snice-cell-percentage.js.map +1 -1
- package/dist/components/table/snice-cell-phone.js +1 -1
- package/dist/components/table/snice-cell-phone.js.map +1 -1
- package/dist/components/table/snice-cell-progress.js +3 -3
- package/dist/components/table/snice-cell-progress.js.map +1 -1
- package/dist/components/table/snice-cell-rating.js +2 -2
- package/dist/components/table/snice-cell-rating.js.map +1 -1
- package/dist/components/table/snice-cell-sparkline.js +2 -2
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-status.js +1 -1
- package/dist/components/table/snice-cell-status.js.map +1 -1
- package/dist/components/table/snice-cell-tag.js +1 -1
- package/dist/components/table/snice-cell-tag.js.map +1 -1
- package/dist/components/table/snice-cell-text.js +1 -1
- package/dist/components/table/snice-cell.js +15 -10
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-header.js +1 -1
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-row.js +2 -2
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +1 -0
- package/dist/components/table/snice-table.js +24 -4
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/terminal/snice-terminal.d.ts +40 -0
- package/dist/components/terminal/snice-terminal.js +371 -0
- package/dist/components/terminal/snice-terminal.js.map +1 -0
- package/dist/components/terminal/snice-terminal.types.d.ts +20 -24
- package/dist/components/textarea/snice-textarea.d.ts +2 -0
- package/dist/components/textarea/snice-textarea.js +25 -6
- package/dist/components/textarea/snice-textarea.js.map +1 -1
- package/dist/components/theme/theme.css +16 -0
- package/dist/components/tree/snice-tree-item.d.ts +18 -4
- package/dist/components/tree/snice-tree-item.js +271 -88
- package/dist/components/tree/snice-tree-item.js.map +1 -1
- package/dist/components/tree/snice-tree-item.types.d.ts +3 -0
- package/dist/components/tree/snice-tree.d.ts +18 -2
- package/dist/components/tree/snice-tree.js +422 -56
- package/dist/components/tree/snice-tree.js.map +1 -1
- package/dist/components/tree/snice-tree.types.d.ts +1 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.js +4 -2
- package/dist/components/virtual-scroller/snice-virtual-scroller.js.map +1 -1
- package/dist/index.cjs +42 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +42 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +42 -23
- package/dist/index.iife.js.map +1 -1
- package/dist/render-tracker.d.ts +1 -0
- package/dist/symbols.cjs +13 -14
- package/dist/symbols.cjs.map +1 -1
- package/dist/symbols.esm.js +13 -14
- package/dist/symbols.esm.js.map +1 -1
- package/dist/template.d.ts +1 -0
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/api.md +37 -4
- package/docs/ai/components/doc.md +41 -106
- package/docs/ai/components/kanban.md +31 -9
- package/docs/ai/components/kpi.md +15 -0
- package/docs/components/doc.md +96 -212
- package/docs/components/kanban.md +119 -4
- package/docs/components/kpi.md +27 -0
- package/package.json +4 -1
- package/dist/components/actions/snice-actions.d.ts +0 -28
- package/dist/components/actions/snice-actions.js +0 -220
- package/dist/components/actions/snice-actions.js.map +0 -1
- package/dist/components/actions/snice-actions.types.d.ts +0 -27
- package/dist/components/doc/snice-doc.types.d.ts +0 -118
- package/dist/components/gantt/snice-gantt.d.ts +0 -29
- package/dist/components/gantt/snice-gantt.js +0 -268
- package/dist/components/gantt/snice-gantt.js.map +0 -1
- package/dist/components/gantt/snice-gantt.types.d.ts +0 -23
- package/dist/components/snice-cell-C0slgOpe.js +0 -4
- package/dist/components/snice-cell-C0slgOpe.js.map +0 -1
- package/dist/components/stat/snice-stat.d.ts +0 -14
- package/dist/components/stat/snice-stat.js +0 -140
- package/dist/components/stat/snice-stat.js.map +0 -1
- package/dist/components/stat/snice-stat.types.d.ts +0 -12
- package/docs/ai/components/actions.md +0 -81
- package/docs/ai/components/gantt.md +0 -95
- package/docs/ai/components/stat.md +0 -29
- package/docs/components/actions.md +0 -317
- package/docs/components/gantt.md +0 -347
- package/docs/components/stat.md +0 -45
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { __runInitializers, __esDecorate } from 'tslib';
|
|
2
|
-
import { element, property, dispatch, styles, render, ready, dispose, css, html } from 'snice';
|
|
3
|
-
|
|
4
|
-
var cssContent = ":host{display:inline-flex;align-items:center;gap:4px;font-family:var(--snice-font-family, system-ui, -apple-system, sans-serif)}.actions{display:inline-flex;align-items:center;gap:4px}.action-button{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:.2s;background:0 0;color:var(--snice-text-primary,#1a1a1a);text-decoration:none;white-space:nowrap}.action-button:hover:not(:disabled){background:var(--snice-bg-hover,#f5f5f5)}.action-button:active:not(:disabled){transform:scale(.95)}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button--danger{color:var(--snice-color-error,#d32f2f)}.action-button--danger:hover:not(:disabled){background:var(--snice-color-error-light,#ffebee)}.action-button--outlined{border:1px solid var(--snice-border-color,#e0e0e0)}.action-button--outlined:hover:not(:disabled){border-color:var(--snice-color-primary,#2196f3);background:var(--snice-color-primary-light,#e3f2fd)}.action-button--filled{background:var(--snice-color-primary,#2196f3);color:#fff}.action-button--filled:hover:not(:disabled){background:var(--snice-color-primary-dark,#1976d2)}.action-button--filled.action-button--danger{background:var(--snice-color-error,#d32f2f);color:#fff}.action-button--filled.action-button--danger:hover:not(:disabled){background:var(--snice-color-error-dark,#c62828)}.action-button--small{padding:4px 8px;font-size:12px}.action-button--large{padding:8px 16px;font-size:16px}.icon{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0}.icon img{width:100%;height:100%;object-fit:contain}.more-button{position:relative}.dropdown{position:absolute;top:calc(100% + 4px);right:0;background:#fff;border:1px solid var(--snice-border-color,#e0e0e0);border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.1);z-index:1000;min-width:150px;display:none}.dropdown--open{display:block}.dropdown-item{display:flex;align-items:center;gap:8px;padding:8px 12px;cursor:pointer;transition:background .2s;color:var(--snice-text-primary,#1a1a1a);text-decoration:none;white-space:nowrap;border:none;background:0 0;width:100%;text-align:left;font-size:14px}.dropdown-item:hover:not(:disabled){background:var(--snice-bg-hover,#f5f5f5)}.dropdown-item:disabled{opacity:.5;cursor:not-allowed}.dropdown-item--danger{color:var(--snice-color-error,#d32f2f)}.dropdown-item--danger:hover:not(:disabled){background:var(--snice-color-error-light,#ffebee)}";
|
|
5
|
-
|
|
6
|
-
let SniceActions = (() => {
|
|
7
|
-
let _classDecorators = [element('snice-actions')];
|
|
8
|
-
let _classDescriptor;
|
|
9
|
-
let _classExtraInitializers = [];
|
|
10
|
-
let _classThis;
|
|
11
|
-
let _classSuper = HTMLElement;
|
|
12
|
-
let _instanceExtraInitializers = [];
|
|
13
|
-
let _actions_decorators;
|
|
14
|
-
let _actions_initializers = [];
|
|
15
|
-
let _actions_extraInitializers = [];
|
|
16
|
-
let _size_decorators;
|
|
17
|
-
let _size_initializers = [];
|
|
18
|
-
let _size_extraInitializers = [];
|
|
19
|
-
let _variant_decorators;
|
|
20
|
-
let _variant_initializers = [];
|
|
21
|
-
let _variant_extraInitializers = [];
|
|
22
|
-
let _showLabels_decorators;
|
|
23
|
-
let _showLabels_initializers = [];
|
|
24
|
-
let _showLabels_extraInitializers = [];
|
|
25
|
-
let _maxVisible_decorators;
|
|
26
|
-
let _maxVisible_initializers = [];
|
|
27
|
-
let _maxVisible_extraInitializers = [];
|
|
28
|
-
let _moreLabel_decorators;
|
|
29
|
-
let _moreLabel_initializers = [];
|
|
30
|
-
let _moreLabel_extraInitializers = [];
|
|
31
|
-
let _moreIcon_decorators;
|
|
32
|
-
let _moreIcon_initializers = [];
|
|
33
|
-
let _moreIcon_extraInitializers = [];
|
|
34
|
-
let _dispatchActionTrigger_decorators;
|
|
35
|
-
let _styles_decorators;
|
|
36
|
-
let _template_decorators;
|
|
37
|
-
let _init_decorators;
|
|
38
|
-
let _cleanup_decorators;
|
|
39
|
-
(class extends _classSuper {
|
|
40
|
-
static { _classThis = this; }
|
|
41
|
-
constructor() {
|
|
42
|
-
super(...arguments);
|
|
43
|
-
this.actions = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _actions_initializers, []));
|
|
44
|
-
this.size = (__runInitializers(this, _actions_extraInitializers), __runInitializers(this, _size_initializers, 'medium'));
|
|
45
|
-
this.variant = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _variant_initializers, 'text'));
|
|
46
|
-
this.showLabels = (__runInitializers(this, _variant_extraInitializers), __runInitializers(this, _showLabels_initializers, true));
|
|
47
|
-
this.maxVisible = (__runInitializers(this, _showLabels_extraInitializers), __runInitializers(this, _maxVisible_initializers, 3));
|
|
48
|
-
this.moreLabel = (__runInitializers(this, _maxVisible_extraInitializers), __runInitializers(this, _moreLabel_initializers, 'More'));
|
|
49
|
-
this.moreIcon = (__runInitializers(this, _moreLabel_extraInitializers), __runInitializers(this, _moreIcon_initializers, '⋯'));
|
|
50
|
-
this.dropdownOpen = (__runInitializers(this, _moreIcon_extraInitializers), false);
|
|
51
|
-
this.handleOutsideClick = (e) => {
|
|
52
|
-
if (!this.contains(e.target)) {
|
|
53
|
-
this.closeDropdown();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
static {
|
|
58
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
59
|
-
_actions_decorators = [property({ type: Array })];
|
|
60
|
-
_size_decorators = [property({ attribute: 'size' })];
|
|
61
|
-
_variant_decorators = [property({ attribute: 'variant' })];
|
|
62
|
-
_showLabels_decorators = [property({ type: Boolean, attribute: 'show-labels' })];
|
|
63
|
-
_maxVisible_decorators = [property({ type: Number, attribute: 'max-visible' })];
|
|
64
|
-
_moreLabel_decorators = [property({ attribute: 'more-label' })];
|
|
65
|
-
_moreIcon_decorators = [property({ attribute: 'more-icon' })];
|
|
66
|
-
_dispatchActionTrigger_decorators = [dispatch('@snice/action-trigger', { bubbles: true, composed: true })];
|
|
67
|
-
_styles_decorators = [styles()];
|
|
68
|
-
_template_decorators = [render()];
|
|
69
|
-
_init_decorators = [ready()];
|
|
70
|
-
_cleanup_decorators = [dispose()];
|
|
71
|
-
__esDecorate(this, null, _dispatchActionTrigger_decorators, { kind: "method", name: "dispatchActionTrigger", static: false, private: false, access: { has: obj => "dispatchActionTrigger" in obj, get: obj => obj.dispatchActionTrigger }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
72
|
-
__esDecorate(this, null, _styles_decorators, { kind: "method", name: "styles", static: false, private: false, access: { has: obj => "styles" in obj, get: obj => obj.styles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
73
|
-
__esDecorate(this, null, _template_decorators, { kind: "method", name: "template", static: false, private: false, access: { has: obj => "template" in obj, get: obj => obj.template }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
74
|
-
__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
75
|
-
__esDecorate(this, null, _cleanup_decorators, { kind: "method", name: "cleanup", static: false, private: false, access: { has: obj => "cleanup" in obj, get: obj => obj.cleanup }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
76
|
-
__esDecorate(null, null, _actions_decorators, { kind: "field", name: "actions", static: false, private: false, access: { has: obj => "actions" in obj, get: obj => obj.actions, set: (obj, value) => { obj.actions = value; } }, metadata: _metadata }, _actions_initializers, _actions_extraInitializers);
|
|
77
|
-
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
78
|
-
__esDecorate(null, null, _variant_decorators, { kind: "field", name: "variant", static: false, private: false, access: { has: obj => "variant" in obj, get: obj => obj.variant, set: (obj, value) => { obj.variant = value; } }, metadata: _metadata }, _variant_initializers, _variant_extraInitializers);
|
|
79
|
-
__esDecorate(null, null, _showLabels_decorators, { kind: "field", name: "showLabels", static: false, private: false, access: { has: obj => "showLabels" in obj, get: obj => obj.showLabels, set: (obj, value) => { obj.showLabels = value; } }, metadata: _metadata }, _showLabels_initializers, _showLabels_extraInitializers);
|
|
80
|
-
__esDecorate(null, null, _maxVisible_decorators, { kind: "field", name: "maxVisible", static: false, private: false, access: { has: obj => "maxVisible" in obj, get: obj => obj.maxVisible, set: (obj, value) => { obj.maxVisible = value; } }, metadata: _metadata }, _maxVisible_initializers, _maxVisible_extraInitializers);
|
|
81
|
-
__esDecorate(null, null, _moreLabel_decorators, { kind: "field", name: "moreLabel", static: false, private: false, access: { has: obj => "moreLabel" in obj, get: obj => obj.moreLabel, set: (obj, value) => { obj.moreLabel = value; } }, metadata: _metadata }, _moreLabel_initializers, _moreLabel_extraInitializers);
|
|
82
|
-
__esDecorate(null, null, _moreIcon_decorators, { kind: "field", name: "moreIcon", static: false, private: false, access: { has: obj => "moreIcon" in obj, get: obj => obj.moreIcon, set: (obj, value) => { obj.moreIcon = value; } }, metadata: _metadata }, _moreIcon_initializers, _moreIcon_extraInitializers);
|
|
83
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
84
|
-
_classThis = _classDescriptor.value;
|
|
85
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
86
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
87
|
-
}
|
|
88
|
-
dispatchActionTrigger(action) {
|
|
89
|
-
return { action, actionsElement: this };
|
|
90
|
-
}
|
|
91
|
-
styles() {
|
|
92
|
-
return css /*css*/ `${cssContent}`;
|
|
93
|
-
}
|
|
94
|
-
triggerAction(id) {
|
|
95
|
-
const action = this.getAction(id);
|
|
96
|
-
if (action && !action.disabled) {
|
|
97
|
-
this.handleActionClick(action);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
getAction(id) {
|
|
101
|
-
return this.actions.find(a => a.id === id);
|
|
102
|
-
}
|
|
103
|
-
async handleActionClick(action) {
|
|
104
|
-
if (action.disabled)
|
|
105
|
-
return;
|
|
106
|
-
this.dispatchActionTrigger(action);
|
|
107
|
-
if (action.action) {
|
|
108
|
-
await action.action();
|
|
109
|
-
}
|
|
110
|
-
if (action.href) {
|
|
111
|
-
if (action.target) {
|
|
112
|
-
window.open(action.href, action.target);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
window.location.href = action.href;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
this.closeDropdown();
|
|
119
|
-
}
|
|
120
|
-
toggleDropdown() {
|
|
121
|
-
this.dropdownOpen = !this.dropdownOpen;
|
|
122
|
-
}
|
|
123
|
-
closeDropdown() {
|
|
124
|
-
if (this.dropdownOpen) {
|
|
125
|
-
this.dropdownOpen = false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
renderActionButton(action, inDropdown = false) {
|
|
129
|
-
const variant = action.variant || this.variant;
|
|
130
|
-
const classes = [
|
|
131
|
-
inDropdown ? 'dropdown-item' : 'action-button',
|
|
132
|
-
variant !== 'text' && !inDropdown ? `action-button--${variant}` : '',
|
|
133
|
-
this.size !== 'medium' && !inDropdown ? `action-button--${this.size}` : '',
|
|
134
|
-
action.danger ? (inDropdown ? 'dropdown-item--danger' : 'action-button--danger') : '',
|
|
135
|
-
].filter(Boolean).join(' ');
|
|
136
|
-
const content = html `
|
|
137
|
-
<if ${action.iconImage}>
|
|
138
|
-
<span class="icon">
|
|
139
|
-
<img src="${action.iconImage}" alt="${action.label || ''}" />
|
|
140
|
-
</span>
|
|
141
|
-
</if>
|
|
142
|
-
<if ${!action.iconImage && action.icon}>
|
|
143
|
-
<span class="icon">${action.icon}</span>
|
|
144
|
-
</if>
|
|
145
|
-
<if ${this.showLabels && action.label}>
|
|
146
|
-
<span>${action.label}</span>
|
|
147
|
-
</if>
|
|
148
|
-
`;
|
|
149
|
-
if (action.href) {
|
|
150
|
-
return html /*html*/ `
|
|
151
|
-
<a
|
|
152
|
-
class="${classes}"
|
|
153
|
-
href="${action.href}"
|
|
154
|
-
target="${action.target || '_self'}"
|
|
155
|
-
title="${action.tooltip || action.label || ''}"
|
|
156
|
-
@click=${(e) => {
|
|
157
|
-
e.preventDefault();
|
|
158
|
-
this.handleActionClick(action);
|
|
159
|
-
}}>
|
|
160
|
-
${content}
|
|
161
|
-
</a>
|
|
162
|
-
`;
|
|
163
|
-
}
|
|
164
|
-
return html /*html*/ `
|
|
165
|
-
<button
|
|
166
|
-
class="${classes}"
|
|
167
|
-
?disabled=${action.disabled}
|
|
168
|
-
title="${action.tooltip || action.label || ''}"
|
|
169
|
-
@click=${() => this.handleActionClick(action)}>
|
|
170
|
-
${content}
|
|
171
|
-
</button>
|
|
172
|
-
`;
|
|
173
|
-
}
|
|
174
|
-
template() {
|
|
175
|
-
if (!this.actions || this.actions.length === 0) {
|
|
176
|
-
return html /*html*/ ``;
|
|
177
|
-
}
|
|
178
|
-
const visibleActions = this.maxVisible > 0
|
|
179
|
-
? this.actions.slice(0, this.maxVisible)
|
|
180
|
-
: this.actions;
|
|
181
|
-
const hiddenActions = this.maxVisible > 0 && this.actions.length > this.maxVisible
|
|
182
|
-
? this.actions.slice(this.maxVisible)
|
|
183
|
-
: [];
|
|
184
|
-
return html /*html*/ `
|
|
185
|
-
<div class="actions">
|
|
186
|
-
${visibleActions.map(action => this.renderActionButton(action))}
|
|
187
|
-
|
|
188
|
-
<if ${hiddenActions.length > 0}>
|
|
189
|
-
<div class="more-button">
|
|
190
|
-
<button
|
|
191
|
-
class="action-button action-button--${this.size}"
|
|
192
|
-
@click=${() => this.toggleDropdown()}
|
|
193
|
-
title="${this.moreLabel}">
|
|
194
|
-
<span class="icon">${this.moreIcon}</span>
|
|
195
|
-
<if ${this.showLabels}>
|
|
196
|
-
<span>${this.moreLabel}</span>
|
|
197
|
-
</if>
|
|
198
|
-
</button>
|
|
199
|
-
|
|
200
|
-
<div class="dropdown ${this.dropdownOpen ? 'dropdown--open' : ''}">
|
|
201
|
-
${hiddenActions.map(action => this.renderActionButton(action, true))}
|
|
202
|
-
</div>
|
|
203
|
-
</div>
|
|
204
|
-
</if>
|
|
205
|
-
</div>
|
|
206
|
-
`;
|
|
207
|
-
}
|
|
208
|
-
init() {
|
|
209
|
-
// Close dropdown when clicking outside
|
|
210
|
-
document.addEventListener('click', this.handleOutsideClick);
|
|
211
|
-
}
|
|
212
|
-
cleanup() {
|
|
213
|
-
document.removeEventListener('click', this.handleOutsideClick);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
return _classThis;
|
|
217
|
-
})();
|
|
218
|
-
|
|
219
|
-
export { SniceActions };
|
|
220
|
-
//# sourceMappingURL=snice-actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snice-actions.js","sources":["../../../components/actions/snice-actions.css?inline","../../../../components/actions/snice-actions.ts"],"sourcesContent":["export default \":host{display:inline-flex;align-items:center;gap:4px;font-family:var(--snice-font-family, system-ui, -apple-system, sans-serif)}.actions{display:inline-flex;align-items:center;gap:4px}.action-button{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:.2s;background:0 0;color:var(--snice-text-primary,#1a1a1a);text-decoration:none;white-space:nowrap}.action-button:hover:not(:disabled){background:var(--snice-bg-hover,#f5f5f5)}.action-button:active:not(:disabled){transform:scale(.95)}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button--danger{color:var(--snice-color-error,#d32f2f)}.action-button--danger:hover:not(:disabled){background:var(--snice-color-error-light,#ffebee)}.action-button--outlined{border:1px solid var(--snice-border-color,#e0e0e0)}.action-button--outlined:hover:not(:disabled){border-color:var(--snice-color-primary,#2196f3);background:var(--snice-color-primary-light,#e3f2fd)}.action-button--filled{background:var(--snice-color-primary,#2196f3);color:#fff}.action-button--filled:hover:not(:disabled){background:var(--snice-color-primary-dark,#1976d2)}.action-button--filled.action-button--danger{background:var(--snice-color-error,#d32f2f);color:#fff}.action-button--filled.action-button--danger:hover:not(:disabled){background:var(--snice-color-error-dark,#c62828)}.action-button--small{padding:4px 8px;font-size:12px}.action-button--large{padding:8px 16px;font-size:16px}.icon{display:flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0}.icon img{width:100%;height:100%;object-fit:contain}.more-button{position:relative}.dropdown{position:absolute;top:calc(100% + 4px);right:0;background:#fff;border:1px solid var(--snice-border-color,#e0e0e0);border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.1);z-index:1000;min-width:150px;display:none}.dropdown--open{display:block}.dropdown-item{display:flex;align-items:center;gap:8px;padding:8px 12px;cursor:pointer;transition:background .2s;color:var(--snice-text-primary,#1a1a1a);text-decoration:none;white-space:nowrap;border:none;background:0 0;width:100%;text-align:left;font-size:14px}.dropdown-item:hover:not(:disabled){background:var(--snice-bg-hover,#f5f5f5)}.dropdown-item:disabled{opacity:.5;cursor:not-allowed}.dropdown-item--danger{color:var(--snice-color-error,#d32f2f)}.dropdown-item--danger:hover:not(:disabled){background:var(--snice-color-error-light,#ffebee)}\";",null],"names":[],"mappings":";;;AAAA,iBAAe,+7EAA+7E;;ICKj8E,YAAY,GAAA,CAAA,MAAA;4BADxB,OAAO,CAAC,eAAe,CAAC,CAAA;;;;sBACS,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAnB,KAAA,cAAQ,WAAW,CAAA;;;;AAE3C,YAAA,IAAA,CAAA,OAAO,IAFI,iBAAA,CAAA,IAAA,EAAA,0BAAA,CAAY,EAAA,iBAAA,CAAA,IAAA,EAAA,qBAAA,EAEG,EAAE,CAAA,CAAA;YAG5B,IAAA,CAAA,IAAI,IAAA,iBAAA,CAAA,IAAA,EAAA,0BAAA,CAAA,EAAA,iBAAA,CAAA,IAAA,EAAA,kBAAA,EAAqB,QAAQ,CAAA,CAAA;YAGjC,IAAA,CAAA,OAAO,IAAA,iBAAA,CAAA,IAAA,EAAA,uBAAA,CAAA,EAAA,iBAAA,CAAA,IAAA,EAAA,qBAAA,EAAwB,MAAM,CAAA,CAAA;YAGrC,IAAA,CAAA,UAAU,IAAA,iBAAA,CAAA,IAAA,EAAA,0BAAA,CAAA,EAAA,iBAAA,CAAA,IAAA,EAAA,wBAAA,EAAG,IAAI,CAAA,CAAA;YAGjB,IAAA,CAAA,UAAU,IAAA,iBAAA,CAAA,IAAA,EAAA,6BAAA,CAAA,EAAA,iBAAA,CAAA,IAAA,EAAA,wBAAA,EAAG,CAAC,CAAA,CAAA;YAGd,IAAA,CAAA,SAAS,IAAA,iBAAA,CAAA,IAAA,EAAA,6BAAA,CAAA,EAAA,iBAAA,CAAA,IAAA,EAAA,uBAAA,EAAG,MAAM,CAAA,CAAA;YAGlB,IAAA,CAAA,QAAQ,IAAA,iBAAA,CAAA,IAA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IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;;cAEzD,aAAa,CAAC,MAAM,GAAG,CAAC,CAAA;;;AAGc,kDAAA,EAAA,IAAI,CAAC,IAAI,CAAA;AACtC,qBAAA,EAAA,MAAM,IAAI,CAAC,cAAc,EAAE;AAC3B,qBAAA,EAAA,IAAI,CAAC,SAAS,CAAA;AACF,iCAAA,EAAA,IAAI,CAAC,QAAQ,CAAA;AAC5B,kBAAA,EAAA,IAAI,CAAC,UAAU,CAAA;AACX,sBAAA,EAAA,IAAI,CAAC,SAAS,CAAA;;;;mCAIH,IAAI,CAAC,YAAY,GAAG,gBAAgB,GAAG,EAAE,CAAA;AAC5D,cAAA,EAAA,aAAa,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;;;;;KAK7E;QACH;QAGA,IAAI,GAAA;;YAEF,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC;QAC7D;QAGA,OAAO,GAAA;YACL,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC;QAChE;;;;;;;"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type ActionButtonSize = 'small' | 'medium' | 'large';
|
|
2
|
-
export type ActionButtonVariant = 'text' | 'outlined' | 'filled';
|
|
3
|
-
export interface ActionButton {
|
|
4
|
-
id: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
icon?: string;
|
|
7
|
-
iconImage?: string;
|
|
8
|
-
variant?: ActionButtonVariant;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
danger?: boolean;
|
|
11
|
-
tooltip?: string;
|
|
12
|
-
action?: () => void | Promise<void>;
|
|
13
|
-
href?: string;
|
|
14
|
-
target?: string;
|
|
15
|
-
data?: any;
|
|
16
|
-
}
|
|
17
|
-
export interface SniceActionsElement extends HTMLElement {
|
|
18
|
-
actions: ActionButton[];
|
|
19
|
-
size: ActionButtonSize;
|
|
20
|
-
variant: ActionButtonVariant;
|
|
21
|
-
showLabels: boolean;
|
|
22
|
-
maxVisible: number;
|
|
23
|
-
moreLabel: string;
|
|
24
|
-
moreIcon: string;
|
|
25
|
-
triggerAction(id: string): void;
|
|
26
|
-
getAction(id: string): ActionButton | undefined;
|
|
27
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types for the snice-doc component
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Block types supported by the editor
|
|
6
|
-
*/
|
|
7
|
-
export type BlockType = 'paragraph' | 'heading-1' | 'heading-2' | 'heading-3' | 'bulleted-list' | 'numbered-list' | 'todo' | 'code' | 'quote' | 'divider';
|
|
8
|
-
/**
|
|
9
|
-
* Inline format types
|
|
10
|
-
*/
|
|
11
|
-
export type InlineFormat = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'link';
|
|
12
|
-
/**
|
|
13
|
-
* Text range for inline formatting
|
|
14
|
-
*/
|
|
15
|
-
export interface TextRange {
|
|
16
|
-
start: number;
|
|
17
|
-
end: number;
|
|
18
|
-
format: InlineFormat;
|
|
19
|
-
value?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Document block
|
|
23
|
-
*/
|
|
24
|
-
export interface DocBlock {
|
|
25
|
-
id: string;
|
|
26
|
-
type: BlockType;
|
|
27
|
-
content: string;
|
|
28
|
-
formats: TextRange[];
|
|
29
|
-
checked?: boolean;
|
|
30
|
-
indent?: number;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Editor selection
|
|
34
|
-
*/
|
|
35
|
-
export interface EditorSelection {
|
|
36
|
-
blockId: string;
|
|
37
|
-
start: number;
|
|
38
|
-
end: number;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Editor state
|
|
42
|
-
*/
|
|
43
|
-
export interface EditorState {
|
|
44
|
-
blocks: DocBlock[];
|
|
45
|
-
selection: EditorSelection | null;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Block menu item
|
|
49
|
-
*/
|
|
50
|
-
export interface BlockMenuItem {
|
|
51
|
-
type: BlockType;
|
|
52
|
-
label: string;
|
|
53
|
-
icon: string;
|
|
54
|
-
keywords: string[];
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Custom events
|
|
58
|
-
*/
|
|
59
|
-
export interface SniceDocEventMap {
|
|
60
|
-
'doc-change': CustomEvent<{
|
|
61
|
-
blocks: DocBlock[];
|
|
62
|
-
}>;
|
|
63
|
-
'doc-focus': CustomEvent<{
|
|
64
|
-
blockId: string;
|
|
65
|
-
}>;
|
|
66
|
-
'doc-blur': CustomEvent<{
|
|
67
|
-
blockId: string;
|
|
68
|
-
}>;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* snice-doc element interface
|
|
72
|
-
*/
|
|
73
|
-
export interface SniceDocElement extends HTMLElement {
|
|
74
|
-
/**
|
|
75
|
-
* Document blocks
|
|
76
|
-
*/
|
|
77
|
-
blocks: DocBlock[];
|
|
78
|
-
/**
|
|
79
|
-
* Placeholder text when empty
|
|
80
|
-
*/
|
|
81
|
-
placeholder: string;
|
|
82
|
-
/**
|
|
83
|
-
* Whether the editor is readonly
|
|
84
|
-
*/
|
|
85
|
-
readonly: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Get current blocks
|
|
88
|
-
*/
|
|
89
|
-
getBlocks(): DocBlock[];
|
|
90
|
-
/**
|
|
91
|
-
* Set blocks
|
|
92
|
-
*/
|
|
93
|
-
setBlocks(blocks: DocBlock[]): void;
|
|
94
|
-
/**
|
|
95
|
-
* Export document as JSON
|
|
96
|
-
*/
|
|
97
|
-
toJSON(): string;
|
|
98
|
-
/**
|
|
99
|
-
* Import document from JSON
|
|
100
|
-
*/
|
|
101
|
-
fromJSON(json: string): void;
|
|
102
|
-
/**
|
|
103
|
-
* Export document as markdown
|
|
104
|
-
*/
|
|
105
|
-
toMarkdown(): string;
|
|
106
|
-
/**
|
|
107
|
-
* Export document as HTML
|
|
108
|
-
*/
|
|
109
|
-
toHTML(): string;
|
|
110
|
-
/**
|
|
111
|
-
* Focus the editor
|
|
112
|
-
*/
|
|
113
|
-
focus(): void;
|
|
114
|
-
/**
|
|
115
|
-
* Clear all content
|
|
116
|
-
*/
|
|
117
|
-
clear(): void;
|
|
118
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { SniceGanttElement, GanttTask, GanttViewMode } from './snice-gantt.types';
|
|
2
|
-
export declare class SniceGantt extends HTMLElement implements SniceGanttElement {
|
|
3
|
-
tasks: GanttTask[];
|
|
4
|
-
viewMode: GanttViewMode;
|
|
5
|
-
showToday: boolean;
|
|
6
|
-
showProgress: boolean;
|
|
7
|
-
showDependencies: boolean;
|
|
8
|
-
minDate: Date | string;
|
|
9
|
-
maxDate: Date | string;
|
|
10
|
-
private dispatchTaskClick;
|
|
11
|
-
private styles;
|
|
12
|
-
getTask(id: string | number): GanttTask | undefined;
|
|
13
|
-
scrollToToday(): void;
|
|
14
|
-
scrollToTask(id: string | number): void;
|
|
15
|
-
private getDateRange;
|
|
16
|
-
private getColumnWidth;
|
|
17
|
-
private getColumns;
|
|
18
|
-
private formatColumnHeader;
|
|
19
|
-
private getWeekNumber;
|
|
20
|
-
private getTaskBarPosition;
|
|
21
|
-
private isToday;
|
|
22
|
-
private handleTaskClick;
|
|
23
|
-
template(): import("snice").TemplateResult;
|
|
24
|
-
}
|
|
25
|
-
declare global {
|
|
26
|
-
interface HTMLElementTagNameMap {
|
|
27
|
-
'snice-gantt': SniceGantt;
|
|
28
|
-
}
|
|
29
|
-
}
|