@doyosi/laraisy 1.0.2 → 1.0.3

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.
Files changed (51) hide show
  1. package/LICENSE +1 -1
  2. package/package.json +1 -1
  3. package/src/CodeInput.js +48 -48
  4. package/src/DSAlert.js +352 -352
  5. package/src/DSAvatar.js +207 -207
  6. package/src/DSDelete.js +274 -274
  7. package/src/DSForm.js +568 -568
  8. package/src/DSGridOrTable.js +453 -453
  9. package/src/DSLocaleSwitcher.js +239 -239
  10. package/src/DSLogout.js +293 -293
  11. package/src/DSNotifications.js +365 -365
  12. package/src/DSRestore.js +181 -181
  13. package/src/DSSelect.js +1071 -1071
  14. package/src/DSSelectBox.js +563 -563
  15. package/src/DSSimpleSlider.js +517 -517
  16. package/src/DSSvgFetch.js +69 -69
  17. package/src/DSTable/DSTableExport.js +68 -68
  18. package/src/DSTable/DSTableFilter.js +224 -224
  19. package/src/DSTable/DSTablePagination.js +136 -136
  20. package/src/DSTable/DSTableSearch.js +40 -40
  21. package/src/DSTable/DSTableSelection.js +192 -192
  22. package/src/DSTable/DSTableSort.js +58 -58
  23. package/src/DSTable.js +353 -353
  24. package/src/DSTabs.js +488 -488
  25. package/src/DSUpload.js +887 -887
  26. package/dist/CodeInput.d.ts +0 -10
  27. package/dist/DSAlert.d.ts +0 -112
  28. package/dist/DSAvatar.d.ts +0 -45
  29. package/dist/DSDelete.d.ts +0 -61
  30. package/dist/DSForm.d.ts +0 -151
  31. package/dist/DSGridOrTable/DSGOTRenderer.d.ts +0 -60
  32. package/dist/DSGridOrTable/DSGOTViewToggle.d.ts +0 -26
  33. package/dist/DSGridOrTable.d.ts +0 -296
  34. package/dist/DSLocaleSwitcher.d.ts +0 -71
  35. package/dist/DSLogout.d.ts +0 -76
  36. package/dist/DSNotifications.d.ts +0 -54
  37. package/dist/DSRestore.d.ts +0 -56
  38. package/dist/DSSelect.d.ts +0 -221
  39. package/dist/DSSelectBox.d.ts +0 -123
  40. package/dist/DSSimpleSlider.d.ts +0 -136
  41. package/dist/DSSvgFetch.d.ts +0 -17
  42. package/dist/DSTable/DSTableExport.d.ts +0 -11
  43. package/dist/DSTable/DSTableFilter.d.ts +0 -40
  44. package/dist/DSTable/DSTablePagination.d.ts +0 -12
  45. package/dist/DSTable/DSTableSearch.d.ts +0 -8
  46. package/dist/DSTable/DSTableSelection.d.ts +0 -46
  47. package/dist/DSTable/DSTableSort.d.ts +0 -8
  48. package/dist/DSTable.d.ts +0 -116
  49. package/dist/DSTabs.d.ts +0 -156
  50. package/dist/DSUpload.d.ts +0 -220
  51. package/dist/index.d.ts +0 -17
