@stonecrop/atable 0.11.6 → 0.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css +1 -1
- package/dist/atable.d.ts +9 -33
- package/dist/atable.js +715 -717
- package/dist/atable.js.map +1 -1
- package/dist/atable.tsbuildinfo +1 -1
- package/dist/src/stores/table.d.ts +9 -33
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/{stores → src/stores}/table.js +3 -9
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +22 -21
- package/src/components/ARow.vue +1 -1
- package/src/components/ATable.vue +5 -5
- package/src/components/ATableColumnFilter.vue +5 -5
- package/src/components/ATableHeader.vue +22 -22
- package/src/stores/table.ts +7 -11
- /package/dist/{icons → src/icons}/index.js +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{types → src/types}/index.js +0 -0
- /package/dist/{utils.js → src/utils.js} +0 -0
package/dist/atable.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"6.0.3"}
|
|
@@ -601,19 +601,11 @@ export declare const createTableStore: (initData: {
|
|
|
601
601
|
column: number | null;
|
|
602
602
|
direction: "asc" | "desc" | null;
|
|
603
603
|
}>;
|
|
604
|
-
table: import("vue").ComputedRef<
|
|
604
|
+
table: import("vue").ComputedRef<Record<string, any>>;
|
|
605
605
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
606
|
-
filteredRows: import("vue").ComputedRef<{
|
|
606
|
+
filteredRows: import("vue").ComputedRef<(TableRow & {
|
|
607
607
|
originalIndex: number;
|
|
608
|
-
|
|
609
|
-
parent?: number | undefined;
|
|
610
|
-
gantt?: {
|
|
611
|
-
color?: string | undefined;
|
|
612
|
-
startIndex?: number | undefined;
|
|
613
|
-
endIndex?: number | undefined;
|
|
614
|
-
colspan?: number | undefined;
|
|
615
|
-
} | undefined;
|
|
616
|
-
}[]>;
|
|
608
|
+
})[]>;
|
|
617
609
|
hasPinnedColumns: import("vue").ComputedRef<boolean>;
|
|
618
610
|
isGanttView: import("vue").ComputedRef<boolean>;
|
|
619
611
|
isTreeView: import("vue").ComputedRef<boolean>;
|
|
@@ -1253,19 +1245,11 @@ export declare const createTableStore: (initData: {
|
|
|
1253
1245
|
column: number | null;
|
|
1254
1246
|
direction: "asc" | "desc" | null;
|
|
1255
1247
|
}>;
|
|
1256
|
-
table: import("vue").ComputedRef<
|
|
1248
|
+
table: import("vue").ComputedRef<Record<string, any>>;
|
|
1257
1249
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
1258
|
-
filteredRows: import("vue").ComputedRef<{
|
|
1250
|
+
filteredRows: import("vue").ComputedRef<(TableRow & {
|
|
1259
1251
|
originalIndex: number;
|
|
1260
|
-
|
|
1261
|
-
parent?: number | undefined;
|
|
1262
|
-
gantt?: {
|
|
1263
|
-
color?: string | undefined;
|
|
1264
|
-
startIndex?: number | undefined;
|
|
1265
|
-
endIndex?: number | undefined;
|
|
1266
|
-
colspan?: number | undefined;
|
|
1267
|
-
} | undefined;
|
|
1268
|
-
}[]>;
|
|
1252
|
+
})[]>;
|
|
1269
1253
|
hasPinnedColumns: import("vue").ComputedRef<boolean>;
|
|
1270
1254
|
isGanttView: import("vue").ComputedRef<boolean>;
|
|
1271
1255
|
isTreeView: import("vue").ComputedRef<boolean>;
|
|
@@ -1905,19 +1889,11 @@ export declare const createTableStore: (initData: {
|
|
|
1905
1889
|
column: number | null;
|
|
1906
1890
|
direction: "asc" | "desc" | null;
|
|
1907
1891
|
}>;
|
|
1908
|
-
table: import("vue").ComputedRef<
|
|
1892
|
+
table: import("vue").ComputedRef<Record<string, any>>;
|
|
1909
1893
|
updates: import("vue").Ref<Record<string, string>, Record<string, string>>;
|
|
1910
|
-
filteredRows: import("vue").ComputedRef<{
|
|
1894
|
+
filteredRows: import("vue").ComputedRef<(TableRow & {
|
|
1911
1895
|
originalIndex: number;
|
|
1912
|
-
|
|
1913
|
-
parent?: number | undefined;
|
|
1914
|
-
gantt?: {
|
|
1915
|
-
color?: string | undefined;
|
|
1916
|
-
startIndex?: number | undefined;
|
|
1917
|
-
endIndex?: number | undefined;
|
|
1918
|
-
colspan?: number | undefined;
|
|
1919
|
-
} | undefined;
|
|
1920
|
-
}[]>;
|
|
1896
|
+
})[]>;
|
|
1921
1897
|
hasPinnedColumns: import("vue").ComputedRef<boolean>;
|
|
1922
1898
|
isGanttView: import("vue").ComputedRef<boolean>;
|
|
1923
1899
|
isTreeView: import("vue").ComputedRef<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/stores/table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,KAAK,CAAA;AAEvD,OAAO,KAAK,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,MAAM,UAAU,CAAA;AAGjB;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,4BAA4B;IAC5B,KAAK,EAAE,GAAG,CAAA;IACV,yCAAyC;IACzC,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,GAAG,CAAA;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU;IAC1C,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE,UAAU,CAAA;CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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xJhB,QAAQ,EAAE;6lBAinBxC,CAAA"}
|
|
@@ -484,15 +484,9 @@ export const createTableStore = (initData) => {
|
|
|
484
484
|
return true;
|
|
485
485
|
switch (filterType) {
|
|
486
486
|
case 'text': {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
// If it's an object, search in all string values
|
|
491
|
-
searchableText = Object.values(cellValue).join(' ');
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
searchableText = String(cellValue || '');
|
|
495
|
-
}
|
|
487
|
+
const searchableText = typeof cellValue === 'object' && cellValue !== null
|
|
488
|
+
? Object.values(cellValue).join(' ')
|
|
489
|
+
: String(cellValue || '');
|
|
496
490
|
return searchableText.toLowerCase().includes(String(value).toLowerCase());
|
|
497
491
|
}
|
|
498
492
|
case 'number': {
|
package/dist/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/atable",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -35,34 +35,35 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@vueuse/components": "^14.2.1",
|
|
37
37
|
"@vueuse/core": "^14.2.1",
|
|
38
|
-
"@stonecrop/
|
|
39
|
-
"@stonecrop/
|
|
38
|
+
"@stonecrop/utilities": "0.11.8",
|
|
39
|
+
"@stonecrop/themes": "0.11.8"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"pinia": "^3.0.4",
|
|
43
|
-
"vue": "^3.5.
|
|
43
|
+
"vue": "^3.5.33"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@eslint/js": "^
|
|
47
|
-
"@microsoft/api-documenter": "^7.
|
|
48
|
-
"@rushstack/heft": "^1.2.
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@vitest/
|
|
52
|
-
"@
|
|
46
|
+
"@eslint/js": "^10.0.1",
|
|
47
|
+
"@microsoft/api-documenter": "^7.30.5",
|
|
48
|
+
"@rushstack/heft": "^1.2.17",
|
|
49
|
+
"@types/node": "^22.19.17",
|
|
50
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
51
|
+
"@vitest/coverage-istanbul": "^4.1.5",
|
|
52
|
+
"@vitest/ui": "^4.1.5",
|
|
53
|
+
"@vue/test-utils": "^2.4.10",
|
|
53
54
|
"eslint-config-prettier": "^10.1.8",
|
|
54
|
-
"eslint-plugin-vue": "^10.
|
|
55
|
-
"eslint": "^
|
|
56
|
-
"globals": "^17.
|
|
57
|
-
"jsdom": "^
|
|
58
|
-
"typescript": "^
|
|
59
|
-
"typescript-eslint": "^8.
|
|
55
|
+
"eslint-plugin-vue": "^10.9.0",
|
|
56
|
+
"eslint": "^10.3.0",
|
|
57
|
+
"globals": "^17.6.0",
|
|
58
|
+
"jsdom": "^29.1.1",
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"typescript-eslint": "^8.59.1",
|
|
60
61
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
61
|
-
"vite": "^7.3.
|
|
62
|
+
"vite": "^7.3.2",
|
|
62
63
|
"pinia": "^3.0.4",
|
|
63
|
-
"vue": "^3.5.
|
|
64
|
-
"vitest": "^4.
|
|
65
|
-
"vue-router": "^5.0.
|
|
64
|
+
"vue": "^3.5.33",
|
|
65
|
+
"vitest": "^4.1.5",
|
|
66
|
+
"vue-router": "^5.0.6",
|
|
66
67
|
"stonecrop-rig": "0.7.0"
|
|
67
68
|
},
|
|
68
69
|
"publishConfig": {
|
package/src/components/ARow.vue
CHANGED
|
@@ -81,7 +81,7 @@ const isRowVisible = computed(() => store.isRowVisible(rowIndex))
|
|
|
81
81
|
const rowExpandSymbol = computed(() => store.getRowExpandSymbol(rowIndex))
|
|
82
82
|
|
|
83
83
|
// Row actions configuration
|
|
84
|
-
const rowActionsConfig = computed
|
|
84
|
+
const rowActionsConfig = computed((): RowActionsConfig => {
|
|
85
85
|
return store.config.rowActions || { enabled: false }
|
|
86
86
|
})
|
|
87
87
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
v-for="(row, filteredIndex) in store.filteredRows"
|
|
18
18
|
:key="`${row.originalIndex}-${filteredIndex}`"
|
|
19
19
|
:row="row"
|
|
20
|
-
:
|
|
20
|
+
:row-index="row.originalIndex"
|
|
21
21
|
:store="store"
|
|
22
22
|
@row:action="handleRowAction">
|
|
23
23
|
<template v-for="(column, colIndex) in getProcessedColumnsForRow(row)" :key="column.name">
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
:end="row.gantt?.endIndex"
|
|
32
32
|
:colspan="column.colspan"
|
|
33
33
|
:pinned="column.pinned"
|
|
34
|
-
:
|
|
35
|
-
:
|
|
34
|
+
:row-index="row.originalIndex"
|
|
35
|
+
:col-index="column.originalIndex ?? colIndex"
|
|
36
36
|
:style="{
|
|
37
37
|
textAlign: column?.align || 'center',
|
|
38
38
|
minWidth: column?.width || '40ch',
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
v-else
|
|
45
45
|
:store="store"
|
|
46
46
|
:pinned="column.pinned"
|
|
47
|
-
:
|
|
48
|
-
:
|
|
47
|
+
:row-index="row.originalIndex"
|
|
48
|
+
:col-index="colIndex"
|
|
49
49
|
:style="{
|
|
50
50
|
textAlign: column?.align || 'center',
|
|
51
51
|
width: store.config.fullWidth ? 'auto' : null,
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
</div>
|
|
53
53
|
|
|
54
54
|
<component
|
|
55
|
-
v-else-if="column.filterType === 'component' && column.filterComponent"
|
|
56
55
|
:is="column.filterComponent"
|
|
56
|
+
v-else-if="column.filterType === 'component' && column.filterComponent"
|
|
57
57
|
:value="filterValue"
|
|
58
58
|
:column="column"
|
|
59
|
-
:
|
|
59
|
+
:col-index="colIndex"
|
|
60
60
|
:store="store"
|
|
61
61
|
@update:value="updateFilter($event)" />
|
|
62
62
|
|
|
63
|
-
<button v-if="hasActiveFilter"
|
|
63
|
+
<button v-if="hasActiveFilter" class="clear-btn" title="Clear" @click="clearFilter">×</button>
|
|
64
64
|
</div>
|
|
65
65
|
</template>
|
|
66
66
|
|
|
@@ -77,8 +77,8 @@ const { column, colIndex, store } = defineProps<{
|
|
|
77
77
|
|
|
78
78
|
const filterValue = ref<any>('')
|
|
79
79
|
const dateFilter = reactive({
|
|
80
|
-
startValue: ''
|
|
81
|
-
endValue: ''
|
|
80
|
+
startValue: '',
|
|
81
|
+
endValue: '',
|
|
82
82
|
})
|
|
83
83
|
|
|
84
84
|
const getSelectOptions = (column: TableColumn): any[] => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<thead v-if="
|
|
2
|
+
<thead v-if="columns.length">
|
|
3
3
|
<!-- Header row -->
|
|
4
4
|
<tr class="atable-header-row" tabindex="-1">
|
|
5
5
|
<!-- Row actions header cell (before-index position) -->
|
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
class="row-actions-header"
|
|
9
9
|
:class="{ 'sticky-column': rowActionsPosition === 'before-index' }" />
|
|
10
10
|
<th
|
|
11
|
-
v-if="
|
|
11
|
+
v-if="store.zeroColumn"
|
|
12
12
|
id="header-index"
|
|
13
13
|
:class="[
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
store.hasPinnedColumns ? 'sticky-index' : '',
|
|
15
|
+
store.isTreeView ? 'tree-index' : '',
|
|
16
|
+
store.config.view === 'list-expansion' ? 'list-expansion-index' : '',
|
|
17
17
|
]"
|
|
18
18
|
class="list-index" />
|
|
19
19
|
<!-- Row actions header cell (after-index position) -->
|
|
20
20
|
<th v-if="showRowActionsHeader && rowActionsPosition === 'after-index'" class="row-actions-header" />
|
|
21
21
|
<th
|
|
22
|
-
v-for="(column, colKey) in
|
|
22
|
+
v-for="(column, colKey) in columns"
|
|
23
23
|
:key="column.name"
|
|
24
24
|
v-resize-observer="onResize"
|
|
25
25
|
:data-colindex="colKey"
|
|
26
26
|
tabindex="-1"
|
|
27
|
-
:style="
|
|
27
|
+
:style="store.getHeaderCellStyle(column)"
|
|
28
28
|
:class="`${column.pinned ? 'sticky-column' : ''} ${column.sortable === false ? '' : 'cursor-pointer'}`"
|
|
29
29
|
@click="column.sortable !== false ? handleSort(colKey) : undefined">
|
|
30
30
|
<slot>{{ column.label || String.fromCharCode(colKey + 97).toUpperCase() }}</slot>
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
class="row-actions-header"
|
|
41
41
|
:class="{ 'sticky-column': rowActionsPosition === 'before-index' }" />
|
|
42
42
|
<th
|
|
43
|
-
v-if="
|
|
43
|
+
v-if="store.zeroColumn"
|
|
44
44
|
:class="[
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
store.hasPinnedColumns ? 'sticky-index' : '',
|
|
46
|
+
store.isTreeView ? 'tree-index' : '',
|
|
47
|
+
store.config.view === 'list-expansion' ? 'list-expansion-index' : '',
|
|
48
48
|
]"
|
|
49
49
|
class="list-index" />
|
|
50
50
|
<!-- Row actions filter cell (after-index position) -->
|
|
51
51
|
<th v-if="showRowActionsHeader && rowActionsPosition === 'after-index'" class="row-actions-header" />
|
|
52
52
|
<th
|
|
53
|
-
v-for="(column, colKey) in
|
|
53
|
+
v-for="(column, colKey) in columns"
|
|
54
54
|
:key="`filter-${column.name}`"
|
|
55
55
|
:class="`${column.pinned ? 'sticky-column' : ''}`"
|
|
56
|
-
:style="
|
|
57
|
-
<ATableColumnFilter v-if="column.filterable" :column="column" :col-index="colKey" :store="
|
|
56
|
+
:style="store.getHeaderCellStyle(column)">
|
|
57
|
+
<ATableColumnFilter v-if="column.filterable" :column="column" :col-index="colKey" :store="store" />
|
|
58
58
|
</th>
|
|
59
59
|
<!-- Row actions filter cell (end position) -->
|
|
60
60
|
<th v-if="showRowActionsHeader && rowActionsPosition === 'end'" class="row-actions-header" />
|
|
@@ -69,18 +69,18 @@ import ATableColumnFilter from './ATableColumnFilter.vue'
|
|
|
69
69
|
import { createTableStore } from '../stores/table'
|
|
70
70
|
import type { TableColumn } from '../types'
|
|
71
71
|
|
|
72
|
-
const
|
|
72
|
+
const { columns, store } = defineProps<{
|
|
73
73
|
columns: TableColumn[]
|
|
74
74
|
store: ReturnType<typeof createTableStore>
|
|
75
75
|
}>()
|
|
76
76
|
|
|
77
|
-
const filterableColumns = computed(() =>
|
|
77
|
+
const filterableColumns = computed(() => columns.filter(column => column.filterable))
|
|
78
78
|
|
|
79
|
-
// Row actions header support
|
|
80
|
-
const showRowActionsHeader = computed(() =>
|
|
81
|
-
const rowActionsPosition = computed(() =>
|
|
79
|
+
// Row actions header support — explicit return type resolves Pinia's inference chain
|
|
80
|
+
const showRowActionsHeader = computed(() => store.config.rowActions?.enabled ?? false)
|
|
81
|
+
const rowActionsPosition = computed(() => store.config.rowActions?.position ?? 'before-index')
|
|
82
82
|
|
|
83
|
-
const handleSort = (colIndex: number) =>
|
|
83
|
+
const handleSort = (colIndex: number) => store.sortByColumn(colIndex)
|
|
84
84
|
|
|
85
85
|
const onResize = (entries: ReadonlyArray<ResizeObserverEntry>) => {
|
|
86
86
|
for (const entry of entries) {
|
|
@@ -88,10 +88,10 @@ const onResize = (entries: ReadonlyArray<ResizeObserverEntry>) => {
|
|
|
88
88
|
const observedCell = entry.borderBoxSize[0]
|
|
89
89
|
const observedWidth = observedCell.inlineSize
|
|
90
90
|
const colIndex = Number((entry.target as HTMLElement).dataset.colindex)
|
|
91
|
-
const currentWidth =
|
|
91
|
+
const currentWidth = store.columns[colIndex]?.width
|
|
92
92
|
|
|
93
93
|
if (typeof currentWidth === 'number' && currentWidth !== observedWidth) {
|
|
94
|
-
|
|
94
|
+
store.resizeColumn(colIndex, observedWidth)
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
package/src/stores/table.ts
CHANGED
|
@@ -124,14 +124,14 @@ export const createTableStore = (initData: {
|
|
|
124
124
|
// state
|
|
125
125
|
const columns = ref(initData.columns)
|
|
126
126
|
const rows = ref(initData.rows)
|
|
127
|
-
const config = ref(initData.config || {})
|
|
127
|
+
const config = ref<TableConfig>(initData.config || {})
|
|
128
128
|
|
|
129
129
|
// Track row modifications and expand states separately from the computed display
|
|
130
130
|
const rowModifications = ref<Record<number, boolean>>({})
|
|
131
131
|
const rowExpandStates = ref<Record<number, { childrenOpen?: boolean; expanded?: boolean }>>({})
|
|
132
132
|
|
|
133
133
|
const table = computed(() => {
|
|
134
|
-
const table = {}
|
|
134
|
+
const table: Record<string, any> = {}
|
|
135
135
|
for (const [colIndex, column] of columns.value.entries()) {
|
|
136
136
|
for (const [rowIndex, row] of rows.value.entries()) {
|
|
137
137
|
table[`${colIndex}:${rowIndex}`] = row[column.name]
|
|
@@ -232,7 +232,7 @@ export const createTableStore = (initData: {
|
|
|
232
232
|
)
|
|
233
233
|
|
|
234
234
|
const filteredRows = computed(() => {
|
|
235
|
-
let filtered = rows.value.map((row, originalIndex) => ({
|
|
235
|
+
let filtered: Array<TableRow & { originalIndex: number }> = rows.value.map((row, originalIndex) => ({
|
|
236
236
|
...row,
|
|
237
237
|
originalIndex,
|
|
238
238
|
}))
|
|
@@ -595,14 +595,10 @@ export const createTableStore = (initData: {
|
|
|
595
595
|
|
|
596
596
|
switch (filterType) {
|
|
597
597
|
case 'text': {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
searchableText = Object.values(cellValue as Record<string, unknown>).join(' ')
|
|
603
|
-
} else {
|
|
604
|
-
searchableText = String(cellValue || '')
|
|
605
|
-
}
|
|
598
|
+
const searchableText =
|
|
599
|
+
typeof cellValue === 'object' && cellValue !== null
|
|
600
|
+
? Object.values(cellValue as Record<string, unknown>).join(' ')
|
|
601
|
+
: String(cellValue || '')
|
|
606
602
|
return searchableText.toLowerCase().includes(String(value).toLowerCase())
|
|
607
603
|
}
|
|
608
604
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|