@@ -1,296 +0,0 @@
1
- /**
2
- * @typedef {Object} DSGridOrTableOptions
3
- * @property {'table'|'grid'|'gridable'} [type] - Display type
4
- * @property {'grid'|'table'} [defaultView] - For 'gridable' mode: initial view
5
- * @property {boolean} [showToggle] - Show view toggle buttons
6
- * @property {boolean} [pagination] - Enable pagination
7
- * @property {boolean} [search] - Enable search
8
- * @property {boolean} [sort] - Enable sorting
9
- * @property {boolean} [filter] - Enable filtering
10
- * @property {boolean} [export] - Enable export
11
- * @property {boolean} [selection] - Enable selection
12
- * @property {'ajax'|'html'|'json'} [table_source] - Data source type
13
- * @property {string} [ajax_url] - URL for AJAX requests
14
- * @property {Object} [ajax_data] - Additional data for AJAX requests
15
- * @property {'GET'|'POST'|'PUT'} [ajax_method] - HTTP method
16
- * @property {'xhr'|'axios'|'fetch'} [ajax_function] - Fetcher implementation
17
- * @property {Object} [rowTemplate] - Template config for table rows
18
- * @property {Object} [gridTemplate] - Template config for grid items
19
- * @property {Object|number} [gridColumns] - Grid column configuration
20
- * @property {number} [gridGap] - Tailwind gap value
21
- * @property {string} [gridContainerClass] - Grid container class
22
- * @property {string} [tableSelector] - Selector for table element
23
- * @property {string} [bodySelector] - Selector for tbody element
24
- * @property {string} [gridSelector] - Selector for grid container
25
- * @property {string} [toggleSelector] - Selector for view toggle
26
- * @property {string} [emptyMessage] - Message when no data found
27
- * @property {string} [errorMessage] - Message on error
28
- * @property {Function} [success] - Success callback
29
- * @property {Function} [error] - Error callback
30
- */
31
- /**
32
- * DSGridOrTable
33
- *
34
- * A flexible data display plugin supporting Table, Grid, or switchable (Gridable) layouts.
35
- * Built on top of DSTable architecture with extended rendering capabilities.
36
- *
37
- * @example
38
- * // Table mode (like standard DSTable)
39
- * const table = new DSGridOrTable('#container', {
40
- * type: 'table',
41
- * ajax_url: '/api/data',
42
- * rowTemplate: { source: 'response', response: 'html' }
43
- * });
44
- *
45
- * @example
46
- * // Grid mode (card layout)
47
- * const grid = new DSGridOrTable('#container', {
48
- * type: 'grid',
49
- * ajax_url: '/api/data',
50
- * gridTemplate: { source: 'response', response: 'grid_html' }
51
- * });
52
- *
53
- * @example
54
- * // Gridable mode (toggle between table and grid)
55
- * const gridable = new DSGridOrTable('#container', {
56
- * type: 'gridable',
57
- * ajax_url: '/api/data',
58
- * rowTemplate: { source: 'response', response: 'html' },
59
- * gridTemplate: { source: 'response', response: 'grid_html' },
60
- * defaultView: 'grid',
61
- * showToggle: true
62
- * });
63
- */
64
- export class DSGridOrTable {
65
- static defaults: {
66
- type: string;
67
- defaultView: string;
68
- showToggle: boolean;
69
- pagination: boolean;
70
- pagination_translations: {
71
- prev: string;
72
- next: string;
73
- goto: string;
74
- stats: string;
75
- };
76
- search: boolean;
77
- sort: boolean;
78
- filter: boolean;
79
- export: boolean;
80
- selection: boolean;
81
- table_source: string;
82
- ajax_url: any;
83
- ajax_data: {};
84
- ajax_method: string;
85
- ajax_function: string;
86
- success: any;
87
- error: any;
88
- beforeSend: any;
89
- afterSend: any;
90
- rowTemplate: {
91
- source: string;
92
- response: string;
93
- function: any;
94
- html: any;
95
- };
96
- gridTemplate: {
97
- source: string;
98
- response: string;
99
- function: any;
100
- html: any;
101
- };
102
- gridColumns: {
103
- default: number;
104
- sm: number;
105
- md: number;
106
- lg: number;
107
- xl: number;
108
- };
109
- gridGap: number;
110
- gridContainerClass: string;
111
- tableSelector: string;
112
- bodySelector: string;
113
- gridSelector: string;
114
- toggleSelector: string;
115
- messageSelector: string;
116
- search_selector: any;
117
- emptyMessage: string;
118
- emptyIcon: string;
119
- errorMessage: string;
120
- filter_selectors: {};
121
- };
122
- /**
123
- * @param {string|HTMLElement} wrapper
124
- * @param {DSGridOrTableOptions} options
125
- */
126
- constructor(wrapper: string | HTMLElement, options?: DSGridOrTableOptions);
127
- wrapper: Element;
128
- /** @type {DSGridOrTableOptions} */
129
- config: DSGridOrTableOptions;
130
- data: any[];
131
- meta: {};
132
- params: {
133
- page: number;
134
- per_page: number;
135
- sort_by: any;
136
- sort_order: string;
137
- search: any;
138
- filters: {};
139
- };
140
- modules: {};
141
- isLoading: boolean;
142
- currentView: "table" | "grid";
143
- _mergeDeep(target: any, ...sources: any[]): any;
144
- _isObject(item: any): boolean;
145
- _init(): void;
146
- table: Element;
147
- tbody: Element;
148
- gridContainer: Element | HTMLDivElement;
149
- renderer: DSGOTRenderer;
150
- viewToggle: DSGOTViewToggle;
151
- _buildGridClasses(): string;
152
- _setInitialVisibility(): void;
153
- loadData(): Promise<void>;
154
- _loadFromAjax(): Promise<void>;
155
- _handleDataSuccess(response: any): void;
156
- _toggleLoading(loading: any): void;
157
- /**
158
- * Switch between grid and table views (for gridable mode)
159
- * @param {string} view - 'grid' or 'table'
160
- */
161
- setView(view: string): void;
162
- /**
163
- * Toggle between grid and table views
164
- */
165
- toggleView(): void;
166
- /**
167
- * Get current view mode
168
- * @returns {string} 'grid' or 'table'
169
- */
170
- getView(): string;
171
- refresh(): void;
172
- setParam(key: any, value: any): void;
173
- getParam(key: any): any;
174
- registerModule(name: any, instance: any): void;
175
- /**
176
- * Get the current render target element
177
- * @returns {HTMLElement}
178
- */
179
- getRenderTarget(): HTMLElement;
180
- on(event: any, handler: any): void;
181
- _emit(event: any, detail?: {}): void;
182
- _getNestedValue(obj: any, path: any): any;
183
- }
184
- export default DSGridOrTable;
185
- export type DSGridOrTableOptions = {
186
- /**
187
- * - Display type
188
- */
189
- type?: "table" | "grid" | "gridable";
190
- /**
191
- * - For 'gridable' mode: initial view
192
- */
193
- defaultView?: "grid" | "table";
194
- /**
195
- * - Show view toggle buttons
196
- */
197
- showToggle?: boolean;
198
- /**
199
- * - Enable pagination
200
- */
201
- pagination?: boolean;
202
- /**
203
- * - Enable search
204
- */
205
- search?: boolean;
206
- /**
207
- * - Enable sorting
208
- */
209
- sort?: boolean;
210
- /**
211
- * - Enable filtering
212
- */
213
- filter?: boolean;
214
- /**
215
- * - Enable export
216
- */
217
- export?: boolean;
218
- /**
219
- * - Enable selection
220
- */
221
- selection?: boolean;
222
- /**
223
- * - Data source type
224
- */
225
- table_source?: "ajax" | "html" | "json";
226
- /**
227
- * - URL for AJAX requests
228
- */
229
- ajax_url?: string;
230
- /**
231
- * - Additional data for AJAX requests
232
- */
233
- ajax_data?: any;
234
- /**
235
- * - HTTP method
236
- */
237
- ajax_method?: "GET" | "POST" | "PUT";
238
- /**
239
- * - Fetcher implementation
240
- */
241
- ajax_function?: "xhr" | "axios" | "fetch";
242
- /**
243
- * - Template config for table rows
244
- */
245
- rowTemplate?: any;
246
- /**
247
- * - Template config for grid items
248
- */
249
- gridTemplate?: any;
250
- /**
251
- * - Grid column configuration
252
- */
253
- gridColumns?: any | number;
254
- /**
255
- * - Tailwind gap value
256
- */
257
- gridGap?: number;
258
- /**
259
- * - Grid container class
260
- */
261
- gridContainerClass?: string;
262
- /**
263
- * - Selector for table element
264
- */
265
- tableSelector?: string;
266
- /**
267
- * - Selector for tbody element
268
- */
269
- bodySelector?: string;
270
- /**
271
- * - Selector for grid container
272
- */
273
- gridSelector?: string;
274
- /**
275
- * - Selector for view toggle
276
- */
277
- toggleSelector?: string;
278
- /**
279
- * - Message when no data found
280
- */
281
- emptyMessage?: string;
282
- /**
283
- * - Message on error
284
- */
285
- errorMessage?: string;
286
- /**
287
- * - Success callback
288
- */
289
- success?: Function;
290
- /**
291
- * - Error callback
292
- */
293
- error?: Function;
294
- };
295
- import DSGOTRenderer from './DSGridOrTable/DSGOTRenderer.js';
296
- import DSGOTViewToggle from './DSGridOrTable/DSGOTViewToggle.js';
@@ -1,71 +0,0 @@
1
- /**
2
- * DSLocaleSwitcher
3
- *
4
- * Manages locale switching for translatable form fields.
5
- * Shows/hides input fields based on selected locale.
6
- */
7
- export class DSLocaleSwitcher {
8
- static instances: Map<any, any>;
9
- static instanceCounter: number;
10
- /**
11
- * Default configuration
12
- */
13
- static defaults: {
14
- defaultLocale: string;
15
- onSwitch: any;
16
- };
17
- /**
18
- * Static factory
19
- */
20
- static create(selector: any, config?: {}): DSLocaleSwitcher;
21
- /**
22
- * Get instance by element
23
- */
24
- static getInstance(element: any): any;
25
- /**
26
- * Auto-initialize all elements with [data-ds-locale-switcher]
27
- */
28
- static initAll(selector?: string): void;
29
- /**
30
- * @param {string|HTMLElement} selector - Container element or selector
31
- * @param {Object} config - Configuration options
32
- */
33
- constructor(selector: string | HTMLElement, config?: any);
34
- instanceId: string;
35
- container: Element;
36
- cfg: any;
37
- _currentLocale: any;
38
- _boundHandlers: {};
39
- _init(): void;
40
- _cacheElements(): void;
41
- elements: {
42
- trigger: Element;
43
- label: Element;
44
- options: NodeListOf<Element>;
45
- translatables: NodeListOf<Element>;
46
- };
47
- _bindEvents(): void;
48
- _setInitialState(): void;
49
- _onOptionClick(e: any): void;
50
- /**
51
- * Switch to a specific locale
52
- */
53
- switchTo(locale: any): void;
54
- /**
55
- * Get current locale
56
- */
57
- getCurrentLocale(): any;
58
- /**
59
- * Get all values for all locales
60
- */
61
- getValues(): {};
62
- /**
63
- * Set values for all locales
64
- */
65
- setValues(values: any): void;
66
- /**
67
- * Destroy instance
68
- */
69
- destroy(): void;
70
- _updateUI(): void;
71
- }
@@ -1,76 +0,0 @@
1
- /**
2
- * DSLogout
3
- *
4
- * JS-only, multi-element Laravel logout helper.
5
- *
6
- * Features:
7
- * - Bind to one or many elements (selector/NodeList/Array/Element)
8
- * - Optional event delegation: { root, match }
9
- * - Prevent multi-click per element with logical + visual disable
10
- * - Axios → fetch → XHR fallback; JSON redirect support
11
- * - CSRF auto-resolution from <meta>, data attribute, window, cookie
12
- * - i18n messages via `translations`
13
- *
14
- * @example
15
- * // Blade <head>:
16
- * // <meta name="csrf-token" content="{{ csrf_token() }}">
17
- *
18
- * // HTML:
19
- * // <a class="js-logout" href="#">Logout</a>
20
- * // <button class="js-logout">Logout 2</button>
21
- *
22
- * // JS:
23
- * import { DSLogout } from '/js/modules/DSLogout.js';
24
- * new DSLogout({
25
- * elements: '.js-logout', // one or many elements
26
- * // or: element: '#header-logout'
27
- * // or delegation:
28
- * // delegate: { root: document, match: '.js-logout' },
29
- * url: '/logout', // or "{{ route('logout') }}"
30
- * requestLibrary: 'axios', // 'auto'|'axios'|'fetch'|'xhr'
31
- * translations: { loading: 'Çıkış yapılıyor...', error: 'Çıkış yapılamadı' },
32
- * disabledClasses: ['pointer-events-none','opacity-60','cursor-not-allowed']
33
- * });
34
- */
35
- export class DSLogout {
36
- constructor({ element, elements, delegate, url, redirect, requestLibrary, csrfToken, translations, disabledClasses, eventType }?: {
37
- element?: any;
38
- elements?: any;
39
- delegate?: any;
40
- url?: string;
41
- redirect?: any;
42
- requestLibrary?: string;
43
- csrfToken?: any;
44
- translations?: {};
45
- disabledClasses?: string[];
46
- eventType?: string;
47
- });
48
- url: string;
49
- redirect: any;
50
- requestLibrary: string;
51
- translations: {
52
- loading: string;
53
- error: string;
54
- };
55
- disabledClasses: string[];
56
- eventType: string;
57
- csrf: any;
58
- _bound: WeakMap<object, any>;
59
- _isDelegated: boolean;
60
- _delegated: {
61
- root: any;
62
- match: any;
63
- };
64
- destroy(): void;
65
- _normalizeElements(element: any, elements: any): any[];
66
- _bindElement(el: any): void;
67
- _bindDelegated(): void;
68
- _handleClick(el: any): Promise<void>;
69
- _isDisabled(el: any): boolean;
70
- _disableWithLoading(el: any): () => void;
71
- _chooseLib(): "axios" | "fetch" | "xhr";
72
- _post(): Promise<any>;
73
- _resolveCsrfToken(): any;
74
- _readCookie(name: any): string;
75
- _entries(weakMap: any): Generator<never, void, unknown>;
76
- }
@@ -1,54 +0,0 @@
1
- export class DSNotifications {
2
- constructor(options?: {});
3
- options: {
4
- drawerToggleId: string;
5
- buttonId: string;
6
- listContainerId: string;
7
- loadingId: string;
8
- emptyId: string;
9
- badgeId: string;
10
- topbarBadgeSelector: string;
11
- markAllReadBtnId: string;
12
- templateId: string;
13
- fetchUrl: string;
14
- readUrl: string;
15
- readAllUrl: string;
16
- deleteUrl: string;
17
- unreadCountUrl: string;
18
- refreshInterval: number;
19
- };
20
- notifications: any[];
21
- unreadCount: number;
22
- isLoading: boolean;
23
- refreshTimer: number;
24
- init(): void;
25
- cacheElements(): void;
26
- drawerToggle: HTMLElement;
27
- button: HTMLElement;
28
- listContainer: HTMLElement;
29
- loading: HTMLElement;
30
- empty: HTMLElement;
31
- badge: HTMLElement;
32
- topbarBadge: Element;
33
- markAllReadBtn: HTMLElement;
34
- template: HTMLElement;
35
- bindEvents(): void;
36
- openDrawer(): void;
37
- closeDrawer(): void;
38
- fetchNotifications(): Promise<void>;
39
- fetchUnreadCount(): Promise<void>;
40
- markAsRead(id: any): Promise<void>;
41
- markAllAsRead(): Promise<void>;
42
- deleteNotification(id: any): Promise<void>;
43
- renderNotifications(): void;
44
- createNotificationItem(notification: any): any;
45
- getColorClass(color: any, type: any): any;
46
- updateBadge(): void;
47
- showLoading(): void;
48
- hideLoading(): void;
49
- showEmpty(): void;
50
- hideEmpty(): void;
51
- startAutoRefresh(): void;
52
- stopAutoRefresh(): void;
53
- destroy(): void;
54
- }
@@ -1,56 +0,0 @@
1
- /**
2
- * DSRestore
3
- *
4
- * A plugin to handle restore actions with confirmation dialogs and AJAX requests.
5
- * Integrates with DSAlert for UI.
6
- */
7
- export class DSRestore {
8
- static defaults: {
9
- selector: string;
10
- method: string;
11
- ajaxFunction: string;
12
- title: string;
13
- text: string;
14
- icon: string;
15
- confirmButtonText: string;
16
- cancelButtonText: string;
17
- confirmButtonColor: string;
18
- successTitle: string;
19
- successText: string;
20
- successIcon: string;
21
- errorTitle: string;
22
- errorText: string;
23
- errorIcon: string;
24
- onSuccess: any;
25
- onError: any;
26
- onRestore: any;
27
- };
28
- constructor(options?: {});
29
- config: {
30
- selector: string;
31
- method: string;
32
- ajaxFunction: string;
33
- title: string;
34
- text: string;
35
- icon: string;
36
- confirmButtonText: string;
37
- cancelButtonText: string;
38
- confirmButtonColor: string;
39
- successTitle: string;
40
- successText: string;
41
- successIcon: string;
42
- errorTitle: string;
43
- errorText: string;
44
- errorIcon: string;
45
- onSuccess: any;
46
- onError: any;
47
- onRestore: any;
48
- };
49
- _init(): void;
50
- _handleRestore(element: any): Promise<void>;
51
- _performRestore(url: any, id: any, element: any): Promise<void>;
52
- _handleSuccess(response: any, element: any): Promise<void>;
53
- _handleError(error: any, element: any): void;
54
- _emit(event: any, detail?: {}): void;
55
- }
56
- export default DSRestore;